Spam protection, AntiSpam, FireWall by CleanTalk - Version development

Version Description

Download this release

Release Info

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

Code changes from version 5.8 to development

cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-58';
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-59';
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
@@ -122,7 +122,7 @@ function ct_init() {
122
  if (ct_is_user_enable()) {
123
  ct_cookies_test();
124
 
125
- if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1) {
126
  ct_contact_form_validate();
127
  }
128
  }
@@ -538,6 +538,8 @@ function ct_die_extended($comment_body) {
538
  */
539
  function js_test($field_name = 'ct_checkjs', $data = null, $random_key = false) {
540
  global $ct_options, $ct_data;
 
 
541
 
542
  $checkjs = null;
543
  $js_post_value = null;
122
  if (ct_is_user_enable()) {
123
  ct_cookies_test();
124
 
125
+ if (isset($ct_options['general_contact_forms_test']) && $ct_options['general_contact_forms_test'] == 1 && !isset($_POST['comment_post_ID']) && !isset($_GET['for'])) {
126
  ct_contact_form_validate();
127
  }
128
  }
538
  */
539
  function js_test($field_name = 'ct_checkjs', $data = null, $random_key = false) {
540
  global $ct_options, $ct_data;
541
+
542
+ $ct_data=ct_get_data();
543
 
544
  $checkjs = null;
545
  $js_post_value = null;
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.8
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.8';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
@@ -157,9 +157,13 @@ function ct_add_nocache_script()
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
 
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.9
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.9';
11
  $cleantalk_executed=false;
12
 
13
  if(!defined('CLEANTALK_PLUGIN_DIR')){
157
 
158
  function ct_inject_nocache_script($html)
159
  {
160
+ if(stripos($html,"</body")!==false)
161
+ {
162
+ $ct_replace="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."';</script>\n";
163
+ $ct_replace.="<script type='text/javascript' src='".plugins_url( '/cleantalk_nocache.js' , __FILE__ )."?random=".rand()."'></script>\n";
164
+ //$html=str_ireplace("</body",$ct_replace."</body",$html);
165
+ $html=substr_replace($html,$ct_replace."</body",strripos($html,"</body"),6);
166
+ }
167
  return $html;
168
  }
169
 
cleantalk_nocache.js CHANGED
@@ -42,9 +42,28 @@ 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++)
42
  {
43
  ct_cookie=req.responseText;
44
  //alert('Key value: ' + ct_cookie);
45
+
46
+ var domain=location.hostname;
47
+ tmp=domain.split('.');
48
+ if(tmp[0].toLowerCase()=='www')
49
+ {
50
+ tmp[0]='';
51
+ }
52
+ else
53
+ {
54
+ tmp[0]='.'+tmp[0];
55
+ }
56
+ domain=tmp.join('.');
57
+
58
  document.cookie = "ct_checkjs =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /";
59
  document.cookie = "ct_checkjs =; expires=Thu, 01 Jan 1970 00:00:01 GMT";
60
+ document.cookie = "ct_checkjs =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; domain = " + domain;
61
+
62
+
63
+
64
+ var date = new Date;
65
+ date.setDate(date.getDate() + 1);
66
+ setTimeout(function() { document.cookie = "ct_checkjs=" + ct_cookie + "; expires=" + date.toUTCString() + "; path = /; domain = " + domain}, 200)
67
 
68
  //alert('Set cookie: \n' + document.cookie);
69
  for(i=0;i<document.forms.length;i++)
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.8
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -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.8 2015-05-18 =
185
  * Minor fixes
186
 
@@ -567,6 +571,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
567
  * First version
568
 
569
  == Upgrade Notice ==
 
 
 
 
570
  = 5.8 2015-05-18 =
571
  * Minor fixes
572
 
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.9
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
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.9 2015-05-21 =
185
+ * Fixed Javascript error on CF7 and JetPack
186
+ * Some backend and frontent fixes
187
+
188
  = 5.8 2015-05-18 =
189
  * Minor fixes
190
 
571
  * First version
572
 
573
  == Upgrade Notice ==
574
+ = 5.9 2015-05-21 =
575
+ * Fixed Javascript error on CF7 and JetPack
576
+ * Some backend and frontent fixes
577
+
578
  = 5.8 2015-05-18 =
579
  * Minor fixes
580