Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.24

Version Description

2015-09-14 = * Backend interface fixes * Improvement for AJAX JavaScript spam checking

Download this release

Release Info

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

Code changes from version 5.23 to 5.24

cleantalk-admin.js CHANGED
@@ -21,20 +21,20 @@ jQuery(document).ready(function(){
21
  ct_adv_settings.hide();
22
  ct_adv_settings_title=ct_adv_settings.prev();
23
  ct_adv_settings.wrap("<div id='ct_advsettings_hide'>");
24
- ct_adv_settings_title.append(" <span id='ct_adv_showhide' style='cursor:pointer'><b>+</b></span>");
25
  ct_adv_settings_title.css('cursor','pointer');
26
  ct_adv_settings_title.click(function(){
27
  if(ct_adv_settings_show)
28
  {
29
  ct_adv_settings.hide();
30
  ct_adv_settings_show=false;
31
- jQuery('#ct_adv_showhide').html('+');
32
  }
33
  else
34
  {
35
  ct_adv_settings.show();
36
  ct_adv_settings_show=true;
37
- jQuery('#ct_adv_showhide').html('-');
38
  }
39
 
40
  });
21
  ct_adv_settings.hide();
22
  ct_adv_settings_title=ct_adv_settings.prev();
23
  ct_adv_settings.wrap("<div id='ct_advsettings_hide'>");
24
+ ct_adv_settings_title.append(" <span id='ct_adv_showhide' style='cursor:pointer'><b><a href='#' style='text-decoration:none;'></a></b></span>");
25
  ct_adv_settings_title.css('cursor','pointer');
26
  ct_adv_settings_title.click(function(){
27
  if(ct_adv_settings_show)
28
  {
29
  ct_adv_settings.hide();
30
  ct_adv_settings_show=false;
31
+ jQuery('#ct_adv_showhide').html("<b><a href='#' style='text-decoration:none;'></a></b>");
32
  }
33
  else
34
  {
35
  ct_adv_settings.show();
36
  ct_adv_settings_show=true;
37
+ jQuery('#ct_adv_showhide').html("<b><a href='#' style='text-decoration:none;'></a></b>");
38
  }
39
 
40
  });
cleantalk-admin.php CHANGED
@@ -275,7 +275,7 @@ else
275
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
276
  add_settings_section('cleantalk_settings_state', "<hr>".__('Protection is active for:', 'cleantalk'), 'ct_section_settings_state', 'cleantalk');
277
  //add_settings_section('cleantalk_settings_autodel', "<hr>", 'ct_section_settings_autodel', 'cleantalk');
278
- add_settings_section('cleantalk_settings_anti_spam', "<hr>Check existing comments and users <br /><br />$buttons_html<hr></h3><h3>".__('Advanced settings', 'cleantalk'), 'ct_section_settings_anti_spam', 'cleantalk');
279
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
280
  add_settings_field('cleantalk_remove_old_spam', __('Automatically delete spam comments', 'cleantalk'), 'ct_input_remove_old_spam', 'cleantalk', 'cleantalk_settings_anti_spam');
281
 
275
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
276
  add_settings_section('cleantalk_settings_state', "<hr>".__('Protection is active for:', 'cleantalk'), 'ct_section_settings_state', 'cleantalk');
277
  //add_settings_section('cleantalk_settings_autodel', "<hr>", 'ct_section_settings_autodel', 'cleantalk');
278
+ add_settings_section('cleantalk_settings_anti_spam', "<hr>Check existing comments and users <br /><br />$buttons_html<hr></h3><a href='#' style='text-decoration:underline;font-size:14px;'>".__('Advanced settings', 'cleantalk')."</a>", 'ct_section_settings_anti_spam', 'cleantalk');
279
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
280
  add_settings_field('cleantalk_remove_old_spam', __('Automatically delete spam comments', 'cleantalk'), 'ct_input_remove_old_spam', 'cleantalk', 'cleantalk_settings_anti_spam');
281
 
cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-523';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -356,14 +356,22 @@ function ct_get_checkjs_value($random_key = false) {
356
  * @return mixed[] Array of options
357
  */
358
  function ct_get_options() {
359
- $options = get_option('cleantalk_settings');
360
- if (!is_array($options)){
361
- $options = array();
362
- }else{
363
- if(array_key_exists('apikey', $options))
364
- $options['apikey'] = trim($options['apikey']);
365
- }
366
- return array_merge(ct_def_options(), (array) $options);
 
 
 
 
 
 
 
 
367
  }
368
 
369
  /**
@@ -393,11 +401,19 @@ function ct_def_options() {
393
  * @return mixed[] Array of options
394
  */
395
  function ct_get_data() {
396
- $data = get_option('cleantalk_data');
397
- if (!is_array($data)){
398
- $data = array();
399
- }
400
- return array_merge(ct_def_data(), (array) $data);
 
 
 
 
 
 
 
 
401
  }
402
 
403
  /**
@@ -647,7 +663,7 @@ $ct_check_post_result=false;
647
  function ct_check_array_keys_loop($key)
648
  {
649
  global $ct_check_post_result;
650
- $strict=Array('pass','login','pwd','members_search_submit');
651
  for($i=0;$i<sizeof($strict);$i++)
652
  {
653
  if(stripos($key,$strict[$i])!==false)
@@ -660,6 +676,10 @@ function ct_check_array_keys_loop($key)
660
  function ct_check_array_keys($arr)
661
  {
662
  global $ct_check_post_result;
 
 
 
 
663
  foreach($arr as $key=>$value)
664
  {
665
  if(!is_array($value))
@@ -694,4 +714,31 @@ function check_url_exclusions()
694
  }
695
  return $result;
696
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  ?>
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-524';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
356
  * @return mixed[] Array of options
357
  */
358
  function ct_get_options() {
359
+ global $ct_options;
360
+ if(isset($ct_options) && isset($ct_options['apikey']))
361
+ {
362
+ return $ct_options;
363
+ }
364
+ else
365
+ {
366
+ $options = get_option('cleantalk_settings');
367
+ if (!is_array($options)){
368
+ $options = array();
369
+ }else{
370
+ if(array_key_exists('apikey', $options))
371
+ $options['apikey'] = trim($options['apikey']);
372
+ }
373
+ return array_merge(ct_def_options(), (array) $options);
374
+ }
375
  }
376
 
377
  /**
401
  * @return mixed[] Array of options
402
  */
403
  function ct_get_data() {
404
+ global $ct_data;
405
+ if(isset($ct_data) && isset($ct_data['js_keys']))
406
+ {
407
+ return $ct_data;
408
+ }
409
+ else
410
+ {
411
+ $data = get_option('cleantalk_data');
412
+ if (!is_array($data)){
413
+ $data = array();
414
+ }
415
+ return array_merge(ct_def_data(), (array) $data);
416
+ }
417
  }
418
 
419
  /**
663
  function ct_check_array_keys_loop($key)
664
  {
665
  global $ct_check_post_result;
666
+ $strict=Array('members_search_submit');
667
  for($i=0;$i<sizeof($strict);$i++)
668
  {
669
  if(stripos($key,$strict[$i])!==false)
676
  function ct_check_array_keys($arr)
677
  {
678
  global $ct_check_post_result;
679
+ if(!is_array($arr))
680
+ {
681
+ return $ct_check_post_result;
682
+ }
683
  foreach($arr as $key=>$value)
684
  {
685
  if(!is_array($value))
714
  }
715
  return $result;
716
  }
717
+
718
+ function ct_filter_array(&$array)
719
+ {
720
+ global $cleantalk_key_exclusions;
721
+ if(isset($cleantalk_key_exclusions) && sizeof($cleantalk_key_exclusions)>0)
722
+ {
723
+ foreach($array as $key=>$value)
724
+ {
725
+ if(!is_array($value))
726
+ {
727
+ if(in_array($key,$cleantalk_key_exclusions))
728
+ {
729
+ unset($array[$key]);
730
+ }
731
+ }
732
+ else
733
+ {
734
+ $array[$key]=ct_filter_array($value);
735
+ }
736
+ }
737
+ return $array;
738
+ }
739
+ else
740
+ {
741
+ return $array;
742
+ }
743
+ }
744
  ?>
cleantalk-public.php CHANGED
@@ -1,8 +1,5 @@
1
  <?php
2
 
3
- $ct_options=ct_get_options();
4
- $ct_data=ct_get_data();
5
-
6
 
7
  /**
8
  * Init functions
@@ -138,8 +135,8 @@ function ct_init() {
138
 
139
  // BuddyPress
140
  if(class_exists('BuddyPress')){
141
- add_action('bp_before_registration_submit_buttons','ct_register_form');
142
- add_filter('bp_signup_validate', 'ct_registration_errors');
143
  }
144
 
145
  // bbPress
@@ -186,6 +183,7 @@ function ct_init() {
186
  ct_cookies_test();
187
 
188
  if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1 && !isset($_POST['comment_post_ID']) && !isset($_GET['for'])) {
 
189
  ct_contact_form_validate();
190
  }
191
  if($_SERVER['REQUEST_METHOD'] == 'POST' && $ct_general_postdata_test==1 && !is_admin())
@@ -1655,7 +1653,7 @@ function ct_contact_form_validate () {
1655
  $ct_cnt=0;
1656
  }
1657
  @header("CtExclusions: ".$ct_cnt);
1658
-
1659
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1660
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1661
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
@@ -1669,6 +1667,10 @@ function ct_contact_form_validate () {
1669
  ) {
1670
  return null;
1671
  }
 
 
 
 
1672
 
1673
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1674
 
@@ -1785,6 +1787,8 @@ function ct_contact_form_validate_postdata () {
1785
  ) {
1786
  return null;
1787
  }
 
 
1788
 
1789
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1790
 
1
  <?php
2
 
 
 
 
3
 
4
  /**
5
  * Init functions
135
 
136
  // BuddyPress
137
  if(class_exists('BuddyPress')){
138
+ add_action('bp_before_registration_submit_buttons','ct_register_form',1);
139
+ add_filter('bp_signup_validate', 'ct_registration_errors',1);
140
  }
141
 
142
  // bbPress
183
  ct_cookies_test();
184
 
185
  if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1 && !isset($_POST['comment_post_ID']) && !isset($_GET['for'])) {
186
+ $ct_check_post_result=false;
187
  ct_contact_form_validate();
188
  }
189
  if($_SERVER['REQUEST_METHOD'] == 'POST' && $ct_general_postdata_test==1 && !is_admin())
1653
  $ct_cnt=0;
1654
  }
1655
  @header("CtExclusions: ".$ct_cnt);
1656
+
1657
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1658
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1659
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
1667
  ) {
1668
  return null;
1669
  }
1670
+
1671
+ @header("CtConditions: Pased");
1672
+
1673
+ $_POST=ct_filter_array($_POST);
1674
 
1675
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1676
 
1787
  ) {
1788
  return null;
1789
  }
1790
+
1791
+ $_POST=ct_filter_array($_POST);
1792
 
1793
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1794
 
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.23
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.23';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
@@ -249,11 +249,11 @@ function ct_add_nocache_script()
249
  function ct_add_nocache_script_footer()
250
  {
251
  global $test_external_forms;
252
- print "<script async type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".rand()."'></script>\n";
253
  if($test_external_forms)
254
  {
255
  print "\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
256
- print "<script async type='text/javascript' src='".plugins_url( '/cleantalk_external.js' , __FILE__ )."?random=".rand()."'></script>\n";
257
  }
258
  }
259
 
@@ -264,15 +264,15 @@ function ct_add_nocache_script_header()
264
 
265
  function ct_inject_nocache_script($html)
266
  {
267
- global $test_external_forms;
268
  if(!is_admin()&&stripos($html,"</body")!==false)
269
  {
270
  //$ct_replace.="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."';</script>\n";
271
- $ct_replace="<script async type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".rand()."'></script>\n";
272
  if($test_external_forms)
273
  {
274
  $ct_replace.="\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
275
- $ct_replace.="<script async type='text/javascript' src='".plugins_url( '/cleantalk_external.js' , __FILE__ )."?random=".rand()."'></script>\n";
276
  }
277
 
278
  //$html=str_ireplace("</body",$ct_replace."</body",$html);
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.24
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.24';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
249
  function ct_add_nocache_script_footer()
250
  {
251
  global $test_external_forms;
252
+ print "<script async type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
253
  if($test_external_forms)
254
  {
255
  print "\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
256
+ print "<script async type='text/javascript' src='".plugins_url( '/cleantalk_external.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
257
  }
258
  }
259
 
264
 
265
  function ct_inject_nocache_script($html)
266
  {
267
+ global $test_external_forms, $cleantalk_plugin_version;
268
  if(!is_admin()&&stripos($html,"</body")!==false)
269
  {
270
  //$ct_replace.="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."';</script>\n";
271
+ $ct_replace="<script async type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
272
  if($test_external_forms)
273
  {
274
  $ct_replace.="\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
275
+ $ct_replace.="<script async type='text/javascript' src='".plugins_url( '/cleantalk_external.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
276
  }
277
 
278
  //$html=str_ireplace("</body",$ct_replace."</body",$html);
cleantalk_nocache.js CHANGED
@@ -12,7 +12,7 @@ function sendRequest(url,callback,postData) {
12
  return;
13
  }
14
  callback(req);
15
- }
16
  if (req.readyState == 4) return;
17
  req.send(postData);
18
  }
12
  return;
13
  }
14
  callback(req);
15
+ };
16
  if (req.readyState == 4) return;
17
  req.send(postData);
18
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Anti-Spam by CleanTalk - No Captcha, no comments & registrations spam ===
2
  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, cleantalk
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.23
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -311,6 +311,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
311
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
312
 
313
  == Changelog ==
 
 
 
 
314
  = 5.23 2015-09-01 =
315
  * Fixed BuddyPress profile search false positivities of anti-spam protection.
316
  * Some interface fixes of bulk users & comments spam checking
@@ -755,6 +759,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
755
  * First version
756
 
757
  == Upgrade Notice ==
 
 
 
 
758
  = 5.23 2015-09-01 =
759
  * Fixed BuddyPress profile search false positivities of anti-spam protection.
760
  * Some interface fixes of bulk users & comments spam checking
1
  === Anti-Spam by CleanTalk - No Captcha, no comments & registrations spam ===
2
  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
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.24
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
311
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
312
 
313
  == Changelog ==
314
+ = 5.24 2015-09-14 =
315
+ * Backend interface fixes
316
+ * Improvement for AJAX JavaScript spam checking
317
+
318
  = 5.23 2015-09-01 =
319
  * Fixed BuddyPress profile search false positivities of anti-spam protection.
320
  * Some interface fixes of bulk users & comments spam checking
759
  * First version
760
 
761
  == Upgrade Notice ==
762
+ = 5.24 2015-09-14 =
763
+ * Backend interface fixes
764
+ * Improvement for AJAX JavaScript spam checking
765
+
766
  = 5.23 2015-09-01 =
767
  * Fixed BuddyPress profile search false positivities of anti-spam protection.
768
  * Some interface fixes of bulk users & comments spam checking