Boost: run module status change routine on plugin activation#43168
Boost: run module status change routine on plugin activation#43168
Conversation
Fixes #41718 When the plugin is activated: 1. Check if some modules are already active (like for example when the plugin was previously active on the site). 2. Check if the plugin is connected to WordPress.com. If so, we'll want to run the feature activation routines to ensure the module is correctly set up.
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
| * Check what modules are already active (from a previous activation for example). | ||
| * If there are active modules, we need to ensure each module-related event is triggered again. | ||
| */ | ||
| $active_modules = $modules_setup->get_ready_active_optimization_modules(); |
There was a problem hiding this comment.
get_ready_active_optimization_modules might not be the right list. The ready check will exclude all the modules that are currently not ready. For example, cloud CSS is not ready until it's generated, but it should be activated to generate the critical CSS in the first place and become ready.
So, in this case, we want to get all modules with the active state and run the routine on them.
There was a problem hiding this comment.
Thanks for the pointer! I updated the PR to try to address that.
be354f2 to
ccdb215
Compare
dilirity
left a comment
There was a problem hiding this comment.
Nice and clean! Thanks for taking care of this.
![]()
* Boost: run module status change routine on plugin activation Fixes #41718 When the plugin is activated: 1. Check if some modules are already active (like for example when the plugin was previously active on the site). 2. Check if the plugin is connected to WordPress.com. If so, we'll want to run the feature activation routines to ensure the module is correctly set up. * Switch method to get active modules See Automattic/jetpack#43168 (review) Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/14598715531 Upstream-Ref: Automattic/jetpack@c06429b
* Boost: run module status change routine on plugin activation Fixes #41718 When the plugin is activated: 1. Check if some modules are already active (like for example when the plugin was previously active on the site). 2. Check if the plugin is connected to WordPress.com. If so, we'll want to run the feature activation routines to ensure the module is correctly set up. * Switch method to get active modules See Automattic/jetpack#43168 (review) Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/14598715531 Upstream-Ref: Automattic/jetpack@c06429b
Fixes #41718
Fixes HOG-20
Proposed changes:
When the plugin is activated:
If so, we'll want to run the feature activation routines to ensure the module is correctly set up.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
advanced-cache.phpfile was created inwp-content.