diff --git a/projects/plugins/jetpack/changelog/update-account-protection-no-auto-activate b/projects/plugins/jetpack/changelog/update-account-protection-no-auto-activate new file mode 100644 index 000000000000..56ae412e2e9b --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-account-protection-no-auto-activate @@ -0,0 +1,4 @@ +Significance: minor +Type: enhancement + +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. diff --git a/projects/plugins/jetpack/modules/account-protection.php b/projects/plugins/jetpack/modules/account-protection.php index 17e14a8d1fe7..2296950fc613 100644 --- a/projects/plugins/jetpack/modules/account-protection.php +++ b/projects/plugins/jetpack/modules/account-protection.php @@ -6,7 +6,7 @@ * First Introduced: 14.5 * Requires Connection: Yes * Requires User Connection: No - * Auto Activate: Yes + * Auto Activate: No * Module Tags: Account Protection * Feature: Security * diff --git a/projects/plugins/jetpack/tests/php/general/Jetpack_Account_Protection_Auto_Activate_Test.php b/projects/plugins/jetpack/tests/php/general/Jetpack_Account_Protection_Auto_Activate_Test.php new file mode 100644 index 000000000000..87d2417ec0c1 --- /dev/null +++ b/projects/plugins/jetpack/tests/php/general/Jetpack_Account_Protection_Auto_Activate_Test.php @@ -0,0 +1,34 @@ +assertContains( 'account-protection', Jetpack::get_available_modules() ); + $this->assertNotContains( 'account-protection', Jetpack::get_default_modules() ); + } + + /** + * An upgrade activates the default modules introduced since the previous version. + */ + public function test_account_protection_is_not_activated_on_upgrade_from_before_14_5() { + $this->assertContains( 'account-protection', Jetpack::get_available_modules( '14.4', JETPACK__VERSION ) ); + $this->assertNotContains( 'account-protection', Jetpack::get_default_modules( '14.4', JETPACK__VERSION ) ); + } +} diff --git a/projects/plugins/protect/changelog/update-account-protection-no-auto-activate b/projects/plugins/protect/changelog/update-account-protection-no-auto-activate new file mode 100644 index 000000000000..9ff5d478b7c6 --- /dev/null +++ b/projects/plugins/protect/changelog/update-account-protection-no-auto-activate @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Account Protection: Stop turning the feature on automatically when Protect is activated. Sites where it is already on keep it on. diff --git a/projects/plugins/protect/src/class-jetpack-protect.php b/projects/plugins/protect/src/class-jetpack-protect.php index 88d4f496f695..df2d2ffa8e96 100644 --- a/projects/plugins/protect/src/class-jetpack-protect.php +++ b/projects/plugins/protect/src/class-jetpack-protect.php @@ -304,7 +304,6 @@ public static function do_plugin_activation_activities() { */ public static function activate_modules() { delete_option( self::JETPACK_PROTECT_ACTIVATION_OPTION ); - ( new Modules() )->activate( self::JETPACK_ACCOUNT_PROTECTION_MODULE_SLUG, false, false ); ( new Modules() )->activate( self::JETPACK_WAF_MODULE_SLUG, false, false ); ( new Modules() )->activate( self::JETPACK_BRUTE_FORCE_PROTECTION_MODULE_SLUG, false, false ); }