Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.163.1

Version Description

Oct 12 2021 = * Fix: Queue. Errors of each try fixed. * Fix: SFW. Sleep before deleting tables was reduced. * Fix: Queue. Accepted tries argument implemented.

Download this release

Release Info

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

Code changes from version 5.163 to 5.163.1

Files changed (3) hide show
  1. cleantalk.php +4 -3
  2. lib/Cleantalk/Common/Queue.php +9 -6
  3. readme.txt +6 -1
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.163
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -1238,7 +1238,8 @@ function apbct_sfw_update__process_exclusions()
1238
 
1239
  return array(
1240
  'next_stage' => array(
1241
- 'name' => 'apbct_sfw_update__end_of_update'
 
1242
  )
1243
  );
1244
  }
@@ -1249,7 +1250,7 @@ function apbct_sfw_update__end_of_update($is_direct_update = false)
1249
 
1250
  $apbct->fw_stats['update_mode'] = 1;
1251
  $apbct->save('fw_stats');
1252
- usleep(100000);
1253
 
1254
 
1255
  // REMOVE AND RENAME
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.163.1
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
1238
 
1239
  return array(
1240
  'next_stage' => array(
1241
+ 'name' => 'apbct_sfw_update__end_of_update',
1242
+ 'accepted_tries' => 1
1243
  )
1244
  );
1245
  }
1250
 
1251
  $apbct->fw_stats['update_mode'] = 1;
1252
  $apbct->save('fw_stats');
1253
+ usleep(10000);
1254
 
1255
 
1256
  // REMOVE AND RENAME
lib/Cleantalk/Common/Queue.php CHANGED
@@ -51,12 +51,13 @@ abstract class Queue
51
  * @param string $stage_name
52
  * @param array $args
53
  */
54
- public function addStage($stage_name, $args = array())
55
  {
56
  $this->queue['stages'][] = array(
57
  'name' => $stage_name,
58
  'status' => 'NULL',
59
  'tries' => '0',
 
60
  'args' => $args,
61
  'pid' => null,
62
  );
@@ -99,15 +100,15 @@ abstract class Queue
99
 
100
  if (isset($result['error'])) {
101
  $stage_to_execute['status'] = 'NULL';
 
102
  if (isset($result['update_args']['args'])) {
103
  $stage_to_execute['args'] = $result['update_args']['args'];
104
  }
105
  $this->saveQueue($this->queue);
106
- if ($stage_to_execute['tries'] >= 3) {
 
107
  $stage_to_execute['status'] = 'FINISHED';
108
- $stage_to_execute['error'] = $result['error'];
109
  $this->saveQueue($this->queue);
110
-
111
  return $result;
112
  }
113
 
@@ -124,7 +125,8 @@ abstract class Queue
124
  if (isset($result['next_stage'])) {
125
  $this->addStage(
126
  $result['next_stage']['name'],
127
- isset($result['next_stage']['args']) ? $result['next_stage']['args'] : array()
 
128
  );
129
  }
130
 
@@ -132,7 +134,8 @@ abstract class Queue
132
  foreach ($result['next_stages'] as $next_stage) {
133
  $this->addStage(
134
  $next_stage['name'],
135
- isset($next_stage['args']) ? $next_stage['args'] : array()
 
136
  );
137
  }
138
  }
51
  * @param string $stage_name
52
  * @param array $args
53
  */
54
+ public function addStage($stage_name, $args = array(), $accepted_tries = 3)
55
  {
56
  $this->queue['stages'][] = array(
57
  'name' => $stage_name,
58
  'status' => 'NULL',
59
  'tries' => '0',
60
+ 'accepted_tries' => $accepted_tries,
61
  'args' => $args,
62
  'pid' => null,
63
  );
100
 
101
  if (isset($result['error'])) {
102
  $stage_to_execute['status'] = 'NULL';
103
+ $stage_to_execute['error'][] = $result['error'];
104
  if (isset($result['update_args']['args'])) {
105
  $stage_to_execute['args'] = $result['update_args']['args'];
106
  }
107
  $this->saveQueue($this->queue);
108
+ $accepted_tries = isset($stage_to_execute['accepted_tries']) ? $stage_to_execute['accepted_tries'] : 3;
109
+ if ($stage_to_execute['tries'] >= $accepted_tries) {
110
  $stage_to_execute['status'] = 'FINISHED';
 
111
  $this->saveQueue($this->queue);
 
112
  return $result;
113
  }
114
 
125
  if (isset($result['next_stage'])) {
126
  $this->addStage(
127
  $result['next_stage']['name'],
128
+ isset($result['next_stage']['args']) ? $result['next_stage']['args'] : array(),
129
+ isset($result['next_stage']['accepted_tries']) ? $result['next_stage']['accepted_tries'] : 3
130
  );
131
  }
132
 
134
  foreach ($result['next_stages'] as $next_stage) {
135
  $this->addStage(
136
  $next_stage['name'],
137
+ isset($next_stage['args']) ? $next_stage['args'] : array(),
138
+ isset($result['next_stage']['accepted_tries']) ? $result['next_stage']['accepted_tries'] : 3
139
  );
140
  }
141
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
- Stable tag: 5.163
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -595,6 +595,11 @@ If your website has forms that send data to external sources, you can enable opt
595
 
596
  == Changelog ==
597
 
 
 
 
 
 
598
  = 5.163 Oct 07 2021 =
599
  * New: State. errorExists method implemented.
600
  * New: SFW. Disabling SFW when the database was outdated.
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 5.163.1
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
595
 
596
  == Changelog ==
597
 
598
+ = 5.163.1 Oct 12 2021 =
599
+ * Fix: Queue. Errors of each try fixed.
600
+ * Fix: SFW. Sleep before deleting tables was reduced.
601
+ * Fix: Queue. Accepted tries argument implemented.
602
+
603
  = 5.163 Oct 07 2021 =
604
  * New: State. errorExists method implemented.
605
  * New: SFW. Disabling SFW when the database was outdated.