Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.99.1

Version Description

July 17 2018 = * IP detection fixed and improved.

Download this release

Release Info

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

Code changes from version 5.99 to 5.99.1

cleantalk.php CHANGED
@@ -3,15 +3,15 @@
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.99
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  $cleantalk_executed = false;
12
 
13
- define('APBCT_VERSION', '5.99');
14
- define('APBCT_AGENT', 'wordpress-599');
15
 
16
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
17
  define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt')
@@ -696,6 +696,9 @@ function apbct_cookies_test()
696
 
697
  $cookie_test = json_decode(stripslashes($_COOKIE['apbct_cookies_test']), true);
698
 
 
 
 
699
  $check_srting = $ct_options['apikey'];
700
  foreach($cookie_test['cookies_names'] as $cookie_name){
701
  $check_srting .= isset($_COOKIE[$cookie_name]) ? $_COOKIE[$cookie_name] : '';
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.99.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  $cleantalk_executed = false;
12
 
13
+ define('APBCT_VERSION', '5.99.1');
14
+ define('APBCT_AGENT', 'wordpress-5991');
15
 
16
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
17
  define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt')
696
 
697
  $cookie_test = json_decode(stripslashes($_COOKIE['apbct_cookies_test']), true);
698
 
699
+ if(!is_array($cookie_test))
700
+ return 0;
701
+
702
  $check_srting = $ct_options['apikey'];
703
  foreach($cookie_test['cookies_names'] as $cookie_name){
704
  $check_srting .= isset($_COOKIE[$cookie_name]) ? $_COOKIE[$cookie_name] : '';
inc/cleantalk-admin.php CHANGED
@@ -732,8 +732,8 @@ function ct_add_admin_menu( $wp_admin_bar ) {
732
  global $ct_options, $ct_data;
733
 
734
  $ct_options = ct_get_options();
735
-
736
- if (current_user_can('activate_plugins') && $ct_options['show_adminbar'] == 1 && ct_valid_key($ct_options['apikey']) !== false) {
737
  $ct_data=ct_get_data();
738
 
739
  //Reset or create user counter
732
  global $ct_options, $ct_data;
733
 
734
  $ct_options = ct_get_options();
735
+
736
+ if (current_user_can('activate_plugins') && $ct_options['show_adminbar'] == 1 && (ct_valid_key($ct_options['apikey']) !== false || (defined('CLEANTALK_SHOW_ADMIN_BAR_FORCE') && CLEANTALK_SHOW_ADMIN_BAR_FORCE))) {
737
  $ct_data=ct_get_data();
738
 
739
  //Reset or create user counter
inc/sfw_die_page.html CHANGED
@@ -4,13 +4,6 @@
4
  <head>
5
  <meta charset='utf-8' />
6
  <meta name='viewport' content='width=device-width, initial-scale=1' />
7
- <meta http-equiv='сache-сontrol' content='no-cache'>
8
- <meta http-equiv='сache-сontrol' content='private'>
9
- <meta http-equiv='сache-сontrol' content='max-age=0, must-revalidate'>
10
- <meta http-equiv='сache-сontrol' content='max-age=0, proxy-revalidate'>
11
- <meta http-equiv='expires' content='0' />
12
- <meta http-equiv='expires' content='Tue, 01 Jan 1980 1:00:00 GMT' />
13
- <meta http-equiv='pragma' content='no-cache' />
14
 
15
  <!--[if lt IE 9]>
16
  <script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
4
  <head>
5
  <meta charset='utf-8' />
6
  <meta name='viewport' content='width=device-width, initial-scale=1' />
 
 
 
 
 
 
 
7
 
8
  <!--[if lt IE 9]>
9
  <script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
lib/CleantalkHelper.php CHANGED
@@ -103,9 +103,11 @@ class CleantalkHelper
103
  // Private networks. Looking for X-Forwarded-For and X-Real-Ip
104
  }elseif(self::ip_mask_match($ips['real'], self::$private_networks)){
105
  if(isset($headers['X-Forwarded-For'])){
106
- $ips['real'] = $headers['X-Forwarded-For'];
 
107
  }elseif(isset($headers['X-Real-Ip'])){
108
- $ips['real'] = $headers['X-Real-Ip'];
 
109
  }
110
  }
111
  }
103
  // Private networks. Looking for X-Forwarded-For and X-Real-Ip
104
  }elseif(self::ip_mask_match($ips['real'], self::$private_networks)){
105
  if(isset($headers['X-Forwarded-For'])){
106
+ $tmp = explode(",", trim($headers['X-Forwarded-For']));
107
+ $ips['real']= trim($tmp[0]);
108
  }elseif(isset($headers['X-Real-Ip'])){
109
+ $tmp = explode(",", trim($headers['X-Real-Ip']));
110
+ $ips['real']= trim($tmp[0]);
111
  }
112
  }
113
  }
lib/CleantalkSFW.php CHANGED
@@ -228,10 +228,10 @@ class CleantalkSFW extends CleantalkHelper
228
 
229
  // Headers
230
  if(headers_sent() === false){
231
- header("Cache-Control: no-store, no-cache, must-revalidate");
232
- header("Pragma: no-cache");
233
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
234
- header("Expires: 0");
235
  header("HTTP/1.0 403 Forbidden");
236
  $sfw_die_page = str_replace('{GENERATED}', "", $sfw_die_page);
237
  }else{
228
 
229
  // Headers
230
  if(headers_sent() === false){
231
+ header('Expires: '.date(DATE_RFC822, mktime(0, 0, 0, 1, 1, 1971)));
232
+ header('Cache-Control: no-store, no-cache, must-revalidate');
233
+ header('Cache-Control: post-check=0, pre-check=0', FALSE);
234
+ header('Pragma: no-cache');
235
  header("HTTP/1.0 403 Forbidden");
236
  $sfw_die_page = str_replace('{GENERATED}', "", $sfw_die_page);
237
  }else{
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: 4.9
6
- Stable tag: 5.99
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -516,6 +516,9 @@ Yes, it is. Please read this article,
516
  10. Website's options.
517
 
518
  == Changelog ==
 
 
 
519
  = 5.99 July 10 2018 =
520
  * Fix: WooCommerce false positives.
521
  * Fix: SpamFireWall IP detection.
@@ -1611,6 +1614,9 @@ Yes, it is. Please read this article,
1611
  * First version
1612
 
1613
  == Upgrade Notice ==
 
 
 
1614
  = 5.99 July 10 2018 =
1615
  * Fix: WooCommerce false positives.
1616
  * Fix: SpamFireWall IP detection.
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
+ Stable tag: 5.99.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.
516
  10. Website's options.
517
 
518
  == Changelog ==
519
+ = 5.99.1 July 17 2018 =
520
+ * IP detection fixed and improved.
521
+
522
  = 5.99 July 10 2018 =
523
  * Fix: WooCommerce false positives.
524
  * Fix: SpamFireWall IP detection.
1614
  * First version
1615
 
1616
  == Upgrade Notice ==
1617
+ = 5.99.1 July 17 2018 =
1618
+ * IP detection fixed and improved.
1619
+
1620
  = 5.99 July 10 2018 =
1621
  * Fix: WooCommerce false positives.
1622
  * Fix: SpamFireWall IP detection.