Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.180.2

Version Description

Jul 04 2022 =

SpamFireWall working fixed.

  • Fix. Updater. Updater actions moved from the hook "upgrader_process_complete"
  • Fix. SFW. JS errors on the block pages fixed.
  • Fix. SFW. Skiping block hyperlink fixed.
  • Fix. SFW. Additional redundant blocking by AC fixed.
Download this release

Release Info

Developer glomberg
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.180.2
Comparing to
See all releases

Code changes from version 5.180.1 to 5.180.2

cleantalk.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  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.
7
- Version: 5.180.1
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -190,33 +190,10 @@ if ( $apbct->plugin_version === '1.0.0' ) {
190
  }
191
 
192
  /**
193
- * This function runs when WordPress completes its upgrade process
194
- * It iterates through each plugin updated to see if ours is included
195
- *
196
- * @param $upgrader WP_Upgrader
197
- * @param $options Array
198
- *
199
  */
200
- function apbct_upgrader_process_complete($_upgrader, $options)
201
- {
202
- $our_plugin = APBCT_PLUGIN_BASE_NAME;
203
-
204
- // If an update has taken place and the updated type is plugins and the plugin's element exists
205
- if ($options['action'] === 'update' && $options['type'] === 'plugin' && isset($options['plugins'])) {
206
- // Iterate through the plugins being updated and check if ours is there
207
-
208
- foreach ($options['plugins'] as $plugin) {
209
- if ($plugin === $our_plugin) {
210
- apbct_update_actions();
211
- }
212
- }
213
- }
214
- }
215
- // compatibility with old version
216
- if (version_compare($apbct->plugin_version, '5.179') === -1) {
217
- apbct_update_actions();
218
- }
219
- add_action('upgrader_process_complete', 'apbct_upgrader_process_complete', 10, 2);
220
 
221
  add_action('init', function () {
222
  global $apbct;
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  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.
7
+ Version: 5.180.2
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
190
  }
191
 
192
  /**
193
+ * Do update actions if version is changed
194
+ * ! we can`t place this function to the hook "upgrader_process_complete" !
 
 
 
 
195
  */
196
+ apbct_update_actions();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  add_action('init', function () {
199
  global $apbct;
lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php CHANGED
@@ -506,11 +506,22 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule
506
  'cookiePrefix' => apbct__get_cookie_prefix(),
507
  );
508
 
 
 
 
 
 
 
 
 
 
 
509
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
510
 
511
  $replaces = array(
512
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
513
- '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js),
 
514
  );
515
 
516
  foreach ( $replaces as $place_holder => $replace ) {
506
  'cookiePrefix' => apbct__get_cookie_prefix(),
507
  );
508
 
509
+ $localize_js_public = array(
510
+ 'pixel__setting' => $apbct->settings['data__pixel'],
511
+ 'pixel__enabled' => $apbct->settings['data__pixel'] === '2' ||
512
+ ($apbct->settings['data__pixel'] === '3' && apbct_is_cache_plugins_exists()),
513
+ 'pixel__url' => $apbct->pixel_url,
514
+ 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
515
+ 'data__cookies_type' => $apbct->data['cookies_type'],
516
+ 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
517
+ );
518
+
519
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
520
 
521
  $replaces = array(
522
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
523
+ '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js) . ';' .
524
+ 'var ctPublic = ' . json_encode($localize_js_public) . ';',
525
  );
526
 
527
  foreach ( $replaces as $place_holder => $replace ) {
lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php CHANGED
@@ -267,11 +267,22 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule
267
  'cookiePrefix' => apbct__get_cookie_prefix(),
268
  );
269
 
 
 
 
 
 
 
 
 
 
 
270
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
271
 
272
  $replaces = array(
273
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
274
- '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js),
 
275
  );
276
 
277
  foreach ($replaces as $place_holder => $replace) {
267
  'cookiePrefix' => apbct__get_cookie_prefix(),
268
  );
269
 
270
+ $localize_js_public = array(
271
+ 'pixel__setting' => $apbct->settings['data__pixel'],
272
+ 'pixel__enabled' => $apbct->settings['data__pixel'] === '2' ||
273
+ ($apbct->settings['data__pixel'] === '3' && apbct_is_cache_plugins_exists()),
274
+ 'pixel__url' => $apbct->pixel_url,
275
+ 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
276
+ 'data__cookies_type' => $apbct->data['cookies_type'],
277
+ 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
278
+ );
279
+
280
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
281
 
282
  $replaces = array(
283
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
284
+ '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js) . ';' .
285
+ 'var ctPublic = ' . json_encode($localize_js_public) . ';',
286
  );
287
 
288
  foreach ($replaces as $place_holder => $replace) {
lib/Cleantalk/ApbctWP/Firewall/SFW.php CHANGED
@@ -330,7 +330,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule
330
  // Cookie
331
  '{COOKIE_PREFIX}' => '',
332
  '{COOKIE_DOMAIN}' => $this->cookie_domain,
333
- '{COOKIE_SFW}' => $this->test ? $this->test_ip : $cookie_val,
334
  '{COOKIE_ANTICRAWLER}' => hash('sha256', $apbct->api_key . $apbct->data['salt']),
335
 
336
  // Test
@@ -419,11 +419,22 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule
419
  'cookiePrefix' => apbct__get_cookie_prefix(),
420
  );
421
 
 
 
 
 
 
 
 
 
 
 
422
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
423
 
424
  $replaces = array(
425
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
426
- '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js),
 
427
  );
428
 
429
  foreach ($replaces as $place_holder => $replace) {
330
  // Cookie
331
  '{COOKIE_PREFIX}' => '',
332
  '{COOKIE_DOMAIN}' => $this->cookie_domain,
333
+ '{COOKIE_SFW}' => $cookie_val,
334
  '{COOKIE_ANTICRAWLER}' => hash('sha256', $apbct->api_key . $apbct->data['salt']),
335
 
336
  // Test
419
  'cookiePrefix' => apbct__get_cookie_prefix(),
420
  );
421
 
422
+ $localize_js_public = array(
423
+ 'pixel__setting' => $apbct->settings['data__pixel'],
424
+ 'pixel__enabled' => $apbct->settings['data__pixel'] === '2' ||
425
+ ($apbct->settings['data__pixel'] === '3' && apbct_is_cache_plugins_exists()),
426
+ 'pixel__url' => $apbct->pixel_url,
427
+ 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
428
+ 'data__cookies_type' => $apbct->data['cookies_type'],
429
+ 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
430
+ );
431
+
432
  $js_jquery_url = includes_url() . 'js/jquery/jquery.min.js';
433
 
434
  $replaces = array(
435
  '{JQUERY_SCRIPT_URL}' => $js_jquery_url,
436
+ '{LOCALIZE_SCRIPT}' => 'var ctPublicFunctions = ' . json_encode($localize_js) . ';' .
437
+ 'var ctPublic = ' . json_encode($localize_js_public) . ';',
438
  );
439
 
440
  foreach ($replaces as $place_holder => $replace) {
lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html CHANGED
@@ -241,7 +241,7 @@
241
  document.getElementById('js_passed').style.display = 'block';
242
  document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
243
  set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_pass_key','{COOKIE_SFW}');
244
- set_spamFireWallCookie('{COOKIE_PREFIX}apbct_antibot','{COOKIE_ANTICRAWLER}');
245
  set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_passed','1');
246
 
247
  if(location.search.search('debug=1') === -1) {
241
  document.getElementById('js_passed').style.display = 'block';
242
  document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
243
  set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_pass_key','{COOKIE_SFW}');
244
+ set_spamFireWallCookie('{COOKIE_PREFIX}wordpress_apbct_antibot','{COOKIE_ANTICRAWLER}');
245
  set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_passed','1');
246
 
247
  if(location.search.search('debug=1') === -1) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 5.180.1
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -602,6 +602,13 @@ If your website has forms that send data to external sources, you can enable opt
602
 
603
  == Changelog ==
604
 
 
 
 
 
 
 
 
605
  = 5.180.1 Jul 01 2022 =
606
  * Fix. Common. Undefined class fixed.
607
 
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 5.180.2
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
602
 
603
  == Changelog ==
604
 
605
+ = 5.180.2 Jul 04 2022 =
606
+ #### SpamFireWall working fixed.
607
+ * Fix. Updater. Updater actions moved from the hook "upgrader_process_complete"
608
+ * Fix. SFW. JS errors on the block pages fixed.
609
+ * Fix. SFW. Skiping block hyperlink fixed.
610
+ * Fix. SFW. Additional redundant blocking by AC fixed.
611
+
612
  = 5.180.1 Jul 01 2022 =
613
  * Fix. Common. Undefined class fixed.
614