From 4f2414db6b5668388dbbd63df27f080cf8f1088d Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 13:15:34 +0800 Subject: [PATCH 1/8] Fix CLI command --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 919eed39..5fcbfeb1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -142,7 +142,7 @@ jobs: # party Plugins. - name: Activate "Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice Plugin" working-directory: ${{ env.ROOT_DIR }} - run: wp-cli plugin activate disable-doing-it-wrong-notices.php + run: wp-cli plugin activate disable-doing-it-wrong-notices # These should be stored as a separated list of URLs in the repository Settings > Secrets > Repository Secret > CONVERTKIT_PAID_PLUGIN_URLS. # We cannot include the URLs in this file, as they're not Plugins we are permitted to distribute. From c0a0bbf78ff2b846240c56c99e290fc1b9d1aec4 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 14:20:34 +0800 Subject: [PATCH 2/8] Output all Plugins in CLI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5fcbfeb1..fba759ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -142,7 +142,7 @@ jobs: # party Plugins. - name: Activate "Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice Plugin" working-directory: ${{ env.ROOT_DIR }} - run: wp-cli plugin activate disable-doing-it-wrong-notices + run: wp-cli-list && wp-cli plugin listwp-cli plugin activate disable-doing-it-wrong-notices # These should be stored as a separated list of URLs in the repository Settings > Secrets > Repository Secret > CONVERTKIT_PAID_PLUGIN_URLS. # We cannot include the URLs in this file, as they're not Plugins we are permitted to distribute. From 78a83047a3a107a57e419c7439f042e9305486ab Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 14:21:57 +0800 Subject: [PATCH 3/8] Tests: List plugins --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fba759ad..4bfaa480 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -142,7 +142,7 @@ jobs: # party Plugins. - name: Activate "Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice Plugin" working-directory: ${{ env.ROOT_DIR }} - run: wp-cli-list && wp-cli plugin listwp-cli plugin activate disable-doing-it-wrong-notices + run: wp-cli plugin list && wp-cli plugin activate disable-doing-it-wrong-notices # These should be stored as a separated list of URLs in the repository Settings > Secrets > Repository Secret > CONVERTKIT_PAID_PLUGIN_URLS. # We cannot include the URLs in this file, as they're not Plugins we are permitted to distribute. From 419cc8de552de5afa3fd271f1b505b2b2863c77d Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 14:25:35 +0800 Subject: [PATCH 4/8] Remove activation step --- .github/workflows/tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bfaa480..834b697b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -137,13 +137,6 @@ jobs: working-directory: ${{ env.ROOT_DIR }} run: wp-cli plugin install ${{ env.INSTALL_PLUGINS_URLS }} - # Activates the Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice Plugin, - # to prevent _load_textdomain_just_in_time PHP notices in WordPress 6.7+ due to third - # party Plugins. - - name: Activate "Disable `_load_textdomain_just_in_time` `doing_it_wrong` notice Plugin" - working-directory: ${{ env.ROOT_DIR }} - run: wp-cli plugin list && wp-cli plugin activate disable-doing-it-wrong-notices - # These should be stored as a separated list of URLs in the repository Settings > Secrets > Repository Secret > CONVERTKIT_PAID_PLUGIN_URLS. # We cannot include the URLs in this file, as they're not Plugins we are permitted to distribute. - name: Install Paid Third Party WordPress Plugins From bab65a6a78fa1b962a36c77e0f8f6b711fc7a77d Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 15:05:46 +0800 Subject: [PATCH 5/8] Divi: Disable notices --- tests/acceptance/integrations/other/DiviBroadcastsCest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/acceptance/integrations/other/DiviBroadcastsCest.php b/tests/acceptance/integrations/other/DiviBroadcastsCest.php index a1ea5990..38eb78dc 100644 --- a/tests/acceptance/integrations/other/DiviBroadcastsCest.php +++ b/tests/acceptance/integrations/other/DiviBroadcastsCest.php @@ -16,6 +16,7 @@ class DiviBroadcastsCest public function _before(AcceptanceTester $I) { $I->activateConvertKitPlugin($I); + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'divi-builder'); } @@ -173,6 +174,7 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(AcceptanceT public function _passed(AcceptanceTester $I) { $I->deactivateThirdPartyPlugin($I, 'divi-builder'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->deactivateConvertKitPlugin($I); $I->resetConvertKitPlugin($I); } From 51efc82154f1eded72f22bd79255e50727660471 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 15:32:59 +0800 Subject: [PATCH 6/8] Fix failing tests --- tests/acceptance/integrations/other/DiviFormCest.php | 2 ++ tests/acceptance/integrations/other/DiviFormTriggerCest.php | 2 ++ tests/acceptance/integrations/other/DiviProductCest.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/acceptance/integrations/other/DiviFormCest.php b/tests/acceptance/integrations/other/DiviFormCest.php index 41aa4e42..e05178f7 100644 --- a/tests/acceptance/integrations/other/DiviFormCest.php +++ b/tests/acceptance/integrations/other/DiviFormCest.php @@ -16,6 +16,7 @@ class DiviFormCest public function _before(AcceptanceTester $I) { $I->activateConvertKitPlugin($I); + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'divi-builder'); } @@ -228,6 +229,7 @@ public function testFormModuleWithNoFormParameter(AcceptanceTester $I) public function _passed(AcceptanceTester $I) { $I->deactivateThirdPartyPlugin($I, 'divi-builder'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->deactivateConvertKitPlugin($I); $I->resetConvertKitPlugin($I); } diff --git a/tests/acceptance/integrations/other/DiviFormTriggerCest.php b/tests/acceptance/integrations/other/DiviFormTriggerCest.php index b4b92e6d..4cce1333 100644 --- a/tests/acceptance/integrations/other/DiviFormTriggerCest.php +++ b/tests/acceptance/integrations/other/DiviFormTriggerCest.php @@ -16,6 +16,7 @@ class DiviFormTriggerCest public function _before(AcceptanceTester $I) { $I->activateConvertKitPlugin($I); + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'divi-builder'); } @@ -193,6 +194,7 @@ public function testFormTriggerModuleWithNoFormParameter(AcceptanceTester $I) public function _passed(AcceptanceTester $I) { $I->deactivateThirdPartyPlugin($I, 'divi-builder'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->deactivateConvertKitPlugin($I); $I->resetConvertKitPlugin($I); } diff --git a/tests/acceptance/integrations/other/DiviProductCest.php b/tests/acceptance/integrations/other/DiviProductCest.php index 5e0e4b59..ebc7f47f 100644 --- a/tests/acceptance/integrations/other/DiviProductCest.php +++ b/tests/acceptance/integrations/other/DiviProductCest.php @@ -16,6 +16,7 @@ class DiviProductCest public function _before(AcceptanceTester $I) { $I->activateConvertKitPlugin($I); + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'divi-builder'); } @@ -186,6 +187,7 @@ public function testProductModuleWithNoProductParameter(AcceptanceTester $I) public function _passed(AcceptanceTester $I) { $I->deactivateThirdPartyPlugin($I, 'divi-builder'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->deactivateConvertKitPlugin($I); $I->resetConvertKitPlugin($I); } From 0a7d4a64224847645e9def5902b9d59f88fd0a86 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 17:34:55 +0800 Subject: [PATCH 7/8] Fix tests --- tests/_support/Helper/Acceptance/WPCron.php | 13 +++++++++++-- .../blocks-shortcodes/PageShortcodeFormCest.php | 4 ++++ .../landing-pages/PageLandingPageCest.php | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/_support/Helper/Acceptance/WPCron.php b/tests/_support/Helper/Acceptance/WPCron.php index 7114632a..f92f4834 100644 --- a/tests/_support/Helper/Acceptance/WPCron.php +++ b/tests/_support/Helper/Acceptance/WPCron.php @@ -9,6 +9,15 @@ */ class WPCron extends \Codeception\Module { + /** + * Holds the admin UI URL for WP Crontrol. + * + * @since 2.6.6 + * + * @var string + */ + private $adminURL = 'tools.php?page=wp-crontrol'; + /** * Asserts if the given event name is scheduled in WordPress' Cron. * @@ -49,7 +58,7 @@ public function dontSeeCronEvent($I, $name) public function runCronEvent($I, $name) { // List cron event in WP-Crontrol Plugin. - $I->amOnAdminPage('tools.php?page=crontrol_admin_manage_page&s=' . $name); + $I->amOnAdminPage($this->adminURL . '&s=' . $name); // Hover mouse over event's name. $I->moveMouseOver('#the-list tr'); @@ -74,7 +83,7 @@ public function runCronEvent($I, $name) public function deleteCronEvent($I, $name) { // List cron event in WP-Crontrol Plugin. - $I->amOnAdminPage('tools.php?page=crontrol_admin_manage_page&s=' . $name); + $I->amOnAdminPage($this->adminURL . '&s=' . $name); // Hover mouse over event's name. $I->moveMouseOver('#the-list tr'); diff --git a/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php b/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php index 6e029610..f70beb45 100644 --- a/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php +++ b/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php @@ -655,6 +655,7 @@ public function testFormShortcodeWithPerfmattersPlugin(AcceptanceTester $I) $I->setupConvertKitPluginResources($I); // Activate Perfmatters Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'perfmatters'); // Enable Defer and Delay JavaScript. @@ -700,6 +701,7 @@ public function testFormShortcodeWithPerfmattersPlugin(AcceptanceTester $I) // Deactivate Perfmatters Plugin. $I->deactivateThirdPartyPlugin($I, 'perfmatters'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /** @@ -770,6 +772,7 @@ public function testFormShortcodeWithWPRocketPlugin(AcceptanceTester $I) $I->setupConvertKitPluginResources($I); // Activate WP Rocket Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'wp-rocket'); // Configure WP Rocket. @@ -806,6 +809,7 @@ public function testFormShortcodeWithWPRocketPlugin(AcceptanceTester $I) // Deactivate WP Rocket Plugin. $I->deactivateThirdPartyPlugin($I, 'wp-rocket'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /** diff --git a/tests/acceptance/landing-pages/PageLandingPageCest.php b/tests/acceptance/landing-pages/PageLandingPageCest.php index 21d921b3..41160d05 100644 --- a/tests/acceptance/landing-pages/PageLandingPageCest.php +++ b/tests/acceptance/landing-pages/PageLandingPageCest.php @@ -328,6 +328,7 @@ public function testAddNewPageUsingDefinedLandingPageWithPerfmattersPlugin(Accep $I->setupConvertKitPluginResources($I); // Activate Perfmatters Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'perfmatters'); // Enable Lazy Loading. @@ -373,6 +374,7 @@ public function testAddNewPageUsingDefinedLandingPageWithPerfmattersPlugin(Accep // Deactivate Perfmatters Plugin. $I->deactivateThirdPartyPlugin($I, 'perfmatters'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /** From 0a7c4a630cf1d6314643a5a4b0f1f514ce91b3f8 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 17:37:09 +0800 Subject: [PATCH 8/8] Coding standards --- tests/_support/Helper/Acceptance/WPCron.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_support/Helper/Acceptance/WPCron.php b/tests/_support/Helper/Acceptance/WPCron.php index f92f4834..7dce90e3 100644 --- a/tests/_support/Helper/Acceptance/WPCron.php +++ b/tests/_support/Helper/Acceptance/WPCron.php @@ -17,7 +17,7 @@ class WPCron extends \Codeception\Module * @var string */ private $adminURL = 'tools.php?page=wp-crontrol'; - + /** * Asserts if the given event name is scheduled in WordPress' Cron. *