Conversation
Set the module's Auto Activate header to No so new Jetpack connections and upgrades no longer turn it on, and stop Jetpack Protect from activating it on plugin activation. Existing sites keep their current setting, since neither activation path deactivates modules. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin: No scheduled milestone found for this 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.
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Prevents Account Protection from activating automatically for new connections, upgrades, or Jetpack Protect activation while preserving existing settings.
Changes:
- Sets
Auto Activate: No. - Removes Protect’s explicit activation.
- Adds PHPUnit coverage and changelog entries.
| File | Description |
|---|---|
projects/plugins/protect/src/class-jetpack-protect.php |
Stops Protect from activating Account Protection. |
projects/plugins/protect/changelog/update-account-protection-no-auto-activate |
Documents the Protect behavior change. |
projects/plugins/jetpack/tests/php/general/Jetpack_Account_Protection_Auto_Activate_Test.php |
Verifies default module exclusions. |
projects/plugins/jetpack/modules/account-protection.php |
Disables automatic activation. |
projects/plugins/jetpack/changelog/update-account-protection-no-auto-activate |
Documents the Jetpack behavior change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kraftbj
left a comment
There was a problem hiding this comment.
Three notes inline, none blocking: one question about Atomic, and two small test tweaks.
The breached-password notice you listed as a follow-up (class-password-detection.php, "was automatically activated with a recent Jetpack update") will read wrong for anyone who turns the feature on after this ships, so it'd be good to land that close behind this one.
| * Requires Connection: Yes | ||
| * Requires User Connection: No | ||
| * Auto Activate: Yes | ||
| * Auto Activate: No |
There was a problem hiding this comment.
Atomic sites will still get this turned on: wpcomsh_woa_post_process_activate_jetpack_modules() activates account-protection after every clone, reset, and transfer (woa.php). Can you confirm that's expected?
There was a problem hiding this comment.
The main intent here was to improve the experience on self-hosted sites. I think it's okay to leave the Atomic part untouched.
Language follow-up here: #52993
Thanks for the other quick fixes on the tests.
|
The breached password notice follow-up is in #52993. It changes the wording to "This security feature is enabled on this site to help keep your account safe." |
enejb
left a comment
There was a problem hiding this comment.
Tested this on a fresh Jurassic Ninja site, and it works as described. Nothing blocking from me, just two small things that aren't covered above.
Testing
- I synced Jetpack and Protect from this branch before connecting, then connected. 15 modules were activated, and
account-protectionwas not among them. Protect is installed but not activated yet. - Mutation check on the new tests: with
auto_activateflipped back toYes, both "not a default" assertions fail. With this branch, all four pass. One thing to know when running them locally: the header is read from the build-generatedmodules/module-headings.php(gitignored), not from the module file itself. Editing onlyaccount-protection.phpwithout rebuilding leaves the tests passing, so a stale local build can hide a regression. CI rebuilds that file, so this isn't a problem for the PR.
My Jetpack "new user" check shifts a little
Initializer::get_active_modules() (packages/my-jetpack/src/class-initializer.php) leaves out Jetpack::get_default_modules(). Sites that already have Account Protection on from the old auto-activation will now count it as a module the user turned on, so is_jetpack_user_new() can return false. That hides the welcome-banner red bubble on sites where the site is connected but no user account is. It's low impact, but it might deserve a line in the description, or account-protection could be excluded there if that banner matters.
Changelog wording (nit)
The Jetpack entry only mentions new connections, but the upgrade path from before 14.5 changes too, and that was the path in the lockout reports. "the module" is also implementation wording. Maybe:
Account Protection: Stop turning the feature on automatically for new connections and upgrades from versions before 14.5. Sites where it is already on keep it on.
FYI
"Reset modules" (the settings reset endpoint and wp jetpack reset modules) replaces the active modules with the defaults, so a reset will now turn Account Protection off. That seems right for a reset. It's just the one case where an existing site's setting doesn't carry over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Proposed changes
Auto Activateheader toNo, so new Jetpack connections, and upgrades from versions before 14.5, no longer turn it on.account-protectionis not among the default modules for a new connection or for an upgrade from before 14.5.Closes #52708
Side effects
Initializer::get_active_modules()excludesJetpack::get_default_modules(). Sites that already have Account Protection on from the old auto-activation will now count it as a user-enabled module, sois_jetpack_user_new()can returnfalseand hide the welcome-banner red bubble when the site is connected but no user account is. This is low impact, so it's left as is rather than special-casingaccount-protectionin My Jetpack.wp jetpack reset modules) replaces the active modules with the defaults, so a reset now turns Account Protection off. That's expected for a reset, and it's the only path where an existing site's setting doesn't carry over.Related product discussion/links
Screenshots
Account Protection disabled on connection in main Jetpack plugin:
Account Protection disabled on connection in Jetpack Protect plugin:
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Automated
modules/module-headings.phpfirst, or a stale build can make the tests pass against the old header:jp build plugins/jetpack, orphp tools/build-module-headings-translations.phpfromprojects/plugins/jetpack.jetpack docker phpunit jetpack -- --filter Jetpack_Account_Protection_Auto_Activate_TestJetpack
Jetpack Protect
Known follow-up (not in this PR): the breached-password notice in
packages/account-protection/src/class-password-detection.phpsays the feature "was automatically activated with a recent Jetpack update", which will no longer be accurate for sites that turn it on manually.🤖 Generated with Claude Code