Adds modules enforcing logic.
This change introduces a new method to enforce module loading with an additional side effect of the jetpack_pre_module_activate being run on first activation.
Changes proposed in this Pull Request:
- Added the
enforcemethod to theModulesclass. - Added unit tests.
Other information:
- [x] Have you written new tests for your changes, if applicable?
- [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?
Jetpack product discussion
TBA
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
- Install a standalone plugin that depends on the Jetpack module being activated.
- Set up a filter to run on the module activation action.
add_action( 'jetpack_pre_activate_module', 'l' ); //Use any other handler here instead of l if you wish
- Use the new method to enforce the needed module to load.
- Make sure the module activation hook fires only once.
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
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 :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Jetpack plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 25, 2022.
Backup plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Boost plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Search plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Social plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Starter Plugin plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Protect plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Videopress plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 24, 2022.
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack add/modules-enforcing-logic to get started. More details: p9dueE-5Nn-p2
Closing this for now because of the lack of activity on this. We can always reopen in the future if needed.