Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.84

Version Description

December 26 2017 = * Integration: PeepSo contact form * Repared: Feedback from comments page. * Fix: mb_* functions used only if exists. * Fix: Gravity forms: Multi-page form logic repared. * Fix: Gravity forms: AJAX form logic repared. * Minor fixes.

Download this release

Release Info

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

Code changes from version 5.83.2 to 5.84

cleantalk.php CHANGED
@@ -3,17 +3,17 @@
3
  Plugin Name: Anti-Spam 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.83.2
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
- $cleantalk_plugin_version='5.83.2';
12
- $ct_agent_version = 'wordpress-5832';
13
  $cleantalk_executed = false;
14
 
15
- define('APBCT_VERSION', '5.83.2');
16
- define('APBCT_AGENT', 'wordpress-5832');
17
 
18
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
19
 
3
  Plugin Name: Anti-Spam 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.84
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
+ $cleantalk_plugin_version='5.84';
12
+ $ct_agent_version = 'wordpress-584';
13
  $cleantalk_executed = false;
14
 
15
+ define('APBCT_VERSION', '5.84');
16
+ define('APBCT_AGENT', 'wordpress-584');
17
 
18
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
19
 
inc/cleantalk-common.php CHANGED
@@ -137,12 +137,12 @@ function apbct_base_call($params = array(), $reg_flag = false){
137
 
138
  // Misc
139
  $ct_request->auth_key = $ct_options['apikey'];
140
- $ct_request->message = !empty($params['message']) ? ct_filter_array($params['message']) : null;
141
- $ct_request->example = !empty($params['example']) ? $params['example'] : null;
142
- $ct_request->sender_email = !empty($params['sender_email']) ? $params['sender_email'] : null;
143
- $ct_request->sender_nickname = !empty($params['sender_nickname']) ? $params['sender_nickname'] : null;
144
- $ct_request->post_info = isset($params['post_info']) ? json_encode($params['post_info']) : null;
145
- $ct_request->js_on = isset($params['checkjs']) ? $params['checkjs'] : js_test('ct_checkjs', $_COOKIE, true);
146
  $ct_request->agent = APBCT_AGENT;
147
  $ct_request->sender_info = json_encode($sender_info);
148
  $ct_request->submit_time = apbct_get_submit_time();
137
 
138
  // Misc
139
  $ct_request->auth_key = $ct_options['apikey'];
140
+ $ct_request->message = !empty($params['message']) ? json_encode(ct_filter_array($params['message'])) : null;
141
+ $ct_request->example = !empty($params['example']) ? $params['example'] : null;
142
+ $ct_request->sender_email = !empty($params['sender_email']) ? $params['sender_email'] : null;
143
+ $ct_request->sender_nickname = !empty($params['sender_nickname']) ? $params['sender_nickname'] : null;
144
+ $ct_request->post_info = isset($params['post_info']) ? json_encode($params['post_info']) : null;
145
+ $ct_request->js_on = isset($params['checkjs']) ? $params['checkjs'] : js_test('ct_checkjs', $_COOKIE, true);
146
  $ct_request->agent = APBCT_AGENT;
147
  $ct_request->sender_info = json_encode($sender_info);
148
  $ct_request->submit_time = apbct_get_submit_time();
inc/cleantalk-public.php CHANGED
@@ -327,7 +327,7 @@ function ct_validate_ccf_submission($value, $field_id, $required){
327
  //Making a call
328
  $base_call_result = apbct_base_call(
329
  array(
330
- 'message' => $subject." ".$message,
331
  'sender_email' => $sender_email,
332
  'sender_nickname' => $sender_nickname,
333
  'post_info' => $post_info,
@@ -1854,7 +1854,7 @@ function ct_gforms_hidden_field ( $form_string, $form ) {
1854
  $form_string = str_replace($search, $js_code . $search, $form_string);
1855
 
1856
  // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
1857
- $append_string = "<input type='hidden' name='ct_multipage_form' value='yes'>";
1858
  $form_string = str_replace($search, $append_string.$search, $form_string);
1859
 
1860
  return $form_string;
@@ -1887,7 +1887,6 @@ function ct_gforms_spam_test ($is_spam, $form, $entry) {
1887
  } unset($key, $value);
1888
 
1889
  $ct_temp_msg_data = ct_get_fields_any($ct_temp);
1890
-
1891
  $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
1892
  $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
1893
  $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
@@ -1911,10 +1910,19 @@ function ct_gforms_spam_test ($is_spam, $form, $entry) {
1911
  )
1912
  );
1913
  $ct_result = $base_call_result['ct_result'];
1914
-
1915
  if ($ct_result->allow == 0) {
1916
  $is_spam = true;
1917
- wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
 
 
 
 
 
 
 
 
 
 
1918
  }
1919
 
1920
  return $is_spam;
@@ -1987,6 +1995,7 @@ function ct_contact_form_validate() {
1987
  strpos($_SERVER['REQUEST_URI'],'?provider=facebook&')!==false ||
1988
  (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],'/wp-admin/') !== false) ||
1989
  strpos($_SERVER['REQUEST_URI'],'/login/')!==false||
 
1990
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
1991
  check_url_exclusions() ||
1992
  check_ip_exclusions() ||
327
  //Making a call
328
  $base_call_result = apbct_base_call(
329
  array(
330
+ 'message' => $message,
331
  'sender_email' => $sender_email,
332
  'sender_nickname' => $sender_nickname,
333
  'post_info' => $post_info,
1854
  $form_string = str_replace($search, $js_code . $search, $form_string);
1855
 
1856
  // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
1857
+ $append_string = isset($form['lastPageButton']) ? "<input type='hidden' name='ct_multipage_form' value='yes'>" : '';
1858
  $form_string = str_replace($search, $append_string.$search, $form_string);
1859
 
1860
  return $form_string;
1887
  } unset($key, $value);
1888
 
1889
  $ct_temp_msg_data = ct_get_fields_any($ct_temp);
 
1890
  $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
1891
  $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
1892
  $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
1910
  )
1911
  );
1912
  $ct_result = $base_call_result['ct_result'];
 
1913
  if ($ct_result->allow == 0) {
1914
  $is_spam = true;
1915
+ if (isset($_POST['gform_ajax']) && $_POST['gform_ajax'] !== null)
1916
+ {
1917
+ $response = sprintf("<!DOCTYPE html><html><head><meta charset='UTF-8' /></head><body class='GF_AJAX_POSTBACK'><div id='gform_wrapper_1' class='gform_confirmation_wrapper '><div id='gform_confirmation_message_1' class='gform_confirmation_message_1
1918
+ gform_confirmation_message'>%s</div></div></body></html>",
1919
+ $ct_result->comment
1920
+ );
1921
+ echo $response;
1922
+ die();
1923
+ }
1924
+ else
1925
+ wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
1926
  }
1927
 
1928
  return $is_spam;
1995
  strpos($_SERVER['REQUEST_URI'],'?provider=facebook&')!==false ||
1996
  (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],'/wp-admin/') !== false) ||
1997
  strpos($_SERVER['REQUEST_URI'],'/login/')!==false||
1998
+ strpos($_SERVER['REQUEST_URI'], '/peepsoajax/profilefieldsajax.validate_register')!== false ||
1999
  isset($_GET['ptype']) && $_GET['ptype']=='login' ||
2000
  check_url_exclusions() ||
2001
  check_ip_exclusions() ||
js/cleantalk-comments-editscreen.js CHANGED
@@ -25,7 +25,7 @@ jQuery(document).ready(function(){
25
  // For approved
26
  jQuery('span.approve').on('click', function(){
27
  var result = jQuery(this).children('a').attr('href');
28
- result = result.match(/^comment\.php\?.*c=(\d).*/);
29
  ct_comment_id = result[1];
30
  undo_comment_id = ct_comment_id;
31
  ct_send_feedback_request(ct_comment_id, 'approve', 0);
@@ -34,7 +34,7 @@ jQuery(document).ready(function(){
34
  // For unapprove
35
  jQuery('span.unapprove').on('click', function(){
36
  var result = jQuery(this).children('a').attr('href');
37
- result = result.match(/^comment\.php\?.*c=(\d).*/);
38
  ct_comment_id = result[1];
39
  undo_comment_id = ct_comment_id;
40
  ct_send_feedback_request(ct_comment_id, 'spam', 0);
@@ -43,7 +43,7 @@ jQuery(document).ready(function(){
43
  // For spammed
44
  jQuery('span.spam').on('click', function(){
45
  var result = jQuery(this).children('a').attr('href');
46
- result = result.match(/^comment\.php\?.*c=(\d).*/);
47
  ct_comment_id = result[1];
48
  undo_comment_id = ct_comment_id;
49
  ct_send_feedback_request(ct_comment_id, 'spam', 0);
@@ -51,7 +51,7 @@ jQuery(document).ready(function(){
51
  setTimeout(function(){
52
  jQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){
53
  var result = jQuery(this).attr('href');
54
- result = result.match(/^comment\.php\?.*&c=(\d).*/);
55
  ct_comment_id = result[1];
56
  ct_send_feedback_request(ct_comment_id, 'approve', 1);
57
  });
@@ -62,7 +62,7 @@ jQuery(document).ready(function(){
62
  // For unspammed
63
  jQuery('span.unspam').on('click', function(){
64
  var result = jQuery(this).children('a').attr('href');
65
- result = result.match(/^comment\.php\?.*c=(\d).*/);
66
  ct_comment_id = result[1];
67
  ct_send_feedback_request(ct_comment_id, 'approve', 0);
68
  });
@@ -70,7 +70,7 @@ jQuery(document).ready(function(){
70
  // For untrashed
71
  jQuery('span.untrash a').on('click', function(){
72
  var result = jQuery(this).attr('href');
73
- result = result.match(/^comment\.php\?.*c=(\d).*/);
74
  ct_comment_id = result[1];
75
  feedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);
76
  });
@@ -94,7 +94,9 @@ function ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){
94
  ct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);
95
  },
96
  error: function(jqXHR, textStatus, errorThrown) {
97
-
 
 
98
  },
99
  timeout: 5000
100
  });
25
  // For approved
26
  jQuery('span.approve').on('click', function(){
27
  var result = jQuery(this).children('a').attr('href');
28
+ result = result.match(/^comment\.php\?.*c=(\d*).*/);
29
  ct_comment_id = result[1];
30
  undo_comment_id = ct_comment_id;
31
  ct_send_feedback_request(ct_comment_id, 'approve', 0);
34
  // For unapprove
35
  jQuery('span.unapprove').on('click', function(){
36
  var result = jQuery(this).children('a').attr('href');
37
+ result = result.match(/^comment\.php\?.*c=(\d*).*/);
38
  ct_comment_id = result[1];
39
  undo_comment_id = ct_comment_id;
40
  ct_send_feedback_request(ct_comment_id, 'spam', 0);
43
  // For spammed
44
  jQuery('span.spam').on('click', function(){
45
  var result = jQuery(this).children('a').attr('href');
46
+ result = result.match(/^comment\.php\?.*c=(\d*).*/);
47
  ct_comment_id = result[1];
48
  undo_comment_id = ct_comment_id;
49
  ct_send_feedback_request(ct_comment_id, 'spam', 0);
51
  setTimeout(function(){
52
  jQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){
53
  var result = jQuery(this).attr('href');
54
+ result = result.match(/^comment\.php\?.*&c=(\d*).*/);
55
  ct_comment_id = result[1];
56
  ct_send_feedback_request(ct_comment_id, 'approve', 1);
57
  });
62
  // For unspammed
63
  jQuery('span.unspam').on('click', function(){
64
  var result = jQuery(this).children('a').attr('href');
65
+ result = result.match(/^comment\.php\?.*c=(\d*).*/);
66
  ct_comment_id = result[1];
67
  ct_send_feedback_request(ct_comment_id, 'approve', 0);
68
  });
70
  // For untrashed
71
  jQuery('span.untrash a').on('click', function(){
72
  var result = jQuery(this).attr('href');
73
+ result = result.match(/^comment\.php\?.*c=(\d*).*/);
74
  ct_comment_id = result[1];
75
  feedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);
76
  });
94
  ct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);
95
  },
96
  error: function(jqXHR, textStatus, errorThrown) {
97
+ console.log(jqXHR);
98
+ console.log(textStatus);
99
+ console.log(errorThrown);
100
  },
101
  timeout: 5000
102
  });
lib/CleantalkHelper.php CHANGED
@@ -180,7 +180,7 @@ class CleantalkHelper
180
  $key_parts = explode('_', $server_key);
181
  if(count($key_parts) > 0 and strlen($server_key) > 2){
182
  foreach($key_parts as $part_index => $part){
183
- $key_parts[$part_index] = mb_strtolower($part);
184
  $key_parts[$part_index][0] = strtoupper($key_parts[$part_index][0]);
185
  }
186
  $server_key = implode('-', $key_parts);
180
  $key_parts = explode('_', $server_key);
181
  if(count($key_parts) > 0 and strlen($server_key) > 2){
182
  foreach($key_parts as $part_index => $part){
183
+ $key_parts[$part_index] = function_exists('mb_strtolower') ? mb_strtolower($part) : strtolower($part);
184
  $key_parts[$part_index][0] = strtoupper($key_parts[$part_index][0]);
185
  }
186
  $server_key = implode('-', $key_parts);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, sartemd174
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9.1
6
- Stable tag: 5.83.2
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
@@ -504,6 +504,14 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
504
  1. The plugin deletes/removes the existing spam comments and users accounts.
505
 
506
  == Changelog ==
 
 
 
 
 
 
 
 
507
  = 5.83.2 December 19 2017 =
508
  * Fix: Error in base class.
509
 
@@ -1484,6 +1492,14 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
1484
  * First version
1485
 
1486
  == Upgrade Notice ==
 
 
 
 
 
 
 
 
1487
  = 5.83.2 December 19 2017 =
1488
  * Fix: Error in base class.
1489
 
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9.1
6
+ Stable tag: 5.84
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
504
  1. The plugin deletes/removes the existing spam comments and users accounts.
505
 
506
  == Changelog ==
507
+ = 5.84 December 26 2017 =
508
+ * Integration: PeepSo contact form
509
+ * Repared: Feedback from comments page.
510
+ * Fix: mb_* functions used only if exists.
511
+ * Fix: Gravity forms: Multi-page form logic repared.
512
+ * Fix: Gravity forms: AJAX form logic repared.
513
+ * Minor fixes.
514
+
515
  = 5.83.2 December 19 2017 =
516
  * Fix: Error in base class.
517
 
1492
  * First version
1493
 
1494
  == Upgrade Notice ==
1495
+ = 5.84 December 26 2017 =
1496
+ * Integration: PeepSo contact form
1497
+ * Repared: Feedback from comments page.
1498
+ * Fix: mb_* functions used only if exists.
1499
+ * Fix: Gravity forms: Multi-page form logic repared.
1500
+ * Fix: Gravity forms: AJAX form logic repared.
1501
+ * Minor fixes.
1502
+
1503
  = 5.83.2 December 19 2017 =
1504
  * Fix: Error in base class.
1505