diff --git a/mailchimp-for-wp.php b/mailchimp-for-wp.php index 6dcfa0a0..bc6dba2b 100755 --- a/mailchimp-for-wp.php +++ b/mailchimp-for-wp.php @@ -32,21 +32,13 @@ // Prevent direct file access defined('ABSPATH') or exit; - - - -/** @ignore */ -function _mc4wp_load_plugin() -{ +// bootstrap main plugin +add_action('plugins_loaded', function () { global $mc4wp; // don't run if Mailchimp for WP Pro 2.x is activated - if (defined('MC4WP_VERSION')) { - return; - } - // don't run if PHP version is lower than 7.4.0 - if (PHP_VERSION_ID < 70400) { + if (defined('MC4WP_VERSION') || PHP_VERSION_ID < 70400) { return; } @@ -101,10 +93,7 @@ function _mc4wp_load_plugin() // bootstrap integrations require __DIR__ . '/integrations/bootstrap.php'; -} - -// bootstrap main plugin -add_action('plugins_loaded', '_mc4wp_load_plugin', 8); +}, 8); // schedule the action hook to refresh the stored Mailchimp lists on a daily basis register_activation_hook(__FILE__, function () {