Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.7

Version Description

2015-05-18 = * Fixed French translation * Fixed protection algorithm

Download this release

Release Info

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

Code changes from version 5.6 to 5.7

cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-56';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-57';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
cleantalk-public.php CHANGED
@@ -18,6 +18,8 @@ function ct_init() {
18
  } else {
19
  $_SESSION[$ct_formtime_label] = time();
20
  }
 
 
21
 
22
  // Fast Secure contact form
23
  if(defined('FSCF_VERSION')){
@@ -57,9 +59,12 @@ function ct_init() {
57
  // Contact Form7
58
  if(defined('WPCF7_VERSION')){
59
  add_filter('wpcf7_form_elements', 'ct_wpcf7_form_elements');
60
- if(WPCF7_VERSION >= '3.0.0'){
 
61
  add_filter('wpcf7_spam', 'ct_wpcf7_spam');
62
- }else{
 
 
63
  add_filter('wpcf7_acceptance', 'ct_wpcf7_spam');
64
  }
65
  }
@@ -123,6 +128,15 @@ function ct_init() {
123
  }
124
  }
125
 
 
 
 
 
 
 
 
 
 
126
  /**
127
  * Adds hidden filed to comment form
128
  */
@@ -175,6 +189,9 @@ ctSetCookie("%s", "%s", "%s");
175
  </script>
176
  ';
177
  $html = sprintf($html, $field_name, $ct_checkjs_key, $ct_checkjs_def);
 
 
 
178
  } else {
179
  $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
180
 
@@ -186,6 +203,10 @@ setTimeout(function(){var ct_input_name = \'%s\';var ct_input_value = document.g
186
  </script>
187
  ';
188
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
 
 
 
 
189
  };
190
 
191
  // Simplify JS code
@@ -1088,8 +1109,9 @@ function ct_wpcf7_spam($param) {
1088
  else if ($subject === '' && ct_get_data_from_submit($k, 'subject')) {
1089
  $subject = $v;
1090
  }
1091
- else {
1092
- $message .= $v."\n";
 
1093
  }
1094
 
1095
  }
18
  } else {
19
  $_SESSION[$ct_formtime_label] = time();
20
  }
21
+
22
+ //add_action('wp_footer','ct_ajaxurl');
23
 
24
  // Fast Secure contact form
25
  if(defined('FSCF_VERSION')){
59
  // Contact Form7
60
  if(defined('WPCF7_VERSION')){
61
  add_filter('wpcf7_form_elements', 'ct_wpcf7_form_elements');
62
+ if(WPCF7_VERSION >= '3.0.0')
63
+ {
64
  add_filter('wpcf7_spam', 'ct_wpcf7_spam');
65
+ }
66
+ else
67
+ {
68
  add_filter('wpcf7_acceptance', 'ct_wpcf7_spam');
69
  }
70
  }
128
  }
129
  }
130
 
131
+ function ct_ajaxurl() {
132
+ ?>
133
+ <script type="text/javascript">
134
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
135
+ </script>
136
+ <?php
137
+ wp_enqueue_script('ct_nocache_js',plugins_url( '/cleantalk_nocache.js' , __FILE__ ));
138
+ }
139
+
140
  /**
141
  * Adds hidden filed to comment form
142
  */
189
  </script>
190
  ';
191
  $html = sprintf($html, $field_name, $ct_checkjs_key, $ct_checkjs_def);
192
+ /*!!! IT'S A TEMPORARILY CODE FOR DEBUGGING CF7 !!!*/
193
+ $html='!!';
194
+ /*!!! IT'S A TEMPORARILY CODE FOR DEBUGGING CF7 !!!*/
195
  } else {
196
  $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
197
 
203
  </script>
204
  ';
205
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
206
+ /*!!! IT'S A TEMPORARILY CODE FOR DEBUGGING CF7 !!!*/
207
+ $html='<input type="hidden" id="%s" name="%s" value="%s" />';
208
+ $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def);
209
+ /*!!! IT'S A TEMPORARILY CODE FOR DEBUGGING CF7 !!!*/
210
  };
211
 
212
  // Simplify JS code
1109
  else if ($subject === '' && ct_get_data_from_submit($k, 'subject')) {
1110
  $subject = $v;
1111
  }
1112
+ else if (preg_match("/(\-message|\w*message\w*|contact|comment|contact\-)$/", $k))
1113
+ {
1114
+ $message.= $v."\n";
1115
  }
1116
 
1117
  }
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.6
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.6';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
@@ -21,10 +21,15 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
21
  register_deactivation_hook( __FILE__, 'ct_deactivation' );
22
  add_action('admin_init', 'ct_plugin_redirect');
23
 
 
24
 
25
  // After plugin loaded - to load locale as described in manual
26
  add_action( 'plugins_loaded', 'ct_plugin_loaded' );
27
 
 
 
 
 
28
 
29
  if (is_admin())
30
  {
@@ -131,6 +136,32 @@ function ct_add_event($event_type)
131
  $cleantalk_executed=true;
132
  }
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-comments.php');
136
 
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.7
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.7';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
21
  register_deactivation_hook( __FILE__, 'ct_deactivation' );
22
  add_action('admin_init', 'ct_plugin_redirect');
23
 
24
+
25
 
26
  // After plugin loaded - to load locale as described in manual
27
  add_action( 'plugins_loaded', 'ct_plugin_loaded' );
28
 
29
+ add_action('wp_loaded', 'ct_add_nocache_script', 1);
30
+ add_action( 'wp_ajax_nopriv_ct_get_cookie', 'ct_get_cookie',1 );
31
+ add_action( 'wp_ajax_ct_get_cookie', 'ct_get_cookie',1 );
32
+
33
 
34
  if (is_admin())
35
  {
136
  $cleantalk_executed=true;
137
  }
138
 
139
+ /**
140
+ * return new cookie value
141
+ */
142
+ function ct_get_cookie()
143
+ {
144
+ global $ct_checkjs_def;
145
+ $ct_checkjs_key = ct_get_checkjs_value(true);
146
+ print $ct_checkjs_key;
147
+ die();
148
+ }
149
+
150
+ /**
151
+ * adds nocache script
152
+ */
153
+ function ct_add_nocache_script()
154
+ {
155
+ ob_start('ct_inject_nocache_script');
156
+ }
157
+
158
+ function ct_inject_nocache_script($html)
159
+ {
160
+ $ct_replace="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."';</script>\n";
161
+ $ct_replace.="<script type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".rand()."'></script>\n";
162
+ $html=str_ireplace("</body",$ct_replace."</body",$html);
163
+ return $html;
164
+ }
165
 
166
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-comments.php');
167
 
cleantalk_nocache.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function sendRequest(url,callback,postData) {
2
+ var req = createXMLHTTPObject();
3
+ if (!req) return;
4
+ var method = (postData) ? "POST" : "GET";
5
+ req.open(method,url,true);
6
+ if (postData)
7
+ req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
8
+ req.onreadystatechange = function () {
9
+ if (req.readyState != 4) return;
10
+ if (req.status != 200 && req.status != 304) {
11
+ // alert('HTTP error ' + req.status);
12
+ return;
13
+ }
14
+ callback(req);
15
+ }
16
+ if (req.readyState == 4) return;
17
+ req.send(postData);
18
+ }
19
+
20
+ var XMLHttpFactories = [
21
+ function () {return new XMLHttpRequest()},
22
+ function () {return new ActiveXObject("Msxml2.XMLHTTP")},
23
+ function () {return new ActiveXObject("Msxml3.XMLHTTP")},
24
+ function () {return new ActiveXObject("Microsoft.XMLHTTP")}
25
+ ];
26
+
27
+ function createXMLHTTPObject() {
28
+ var xmlhttp = false;
29
+ for (var i=0;i<XMLHttpFactories.length;i++) {
30
+ try {
31
+ xmlhttp = XMLHttpFactories[i]();
32
+ }
33
+ catch (e) {
34
+ continue;
35
+ }
36
+ break;
37
+ }
38
+ return xmlhttp;
39
+ }
40
+
41
+ function ct_callback(req)
42
+ {
43
+ ct_cookie=req.responseText;
44
+ //alert('Key value: ' + ct_cookie);
45
+ document.cookie = "ct_checkjs =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /";
46
+ document.cookie = "ct_checkjs =; expires=Thu, 01 Jan 1970 00:00:01 GMT";
47
+ setTimeout(function() { document.cookie = "ct_checkjs=" + ct_cookie }, 200)
48
+
49
+ //alert('Set cookie: \n' + document.cookie);
50
+ for(i=0;i<document.forms.length;i++)
51
+ {
52
+ f=document.forms[i];
53
+ for(j=0;j<f.elements.length;j++)
54
+ {
55
+ e=f.elements[j];
56
+ if(e.name.indexOf('ct_checkjs')!=-1)
57
+ {
58
+ e.value=ct_cookie;
59
+ //alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);
60
+ }
61
+ }
62
+ }
63
+ }
64
+ sendRequest(ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');
i18n/cleantalk-fr_FR.mo CHANGED
Binary file
readme.txt CHANGED
@@ -2,13 +2,13 @@
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 antispam, registration, spam pingbacks
4
  Requires at least: 3.0
5
- Tested up to: 4.2.2
6
- Stable tag: 5.6
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
 
11
- Max power, all-in-one, premium anti-spam. No comments & registrations spam, no contact spam, protects any forms. Just install and forget spam.
12
 
13
  == Description ==
14
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
@@ -181,6 +181,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
181
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
182
 
183
  == Changelog ==
 
 
 
 
184
  = 5.6 2015-05-11 =
185
  * Fixed translation
186
  * Fixed bulk comments anti-spam checking
@@ -560,6 +564,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
560
  * First version
561
 
562
  == Upgrade Notice ==
 
 
 
 
563
  = 5.6 2015-05-11 =
564
  * Fixed translation
565
  * Fixed bulk comments anti-spam checking
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 antispam, registration, spam pingbacks
4
  Requires at least: 3.0
5
+ Tested up to: 4.2.2
6
+ Stable tag: 5.7
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
 
11
+ Max power, all-in-one, premium anti-spam. No comments & registrations spam, no contact spam, protects any forms. Just install and forget spam.
12
 
13
  == Description ==
14
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
181
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
182
 
183
  == Changelog ==
184
+ = 5.7 2015-05-18 =
185
+ * Fixed French translation
186
+ * Fixed protection algorithm
187
+
188
  = 5.6 2015-05-11 =
189
  * Fixed translation
190
  * Fixed bulk comments anti-spam checking
564
  * First version
565
 
566
  == Upgrade Notice ==
567
+ = 5.7 2015-05-18 =
568
+ * Fixed French translation
569
+ * Fixed protection algorithm
570
+
571
  = 5.6 2015-05-11 =
572
  * Fixed translation
573
  * Fixed bulk comments anti-spam checking