Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.58.4

Version Description

March 6 2017 = * Users check fix (redirect after the check). * Fixed PHP Notice "HTTP_REFERER" is unset. * Updated Notice logic.

Download this release

Release Info

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

Code changes from version 5.58.3 to 5.58.4

cleantalk.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Spam Protection by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
- Version: 5.58.3
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.58.3';
11
- $ct_agent_version = 'wordpress-5583';
12
  $cleantalk_executed=false;
13
  $ct_sfw_updated = false;
14
 
@@ -30,38 +30,48 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
30
 
31
  $ct_options=ct_get_options();
32
  $ct_data=ct_get_data();
33
-
34
  //Cron jobs
35
  add_action('cleantalk_send_daily_report_hook', 'cleantalk_send_daily_report'); //Sending daily report
36
-
 
37
  if(!isset($ct_data['db_refreshed'])){
38
 
39
  global $wpdb;
40
 
41
  $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw` (
42
- `network` int(11) unsigned NOT NULL,
43
- `mask` int(11) unsigned NOT NULL,
44
- INDEX ( `network` , `mask` )
45
- ) ENGINE = MYISAM ;");
46
 
47
- $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw_logs` (
48
- `ip` VARCHAR(15) NOT NULL ,
49
- `all` INT NOT NULL ,
50
- `blocked` INT NOT NULL ,
51
- `timestamp` INT NOT NULL ,
52
- PRIMARY KEY (`ip`))
53
- ENGINE = MYISAM;");
54
 
55
  $ct_data['db_refreshed'] = 1;
56
- update_option('cleantalk_data', $ct_data);
57
-
58
- }
59
  if(isset($ct_data['db_refreshed']) && $ct_data['db_refreshed'] == 1){
60
  if (!wp_next_scheduled('cleantalk_update_sfw_hook'))
61
  wp_schedule_event(time()+1800, 'daily', 'cleantalk_update_sfw_hook' );
62
  $ct_data['db_refreshed'] = 2;
63
  update_option('cleantalk_data', $ct_data);
64
  }
 
 
 
 
 
 
 
 
 
65
 
66
  if(@stripos($_SERVER['REQUEST_URI'],'admin-ajax.php')!==false && sizeof($_POST)>0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
67
  $_POST['action']='ninja_forms_ajax_submit';
@@ -342,7 +352,7 @@ function ct_db_refresh(){
342
  `timestamp` INT NOT NULL ,
343
  PRIMARY KEY (`ip`))
344
  ENGINE = MYISAM;");
345
-
346
  }
347
 
348
  /**
@@ -351,8 +361,6 @@ function ct_db_refresh(){
351
  if (!function_exists ( 'ct_activation')) {
352
  function ct_activation() {
353
 
354
- global $wpdb;
355
-
356
  ct_db_refresh();
357
 
358
  wp_schedule_event(time(), 'hourly', 'ct_hourly_event_hook' );
@@ -367,6 +375,7 @@ if (!function_exists ( 'ct_activation')) {
367
  add_option('cleantalk_activation_timestamp', time());
368
  }
369
  }
 
370
  /**
371
  * On deactivation, clear schedule.
372
  */
3
  Plugin Name: Spam Protection by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
+ Version: 5.58.4
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.58.4';
11
+ $ct_agent_version = 'wordpress-5584';
12
  $cleantalk_executed=false;
13
  $ct_sfw_updated = false;
14
 
30
 
31
  $ct_options=ct_get_options();
32
  $ct_data=ct_get_data();
33
+
34
  //Cron jobs
35
  add_action('cleantalk_send_daily_report_hook', 'cleantalk_send_daily_report'); //Sending daily report
36
+
37
+ //Update actions
38
  if(!isset($ct_data['db_refreshed'])){
39
 
40
  global $wpdb;
41
 
42
  $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw` (
43
+ `network` int(11) unsigned NOT NULL,
44
+ `mask` int(11) unsigned NOT NULL,
45
+ INDEX ( `network` , `mask` )
46
+ ) ENGINE = MYISAM ;");
47
 
48
+ $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw_logs` (
49
+ `ip` VARCHAR(15) NOT NULL ,
50
+ `all` INT NOT NULL ,
51
+ `blocked` INT NOT NULL ,
52
+ `timestamp` INT NOT NULL ,
53
+ PRIMARY KEY (`ip`))
54
+ ENGINE = MYISAM;");
55
 
56
  $ct_data['db_refreshed'] = 1;
57
+ update_option('cleantalk_data', $ct_data);
58
+
59
+ }
60
  if(isset($ct_data['db_refreshed']) && $ct_data['db_refreshed'] == 1){
61
  if (!wp_next_scheduled('cleantalk_update_sfw_hook'))
62
  wp_schedule_event(time()+1800, 'daily', 'cleantalk_update_sfw_hook' );
63
  $ct_data['db_refreshed'] = 2;
64
  update_option('cleantalk_data', $ct_data);
65
  }
66
+ /*
67
+ if(isset($ct_data['db_refreshed']) && $ct_data['db_refreshed'] == 2){
68
+ $ct_activation_timestamp = get_option('cleantalk_activation_timestamp');
69
+ if(!$ct_activation_timestamp)
70
+ add_option('cleantalk_activation_timestamp', time());
71
+ $ct_data['db_refreshed'] = 3;
72
+ update_option('cleantalk_data', $ct_data);
73
+ }
74
+ //*/
75
 
76
  if(@stripos($_SERVER['REQUEST_URI'],'admin-ajax.php')!==false && sizeof($_POST)>0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
77
  $_POST['action']='ninja_forms_ajax_submit';
352
  `timestamp` INT NOT NULL ,
353
  PRIMARY KEY (`ip`))
354
  ENGINE = MYISAM;");
355
+
356
  }
357
 
358
  /**
361
  if (!function_exists ( 'ct_activation')) {
362
  function ct_activation() {
363
 
 
 
364
  ct_db_refresh();
365
 
366
  wp_schedule_event(time(), 'hourly', 'ct_hourly_event_hook' );
375
  add_option('cleantalk_activation_timestamp', time());
376
  }
377
  }
378
+
379
  /**
380
  * On deactivation, clear schedule.
381
  */
inc/cleantalk-admin.php CHANGED
@@ -136,7 +136,7 @@ function ct_admin_init()
136
 
137
  $ct_options = ct_get_options();
138
  $ct_data = ct_get_data();
139
-
140
  if(isset($_GET['from_report']) && $_GET['from_report']){
141
  $ct_data['ct_show_notice_from_report'] = true;
142
  update_option('cleantalk_data', $ct_data);
@@ -1449,8 +1449,8 @@ function cleantalk_admin_notice_message(){
1449
  $next_notice_show = (isset($ct_data['next_notice_show']) ? intval($ct_data['next_notice_show']) : 0); //inactive
1450
  $notice_from_report = (isset($ct_data['ct_show_notice_from_report']) ? intval($ct_data['ct_show_notice_from_report']) : 0);
1451
  $page_is_ct_settings = ($page->id == 'settings_page_cleantalk' || $page->id == 'settings_page_cleantalk-network' ? true : false);
1452
- $three_days_since_activation = (intval($activation_timestapm)+(3*24*60*60) < time() ? true : false);
1453
-
1454
  //Misc
1455
  $user_token = (isset($ct_data['user_token']) && $ct_data['user_token'] != '' ? "&user_token={$ct_data['user_token']}" : "");
1456
 
@@ -1458,7 +1458,7 @@ function cleantalk_admin_notice_message(){
1458
 
1459
  //Notice when users came from the daily report letter
1460
  if ($show_notice && $notice_from_report && !ct_valid_key()){
1461
-
1462
  if($page_is_ct_settings)
1463
  echo '<div class="error">
1464
  <h3>' .__("To see the anti-spam log and complete the setup, please get the Access key.", 'cleantalk'). '</h3>
@@ -1478,7 +1478,7 @@ function cleantalk_admin_notice_message(){
1478
  //key == "" || "enter key"
1479
  if ($show_notice && !ct_valid_key()){
1480
 
1481
- if($page_is_ct_settings || $three_days_since_activation)
1482
  echo '<div class="error">
1483
  <h3>' . sprintf(__("Please enter Access Key in %s settings to enable anti spam protection!", 'cleantalk'), "
1484
  <a href=\"options-general.php?page=cleantalk\">CleanTalk plugin</a>") .
136
 
137
  $ct_options = ct_get_options();
138
  $ct_data = ct_get_data();
139
+
140
  if(isset($_GET['from_report']) && $_GET['from_report']){
141
  $ct_data['ct_show_notice_from_report'] = true;
142
  update_option('cleantalk_data', $ct_data);
1449
  $next_notice_show = (isset($ct_data['next_notice_show']) ? intval($ct_data['next_notice_show']) : 0); //inactive
1450
  $notice_from_report = (isset($ct_data['ct_show_notice_from_report']) ? intval($ct_data['ct_show_notice_from_report']) : 0);
1451
  $page_is_ct_settings = ($page->id == 'settings_page_cleantalk' || $page->id == 'settings_page_cleantalk-network' ? true : false);
1452
+ $three_days_since_activation = (intval($activation_timestapm)+(3*24*60*60) < time() ? true : false);
1453
+
1454
  //Misc
1455
  $user_token = (isset($ct_data['user_token']) && $ct_data['user_token'] != '' ? "&user_token={$ct_data['user_token']}" : "");
1456
 
1458
 
1459
  //Notice when users came from the daily report letter
1460
  if ($show_notice && $notice_from_report && !ct_valid_key()){
1461
+
1462
  if($page_is_ct_settings)
1463
  echo '<div class="error">
1464
  <h3>' .__("To see the anti-spam log and complete the setup, please get the Access key.", 'cleantalk'). '</h3>
1478
  //key == "" || "enter key"
1479
  if ($show_notice && !ct_valid_key()){
1480
 
1481
+ // if($page_is_ct_settings || $three_days_since_activation) //INACTIVE
1482
  echo '<div class="error">
1483
  <h3>' . sprintf(__("Please enter Access Key in %s settings to enable anti spam protection!", 'cleantalk'), "
1484
  <a href=\"options-general.php?page=cleantalk\">CleanTalk plugin</a>") .
inc/cleantalk-comments-checkspam.js CHANGED
@@ -95,7 +95,7 @@ function ct_send_comments()
95
  {
96
  working=false;
97
  alert('Server response: ' + msg);
98
- location.href='users.php?page=ct_check_users&ct_worked=1';
99
  }
100
  },
101
  error: function(jqXHR, textStatus, errorThrown) {
95
  {
96
  working=false;
97
  alert('Server response: ' + msg);
98
+ location.href='users.php?page=ct_check_spam&ct_worked=1';
99
  }
100
  },
101
  error: function(jqXHR, textStatus, errorThrown) {
inc/cleantalk-public.php CHANGED
@@ -2401,7 +2401,7 @@ function ct_contact_form_validate() {
2401
  (strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!== false && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
2402
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false||
2403
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
2404
- strpos($_SERVER['HTTP_REFERER'],'/wp-admin/') !== false ||
2405
  strpos($_SERVER['REQUEST_URI'],'/login/')!==false||
2406
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
2407
  check_url_exclusions() ||
2401
  (strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!== false && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
2402
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false||
2403
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
2404
+ (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],'/wp-admin/') !== false) ||
2405
  strpos($_SERVER['REQUEST_URI'],'/login/')!==false||
2406
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
2407
  check_url_exclusions() ||
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, serge00, sartemd174
3
  Tags: spam, anti-spam, antispam, anti spam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spammers, spammy, woocommerce, wordpress spam, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, plugin, contact, recaptcha, google captcha, google recaptcha, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, widget, review, firewall, cleantalk, mailpoet, profile builder, comment spam, registration spam, spam comments, comment moderation, spam bots, block spam, signup spam, spam blocker, spam filter, user registration spam,pingback,trackback, anti-spam plugin, varnish, amp, spam free, userpro,honeypot,puzzle,quiz,survey,poll,security, amo forms, caldera forms, visual form builder, contact form clean and simple
4
  Requires at least: 3.0
5
  Tested up to: 4.7.2
6
- Stable tag: 5.58.3
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -486,6 +486,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
486
  1. The Dashboard with a map of most spam active countries per your account.
487
 
488
  == Changelog ==
 
 
 
 
 
489
  = 5.58.3 February 28 2017 =
490
  * Bitrix24 Contact form integration.
491
  * Users/comments check fix.
@@ -1255,6 +1260,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
1255
  * First version
1256
 
1257
  == Upgrade Notice ==
 
 
 
 
 
1258
  = 5.58.3 February 28 2017 =
1259
  * Bitrix24 Contact form integration.
1260
  * Users/comments check fix.
3
  Tags: spam, anti-spam, antispam, anti spam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spammers, spammy, woocommerce, wordpress spam, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, plugin, contact, recaptcha, google captcha, google recaptcha, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, widget, review, firewall, cleantalk, mailpoet, profile builder, comment spam, registration spam, spam comments, comment moderation, spam bots, block spam, signup spam, spam blocker, spam filter, user registration spam,pingback,trackback, anti-spam plugin, varnish, amp, spam free, userpro,honeypot,puzzle,quiz,survey,poll,security, amo forms, caldera forms, visual form builder, contact form clean and simple
4
  Requires at least: 3.0
5
  Tested up to: 4.7.2
6
+ Stable tag: 5.58.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
486
  1. The Dashboard with a map of most spam active countries per your account.
487
 
488
  == Changelog ==
489
+ = 5.58.4 March 6 2017 =
490
+ * Users check fix (redirect after the check).
491
+ * Fixed PHP Notice "HTTP_REFERER" is unset.
492
+ * Updated Notice logic.
493
+
494
  = 5.58.3 February 28 2017 =
495
  * Bitrix24 Contact form integration.
496
  * Users/comments check fix.
1260
  * First version
1261
 
1262
  == Upgrade Notice ==
1263
+ = 5.58.4 March 6 2017 =
1264
+ * Users check fix (redirect after the check).
1265
+ * Fixed PHP Notice "HTTP_REFERER" is unset.
1266
+ * Updated Notice logic.
1267
+
1268
  = 5.58.3 February 28 2017 =
1269
  * Bitrix24 Contact form integration.
1270
  * Users/comments check fix.