-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules: Allow filtering of active modules. #8465
Conversation
This change introduces a filter (`jetpack_active_modules`) that allows theme and plugin developers to modify the list of active Jetpack modules. For some projects, there will be multiple copies of a site in different environments (e.g. development, QA, staging as well as production) and maintaining consistency across environments is important for quality assurance. Manually enabling/disabling modules across multiple environments is time consuming, inefficient and susceptible to human error. This change allows active modules to be defined in code, under version control, helping to ensure consistency across environments.
@philipjohn I've just labeled this one as ready for review. Please relabel as in progress if it's not the case. Thanks! |
Thanks @oskosk - I've changed to Needs Testing because I've been reminded I haven't really tested it yet. |
This is neat, thanks @philipjohn. I have one question (which in no way should block the work here)—is it possible, once this is implemented, for us to export the active module definition file? I have hopes of adding an import/export config feature to the Jetpack Beta plugin that would start to let us rebrand the beta plugin as a developer tools plugin. Exporting/importing your config across sites via a file would be a nice addition to it. |
Awesome! |
LGTM! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this generally looks good to me, do you think it may be better to filter the array just before returning it? This way protect
and vaultpress
will be also filterable.
I hadn't done that because in my mind I didn't want VIPs to disable either of those. But you're right, others might want to and we should allow that. We can use the filter ourselves on VIP Go to ensure the modules we want to be active always are. |
Filter the list of active modules right before we return the list so that Vaultpress and Protect can also be filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making that change!
The `jetpack_active_modules` filter allows developers to enable/disable some modules in code. We might need to ensure some modules are always enabled/disabled and so we hook in to that filter ourselves. At the moment, this just forces Vaultpress to be enabled. It won't have any effect until Automattic/jetpack#8465 is merged and released.
* Changelog 5.8: create base for changelog. * Update 5.8 release post link * fix 5.8 release date * Updates to plugin description * Changelog: add #8499 * Changelog: add #8506 * Changelog: add #8509 * Changelog: add #8516 * Changelog: add #8517 * Changelog: add #8523 * Changelog: add #8547 * Changelog: add #8496 * Changelog: add #8584 * Changelog: add #8595 * Changelog: add #8445 * Changelog: add #8431 * Changelog: add #8284 * Changelog: add #8270 * Changelog: add #8124 * Changelog: add #8581 * Changelog: add #8463 * Changelog: add #8568 (#8646) * Updates to testing list and changelog * Changelog: add #8443 * Changelog: add #8459 * Changelog: add #8469 * Changelog: add #8464 * Changelog: add #8478 and #8479 * Changelog: add #8483 * Changelog: add #8488 * Changelog: add #8513 * Changelog: add #8555 * Changelog: add #8565 * Changelog: add #8601 * Changelog: add #8612 * Changelog: add first pass at Search items. * Changelog: add more info to help test Search. * Changelog: add #8144 * Changelog: add #8313 * Changelog: add #8419 * Changelog: add #8465 * Changelog: add #8515 * Changelog: add #8587 * Changelog: add #8591 * Changelog: add #8659 * Changelog: add #8661 * Changelog: add #8671 * Changelog: add 5.7.1 to archived changelog too. * Reverted changes to readme, removed entry about backups.
This change introduces a filter (
jetpack_active_modules
) that allows theme and plugin developers to modify the list of active Jetpack modules.For some projects, there will be multiple copies of a site in different environments (e.g. development, QA, staging as well as production) and maintaining consistency across environments is important for quality assurance. Manually enabling/disabling modules across multiple environments is time consuming, inefficient and susceptible to human error. This change allows active modules to be defined in code, under version control, helping to ensure consistency across environments.