diff --git a/lib/Config/Changelog.php b/lib/Config/Changelog.php index 647af1c5b1..b4c314ca5b 100644 --- a/lib/Config/Changelog.php +++ b/lib/Config/Changelog.php @@ -62,9 +62,7 @@ class Changelog { $this->setupNewInstallation(); $this->checkWelcomeWizard(); } - if ($this->settings->get('woo_commerce_list_sync_enabled')) { - $this->checkWooCommerceListImportPage(); - } + $this->checkWooCommerceListImportPage(); } private function checkMp2Migration($version) { diff --git a/lib/Config/Hooks.php b/lib/Config/Hooks.php index 144705f0d5..875b3ef02f 100644 --- a/lib/Config/Hooks.php +++ b/lib/Config/Hooks.php @@ -163,10 +163,6 @@ class Hooks { } function setupWooCommerceSubscriptionEvents() { - if (!$this->settings->get('woo_commerce_list_sync_enabled')) { - return false; - } - $woocommerce = $this->settings->get('woocommerce', []); // WooCommerce: subscribe on checkout if (!empty($woocommerce['optin_on_checkout']['enabled'])) { diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index d5f3ebb86e..66ad7094e6 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -408,9 +408,6 @@ class Menu { } function wooCommerceListImport() { - if (!$this->settings->get('woo_commerce_list_sync_enabled')) { - return; - } if ((bool)(defined('DOING_AJAX') && DOING_AJAX)) return; $data = [ 'finish_wizard_url' => $this->wp->adminUrl('admin.php?page=' . self::MAIN_PAGE_SLUG), diff --git a/lib/Cron/Daemon.php b/lib/Cron/Daemon.php index d4c4ae969a..18a7aff74b 100644 --- a/lib/Cron/Daemon.php +++ b/lib/Cron/Daemon.php @@ -56,8 +56,6 @@ class Daemon { yield $this->workers_factory->createBounceWorker($this->timer); yield $this->workers_factory->createExportFilesCleanupWorker($this->timer); yield $this->workers_factory->createInactiveSubscribersWorker($this->timer); - if ($this->settings_controller->get('woo_commerce_list_sync_enabled')) { - yield $this->workers_factory->createWooCommerceSyncWorker($this->timer); - } + yield $this->workers_factory->createWooCommerceSyncWorker($this->timer); } } diff --git a/lib/Segments/WooCommerce.php b/lib/Segments/WooCommerce.php index 27354ed00a..131811c4cd 100644 --- a/lib/Segments/WooCommerce.php +++ b/lib/Segments/WooCommerce.php @@ -25,9 +25,6 @@ class WooCommerce { } function synchronizeRegisteredCustomer($wp_user_id, $current_filter = null) { - if (!$this->settings->get('woo_commerce_list_sync_enabled')) { - return false; - } $wc_segment = Segment::getWooCommerceSegment(); if ($wc_segment === false) return; @@ -76,9 +73,6 @@ class WooCommerce { } function synchronizeGuestCustomer($order_id, $current_filter = null) { - if (!$this->settings->get('woo_commerce_list_sync_enabled')) { - return false; - } $wc_order = $this->wp->getPost($order_id); $wc_segment = Segment::getWooCommerceSegment(); diff --git a/tests/DataFactories/Settings.php b/tests/DataFactories/Settings.php index 8b17a35b65..637ffe8b3a 100644 --- a/tests/DataFactories/Settings.php +++ b/tests/DataFactories/Settings.php @@ -100,11 +100,6 @@ class Settings { return $this; } - function withWooCommerceListSyncEnabled() { - $this->settings->set('woo_commerce_list_sync_enabled', 1); - return $this; - } - function withWooCommerceCheckoutOptinEnabled() { $this->settings->set('woocommerce.optin_on_checkout.enabled', true); $this->settings->set('woocommerce.optin_on_checkout.message', 'Yes, I would like to be added to your mailing list'); diff --git a/tests/acceptance/WooCommerceCheckoutOptinCest.php b/tests/acceptance/WooCommerceCheckoutOptinCest.php index 58666c75af..369461ce54 100644 --- a/tests/acceptance/WooCommerceCheckoutOptinCest.php +++ b/tests/acceptance/WooCommerceCheckoutOptinCest.php @@ -21,7 +21,6 @@ class WooCommerceCheckoutOptinCest { $this->product_factory = new WooCommerceProduct($I); $this->settings_factory = new Settings(); $this->settings_factory->withWooCommerceListImportPageDisplayed(true); - $this->settings_factory->withWooCommerceListSyncEnabled(); $this->settings_factory->withWooCommerceCheckoutOptinEnabled(); } diff --git a/tests/acceptance/WooCommerceCustomerListCest.php b/tests/acceptance/WooCommerceCustomerListCest.php index 158ac6d26c..11df37c594 100644 --- a/tests/acceptance/WooCommerceCustomerListCest.php +++ b/tests/acceptance/WooCommerceCustomerListCest.php @@ -22,7 +22,6 @@ class WooCommerceCustomerListCest { $this->product_factory = new WooCommerceProduct($I); $settings_factory = new Settings(); $settings_factory->withWooCommerceListImportPageDisplayed(true); - $settings_factory->withWooCommerceListSyncEnabled(); $settings_factory->withWooCommerceCheckoutOptinEnabled(); $customer_factory = new WooCommerceCustomer($I); $customer_factory->deleteAll(); diff --git a/tests/acceptance/WooCommerceListImportPageCest.php b/tests/acceptance/WooCommerceListImportPageCest.php index 5ee6efe004..99534aa370 100644 --- a/tests/acceptance/WooCommerceListImportPageCest.php +++ b/tests/acceptance/WooCommerceListImportPageCest.php @@ -27,9 +27,6 @@ class WooCommerceListImportPageCest { // Cleanup $this->customer_factory->deleteAll(); $this->order_factory->deleteAll(); - // Feature switch - $settings_factory = new Settings(); - $settings_factory->withWooCommerceListSyncEnabled(); $scheduled_tasks_factory = new ScheduledTask(); $scheduled_tasks_factory->deleteAll(); } diff --git a/tests/acceptance/WooCommerceSettingsTabCest.php b/tests/acceptance/WooCommerceSettingsTabCest.php index d9cc12e370..5994b99ac4 100644 --- a/tests/acceptance/WooCommerceSettingsTabCest.php +++ b/tests/acceptance/WooCommerceSettingsTabCest.php @@ -12,7 +12,6 @@ class WooCommerceSettingsTabCest { $I->activateWooCommerce(); $this->settings_factory = new Settings(); $this->settings_factory->withWooCommerceListImportPageDisplayed(true); - $this->settings_factory->withWooCommerceListSyncEnabled(); } function checkWooCommerceTabExists(\AcceptanceTester $I) { diff --git a/tests/integration/Cron/DaemonTest.php b/tests/integration/Cron/DaemonTest.php index ff34f6c38e..c52ae00906 100644 --- a/tests/integration/Cron/DaemonTest.php +++ b/tests/integration/Cron/DaemonTest.php @@ -17,7 +17,6 @@ class DaemonTest extends \MailPoetTest { public function _before() { parent::_before(); $this->settings = new SettingsController(); - $this->settings->set('woo_commerce_list_sync_enabled', 1); } function testItCanRun() { diff --git a/tests/integration/Segments/WooCommerceTest.php b/tests/integration/Segments/WooCommerceTest.php index 17613da3b1..60decc7058 100644 --- a/tests/integration/Segments/WooCommerceTest.php +++ b/tests/integration/Segments/WooCommerceTest.php @@ -27,7 +27,6 @@ class WooCommerceTest extends \MailPoetTest { function _before() { $this->woocommerce_segment = ContainerWrapper::getInstance()->get(WooCommerceSegment::class); $this->settings = ContainerWrapper::getInstance()->get(SettingsController::class); - $this->settings->set('woo_commerce_list_sync_enabled', 1); $this->cleanData(); $this->addCustomerRole(); } diff --git a/tests/integration/WooCommerce/SubscriptionTest.php b/tests/integration/WooCommerce/SubscriptionTest.php index 24eea6d7fc..6650c9e7b9 100644 --- a/tests/integration/WooCommerce/SubscriptionTest.php +++ b/tests/integration/WooCommerce/SubscriptionTest.php @@ -15,7 +15,6 @@ class SubscriptionTest extends \MailPoetTest { $this->order_id = 123; // dummy $this->subscription = ContainerWrapper::getInstance()->get(Subscription::class); $this->settings = new SettingsController(); - $this->settings->set('woo_commerce_list_sync_enabled', 1); $this->wc_segment = Segment::getWooCommerceSegment(); $subscriber = Subscriber::create(); diff --git a/views/settings.html b/views/settings.html index 92b2c234e3..a9e22e2e43 100644 --- a/views/settings.html +++ b/views/settings.html @@ -117,7 +117,7 @@ } else { $('#settings_stats_notifications_error').hide(); } - <% if is_woocommerce_active and settings.woo_commerce_list_sync_enabled %> + <% if is_woocommerce_active %> // if WooCommerce opt-in on checkout is enabled but the checkbox message is empty, show an error var woocommerce_optin_on_checkout_enabled = $('input[name="woocommerce[optin_on_checkout][enabled]"]:checked').val(), woocommerce_optin_on_checkout_message = $('input[name="woocommerce[optin_on_checkout][message]"]').val().trim(); diff --git a/views/settings/woocommerce.html b/views/settings/woocommerce.html index e1f305a584..003f561ba5 100644 --- a/views/settings/woocommerce.html +++ b/views/settings/woocommerce.html @@ -1,5 +1,4 @@ - <% if settings.woo_commerce_list_sync_enabled %> - <% endif %>