From a69185a29a8f6c5ab1f0cf957edc3d1754b25bf6 Mon Sep 17 00:00:00 2001 From: Nate Weller Date: Tue, 8 Oct 2024 13:02:07 -0600 Subject: [PATCH] Move functionality from module activation into the more generic waf activation method --- projects/packages/waf/src/class-waf-initializer.php | 3 --- projects/packages/waf/src/class-waf-runner.php | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/projects/packages/waf/src/class-waf-initializer.php b/projects/packages/waf/src/class-waf-initializer.php index c2720f83ca7cf..57a64306d1812 100644 --- a/projects/packages/waf/src/class-waf-initializer.php +++ b/projects/packages/waf/src/class-waf-initializer.php @@ -68,9 +68,6 @@ public static function init() { * @return bool|WP_Error True if the WAF activation is successful, WP_Error otherwise. */ public static function on_waf_activation() { - update_option( Waf_Runner::MODE_OPTION_NAME, 'normal' ); - add_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME, false ); - try { Waf_Runner::activate(); ( new Waf_Standalone_Bootstrap() )->generate(); diff --git a/projects/packages/waf/src/class-waf-runner.php b/projects/packages/waf/src/class-waf-runner.php index e961c10bff087..a4275ae7e43b4 100644 --- a/projects/packages/waf/src/class-waf-runner.php +++ b/projects/packages/waf/src/class-waf-runner.php @@ -324,6 +324,7 @@ public static function activate() { add_option( self::MODE_OPTION_NAME, 'normal' ); } + add_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME, false ); add_option( self::SHARE_DATA_OPTION_NAME, true ); self::initialize_filesystem();