From c2e00b3ed007825aac98eae8543eafe991113379 Mon Sep 17 00:00:00 2001 From: kagg-design Date: Tue, 23 Jul 2024 16:17:16 +0300 Subject: [PATCH] Do not activate the plugin on cron requests. --- src/php/Main.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/php/Main.php b/src/php/Main.php index 8dbc86e3..a468fea9 100644 --- a/src/php/Main.php +++ b/src/php/Main.php @@ -123,14 +123,18 @@ class Main { * @return void */ public function init(): void { - if ( Request::is_xml_rpc() || wp_doing_cron() ) { + if ( Request::is_xml_rpc() ) { return; } - ( new Fix() )->init(); - new Migrations(); + if ( wp_doing_cron() ) { + return; + } + + ( new Fix() )->init(); + add_action( 'plugins_loaded', [ $this, 'init_hooks' ], -PHP_INT_MAX ); }