Skip to content
Merged

Beta #795

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7439f22
Version: 6.78.99-dev.
Glomberg Apr 29, 2026
f82c996
Version: 6.78.99-fix.
Glomberg Apr 29, 2026
e21b6d5
Fix. Code. Github action fixed.
Glomberg Apr 29, 2026
f70df83
Fix. Code. Unit tests for #760 added. (#779) (#792)
Glomberg Apr 29, 2026
53685fc
Mod. Settings. Moving the AC option
AntonV1211 May 4, 2026
db07073
Merge pull request #793 from CleanTalk/moving_ac_setting_av
AntonV1211 May 5, 2026
8b95e4f
Fix. Search forms. Add a sign of 's' GET param to a native search for…
alexandergull May 5, 2026
325dcac
Merge remote-tracking branch 'origin/fix' into fix
alexandergull May 5, 2026
cc18c63
Fix. Contacts Encoder. Shortcodes. Content sanitization improved.
alexandergull May 7, 2026
1ab88a3
Fix. Codepilot review.
alexandergull May 9, 2026
a45bbcb
merge
AntonV1211 May 12, 2026
5a12c3c
Upd version 6.79
AntonV1211 May 12, 2026
1d54959
Merge branch 'master' of https://github.com/CleanTalk/wordpress-antis…
AntonV1211 May 12, 2026
1e6083b
Upd changelog
AntonV1211 May 12, 2026
91ba182
Merge pull request #794 from CleanTalk/fix.ee.kses.ag
AntonV1211 May 12, 2026
ea87136
Merge branch 'fix' of https://github.com/CleanTalk/wordpress-antispam…
AntonV1211 May 12, 2026
d4e3a5b
Upd changelog
AntonV1211 May 12, 2026
be3204c
Upd changelog
AntonV1211 May 12, 2026
e9898e9
Fix. NoCookieData. Correcting an error when encoding a NoCookie array
AntonV1211 May 14, 2026
561944e
Fix. CheckForSpam. Editing the deletion of spam check logs
AntonV1211 May 14, 2026
95c4202
Upd changelog
AntonV1211 May 14, 2026
3722592
Mod. AntiCrawler. Editing the option description
AntonV1211 May 14, 2026
d5ebfc0
Upd changelog
AntonV1211 May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: xdebug

- name: Run MySQL server
run: sudo systemctl start mysql
Expand Down
2 changes: 1 addition & 1 deletion cleantalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Anti-Spam by CleanTalk
Plugin URI: https://cleantalk.org
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
Version: 6.78
Version: 6.79
Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org>
Author URI: https://cleantalk.org
Text Domain: cleantalk-spam-protect
Expand Down
39 changes: 22 additions & 17 deletions inc/cleantalk-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,28 @@ function apbct_settings__set_fields()
),
'long_description' => true,
),
'sfw__anti_crawler' => array(
'type' => 'checkbox',
'title' => 'Anti-Crawler' . $additional_ac_title, // Do not to localize this phrase
'class' => 'apbct_settings-field_wrapper',
'parent' => 'sfw__enabled',
'description' =>
__(
'Plugin shows SpamFireWall stop page for any bot, except allowed bots (Google, Yahoo and etc).',
'cleantalk-spam-protect'
)
. '<br>'
. __(
'Anti-Crawler includes blocking bots by the User-Agent. Use Personal lists in the Dashboard to filter specific User-Agents.',
'cleantalk-spam-protect'
)
. '<br><b>'
. __(
'This option works only when SpamFireWall is enabled.',
'cleantalk-spam-protect'
) . '</b>',
'long_description' => true,
),
'data__email_decoder__status' => array(
'type' => 'custom_html',
'title' => __('Encode contact data', 'cleantalk-spam-protect'),
Expand Down Expand Up @@ -869,23 +891,6 @@ function apbct_settings__set_fields()
'title' => __('Custom logo on SpamFireWall blocking pages', 'cleantalk-spam-protect'),
'parent' => 'sfw__enabled',
),
'sfw__anti_crawler' => array(
'type' => 'checkbox',
'title' => 'Anti-Crawler' . $additional_ac_title, // Do not to localize this phrase
'class' => 'apbct_settings-field_wrapper',
'parent' => 'sfw__enabled',
'description' =>
__(
'Plugin shows SpamFireWall stop page for any bot, except allowed bots (Google, Yahoo and etc).',
'cleantalk-spam-protect'
)
. '<br>'
. __(
'Anti-Crawler includes blocking bots by the User-Agent. Use Personal lists in the Dashboard to filter specific User-Agents.',
'cleantalk-spam-protect'
),
'long_description' => true,
),
'sfw__anti_flood' => array(
'type' => 'checkbox',
'title' => 'Anti-Flood', // Do not to localize this phrase
Expand Down
2 changes: 1 addition & 1 deletion js/apbct-public-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_ext-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_ext-protection_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_full-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_full-protection_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_gathering.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_int-protection.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/apbct-public-bundle_int-protection_gathering.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_ext-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_ext-protection_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_full-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_full-protection_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_int-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
6 changes: 3 additions & 3 deletions js/prebuild/apbct-public-bundle_int-protection_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down Expand Up @@ -2694,7 +2694,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
2 changes: 1 addition & 1 deletion js/src/public-1-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function getNoCookieData() { // eslint-disable-line no-unused-vars
let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};
noCookieData = JSON.stringify(noCookieData);

return '_ct_no_cookie_data_' + btoa(noCookieData);
return '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
}


Expand Down
4 changes: 2 additions & 2 deletions js/src/public-1-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ApbctAttachData {
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
let visibleFieldsToInput = {};
visibleFieldsToInput[0] = this.collectVisibleFields(form);
hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));
hiddenInput.value = btoa(unescape(encodeURIComponent(JSON.stringify(visibleFieldsToInput))));
form.append( hiddenInput );
}

Expand Down Expand Up @@ -142,7 +142,7 @@ class ApbctAttachData {

let noCookieData = getCleanTalkStorageDataArray();
noCookieData = JSON.stringify(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);
noCookieData = '_ct_no_cookie_data_' + btoa(unescape(encodeURIComponent(noCookieData)));
field = document.createElement('input');
field.setAttribute('name', 'ct_no_cookie_hidden_field');
field.setAttribute('value', noCookieData);
Expand Down
29 changes: 20 additions & 9 deletions lib/Cleantalk/Antispam/IntegrationsByClass/WPSearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

namespace Cleantalk\Antispam\IntegrationsByClass;

use Cleantalk\ApbctWP\Escape;
use Cleantalk\ApbctWP\Variables\Post;
use Cleantalk\ApbctWP\Variables\Server;
use Cleantalk\Common\TT;
use Cleantalk\ApbctWP\Sanitize;
use Cleantalk\ApbctWP\Variables\Cookie;
use Cleantalk\ApbctWP\State;
use Cleantalk\ApbctWP\Honeypot;
use DOMDocument;

Expand All @@ -32,10 +25,10 @@ public function doAjaxWork()
public function doPublicWork()
{
global $apbct;
if ( $apbct->settings['forms__search_test'] ) {
if ($apbct->settings['forms__search_test']) {
add_filter('get_search_form', array($this, 'apbctFormSearchAddFields'), 999);
}
if ( ! is_admin() && ! apbct_is_ajax() && ! apbct_is_customize_preview() ) {
if ($this->isNativeSearchFormRequest()) {
// Default search
add_filter('get_search_query', array($this, 'testSpam'));
add_action('wp_head', array($this, 'addNoindex'), 1);
Expand Down Expand Up @@ -168,4 +161,22 @@ public function addNoindex()
echo '<!-- meta by CleanTalk Anti-Spam Protection plugin -->' . "\n";
echo '<meta name="robots" content="noindex,nofollow" />' . "\n";
}

/**
* Process signs for the default search request.
* - not an admin page
* - not an ajax call
* - not a preview
* - has a 's' param in the GET array
* @return bool
*/
public function isNativeSearchFormRequest()
{
return (
!is_admin() &&
!apbct_is_ajax() &&
!apbct_is_customize_preview() &&
isset($_GET['s']) // https://app.doboard.com/1/task/47523#comment_305493
);
}
}
Loading
Loading