Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.31

Version Description

2015-11-11 = * Improved backend performance * Fixed counter of approved/blocked spam attacks * Fixed Spam Firewall logging

Download this release

Release Info

Developer Vlad Cleantalk
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.31
Comparing to
See all releases

Code changes from version 5.30 to 5.31

cleantalk.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.30
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.30';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
@@ -47,13 +47,28 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
47
 
48
  if($value==1 && !is_admin() && stripos($_SERVER['REQUEST_URI'],'/wp-admin/')===false) //&& (!isset($_POST) || isset($_POST) && sizeof($_POST)==0)
49
  {
50
-
51
- $is_sfw_check=true;
52
  if(isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key']==md5(cleantalk_get_ip().$ct_options['apikey']))
53
  {
54
  $is_sfw_check=false;
55
- @$ct_data['sfw_log'][cleantalk_get_ip()]['all']++;
56
- update_option('cleantalk_data', $ct_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
  if($is_sfw_check)
59
  {
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.31
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.31';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
47
 
48
  if($value==1 && !is_admin() && stripos($_SERVER['REQUEST_URI'],'/wp-admin/')===false) //&& (!isset($_POST) || isset($_POST) && sizeof($_POST)==0)
49
  {
50
+ $is_sfw_check=true;
 
51
  if(isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key']==md5(cleantalk_get_ip().$ct_options['apikey']))
52
  {
53
  $is_sfw_check=false;
54
+ if(isset($_COOKIE['ct_sfw_passed']))
55
+ {
56
+ if(isset($ct_data['sfw_log']))
57
+ {
58
+ $sfw_log=$ct_data['sfw_log'];
59
+ }
60
+ else
61
+ {
62
+ $sfw_log=array();
63
+ $sfw_log[cleantalk_get_ip()]=Array();
64
+ }
65
+ $sfw_log[cleantalk_get_ip()]['allow']++;
66
+ $ct_data['sfw_log'] = $sfw_log;
67
+ update_option('cleantalk_data', $ct_data);
68
+ @setcookie ('ct_sfw_passed', '0', 1, "/");
69
+ }
70
+ //@$ct_data['sfw_log'][cleantalk_get_ip()]['all']++;
71
+ //update_option('cleantalk_data', $ct_data);
72
  }
73
  if($is_sfw_check)
74
  {
inc/cleantalk-admin.php CHANGED
@@ -586,7 +586,7 @@ function ct_input_apikey() {
586
  echo "<script>var cleantalk_good_key=false;</script>";
587
  echo "<br /><br /><a target='__blank' class='cleantalk_manual_link' style='text-decoration:none;' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Get the Access key', 'cleantalk')."</a>";
588
  if (function_exists('curl_init') && function_exists('json_decode')) {
589
- //echo '<br /><br /><input name="get_apikey_auto" type="submit" value="' . __('Get access key automatically', 'cleantalk') . '" />';
590
  //admin_addDescriptionsFields(sprintf(__('Admin e-mail (%s) will be used for registration', 'cleantalk'), get_option('admin_email')));
591
  //admin_addDescriptionsFields(sprintf('<a target="__blank" style="color:#BBB;" href="https://cleantalk.org/publicoffer">%s</a>', __('License agreement', 'cleantalk')));
592
  }
586
  echo "<script>var cleantalk_good_key=false;</script>";
587
  echo "<br /><br /><a target='__blank' class='cleantalk_manual_link' style='text-decoration:none;' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Get the Access key', 'cleantalk')."</a>";
588
  if (function_exists('curl_init') && function_exists('json_decode')) {
589
+ //echo '<br /><br /><input name="get_apikey_auto" type="submit" class="cleantalk_manual_link" value="' . __('Get access key automatically', 'cleantalk') . '" />';
590
  //admin_addDescriptionsFields(sprintf(__('Admin e-mail (%s) will be used for registration', 'cleantalk'), get_option('admin_email')));
591
  //admin_addDescriptionsFields(sprintf('<a target="__blank" style="color:#BBB;" href="https://cleantalk.org/publicoffer">%s</a>', __('License agreement', 'cleantalk')));
592
  }
inc/cleantalk-ajax.php CHANGED
@@ -78,6 +78,14 @@ add_action( 'wp_ajax_frm_entries_create', 'ct_ajax_hook',1 );
78
  add_action( 'wp_ajax_nopriv_td_mod_register', 'ct_ajax_hook',1 );
79
  add_action( 'wp_ajax_td_mod_register', 'ct_ajax_hook',1 );
80
 
 
 
 
 
 
 
 
 
81
  /**hooks for cm answers pro */
82
  add_action( 'template_redirect', 'ct_ajax_hook',1 );
83
 
@@ -428,6 +436,16 @@ function ct_ajax_hook()
428
  print json_encode(array('register', 0, $ct_result->comment));
429
  die();
430
  }
 
 
 
 
 
 
 
 
 
 
431
  }
432
  }
433
  }
78
  add_action( 'wp_ajax_nopriv_td_mod_register', 'ct_ajax_hook',1 );
79
  add_action( 'wp_ajax_td_mod_register', 'ct_ajax_hook',1 );
80
 
81
+ /*hooks for tevolution theme*/
82
+ add_action( 'wp_ajax_nopriv_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
83
+ add_action( 'wp_ajax_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
84
+ add_action( 'wp_ajax_nopriv_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
85
+ add_action( 'wp_ajax_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
86
+ add_action( 'wp_ajax_nopriv_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
87
+ add_action( 'wp_ajax_tmpl_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
88
+
89
  /**hooks for cm answers pro */
90
  add_action( 'template_redirect', 'ct_ajax_hook',1 );
91
 
436
  print json_encode(array('register', 0, $ct_result->comment));
437
  die();
438
  }
439
+ else if($_POST['action']=='tmpl_ajax_check_user_email')
440
+ {
441
+ print "17,email";
442
+ die();
443
+ }
444
+ else if($_POST['action']=='tevolution_submit_from_preview'||$_POST['action']=='submit_form_recaptcha_validation')
445
+ {
446
+ print $ct_result->comment;
447
+ die();
448
+ }
449
  }
450
  }
451
  }
inc/cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-530';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -207,17 +207,11 @@ function ct_base_call($params = array()) {
207
  ct_init_session();
208
 
209
  $_SESSION[$ct_formtime_label] = time();
210
- if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
211
- {
212
- ct_add_event('no');
213
- }
214
  }
215
  else
216
  {
217
- if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
218
- {
219
- ct_add_event('yes');
220
- }
221
  /*if($is_logged_in)
222
  {
223
  $user_cnt++;
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-531';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
207
  ct_init_session();
208
 
209
  $_SESSION[$ct_formtime_label] = time();
210
+ ct_add_event('no');
 
 
 
211
  }
212
  else
213
  {
214
+ ct_add_event('yes');
 
 
 
215
  /*if($is_logged_in)
216
  {
217
  $user_cnt++;
inc/cleantalk-public.php CHANGED
@@ -31,7 +31,7 @@ function ct_init() {
31
  die();
32
  }
33
 
34
- if(isset($ct_options['general_postdata_test']) && $ct_options['general_postdata_test'] == 1)
35
  {
36
  $ct_general_postdata_test = @intval($ct_options['general_postdata_test']);
37
  //hook for Anonymous Post
@@ -42,12 +42,13 @@ function ct_init() {
42
  $ct_general_postdata_test=0;
43
  }
44
 
45
- if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1)
46
  {
47
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
48
  add_action('template_redirect','ct_contact_form_validate',1);
49
  if(isset($_POST['reg_redirect_link'])&&isset($_POST['tmpl_registration_nonce_field']))
50
  {
 
51
  ct_contact_form_validate();
52
  }
53
  /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
@@ -59,7 +60,7 @@ function ct_init() {
59
  }*/
60
  }
61
 
62
- if($ct_general_postdata_test==1)
63
  {
64
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
65
  }
@@ -173,7 +174,7 @@ function ct_init() {
173
  $ct_check_post_result=false;
174
  ct_contact_form_validate();
175
  }
176
- if($_SERVER['REQUEST_METHOD'] == 'POST' && $ct_general_postdata_test==1 && !is_admin())
177
  {
178
  $ct_check_post_result=false;
179
  ct_contact_form_validate_postdata();
31
  die();
32
  }
33
 
34
+ if(isset($ct_options['general_postdata_test']) && $ct_options['general_postdata_test'] == 1 &&!@isset($_POST['ct_checkjs_cf7']))
35
  {
36
  $ct_general_postdata_test = @intval($ct_options['general_postdata_test']);
37
  //hook for Anonymous Post
42
  $ct_general_postdata_test=0;
43
  }
44
 
45
+ if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1&&!@isset($_POST['ct_checkjs_cf7']))
46
  {
47
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
48
  add_action('template_redirect','ct_contact_form_validate',1);
49
  if(isset($_POST['reg_redirect_link'])&&isset($_POST['tmpl_registration_nonce_field']))
50
  {
51
+ unset($_POST['ct_checkjs_register_form']);
52
  ct_contact_form_validate();
53
  }
54
  /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
60
  }*/
61
  }
62
 
63
+ if($ct_general_postdata_test==1&&!@isset($_POST['ct_checkjs_cf7']))
64
  {
65
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
66
  }
174
  $ct_check_post_result=false;
175
  ct_contact_form_validate();
176
  }
177
+ if($_SERVER['REQUEST_METHOD'] == 'POST' && $ct_general_postdata_test==1 && !is_admin()&&!@isset($_POST['ct_checkjs_cf7']))
178
  {
179
  $ct_check_post_result=false;
180
  ct_contact_form_validate_postdata();
inc/cleantalk-sfw.class.php CHANGED
@@ -53,22 +53,30 @@ class CleanTalkSFW
53
  $sfw_log=array();
54
  }
55
 
56
- if(isset($sfw_log[$this->ip_str]))
57
  {
58
  $sfw_log[$this->ip_str]['all']++;
59
  }
60
  else
61
  {
62
  $sfw_log[$this->ip_str] = Array('datetime'=>time(), 'all' => 1, 'allow' => 0);
63
- }
64
 
65
  if(sizeof($r)>0)
66
  {
67
  $this->result=true;
 
 
 
 
 
 
 
 
68
  }
69
  else
70
  {
71
- $sfw_log[$this->ip_str]['allow']++;
72
  @setcookie ('ct_sfw_pass_key', md5($this->ip_str.$ct_options['apikey']), 0, "/");
73
  }
74
  $ct_data['sfw_log'] = $sfw_log;
53
  $sfw_log=array();
54
  }
55
 
56
+ /*if(isset($sfw_log[$this->ip_str]))
57
  {
58
  $sfw_log[$this->ip_str]['all']++;
59
  }
60
  else
61
  {
62
  $sfw_log[$this->ip_str] = Array('datetime'=>time(), 'all' => 1, 'allow' => 0);
63
+ }*/
64
 
65
  if(sizeof($r)>0)
66
  {
67
  $this->result=true;
68
+ if(isset($sfw_log[$this->ip_str]))
69
+ {
70
+ $sfw_log[$this->ip_str]['all']++;
71
+ }
72
+ else
73
+ {
74
+ $sfw_log[$this->ip_str] = Array('datetime'=>time(), 'all' => 1, 'allow' => 0);
75
+ }
76
  }
77
  else
78
  {
79
+ //$sfw_log[$this->ip_str]['allow']++;
80
  @setcookie ('ct_sfw_pass_key', md5($this->ip_str.$ct_options['apikey']), 0, "/");
81
  }
82
  $ct_data['sfw_log'] = $sfw_log;
inc/sfw_die_page.html CHANGED
@@ -56,6 +56,7 @@ function get_current_url() {
56
  document.getElementById('js_info').style.display = 'none';
57
  document.getElementById('js_passed').style.display = 'block';
58
  set_spamFireWallCookie('ct_sfw_pass_key','{SFW_COOKIE}');
 
59
  setTimeout(function(){
60
  window.location.reload(1);
61
  }, reload_timeout);
56
  document.getElementById('js_info').style.display = 'none';
57
  document.getElementById('js_passed').style.display = 'block';
58
  set_spamFireWallCookie('ct_sfw_pass_key','{SFW_COOKIE}');
59
+ set_spamFireWallCookie('ct_sfw_passed','1');
60
  setTimeout(function(){
61
  window.location.reload(1);
62
  }, reload_timeout);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, vlad-cleantalk
3
  Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, math, security, login, blacklist, cache, prevent, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, cleantalk, mailpoet
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.30
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -374,6 +374,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
374
  1. CleanTalk works faster than most of the other anti-spam plugins.
375
 
376
  == Changelog ==
 
 
 
 
 
377
  = 5.30 2015-11-05 =
378
  * Improved anti-spam checking
379
  * Optimized performance
@@ -867,6 +872,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
867
  * First version
868
 
869
  == Upgrade Notice ==
 
 
 
 
 
870
  = 5.30 2015-11-05 =
871
  * Improved anti-spam checking
872
  * Optimized performance
3
  Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, math, security, login, blacklist, cache, prevent, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, cleantalk, mailpoet
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.31
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
374
  1. CleanTalk works faster than most of the other anti-spam plugins.
375
 
376
  == Changelog ==
377
+ = 5.31 2015-11-11 =
378
+ * Improved backend performance
379
+ * Fixed counter of approved/blocked spam attacks
380
+ * Fixed Spam Firewall logging
381
+
382
  = 5.30 2015-11-05 =
383
  * Improved anti-spam checking
384
  * Optimized performance
872
  * First version
873
 
874
  == Upgrade Notice ==
875
+ = 5.31 2015-11-11 =
876
+ * Improved backend performance
877
+ * Fixed counter of approved/blocked spam attacks
878
+ * Fixed Spam Firewall logging
879
+
880
  = 5.30 2015-11-05 =
881
  * Improved anti-spam checking
882
  * Optimized performance