Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.14

Version Description

2015-07-03 = * Added anti-spam protection for some themes and plugins * Some backend fixes

Download this release

Release Info

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

Code changes from version 5.13 to 5.14

cleantalk-ajax.php CHANGED
@@ -49,6 +49,10 @@ add_action( 'wp_ajax_cscf-submitform', 'ct_cscf_submitform',1 );
49
  add_action( 'wp_ajax_nopriv_ajax_get_stats', 'ct_get_stats',1 );
50
  add_action( 'wp_ajax_ajax_get_stats', 'ct_get_stats',1 );
51
 
 
 
 
 
52
  function ct_get_stats()
53
  {
54
  check_ajax_referer( 'ct_secret_nonce', 'security' );
@@ -570,6 +574,64 @@ function ct_zn_do_login()
570
  }
571
  }
572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  function ct_cscf_submitform()
574
  {
575
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
@@ -628,6 +690,66 @@ function ct_cscf_submitform()
628
  }
629
  }
630
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  function ct_get_fields(&$email,&$message,$arr)
632
  {
633
  foreach($arr as $key=>$value)
49
  add_action( 'wp_ajax_nopriv_ajax_get_stats', 'ct_get_stats',1 );
50
  add_action( 'wp_ajax_ajax_get_stats', 'ct_get_stats',1 );
51
 
52
+ /*hooks for visual form builder */
53
+ add_action( 'wp_ajax_nopriv_vfb_submit', 'ct_vfb_submit',1 );
54
+ add_action( 'wp_ajax_vfb_submit', 'ct_vfb_submit',1 );
55
+
56
  function ct_get_stats()
57
  {
58
  check_ajax_referer( 'ct_secret_nonce', 'security' );
574
  }
575
  }
576
 
577
+ function ct_vfb_submit()
578
+ {
579
+ require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
580
+ global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
581
+
582
+ $ct_data=ct_get_data();
583
+
584
+ $ct_options=ct_get_options();
585
+
586
+ $sender_email = null;
587
+ $message = '';
588
+
589
+ foreach ($_POST as $key => $value)
590
+ {
591
+ if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $value))
592
+ {
593
+ $sender_email = $value;
594
+ }
595
+ else
596
+ {
597
+ $message.="$value\n";
598
+ }
599
+ }
600
+
601
+ if($sender_email!=null)
602
+ {
603
+ $checkjs = js_test('ct_checkjs', $_COOKIE, true);
604
+ $submit_time = submit_time_test();
605
+ $sender_info = get_sender_info();
606
+ $sender_info['post_checkjs_passed']=$checkjs;
607
+
608
+ $sender_info = json_encode($sender_info);
609
+ if ($sender_info === false)
610
+ {
611
+ $sender_info= '';
612
+ }
613
+
614
+ $ct_base_call_result = ct_base_call(array(
615
+ 'message' => $message,
616
+ 'example' => null,
617
+ 'sender_email' => $sender_email,
618
+ 'sender_nickname' => null,
619
+ 'sender_info' => $sender_info,
620
+ 'post_info'=>null,
621
+ 'checkjs' => $checkjs));
622
+
623
+ $ct = $ct_base_call_result['ct'];
624
+ $ct_result = $ct_base_call_result['ct_result'];
625
+ if ($ct_result->allow == 0)
626
+ {
627
+ $result=Array('result'=>false,'message'=>$ct_result->comment);
628
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
629
+ print json_encode($result);
630
+ die();
631
+ }
632
+ }
633
+ }
634
+
635
  function ct_cscf_submitform()
636
  {
637
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
690
  }
691
  }
692
  }
693
+
694
+ function ct_theme_submit()
695
+ {
696
+ require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
697
+ global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
698
+
699
+ $ct_data=ct_get_data();
700
+
701
+ $ct_options=ct_get_options();
702
+
703
+ $sender_email = null;
704
+ $message = '';
705
+
706
+ if(isset($_POST['cscf']['confirm-email']))
707
+ {
708
+ $tmp=$_POST['cscf']['confirm-email'];
709
+ $_POST['cscf']['confirm-email']=1;
710
+ }
711
+
712
+ ct_get_fields($sender_email,$message,$_POST);
713
+
714
+ if(isset($_POST['cscf']['confirm-email']))
715
+ {
716
+ $_POST['cscf']['confirm-email']=$tmp;
717
+ }
718
+
719
+
720
+ if($sender_email!=null)
721
+ {
722
+ $checkjs = js_test('ct_checkjs', $_COOKIE, true);
723
+ $submit_time = submit_time_test();
724
+ $sender_info = get_sender_info();
725
+ $sender_info['post_checkjs_passed']=$checkjs;
726
+
727
+ $sender_info = json_encode($sender_info);
728
+ if ($sender_info === false)
729
+ {
730
+ $sender_info= '';
731
+ }
732
+
733
+ $ct_base_call_result = ct_base_call(array(
734
+ 'message' => $message,
735
+ 'example' => null,
736
+ 'sender_email' => $sender_email,
737
+ 'sender_nickname' => null,
738
+ 'sender_info' => $sender_info,
739
+ 'post_info'=>null,
740
+ 'checkjs' => $checkjs));
741
+
742
+ $ct = $ct_base_call_result['ct'];
743
+ $ct_result = $ct_base_call_result['ct_result'];
744
+ if ($ct_result->allow == 0)
745
+ {
746
+ $result=Array('sent'=>true,'valid'=>false,'errorlist'=>Array('name'=>$ct_result->comment));
747
+ print json_encode($result);
748
+ die();
749
+ }
750
+ }
751
+ }
752
+
753
  function ct_get_fields(&$email,&$message,$arr)
754
  {
755
  foreach($arr as $key=>$value)
cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-513';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -558,12 +558,12 @@ function ct_get_fields_any(&$email,&$message,&$nickname,&$subject, &$contact,$ar
558
  );
559
  foreach($arr as $key=>$value)
560
  {
561
- if(!is_array($value))
562
  {
563
  if (in_array($key, $skip_params) || preg_match("/^ct_checkjs/", $key)) {
564
  $contact = false;
565
  }
566
- if ($email === '' && preg_match("/^\S+@\S+\.\S+$/", $value))
567
  {
568
  $email = $value;
569
  }
@@ -577,10 +577,10 @@ function ct_get_fields_any(&$email,&$message,&$nickname,&$subject, &$contact,$ar
577
  }
578
  else
579
  {
580
- $message.="$value\n";
581
  }
582
  }
583
- else
584
  {
585
  ct_get_fields_any($email, $message, $nickname, $subject, $contact, $value);
586
  }
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-514';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
558
  );
559
  foreach($arr as $key=>$value)
560
  {
561
+ if(!is_array($value)&&!is_object($value)&&@get_class($value)!='WP_User')
562
  {
563
  if (in_array($key, $skip_params) || preg_match("/^ct_checkjs/", $key)) {
564
  $contact = false;
565
  }
566
+ if ($email === '' && @preg_match("/^\S+@\S+\.\S+$/", $value))
567
  {
568
  $email = $value;
569
  }
577
  }
578
  else
579
  {
580
+ @$message.="$value\n";
581
  }
582
  }
583
+ else if(!is_object($value)&&@get_class($value)!='WP_User')
584
  {
585
  ct_get_fields_any($email, $message, $nickname, $subject, $contact, $value);
586
  }
cleantalk-public.php CHANGED
@@ -1454,9 +1454,11 @@ function ct_contact_form_validate () {
1454
  }*/
1455
 
1456
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1457
- (isset($_POST['log']) && isset($_POST['pwd']) && isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1458
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword'||
1459
- strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false
 
 
1460
  )
1461
  ) {
1462
  return null;
@@ -1534,7 +1536,9 @@ function ct_contact_form_validate_postdata () {
1534
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword')||
1535
  ct_check_array_keys($_POST) ||
1536
  (isset($pagenow) && $pagenow == 'wp-cron.php' ||
1537
- strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false)
 
 
1538
  ) {
1539
  return null;
1540
  }
1454
  }*/
1455
 
1456
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1457
+ (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1458
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword'||
1459
+ strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
1460
+ strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1461
+ strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false
1462
  )
1463
  ) {
1464
  return null;
1536
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword')||
1537
  ct_check_array_keys($_POST) ||
1538
  (isset($pagenow) && $pagenow == 'wp-cron.php' ||
1539
+ strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false) ||
1540
+ strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1541
+ strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false
1542
  ) {
1543
  return null;
1544
  }
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.13
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.13';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
@@ -19,7 +19,10 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
19
  // http://codex.wordpress.org/Function_Reference/register_activation_hook
20
  register_activation_hook( __FILE__, 'ct_activation' );
21
  register_deactivation_hook( __FILE__, 'ct_deactivation' );
22
- add_action('admin_init', 'ct_plugin_redirect');
 
 
 
23
 
24
 
25
 
@@ -68,7 +71,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
68
  add_action('comment_approved_to_unapproved', 'ct_comment_unapproved'); // param - comment object
69
  add_action('comment_unapproved_to_spam', 'ct_comment_spam'); // param - comment object
70
  add_action('comment_approved_to_spam', 'ct_comment_spam'); // param - comment object
71
- add_filter('get_comment_text', 'ct_get_comment_text'); // param - current comment text
72
  add_filter('unspam_comment', 'ct_unspam_comment');
73
  add_action('delete_user', 'ct_delete_user');
74
  add_filter('plugin_row_meta', 'ct_register_plugin_links', 10, 2);
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.14
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.14';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
19
  // http://codex.wordpress.org/Function_Reference/register_activation_hook
20
  register_activation_hook( __FILE__, 'ct_activation' );
21
  register_deactivation_hook( __FILE__, 'ct_deactivation' );
22
+ if(!defined('WP_ALLOW_MULTISITE')||defined('WP_ALLOW_MULTISITE')&&WP_ALLOW_MULTISITE==false)
23
+ {
24
+ add_action('admin_init', 'ct_plugin_redirect');
25
+ }
26
 
27
 
28
 
71
  add_action('comment_approved_to_unapproved', 'ct_comment_unapproved'); // param - comment object
72
  add_action('comment_unapproved_to_spam', 'ct_comment_spam'); // param - comment object
73
  add_action('comment_approved_to_spam', 'ct_comment_spam'); // param - comment object
74
+ //add_filter('get_comment_text', 'ct_get_comment_text'); // param - current comment text
75
  add_filter('unspam_comment', 'ct_unspam_comment');
76
  add_action('delete_user', 'ct_delete_user');
77
  add_filter('plugin_row_meta', 'ct_register_plugin_links', 10, 2);
cleantalk_nocache.js CHANGED
@@ -47,7 +47,7 @@ function ct_getCookie(name) {
47
 
48
  function ct_setCookie(name, value)
49
  {
50
- var domain=location.hostname;
51
  tmp=domain.split('.');
52
  if(tmp[0].toLowerCase()=='www')
53
  {
@@ -57,15 +57,16 @@ function ct_setCookie(name, value)
57
  {
58
  tmp[0]='.'+tmp[0];
59
  }
60
- domain=tmp.join('.');
61
 
62
  document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /";
63
  document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT";
64
- document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; domain = " + domain;
65
 
66
  var date = new Date;
67
  date.setDate(date.getDate() + 1);
68
- setTimeout(function() { document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /; domain = " + domain}, 200)
 
69
  }
70
 
71
  function ct_callback(req)
47
 
48
  function ct_setCookie(name, value)
49
  {
50
+ /*var domain=location.hostname;
51
  tmp=domain.split('.');
52
  if(tmp[0].toLowerCase()=='www')
53
  {
57
  {
58
  tmp[0]='.'+tmp[0];
59
  }
60
+ domain=tmp.join('.');*/
61
 
62
  document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /";
63
  document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT";
64
+ //document.cookie = name+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; domain = " + domain;
65
 
66
  var date = new Date;
67
  date.setDate(date.getDate() + 1);
68
+ //setTimeout(function() { document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /; domain = " + domain}, 200)
69
+ setTimeout(function() { document.cookie = name+"=" + value + "; expires=" + date.toUTCString() + "; path = /;"}, 200)
70
  }
71
 
72
  function ct_callback(req)
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: akismet, anti-spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, form, Formidable spam, jetpack spam, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam, widget, widget spam, registration, plugin, antispam plugin, anti-spam plugin, ninja, cache
4
  Requires at least: 3.0
5
- Tested up to: 4.2.2
6
- Stable tag: 5.13
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -35,7 +35,7 @@ No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam b
35
  * W3 Total Cache, Quick Cache, WP Fastest Cache, Hyper Cache, WP Super cache
36
 
37
  = Check existing comments for spam =
38
- With the help of anti-spam CleanTalk you can check existing comments, to find and quickly delete spam comments. For use this function, go to WP Console->Comments->Find spam comments.
39
 
40
  = Cloud anti-spam for WordPress. CAPTCHA less, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
41
  Spam is one of the most irritating factors. Spam become every year more and conventional anti-spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
@@ -83,7 +83,7 @@ Audience engagement plugin <a href="http://wordpress.org/plugins/feedweb/">Feedw
83
  == Installation ==
84
  1. Download, install and activate Anti-spam by CleanTalk.
85
  1. Get Access key <a href="https://cleantalk.org/register?platform=wordpress" target="_blank">https://cleantalk.org/register</a>
86
- 1. Enter Access key at the plugin settings.
87
  1. Do dummy spam comment (registration or contact message) with email **stop_email@example.com**.
88
 
89
  You should see notice,
@@ -184,8 +184,15 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
184
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
185
 
186
  == Changelog ==
 
 
 
 
 
 
 
187
  = 5.13 2015-06-12 =
188
- * Closing notifocatiion for anti-spam renew
189
  * Fixed bulk antispam comment checking
190
 
191
  = 5.12 2015-06-01 =
@@ -586,8 +593,15 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
586
  * First version
587
 
588
  == Upgrade Notice ==
 
 
 
 
 
 
 
589
  = 5.13 2015-06-12 =
590
- * Closing notifocatiion for anti-spam renew
591
  * Fixed bulk antispam comment checking
592
 
593
  = 5.12 2015-06-01 =
1
  === Anti-spam by CleanTalk - No Captcha, no comments & registrations spam ===
2
  Contributors: znaeff, shagimuratov, vlad-cleantalk
3
+ Tags: akismet, anti-spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, form, Formidable spam, jetpack spam, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam, widget, widget spam, registration, plugin, antispam plugin, anti-spam plugin, ninja, cache, subscribe spam
4
  Requires at least: 3.0
5
+ Tested up to: 4.3
6
+ Stable tag: 5.14
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
35
  * W3 Total Cache, Quick Cache, WP Fastest Cache, Hyper Cache, WP Super cache
36
 
37
  = Check existing comments for spam =
38
+ With the help of anti-spam CleanTalk you can check existing comments, to find and quickly delete spam comments. For use this function, go to WP Console->Comments->Find spam comments.
39
 
40
  = Cloud anti-spam for WordPress. CAPTCHA less, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
41
  Spam is one of the most irritating factors. Spam become every year more and conventional anti-spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
83
  == Installation ==
84
  1. Download, install and activate Anti-spam by CleanTalk.
85
  1. Get Access key <a href="https://cleantalk.org/register?platform=wordpress" target="_blank">https://cleantalk.org/register</a>
86
+ 1. Enter Access key on the plugin settings.
87
  1. Do dummy spam comment (registration or contact message) with email **stop_email@example.com**.
88
 
89
  You should see notice,
184
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
185
 
186
  == Changelog ==
187
+ = 5.15 2015-07-13 =
188
+ * New feature: anti-spam protection for forms, that uses external services
189
+
190
+ = 5.14 2015-07-03 =
191
+ * Added anti-spam protection for some themes and plugins
192
+ * Some backend fixes
193
+
194
  = 5.13 2015-06-12 =
195
+ * Closing notification for anti-spam renew
196
  * Fixed bulk antispam comment checking
197
 
198
  = 5.12 2015-06-01 =
593
  * First version
594
 
595
  == Upgrade Notice ==
596
+ = 5.15 2015-07-13 =
597
+ * New feature: anti-spam protection for forms, that uses external services
598
+
599
+ = 5.14 2015-07-03 =
600
+ * Added anti-spam protection for some themes and plugins
601
+ * Some backend fixes
602
+
603
  = 5.13 2015-06-12 =
604
+ * Closing notification for anti-spam renew
605
  * Fixed bulk antispam comment checking
606
 
607
  = 5.12 2015-06-01 =