Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.118.1

Version Description

April 19 2019 = * Fix: Fatal error. * Mod: Spam protection improved on registrations.

Download this release

Release Info

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

Code changes from version 5.118 to 5.118.1

cleantalk.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  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.
6
- Version: 5.118
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
@@ -321,6 +321,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
321
  add_filter('wp_die_handler', 'apbct_comment__sanitize_data__before_wp_die', 1); // Check comments after validation
322
 
323
  // Registrations
 
324
  add_action('login_form_register', 'apbct_cookie');
325
  add_action('login_form_register', 'apbct_store__urls');
326
  add_action('register_form', 'ct_register_form');
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  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.
6
+ Version: 5.118.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
321
  add_filter('wp_die_handler', 'apbct_comment__sanitize_data__before_wp_die', 1); // Check comments after validation
322
 
323
  // Registrations
324
+ add_action('login_enqueue_scripts', 'apbct_login__scripts');
325
  add_action('login_form_register', 'apbct_cookie');
326
  add_action('login_form_register', 'apbct_store__urls');
327
  add_action('register_form', 'ct_register_form');
inc/cleantalk-public.php CHANGED
@@ -1400,6 +1400,10 @@ function ct_register_form() {
1400
  return null;
1401
  }
1402
 
 
 
 
 
1403
  /**
1404
  * Adds notification text to login form - to inform about approved registration
1405
  * @return null
1400
  return null;
1401
  }
1402
 
1403
+ function apbct_login__scripts(){
1404
+ echo '<script src="'.APBCT_URL_PATH.'/js/apbct-public.js"></script>';
1405
+ }
1406
+
1407
  /**
1408
  * Adds notification text to login form - to inform about approved registration
1409
  * @return null
lib/CleantalkHelper.php CHANGED
@@ -93,25 +93,25 @@ class CleantalkHelper
93
  if(isset($headers['Cf-Connecting-Ip'], $headers['Cf-Ipcountry'], $headers['Cf-Ray'])){
94
  $ip_type = self::ip__validate($headers['Cf-Connecting-Ip']);
95
  if($ip_type)
96
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($headers['Cf-Connecting-Ip']) : $headers['Cf-Connecting-Ip'];
97
 
98
  // Sucury
99
  }elseif(isset($headers['X-Sucuri-Clientip'], $headers['X-Sucuri-Country'])){
100
  $ip_type = self::ip__validate($headers['X-Sucuri-Clientip']);
101
  if($ip_type)
102
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($headers['X-Sucuri-Clientip']) : $headers['X-Sucuri-Clientip'];
103
 
104
  // OVH
105
  }elseif(isset($headers['X-Cdn-Any-Ip'], $headers['Remote-Ip'])){
106
  $ip_type = self::ip__validate($headers['X-Cdn-Any-Ip']);
107
  if($ip_type)
108
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($headers['X-Cdn-Any-Ip']) : $headers['X-Cdn-Any-Ip'];
109
 
110
  // Incapsula proxy
111
  }elseif(isset($headers['Incap-Client-Ip'])){
112
  $ip_type = self::ip__validate($headers['Incap-Client-Ip']);
113
  if($ip_type)
114
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($headers['Incap-Client-Ip']) : $headers['Incap-Client-Ip'];
115
  }
116
 
117
  // Is private network
@@ -123,7 +123,7 @@ class CleantalkHelper
123
  $tmp = trim($tmp[0]);
124
  $ip_type = self::ip__validate($tmp);
125
  if($ip_type)
126
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($tmp) : $tmp;
127
 
128
  // X-Real-Ip
129
  }elseif(isset($headers['X-Real-Ip'])){
@@ -131,7 +131,7 @@ class CleantalkHelper
131
  $tmp = trim($tmp[0]);
132
  $ip_type = self::ip__validate($tmp);
133
  if($ip_type)
134
- $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalizе($tmp) : $tmp;
135
  }
136
  }
137
  }
@@ -235,7 +235,7 @@ class CleantalkHelper
235
  * param (string) $ip
236
  * returns (string) IPv6
237
  */
238
- static public function ip__v6_normalizе($ip)
239
  {
240
  $ip = trim($ip);
241
  // Searching for ::ffff:xx.xx.xx.xx patterns and turn it to IPv6
@@ -251,7 +251,7 @@ class CleantalkHelper
251
  // Simplifyng hextets
252
  if(preg_match('/:0(?=[a-z0-9]+)/', $ip)){
253
  $ip = preg_replace('/:0(?=[a-z0-9]+)/', ':', strtolower($ip));
254
- $ip = self::ip__v6_normalizе($ip);
255
  }
256
  return $ip;
257
  }
93
  if(isset($headers['Cf-Connecting-Ip'], $headers['Cf-Ipcountry'], $headers['Cf-Ray'])){
94
  $ip_type = self::ip__validate($headers['Cf-Connecting-Ip']);
95
  if($ip_type)
96
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($headers['Cf-Connecting-Ip']) : $headers['Cf-Connecting-Ip'];
97
 
98
  // Sucury
99
  }elseif(isset($headers['X-Sucuri-Clientip'], $headers['X-Sucuri-Country'])){
100
  $ip_type = self::ip__validate($headers['X-Sucuri-Clientip']);
101
  if($ip_type)
102
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($headers['X-Sucuri-Clientip']) : $headers['X-Sucuri-Clientip'];
103
 
104
  // OVH
105
  }elseif(isset($headers['X-Cdn-Any-Ip'], $headers['Remote-Ip'])){
106
  $ip_type = self::ip__validate($headers['X-Cdn-Any-Ip']);
107
  if($ip_type)
108
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($headers['X-Cdn-Any-Ip']) : $headers['X-Cdn-Any-Ip'];
109
 
110
  // Incapsula proxy
111
  }elseif(isset($headers['Incap-Client-Ip'])){
112
  $ip_type = self::ip__validate($headers['Incap-Client-Ip']);
113
  if($ip_type)
114
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($headers['Incap-Client-Ip']) : $headers['Incap-Client-Ip'];
115
  }
116
 
117
  // Is private network
123
  $tmp = trim($tmp[0]);
124
  $ip_type = self::ip__validate($tmp);
125
  if($ip_type)
126
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($tmp) : $tmp;
127
 
128
  // X-Real-Ip
129
  }elseif(isset($headers['X-Real-Ip'])){
131
  $tmp = trim($tmp[0]);
132
  $ip_type = self::ip__validate($tmp);
133
  if($ip_type)
134
+ $ips['real'] = $ip_type == 'v6' ? self::ip__v6_normalize($tmp) : $tmp;
135
  }
136
  }
137
  }
235
  * param (string) $ip
236
  * returns (string) IPv6
237
  */
238
+ static public function ip__v6_normalize($ip)
239
  {
240
  $ip = trim($ip);
241
  // Searching for ::ffff:xx.xx.xx.xx patterns and turn it to IPv6
251
  // Simplifyng hextets
252
  if(preg_match('/:0(?=[a-z0-9]+)/', $ip)){
253
  $ip = preg_replace('/:0(?=[a-z0-9]+)/', ':', strtolower($ip));
254
+ $ip = self::ip__v6_normalize($ip);
255
  }
256
  return $ip;
257
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
- Stable tag: 5.118
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -558,6 +558,10 @@ If your website has forms that send data to external sources, you can enable opt
558
  10. Website's options.
559
 
560
  == Changelog ==
 
 
 
 
561
  = 5.118 April 19 2019 =
562
  * Fix: Cookies on registration page.
563
  * Fix: Update fix.
@@ -1855,6 +1859,10 @@ If your website has forms that send data to external sources, you can enable opt
1855
  * First version
1856
 
1857
  == Upgrade Notice ==
 
 
 
 
1858
  = 5.118 April 19 2019 =
1859
  * Fix: Cookies on registration page.
1860
  * Fix: Update fix.
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 5.118.1
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
558
  10. Website's options.
559
 
560
  == Changelog ==
561
+ = 5.118.1 April 19 2019 =
562
+ * Fix: Fatal error.
563
+ * Mod: Spam protection improved on registrations.
564
+
565
  = 5.118 April 19 2019 =
566
  * Fix: Cookies on registration page.
567
  * Fix: Update fix.
1859
  * First version
1860
 
1861
  == Upgrade Notice ==
1862
+ = 5.118.1 April 19 2019 =
1863
+ * Fix: Fatal error.
1864
+ * Mod: Spam protection improved on registrations.
1865
+
1866
  = 5.118 April 19 2019 =
1867
  * Fix: Cookies on registration page.
1868
  * Fix: Update fix.