From 8ad0b2aa8f47f66adfebf82f2dd6926957864a17 Mon Sep 17 00:00:00 2001 From: Torsten Landsiedel Date: Thu, 1 Oct 2020 14:49:29 +0200 Subject: [PATCH 1/4] Add filter to allow ajax calls To allow ajaxified comments, this adds a filter to allow ajax calls if necessary --- antispam_bee.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/antispam_bee.php b/antispam_bee.php index ca8d08ab..6c05a848 100755 --- a/antispam_bee.php +++ b/antispam_bee.php @@ -119,7 +119,13 @@ public static function init() { ) ); - if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) { + $disallow_ajax = apply_filters( 'antispam_bee_allow_ajax_calls', true ); + + if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $disallow_ajax ) { + return; + } + + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } From dc60450293e400922db20a566ab17f378596bdd7 Mon Sep 17 00:00:00 2001 From: Torsten Landsiedel Date: Thu, 1 Oct 2020 14:55:06 +0200 Subject: [PATCH 2/4] Fix filter logic Fixed wrongly named filter --- antispam_bee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/antispam_bee.php b/antispam_bee.php index 6c05a848..f7672bb7 100755 --- a/antispam_bee.php +++ b/antispam_bee.php @@ -119,7 +119,7 @@ public static function init() { ) ); - $disallow_ajax = apply_filters( 'antispam_bee_allow_ajax_calls', true ); + $disallow_ajax = apply_filters( 'antispam_bee_disallow_ajax_calls', true ); if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $disallow_ajax ) { return; From 80b08d6b54e867373e277458a0af671a88ae43bd Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Sun, 8 Nov 2020 14:25:55 +0100 Subject: [PATCH 3/4] Cherry-pick Travis build updates --- .gitignore | 2 ++ .travis.yml | 4 ++++ composer.json | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 57872d0f..a4857288 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +.idea +composer.lock /vendor/ diff --git a/.travis.yml b/.travis.yml index cbcb67ae..7a1807eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,10 @@ jobs: script: ./bin/behat.sh - stage: behat php: '7.2' + env: WORDPRESS_VERSION=5.4 + script: ./bin/behat.sh + - stage: behat + php: '7.0' env: WORDPRESS_VERSION=5.3 script: ./bin/behat.sh - stage: behat diff --git a/composer.json b/composer.json index 5a644135..1d661ba7 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "behat/mink-goutte-driver": "^1.2", "behat/mink-selenium2-driver": "^1.3", "wp-coding-standards/wpcs": "^0.14.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "composer/package-versions-deprecated": "^1.11" }, "autoload-dev": { "classmap": [ From 3ff33eeb83ee29f72a0a26bbfc0bc87ffe4f7caf Mon Sep 17 00:00:00 2001 From: Torsten Landsiedel Date: Sun, 8 Nov 2020 16:11:13 +0100 Subject: [PATCH 4/4] Fix behat test --- tests/Acceptance/Behat/filter.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Acceptance/Behat/filter.feature b/tests/Acceptance/Behat/filter.feature index 3ab33c57..8ebf80bf 100644 --- a/tests/Acceptance/Behat/filter.feature +++ b/tests/Acceptance/Behat/filter.feature @@ -357,7 +357,7 @@ Feature: Filter settings Given I am on "/wp-admin/edit-comments.php" Then I should see "Monty" Then I check "cb-select-all-1" - Then I select "Mark as Spam" from "bulk-action-selector-top" + Then I select "spam" from "bulk-action-selector-top" Then I press "doaction" Given I am an anonymous user