Version Description
2015-12-04 = * Fixed issue with BBPress: restored old user permission checking mechanism * Fixed anti-spam comments checking: sometimes get_comments returned wrong comments number * Fixed bulk checking: made numeric indexes in users and comments arrays * Fixed trackback and pingback checking: removed exception for checking
Download this release
Release Info
Developer | shagimuratov |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.33.1 |
Comparing to | |
See all releases |
Code changes from version 5.31.1 to 5.33.1
- cleantalk.php +98 -70
- inc/cleantalk-admin.php +18 -14
- inc/cleantalk-ajax.php +9 -0
- inc/cleantalk-comments-checkspam.js +1 -0
- inc/cleantalk-comments.php +3 -2
- inc/cleantalk-common.php +10 -2
- inc/cleantalk-public.php +14 -8
- inc/cleantalk-sfw.class.php +49 -37
- inc/cleantalk-users-checkspam.js +1 -0
- inc/cleantalk-users.php +33 -82
- inc/cleantalk_nocache.js +76 -0
- inc/images/preloader.gif +0 -0
- readme.txt +51 -10
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.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
-
$cleantalk_plugin_version='5.
|
11 |
$cleantalk_executed=false;
|
12 |
|
13 |
if(defined('CLEANTALK_AJAX_USE_BUFFER'))
|
@@ -35,6 +35,10 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
35 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
|
36 |
$ct_options=ct_get_options();
|
37 |
$ct_data=ct_get_data();
|
|
|
|
|
|
|
|
|
38 |
|
39 |
if(isset($ct_options['spam_firewall']))
|
40 |
{
|
@@ -44,32 +48,35 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
44 |
{
|
45 |
$value=0;
|
46 |
}
|
47 |
-
|
48 |
-
if($value==1 && !is_admin() && stripos($_SERVER['REQUEST_URI'],'/wp-admin/')===false) //&& (!isset($_POST) || isset($_POST) && sizeof($_POST)==0)
|
49 |
{
|
50 |
$is_sfw_check=true;
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
73 |
if($is_sfw_check)
|
74 |
{
|
75 |
//include_once("cleantalk-sfw.php");
|
@@ -169,42 +176,43 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
169 |
if (is_admin()||is_network_admin())
|
170 |
{
|
171 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-admin.php');
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
182 |
{
|
183 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
184 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
|
185 |
}
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
}else{
|
209 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
210 |
|
@@ -319,19 +327,40 @@ function ct_add_nocache_script_footer()
|
|
319 |
print "\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
|
320 |
print "<script async type='text/javascript' src='".plugins_url( '/inc/cleantalk_external.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
|
321 |
}
|
|
|
322 |
}
|
323 |
|
324 |
function ct_add_nocache_script_header()
|
325 |
{
|
326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
}
|
328 |
|
329 |
function ct_inject_nocache_script($html)
|
330 |
{
|
331 |
-
global $test_external_forms, $cleantalk_plugin_version;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
if(!is_admin()&&stripos($html,"</body")!==false)
|
333 |
{
|
334 |
-
//$ct_replace.="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."'
|
335 |
$ct_replace="<script async type='text/javascript' src='".plugins_url( '/inc/cleantalk_nocache.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
|
336 |
if($test_external_forms)
|
337 |
{
|
@@ -344,7 +373,7 @@ function ct_inject_nocache_script($html)
|
|
344 |
}
|
345 |
if(!is_admin()&&preg_match("#<head[^>]*>#i",$html)==1)
|
346 |
{
|
347 |
-
$ct_replace="\n<script type='text/javascript'>\nvar ct_ajaxurl = '".admin_url('admin-ajax.php')."';\n</script>\n";
|
348 |
$html=preg_replace("(<head[^>]*>)","$0".$ct_replace,$html,1);
|
349 |
}
|
350 |
return $html;
|
@@ -427,6 +456,7 @@ INDEX ( `network` , `mask` )
|
|
427 |
|
428 |
function cleantalk_get_ip()
|
429 |
{
|
|
|
430 |
if ( function_exists( 'apache_request_headers' ) )
|
431 |
{
|
432 |
$headers = apache_request_headers();
|
@@ -438,22 +468,20 @@ function cleantalk_get_ip()
|
|
438 |
if ( array_key_exists( 'X-Forwarded-For', $headers ) )
|
439 |
{
|
440 |
$the_ip=explode(",", trim($headers['X-Forwarded-For']));
|
441 |
-
$
|
442 |
}
|
443 |
-
|
444 |
{
|
445 |
$the_ip=explode(",", trim($headers['HTTP_X_FORWARDED_FOR']));
|
446 |
-
$
|
447 |
-
}
|
448 |
-
else
|
449 |
-
{
|
450 |
-
$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );
|
451 |
}
|
|
|
|
|
452 |
if(isset($_GET['sfw_test_ip']))
|
453 |
{
|
454 |
-
$
|
455 |
}
|
456 |
-
return $
|
457 |
}
|
458 |
|
459 |
function ct_send_sfw_log()
|
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.33.1
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
+
$cleantalk_plugin_version='5.33.1';
|
11 |
$cleantalk_executed=false;
|
12 |
|
13 |
if(defined('CLEANTALK_AJAX_USE_BUFFER'))
|
35 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
|
36 |
$ct_options=ct_get_options();
|
37 |
$ct_data=ct_get_data();
|
38 |
+
if(@stripos($_SERVER['REQUEST_URI'],'admin-ajax.php')!==false && sizeof($_POST)>0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
|
39 |
+
{
|
40 |
+
$_POST['action']='ninja_forms_ajax_submit';
|
41 |
+
}
|
42 |
|
43 |
if(isset($ct_options['spam_firewall']))
|
44 |
{
|
48 |
{
|
49 |
$value=0;
|
50 |
}
|
51 |
+
if($value==1 && !is_admin() && stripos($_SERVER['REQUEST_URI'],'/wp-admin/')===false || stripos($_SERVER['REQUEST_URI'],basename(admin_url('admin-ajax.php')))!=false) //&& (!isset($_POST) || isset($_POST) && sizeof($_POST)==0)
|
|
|
52 |
{
|
53 |
$is_sfw_check=true;
|
54 |
+
$ip=cleantalk_get_ip();
|
55 |
+
for($i=0;$i<sizeof($ip);$i++)
|
56 |
+
{
|
57 |
+
if(isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key']==md5($ip[$i].$ct_options['apikey']))
|
58 |
+
{
|
59 |
+
$is_sfw_check=false;
|
60 |
+
if(isset($_COOKIE['ct_sfw_passed']))
|
61 |
+
{
|
62 |
+
if(isset($ct_data['sfw_log']))
|
63 |
+
{
|
64 |
+
$sfw_log=$ct_data['sfw_log'];
|
65 |
+
}
|
66 |
+
else
|
67 |
+
{
|
68 |
+
$sfw_log=array();
|
69 |
+
$sfw_log[$ip[$i]]=Array();
|
70 |
+
}
|
71 |
+
$sfw_log[$ip[$i]]['allow']++;
|
72 |
+
$ct_data['sfw_log'] = $sfw_log;
|
73 |
+
update_option('cleantalk_data', $ct_data);
|
74 |
+
@setcookie ('ct_sfw_passed', '0', 1, "/");
|
75 |
+
}
|
76 |
+
//@$ct_data['sfw_log'][cleantalk_get_ip()]['all']++;
|
77 |
+
//update_option('cleantalk_data', $ct_data);
|
78 |
+
}
|
79 |
+
}
|
80 |
if($is_sfw_check)
|
81 |
{
|
82 |
//include_once("cleantalk-sfw.php");
|
176 |
if (is_admin()||is_network_admin())
|
177 |
{
|
178 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-admin.php');
|
179 |
+
if (!(defined( 'DOING_AJAX' ) && DOING_AJAX))
|
180 |
+
{
|
181 |
+
add_action('admin_init', 'ct_admin_init', 1);
|
182 |
+
add_action('admin_menu', 'ct_admin_add_page');
|
183 |
+
if(is_network_admin())
|
184 |
+
{
|
185 |
+
add_action('network_admin_menu', 'ct_admin_add_page');
|
186 |
+
}
|
187 |
+
add_action('admin_notices', 'cleantalk_admin_notice_message');
|
188 |
+
}
|
189 |
+
if (defined( 'DOING_AJAX' ) && DOING_AJAX||isset($_POST['cma-action']))
|
190 |
{
|
191 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
192 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
|
193 |
}
|
194 |
|
195 |
+
add_action('admin_enqueue_scripts', 'ct_enqueue_scripts');
|
196 |
+
if($pagenow=='edit-comments.php')
|
197 |
+
{
|
198 |
+
add_action('comment_unapproved_to_approvecomment', 'ct_comment_approved'); // param - comment object
|
199 |
+
add_action('comment_unapproved_to_approved', 'ct_comment_approved'); // param - comment object
|
200 |
+
add_action('comment_approved_to_unapproved', 'ct_comment_unapproved'); // param - comment object
|
201 |
+
add_action('comment_unapproved_to_spam', 'ct_comment_spam'); // param - comment object
|
202 |
+
add_action('comment_approved_to_spam', 'ct_comment_spam'); // param - comment object
|
203 |
+
//add_filter('get_comment_text', 'ct_get_comment_text'); // param - current comment text
|
204 |
+
add_filter('unspam_comment', 'ct_unspam_comment');
|
205 |
+
}
|
206 |
+
if($pagenow=='users.php')
|
207 |
+
{
|
208 |
+
add_action('delete_user', 'ct_delete_user');
|
209 |
+
}
|
210 |
+
if($pagenow=='plugins.php' || @strpos($_SERVER['REQUEST_URI'],'plugins.php')!==false)
|
211 |
+
{
|
212 |
+
add_filter('plugin_row_meta', 'ct_register_plugin_links', 10, 2);
|
213 |
+
add_filter('plugin_action_links', 'ct_plugin_action_links', 10, 2);
|
214 |
+
}
|
215 |
+
add_action('updated_option', 'ct_update_option'); // param - option name, i.e. 'cleantalk_settings'
|
216 |
}else{
|
217 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
218 |
|
327 |
print "\n<script type='text/javascript'>var ct_blog_home = '".get_home_url()."';</script>\n";
|
328 |
print "<script async type='text/javascript' src='".plugins_url( '/inc/cleantalk_external.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
|
329 |
}
|
330 |
+
//print "<script async type='text/javascript' src='".plugins_url( '/inc/cleantalk-info.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
|
331 |
}
|
332 |
|
333 |
function ct_add_nocache_script_header()
|
334 |
{
|
335 |
+
global $ct_options;
|
336 |
+
$ct_options=ct_get_options();
|
337 |
+
if(substr($ct_options['apikey'],0,1)=='y')
|
338 |
+
{
|
339 |
+
$ct_info_flag="var ct_info_flag=true;\n";
|
340 |
+
}
|
341 |
+
else
|
342 |
+
{
|
343 |
+
$ct_info_flag="var ct_info_flag=false;\n";
|
344 |
+
}
|
345 |
+
|
346 |
+
print "\n<script type='text/javascript'>\nvar ct_ajaxurl = '".admin_url('admin-ajax.php')."';\n $ct_info_flag </script>\n";
|
347 |
}
|
348 |
|
349 |
function ct_inject_nocache_script($html)
|
350 |
{
|
351 |
+
global $test_external_forms, $cleantalk_plugin_version, $ct_options;
|
352 |
+
$ct_options=ct_get_options();
|
353 |
+
if(substr($ct_options['apikey'],0,1)=='y')
|
354 |
+
{
|
355 |
+
$ct_info_flag="var ct_info_flag=true;\n";
|
356 |
+
}
|
357 |
+
else
|
358 |
+
{
|
359 |
+
$ct_info_flag="var ct_info_flag=false;\n";
|
360 |
+
}
|
361 |
if(!is_admin()&&stripos($html,"</body")!==false)
|
362 |
{
|
363 |
+
//$ct_replace.="\n<script type='text/javascript'>var ajaxurl = '".admin_url('admin-ajax.php')."';\n $ct_info_flag </script>\n";
|
364 |
$ct_replace="<script async type='text/javascript' src='".plugins_url( '/inc/cleantalk_nocache.js' , __FILE__ )."?random=".$cleantalk_plugin_version."'></script>\n";
|
365 |
if($test_external_forms)
|
366 |
{
|
373 |
}
|
374 |
if(!is_admin()&&preg_match("#<head[^>]*>#i",$html)==1)
|
375 |
{
|
376 |
+
$ct_replace="\n<script type='text/javascript'>\nvar ct_ajaxurl = '".admin_url('admin-ajax.php')."';\n $ct_info_flag </script>\n";
|
377 |
$html=preg_replace("(<head[^>]*>)","$0".$ct_replace,$html,1);
|
378 |
}
|
379 |
return $html;
|
456 |
|
457 |
function cleantalk_get_ip()
|
458 |
{
|
459 |
+
$result=Array();
|
460 |
if ( function_exists( 'apache_request_headers' ) )
|
461 |
{
|
462 |
$headers = apache_request_headers();
|
468 |
if ( array_key_exists( 'X-Forwarded-For', $headers ) )
|
469 |
{
|
470 |
$the_ip=explode(",", trim($headers['X-Forwarded-For']));
|
471 |
+
$result[] = trim($the_ip[0]);
|
472 |
}
|
473 |
+
if ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ))
|
474 |
{
|
475 |
$the_ip=explode(",", trim($headers['HTTP_X_FORWARDED_FOR']));
|
476 |
+
$result[] = trim($the_ip[0]);
|
|
|
|
|
|
|
|
|
477 |
}
|
478 |
+
$result[] = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );
|
479 |
+
|
480 |
if(isset($_GET['sfw_test_ip']))
|
481 |
{
|
482 |
+
$result[]=$_GET['sfw_test_ip'];
|
483 |
}
|
484 |
+
return $result;
|
485 |
}
|
486 |
|
487 |
function ct_send_sfw_log()
|
inc/cleantalk-admin.php
CHANGED
@@ -124,8 +124,10 @@ function ct_admin_init()
|
|
124 |
'checkjs' => 1
|
125 |
));
|
126 |
}
|
127 |
-
if(isset($_POST['option_page'])&&$_POST['option_page']=='cleantalk_settings')
|
128 |
{
|
|
|
|
|
129 |
$ct_base_call_result = ct_base_call(array(
|
130 |
'message' => 'This message is a test to check the connection to the CleanTalk servers. ',
|
131 |
'example' => null,
|
@@ -136,7 +138,7 @@ function ct_admin_init()
|
|
136 |
));
|
137 |
}
|
138 |
|
139 |
-
if(@isset($_POST['cleantalk_settings']['spam_firewall']) && $_POST['cleantalk_settings']['spam_firewall']==1
|
140 |
{
|
141 |
cleantalk_update_sfw();
|
142 |
}
|
@@ -277,7 +279,7 @@ function ct_admin_init()
|
|
277 |
}
|
278 |
|
279 |
// Save next status request time
|
280 |
-
$ct_data['next_account_status_check'] =
|
281 |
update_option('cleantalk_data', $ct_data);
|
282 |
}
|
283 |
|
@@ -584,11 +586,12 @@ function ct_input_apikey() {
|
|
584 |
echo "<script src='".plugins_url( 'cleantalk-admin.js', __FILE__ )."'></script>\n";
|
585 |
if (ct_valid_key($value) === false && !$is_wpmu) {
|
586 |
echo "<script>var cleantalk_good_key=false;</script>";
|
587 |
-
echo "<br /><br /><a target='__blank' class='cleantalk_manual_link' style='text-decoration:none;' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Get the Access key', 'cleantalk')."</a>";
|
588 |
if (function_exists('curl_init') && function_exists('json_decode')) {
|
589 |
-
|
590 |
-
|
591 |
-
|
|
|
|
|
592 |
}
|
593 |
} else {
|
594 |
echo "<script>var cleantalk_good_key=true;</script>";
|
@@ -1024,7 +1027,7 @@ function cleantalk_admin_notice_message(){
|
|
1024 |
$show_notice = false;
|
1025 |
}
|
1026 |
|
1027 |
-
if ($show_notice && $show_ct_notice_trial && $value==1 && (is_network_admin() ||
|
1028 |
echo '<div class="error"><h3>' . sprintf(__("%s trial period ends, please upgrade to %s!", 'cleantalk'), "<a href=\"options-general.php?page=cleantalk\">$ct_plugin_name</a>", "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token\" target=\"_blank\"><b>premium version</b></a>") . '</h3></div>';
|
1029 |
$show_notice = false;
|
1030 |
}
|
@@ -1048,18 +1051,18 @@ function cleantalk_admin_notice_message(){
|
|
1048 |
$link="?close_notice=1";
|
1049 |
}
|
1050 |
|
1051 |
-
if ($show_notice && $show_ct_notice_renew && $value==1 && time()>$next_notice_show && (is_network_admin() ||
|
1052 |
$button_html = "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\">" . '<input type="button" class="button button-primary" value="' . __('RENEW ANTI-SPAM', 'cleantalk') . '" />' . "</a>";
|
1053 |
echo '<div class="updated"><a href="'.$link.'" style="text-decoration:none;float:right;font-size:16px;margin-top:5px;"><b>X</b></a><h3>' . sprintf(__("Please renew your anti-spam license for %s.", 'cleantalk'), "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\"><b>" . __('next year', 'cleantalk') ."</b></a>") . '<br /><br />' . $button_html . '</h3></div>';
|
1054 |
$show_notice = false;
|
1055 |
}
|
1056 |
|
1057 |
-
if ($show_notice && $show_ct_notice_online != '' && $value==1 && (is_network_admin() ||
|
1058 |
if($show_ct_notice_online === 'Y'){
|
1059 |
-
echo '<div class="updated"><h3><b>';
|
1060 |
//echo __("Don’t forget to disable CAPTCHA if you have it!", 'cleantalk');
|
1061 |
-
echo __("Settings updated!", 'cleantalk');
|
1062 |
-
echo '</b></h3></div>';
|
1063 |
}
|
1064 |
|
1065 |
if($show_ct_notice_online === 'N' && $value==1 && (is_network_admin() || (!defined('WP_ALLOW_MULTISITE')||defined('WP_ALLOW_MULTISITE')&&WP_ALLOW_MULTISITE==false) && is_admin())){
|
@@ -1256,7 +1259,7 @@ function ct_update_option($option_name) {
|
|
1256 |
$ct_options['apikey'] = $api_key;
|
1257 |
}
|
1258 |
|
1259 |
-
if(@isset($_POST['cleantalk_settings']['spam_firewall']) && $_POST['cleantalk_settings']['spam_firewall']==1
|
1260 |
{
|
1261 |
cleantalk_update_sfw();
|
1262 |
}
|
@@ -1293,6 +1296,7 @@ function ct_update_option($option_name) {
|
|
1293 |
require_once('cleantalk.class.php');
|
1294 |
}
|
1295 |
$result=sendRawRequest($url, $request);
|
|
|
1296 |
if ($result)
|
1297 |
{
|
1298 |
$result = json_decode($result, true);
|
124 |
'checkjs' => 1
|
125 |
));
|
126 |
}
|
127 |
+
if(isset($_POST['option_page'])&&$_POST['option_page']=='cleantalk_settings'&&isset($_POST['cleantalk_settings']['apikey']))
|
128 |
{
|
129 |
+
$ct_options['apikey']=$_POST['cleantalk_settings']['apikey'];
|
130 |
+
update_option('cleantalk_settings', $ct_options);
|
131 |
$ct_base_call_result = ct_base_call(array(
|
132 |
'message' => 'This message is a test to check the connection to the CleanTalk servers. ',
|
133 |
'example' => null,
|
138 |
));
|
139 |
}
|
140 |
|
141 |
+
if(@isset($_POST['cleantalk_settings']['spam_firewall']) && $_POST['cleantalk_settings']['spam_firewall']==1)
|
142 |
{
|
143 |
cleantalk_update_sfw();
|
144 |
}
|
279 |
}
|
280 |
|
281 |
// Save next status request time
|
282 |
+
$ct_data['next_account_status_check'] = time()+86400;
|
283 |
update_option('cleantalk_data', $ct_data);
|
284 |
}
|
285 |
|
586 |
echo "<script src='".plugins_url( 'cleantalk-admin.js', __FILE__ )."'></script>\n";
|
587 |
if (ct_valid_key($value) === false && !$is_wpmu) {
|
588 |
echo "<script>var cleantalk_good_key=false;</script>";
|
|
|
589 |
if (function_exists('curl_init') && function_exists('json_decode')) {
|
590 |
+
echo "<a target='__blank' style='' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Click here to get access key manually', 'cleantalk')."</a>";
|
591 |
+
echo '<br /><br /><input name="get_apikey_auto" type="submit" class="cleantalk_manual_link" value="' . __('Get access key automatically', 'cleantalk') . '" />';
|
592 |
+
|
593 |
+
admin_addDescriptionsFields(sprintf(__('Admin e-mail (%s) will be used for registration', 'cleantalk'), get_option('admin_email')));
|
594 |
+
admin_addDescriptionsFields(sprintf('<a target="__blank" style="color:#BBB;" href="https://cleantalk.org/publicoffer">%s</a>', __('License agreement', 'cleantalk')));
|
595 |
}
|
596 |
} else {
|
597 |
echo "<script>var cleantalk_good_key=true;</script>";
|
1027 |
$show_notice = false;
|
1028 |
}
|
1029 |
|
1030 |
+
if ($show_notice && $show_ct_notice_trial && $value==1 && (is_network_admin() || is_admin())) {
|
1031 |
echo '<div class="error"><h3>' . sprintf(__("%s trial period ends, please upgrade to %s!", 'cleantalk'), "<a href=\"options-general.php?page=cleantalk\">$ct_plugin_name</a>", "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token\" target=\"_blank\"><b>premium version</b></a>") . '</h3></div>';
|
1032 |
$show_notice = false;
|
1033 |
}
|
1051 |
$link="?close_notice=1";
|
1052 |
}
|
1053 |
|
1054 |
+
if ($show_notice && $show_ct_notice_renew && $value==1 && time()>$next_notice_show && (is_network_admin() || is_admin())) {
|
1055 |
$button_html = "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\">" . '<input type="button" class="button button-primary" value="' . __('RENEW ANTI-SPAM', 'cleantalk') . '" />' . "</a>";
|
1056 |
echo '<div class="updated"><a href="'.$link.'" style="text-decoration:none;float:right;font-size:16px;margin-top:5px;"><b>X</b></a><h3>' . sprintf(__("Please renew your anti-spam license for %s.", 'cleantalk'), "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\"><b>" . __('next year', 'cleantalk') ."</b></a>") . '<br /><br />' . $button_html . '</h3></div>';
|
1057 |
$show_notice = false;
|
1058 |
}
|
1059 |
|
1060 |
+
if ($show_notice && $show_ct_notice_online != '' && $value==1 && (is_network_admin() || is_admin())) {
|
1061 |
if($show_ct_notice_online === 'Y'){
|
1062 |
+
//echo '<div class="updated"><h3><b>';
|
1063 |
//echo __("Don’t forget to disable CAPTCHA if you have it!", 'cleantalk');
|
1064 |
+
//echo __("Settings updated!", 'cleantalk');
|
1065 |
+
//echo '</b></h3></div>';
|
1066 |
}
|
1067 |
|
1068 |
if($show_ct_notice_online === 'N' && $value==1 && (is_network_admin() || (!defined('WP_ALLOW_MULTISITE')||defined('WP_ALLOW_MULTISITE')&&WP_ALLOW_MULTISITE==false) && is_admin())){
|
1259 |
$ct_options['apikey'] = $api_key;
|
1260 |
}
|
1261 |
|
1262 |
+
if(@isset($_POST['cleantalk_settings']['spam_firewall']) && $_POST['cleantalk_settings']['spam_firewall']==1)
|
1263 |
{
|
1264 |
cleantalk_update_sfw();
|
1265 |
}
|
1296 |
require_once('cleantalk.class.php');
|
1297 |
}
|
1298 |
$result=sendRawRequest($url, $request);
|
1299 |
+
|
1300 |
if ($result)
|
1301 |
{
|
1302 |
$result = json_decode($result, true);
|
inc/cleantalk-ajax.php
CHANGED
@@ -89,6 +89,10 @@ add_action( 'wp_ajax_tmpl_submit_form_recaptcha_validation', 'ct_ajax_hook',1 )
|
|
89 |
/**hooks for cm answers pro */
|
90 |
add_action( 'template_redirect', 'ct_ajax_hook',1 );
|
91 |
|
|
|
|
|
|
|
|
|
92 |
function ct_get_stats()
|
93 |
{
|
94 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
@@ -446,6 +450,11 @@ function ct_ajax_hook()
|
|
446 |
print $ct_result->comment;
|
447 |
die();
|
448 |
}
|
|
|
|
|
|
|
|
|
|
|
449 |
}
|
450 |
}
|
451 |
}
|
89 |
/**hooks for cm answers pro */
|
90 |
add_action( 'template_redirect', 'ct_ajax_hook',1 );
|
91 |
|
92 |
+
/* hooks for ninja forms ajax*/
|
93 |
+
add_action( 'wp_ajax_nopriv_ninja_forms_ajax_submit', 'ct_ajax_hook',1 );
|
94 |
+
add_action( 'wp_ajax_ninja_forms_ajax_submit', 'ct_ajax_hook',1 );
|
95 |
+
|
96 |
function ct_get_stats()
|
97 |
{
|
98 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
450 |
print $ct_result->comment;
|
451 |
die();
|
452 |
}
|
453 |
+
else if($_POST['action']=='ninja_forms_ajax_submit')
|
454 |
+
{
|
455 |
+
print '{"form_id":'.$_POST['_form_id'].',"errors":false,"success":{"success_msg-Success":"'.$ct_result->comment.'"}}';
|
456 |
+
die();
|
457 |
+
}
|
458 |
}
|
459 |
}
|
460 |
}
|
inc/cleantalk-comments-checkspam.js
CHANGED
@@ -183,6 +183,7 @@ jQuery("#ct_check_spam_button").click(function(){
|
|
183 |
jQuery('#ct_check_comments_table').hide();
|
184 |
jQuery('#ct_delete_all').hide();
|
185 |
jQuery('#ct_delete_checked').hide();
|
|
|
186 |
working=true;
|
187 |
ct_show_info();
|
188 |
});
|
183 |
jQuery('#ct_check_comments_table').hide();
|
184 |
jQuery('#ct_delete_all').hide();
|
185 |
jQuery('#ct_delete_checked').hide();
|
186 |
+
jQuery('#ct_preloader').show();
|
187 |
working=true;
|
188 |
ct_show_info();
|
189 |
});
|
inc/cleantalk-comments.php
CHANGED
@@ -17,6 +17,7 @@ function ct_show_checkspam_page()
|
|
17 |
<h2><?php _e("Anti-spam by CleanTalk", 'cleantalk'); ?></h2><br />
|
18 |
|
19 |
<h3 id="ct_checking_status" style="text-align:center;width:90%;"></h3>
|
|
|
20 |
<?php
|
21 |
$args_spam = array(
|
22 |
'meta_query' => array(
|
@@ -277,6 +278,7 @@ function ct_ajax_check_comments()
|
|
277 |
|
278 |
$u=get_comments($args_unchecked);
|
279 |
$u=array_slice($u,0,500);
|
|
|
280 |
if(sizeof($u)>0)
|
281 |
{
|
282 |
//print_r($u);
|
@@ -299,7 +301,6 @@ function ct_ajax_check_comments()
|
|
299 |
);
|
300 |
|
301 |
$context = stream_context_create($opts);
|
302 |
-
|
303 |
$result = @file_get_contents("https://api.cleantalk.org/?method_name=spam_check&auth_key=".$ct_options['apikey'], 0, $context);
|
304 |
$result=json_decode($result);
|
305 |
if(isset($result->error_message))
|
@@ -315,7 +316,7 @@ function ct_ajax_check_comments()
|
|
315 |
if(empty($uip))continue;
|
316 |
$uim=$u[$i]->comment_author_email;
|
317 |
if(empty($uim))continue;
|
318 |
-
if($result->data->$uip->appears==1
|
319 |
{
|
320 |
add_comment_meta($u[$i]->comment_ID,'ct_marked_as_spam','1',true);
|
321 |
}
|
17 |
<h2><?php _e("Anti-spam by CleanTalk", 'cleantalk'); ?></h2><br />
|
18 |
|
19 |
<h3 id="ct_checking_status" style="text-align:center;width:90%;"></h3>
|
20 |
+
<div style="text-align:center;width:100%;display:none;" id="ct_preloader"><img border=0 src="<?php print plugin_dir_url(__FILE__); ?>images/preloader.gif" /></div>
|
21 |
<?php
|
22 |
$args_spam = array(
|
23 |
'meta_query' => array(
|
278 |
|
279 |
$u=get_comments($args_unchecked);
|
280 |
$u=array_slice($u,0,500);
|
281 |
+
$u=array_values($u);
|
282 |
if(sizeof($u)>0)
|
283 |
{
|
284 |
//print_r($u);
|
301 |
);
|
302 |
|
303 |
$context = stream_context_create($opts);
|
|
|
304 |
$result = @file_get_contents("https://api.cleantalk.org/?method_name=spam_check&auth_key=".$ct_options['apikey'], 0, $context);
|
305 |
$result=json_decode($result);
|
306 |
if(isset($result->error_message))
|
316 |
if(empty($uip))continue;
|
317 |
$uim=$u[$i]->comment_author_email;
|
318 |
if(empty($uim))continue;
|
319 |
+
if(isset($result->data->$uip) && $result->data->$uip->appears==1 || isset($result->data->$uim) && $result->data->$uim->appears==1)
|
320 |
{
|
321 |
add_comment_meta($u[$i]->comment_ID,'ct_marked_as_spam','1',true);
|
322 |
}
|
inc/cleantalk-common.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$ct_agent_version = 'wordpress-
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
@@ -143,6 +143,7 @@ function ct_base_call($params = array()) {
|
|
143 |
if (array_key_exists('sender_info', $params)) {
|
144 |
$sender_info = array_merge($sender_info, (array) $params['sender_info']);
|
145 |
}
|
|
|
146 |
$sender_info = json_encode($sender_info);
|
147 |
if ($sender_info === false)
|
148 |
$sender_info = '';
|
@@ -187,7 +188,7 @@ function ct_base_call($params = array()) {
|
|
187 |
);
|
188 |
}
|
189 |
|
190 |
-
if($ct_result->errno != 0)
|
191 |
{
|
192 |
if($params['checkjs']!=1)
|
193 |
{
|
@@ -277,6 +278,12 @@ function get_sender_info() {
|
|
277 |
'ssl_on' => $ct_options['ssl_on'],
|
278 |
);*/
|
279 |
$options2server=$ct_options;
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
return $sender_info = array(
|
282 |
'page_url' => htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']),
|
@@ -290,6 +297,7 @@ function get_sender_info() {
|
|
290 |
'checkjs_data_cookies' => $checkjs_data_cookies,
|
291 |
'ct_options' => json_encode($options2server),
|
292 |
'fields_number' => sizeof($_POST),
|
|
|
293 |
);
|
294 |
}
|
295 |
|
1 |
<?php
|
2 |
|
3 |
+
$ct_agent_version = 'wordpress-5331';
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
143 |
if (array_key_exists('sender_info', $params)) {
|
144 |
$sender_info = array_merge($sender_info, (array) $params['sender_info']);
|
145 |
}
|
146 |
+
|
147 |
$sender_info = json_encode($sender_info);
|
148 |
if ($sender_info === false)
|
149 |
$sender_info = '';
|
188 |
);
|
189 |
}
|
190 |
|
191 |
+
if(@intval($ct_result->errno) != 0)
|
192 |
{
|
193 |
if($params['checkjs']!=1)
|
194 |
{
|
278 |
'ssl_on' => $ct_options['ssl_on'],
|
279 |
);*/
|
280 |
$options2server=$ct_options;
|
281 |
+
$js_info='';
|
282 |
+
if(isset($_COOKIE['ct_user_info']))
|
283 |
+
{
|
284 |
+
$js_info=stripslashes(rawurldecode($_COOKIE['ct_user_info']));
|
285 |
+
$js_info=mb_convert_encoding($js_info, "UTF-8", "Windows-1252");
|
286 |
+
}
|
287 |
|
288 |
return $sender_info = array(
|
289 |
'page_url' => htmlspecialchars(@$_SERVER['SERVER_NAME'].@$_SERVER['REQUEST_URI']),
|
297 |
'checkjs_data_cookies' => $checkjs_data_cookies,
|
298 |
'ct_options' => json_encode($options2server),
|
299 |
'fields_number' => sizeof($_POST),
|
300 |
+
'js_info' => $js_info,
|
301 |
);
|
302 |
}
|
303 |
|
inc/cleantalk-public.php
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
/**
|
5 |
* Init functions
|
6 |
* @return mixed[] Array of options
|
@@ -328,6 +327,7 @@ function ct_is_user_enable() {
|
|
328 |
}
|
329 |
|
330 |
return true;
|
|
|
331 |
}
|
332 |
|
333 |
/**
|
@@ -497,9 +497,10 @@ function ct_preprocess_comment($comment) {
|
|
497 |
{
|
498 |
$args=Array('author_email' => $comment['comment_author_email'],
|
499 |
'status' => 'approve',
|
500 |
-
'count' =>
|
|
|
501 |
);
|
502 |
-
$cnt = get_comments( $args );
|
503 |
if($cnt >= $comments_check_number)
|
504 |
{
|
505 |
$is_max_comments = true;
|
@@ -526,9 +527,9 @@ function ct_preprocess_comment($comment) {
|
|
526 |
}
|
527 |
|
528 |
// Skip pingback anti-spam test
|
529 |
-
if ($comment['comment_type'] == 'pingback') {
|
530 |
return $comment;
|
531 |
-
}
|
532 |
|
533 |
$ct_comment_done = true;
|
534 |
|
@@ -979,6 +980,7 @@ function ct_test_registration($nickname, $email, $ip){
|
|
979 |
if ($sender_info === false) {
|
980 |
$sender_info= '';
|
981 |
}
|
|
|
982 |
|
983 |
require_once('cleantalk.class.php');
|
984 |
$config = get_option('cleantalk_server');
|
@@ -1117,7 +1119,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1117 |
)
|
1118 |
);
|
1119 |
}
|
1120 |
-
|
1121 |
$ct_signup_done = true;
|
1122 |
|
1123 |
if ($ct_result->errno != 0 && $ct_options['notice_api_errors']) {
|
@@ -1469,6 +1471,7 @@ function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
|
|
1469 |
|
1470 |
if ($ct_options['contact_forms_test'] == 0)
|
1471 |
return $form_errors;
|
|
|
1472 |
|
1473 |
$checkjs = js_test('ct_checkjs', $_POST, true);
|
1474 |
|
@@ -1492,6 +1495,7 @@ function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
|
|
1492 |
|
1493 |
if (isset($_POST['message']))
|
1494 |
$message = $_POST['message'];
|
|
|
1495 |
|
1496 |
$ct_base_call_result = ct_base_call(array(
|
1497 |
'message' => $subject . "\n\n" . $message,
|
@@ -1728,7 +1732,8 @@ function ct_contact_form_validate () {
|
|
1728 |
isset($_POST['bbp_topic_content']) ||
|
1729 |
isset($_POST['bbp_reply_content']) ||
|
1730 |
isset($_COOKIE[LOGGED_IN_COOKIE]) ||
|
1731 |
-
isset($_POST['fscf_submitted'])
|
|
|
1732 |
) {
|
1733 |
return null;
|
1734 |
}
|
@@ -1891,7 +1896,8 @@ function ct_contact_form_validate_postdata () {
|
|
1891 |
@intval($ct_options['general_contact_forms_test'])==0 ||
|
1892 |
isset($_POST['bbp_topic_content']) ||
|
1893 |
isset($_POST['bbp_reply_content']) ||
|
1894 |
-
isset($_POST['fscf_submitted'])
|
|
|
1895 |
) {
|
1896 |
return null;
|
1897 |
}
|
1 |
<?php
|
2 |
|
|
|
3 |
/**
|
4 |
* Init functions
|
5 |
* @return mixed[] Array of options
|
327 |
}
|
328 |
|
329 |
return true;
|
330 |
+
//return !current_user_can('publish_posts');
|
331 |
}
|
332 |
|
333 |
/**
|
497 |
{
|
498 |
$args=Array('author_email' => $comment['comment_author_email'],
|
499 |
'status' => 'approve',
|
500 |
+
'count' => false,
|
501 |
+
'number' => $comments_check_number
|
502 |
);
|
503 |
+
$cnt = sizeof(get_comments( $args ));
|
504 |
if($cnt >= $comments_check_number)
|
505 |
{
|
506 |
$is_max_comments = true;
|
527 |
}
|
528 |
|
529 |
// Skip pingback anti-spam test
|
530 |
+
/*if ($comment['comment_type'] == 'pingback') {
|
531 |
return $comment;
|
532 |
+
}*/
|
533 |
|
534 |
$ct_comment_done = true;
|
535 |
|
980 |
if ($sender_info === false) {
|
981 |
$sender_info= '';
|
982 |
}
|
983 |
+
|
984 |
|
985 |
require_once('cleantalk.class.php');
|
986 |
$config = get_option('cleantalk_server');
|
1119 |
)
|
1120 |
);
|
1121 |
}
|
1122 |
+
|
1123 |
$ct_signup_done = true;
|
1124 |
|
1125 |
if ($ct_result->errno != 0 && $ct_options['notice_api_errors']) {
|
1471 |
|
1472 |
if ($ct_options['contact_forms_test'] == 0)
|
1473 |
return $form_errors;
|
1474 |
+
$sender_info='';
|
1475 |
|
1476 |
$checkjs = js_test('ct_checkjs', $_POST, true);
|
1477 |
|
1495 |
|
1496 |
if (isset($_POST['message']))
|
1497 |
$message = $_POST['message'];
|
1498 |
+
|
1499 |
|
1500 |
$ct_base_call_result = ct_base_call(array(
|
1501 |
'message' => $subject . "\n\n" . $message,
|
1732 |
isset($_POST['bbp_topic_content']) ||
|
1733 |
isset($_POST['bbp_reply_content']) ||
|
1734 |
isset($_COOKIE[LOGGED_IN_COOKIE]) ||
|
1735 |
+
isset($_POST['fscf_submitted']) ||
|
1736 |
+
strpos($_SERVER['REQUEST_URI'],'/wc-api/')!==false
|
1737 |
) {
|
1738 |
return null;
|
1739 |
}
|
1896 |
@intval($ct_options['general_contact_forms_test'])==0 ||
|
1897 |
isset($_POST['bbp_topic_content']) ||
|
1898 |
isset($_POST['bbp_reply_content']) ||
|
1899 |
+
isset($_POST['fscf_submitted']) ||
|
1900 |
+
strpos($_SERVER['REQUEST_URI'],'/wc-api/')!==false
|
1901 |
) {
|
1902 |
return null;
|
1903 |
}
|
inc/cleantalk-sfw.class.php
CHANGED
@@ -3,6 +3,9 @@ class CleanTalkSFW
|
|
3 |
{
|
4 |
public $ip = 0;
|
5 |
public $ip_str = '';
|
|
|
|
|
|
|
6 |
public $result = false;
|
7 |
|
8 |
public function cleantalk_get_real_ip()
|
@@ -19,65 +22,74 @@ class CleanTalkSFW
|
|
19 |
{
|
20 |
$the_ip=explode(",", trim($headers['X-Forwarded-For']));
|
21 |
$the_ip = trim($the_ip[0]);
|
|
|
|
|
22 |
}
|
23 |
-
|
24 |
{
|
25 |
$the_ip=explode(",", trim($headers['HTTP_X_FORWARDED_FOR']));
|
26 |
$the_ip = trim($the_ip[0]);
|
|
|
|
|
27 |
}
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
if(isset($_GET['sfw_test_ip']))
|
33 |
{
|
34 |
$the_ip=$_GET['sfw_test_ip'];
|
|
|
|
|
35 |
}
|
36 |
-
|
37 |
-
|
38 |
//print sprintf("%u", ip2long($the_ip));
|
39 |
}
|
40 |
|
41 |
public function check_ip()
|
42 |
{
|
43 |
global $wpdb,$ct_options, $ct_data;
|
44 |
-
|
45 |
-
$
|
46 |
-
|
47 |
-
if(isset($ct_data['sfw_log']))
|
48 |
-
{
|
49 |
-
$sfw_log=$ct_data['sfw_log'];
|
50 |
-
}
|
51 |
-
else
|
52 |
-
{
|
53 |
-
$sfw_log=array();
|
54 |
-
}
|
55 |
-
|
56 |
-
/*if(isset($sfw_log[$this->ip_str]))
|
57 |
-
{
|
58 |
-
$sfw_log[$this->ip_str]['all']++;
|
59 |
-
}
|
60 |
-
else
|
61 |
{
|
62 |
-
|
63 |
-
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
{
|
70 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
else
|
73 |
{
|
74 |
-
|
|
|
|
|
75 |
}
|
|
|
76 |
}
|
77 |
-
|
78 |
{
|
79 |
-
|
80 |
-
@setcookie ('ct_sfw_pass_key', md5($this->ip_str.$ct_options['apikey']), 0, "/");
|
81 |
}
|
82 |
$ct_data['sfw_log'] = $sfw_log;
|
83 |
update_option('cleantalk_data', $ct_data);
|
@@ -87,9 +99,9 @@ class CleanTalkSFW
|
|
87 |
{
|
88 |
global $ct_options, $ct_data;
|
89 |
$sfw_die_page=file_get_contents(dirname(__FILE__)."/sfw_die_page.html");
|
90 |
-
$sfw_die_page=str_replace("{REMOTE_ADDRESS}",$this->
|
91 |
$sfw_die_page=str_replace("{REQUEST_URI}",$_SERVER['REQUEST_URI'],$sfw_die_page);
|
92 |
-
$sfw_die_page=str_replace("{SFW_COOKIE}",md5($this->
|
93 |
@header('HTTP/1.0 403 Forbidden');
|
94 |
wp_die( $sfw_die_page, "Blacklisted", Array('response'=>403) );
|
95 |
}
|
3 |
{
|
4 |
public $ip = 0;
|
5 |
public $ip_str = '';
|
6 |
+
public $ip_array = Array();
|
7 |
+
public $ip_str_array = Array();
|
8 |
+
public $blocked_ip = '';
|
9 |
public $result = false;
|
10 |
|
11 |
public function cleantalk_get_real_ip()
|
22 |
{
|
23 |
$the_ip=explode(",", trim($headers['X-Forwarded-For']));
|
24 |
$the_ip = trim($the_ip[0]);
|
25 |
+
$this->ip_str_array[]=$the_ip;
|
26 |
+
$this->ip_array[]=sprintf("%u", ip2long($the_ip));
|
27 |
}
|
28 |
+
if ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ))
|
29 |
{
|
30 |
$the_ip=explode(",", trim($headers['HTTP_X_FORWARDED_FOR']));
|
31 |
$the_ip = trim($the_ip[0]);
|
32 |
+
$this->ip_str_array[]=$the_ip;
|
33 |
+
$this->ip_array[]=sprintf("%u", ip2long($the_ip));
|
34 |
}
|
35 |
+
$the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );
|
36 |
+
$this->ip_str_array[]=$the_ip;
|
37 |
+
$this->ip_array[]=sprintf("%u", ip2long($the_ip));
|
38 |
+
|
39 |
if(isset($_GET['sfw_test_ip']))
|
40 |
{
|
41 |
$the_ip=$_GET['sfw_test_ip'];
|
42 |
+
$this->ip_str_array[]=$the_ip;
|
43 |
+
$this->ip_array[]=sprintf("%u", ip2long($the_ip));
|
44 |
}
|
45 |
+
//$this->ip_str=$the_ip;
|
46 |
+
//$this->ip=sprintf("%u", ip2long($the_ip));
|
47 |
//print sprintf("%u", ip2long($the_ip));
|
48 |
}
|
49 |
|
50 |
public function check_ip()
|
51 |
{
|
52 |
global $wpdb,$ct_options, $ct_data;
|
53 |
+
$passed_ip='';
|
54 |
+
for($i=0;$i<sizeof($this->ip_array);$i++)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
{
|
56 |
+
//print "select network from `".$wpdb->base_prefix."cleantalk_sfw` where ".$this->ip." & mask = network;";
|
57 |
+
//$r = $wpdb->get_results("select network from `".$wpdb->base_prefix."cleantalk_sfw` where network = ".$this->ip." & mask;", ARRAY_A);
|
58 |
+
$r = $wpdb->get_results("select network from `".$wpdb->base_prefix."cleantalk_sfw` where network = ".$this->ip_array[$i]." & mask;", ARRAY_A);
|
59 |
|
60 |
+
if(isset($ct_data['sfw_log']))
|
61 |
+
{
|
62 |
+
$sfw_log=$ct_data['sfw_log'];
|
63 |
+
}
|
64 |
+
else
|
65 |
+
{
|
66 |
+
$sfw_log=array();
|
67 |
+
}
|
68 |
+
|
69 |
+
if(sizeof($r)>0)
|
70 |
{
|
71 |
+
$this->result=true;
|
72 |
+
$this->blocked_ip=$this->ip_str_array[$i];
|
73 |
+
if(isset($sfw_log[$this->ip_str_array[$i]]))
|
74 |
+
{
|
75 |
+
$sfw_log[$this->ip_str_array[$i]]['all']++;
|
76 |
+
}
|
77 |
+
else
|
78 |
+
{
|
79 |
+
$sfw_log[$this->ip_str_array[$i]] = Array('datetime'=>time(), 'all' => 1, 'allow' => 0);
|
80 |
+
}
|
81 |
}
|
82 |
else
|
83 |
{
|
84 |
+
//$sfw_log[$this->ip_str]['allow']++;
|
85 |
+
//@setcookie ('ct_sfw_pass_key', md5($this->ip_str.$ct_options['apikey']), 0, "/");
|
86 |
+
$passed_ip = $this->ip_str_array[$i];
|
87 |
}
|
88 |
+
//if($this->result)break;
|
89 |
}
|
90 |
+
if($passed_ip!='')
|
91 |
{
|
92 |
+
@setcookie ('ct_sfw_pass_key', md5($passed_ip.$ct_options['apikey']), 0, "/");
|
|
|
93 |
}
|
94 |
$ct_data['sfw_log'] = $sfw_log;
|
95 |
update_option('cleantalk_data', $ct_data);
|
99 |
{
|
100 |
global $ct_options, $ct_data;
|
101 |
$sfw_die_page=file_get_contents(dirname(__FILE__)."/sfw_die_page.html");
|
102 |
+
$sfw_die_page=str_replace("{REMOTE_ADDRESS}",$this->blocked_ip,$sfw_die_page);
|
103 |
$sfw_die_page=str_replace("{REQUEST_URI}",$_SERVER['REQUEST_URI'],$sfw_die_page);
|
104 |
+
$sfw_die_page=str_replace("{SFW_COOKIE}",md5($this->blocked_ip.$ct_options['apikey']),$sfw_die_page);
|
105 |
@header('HTTP/1.0 403 Forbidden');
|
106 |
wp_die( $sfw_die_page, "Blacklisted", Array('response'=>403) );
|
107 |
}
|
inc/cleantalk-users-checkspam.js
CHANGED
@@ -212,6 +212,7 @@ jQuery("#ct_check_users_button").click(function(){
|
|
212 |
jQuery('#ct_check_users_table').hide();
|
213 |
jQuery('#ct_delete_all_users').hide();
|
214 |
jQuery('#ct_delete_checked_users').hide();
|
|
|
215 |
working=true;
|
216 |
ct_show_users_info();
|
217 |
});
|
212 |
jQuery('#ct_check_users_table').hide();
|
213 |
jQuery('#ct_delete_all_users').hide();
|
214 |
jQuery('#ct_delete_checked_users').hide();
|
215 |
+
jQuery('#ct_preloader').show();
|
216 |
working=true;
|
217 |
ct_show_users_info();
|
218 |
});
|
inc/cleantalk-users.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
add_action('admin_menu', 'ct_add_users_menu');
|
4 |
|
5 |
function ct_add_users_menu()
|
@@ -16,7 +15,7 @@ function ct_show_users_page()
|
|
16 |
<div class="wrap">
|
17 |
<h2><?php _e("Anti-spam by CleanTalk", 'cleantalk'); ?></h2><br />
|
18 |
<?php
|
19 |
-
|
20 |
'meta_query' => array(
|
21 |
'relation' => 'AND',
|
22 |
Array(
|
@@ -30,28 +29,25 @@ function ct_show_users_page()
|
|
30 |
'compare' => 'NOT EXISTS'
|
31 |
)
|
32 |
)
|
33 |
-
)
|
34 |
-
$
|
35 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
'meta_query' => array(
|
37 |
Array(
|
38 |
'key' => 'ct_marked_as_spam',
|
39 |
'compare' => 'EXISTS'
|
40 |
)
|
41 |
)
|
42 |
-
)
|
43 |
-
$
|
44 |
-
|
45 |
-
{
|
46 |
-
?>
|
47 |
-
</div>
|
48 |
-
<?php
|
49 |
-
}
|
50 |
-
?>
|
51 |
-
<?php
|
52 |
-
//print '<button class="button" id="ct_insert_users">Insert users</button><br />';
|
53 |
?>
|
54 |
-
|
55 |
<div id="ct_working_message" style="margin:auto;padding:3px;width:70%;border:2px dotted gray;display:none;background:#ffff99;">
|
56 |
<?php _e("Please wait for a while. CleanTalk is checking all users via blacklist database at cleantalk.org. You will have option to delete found spam users after plugin finish.", 'cleantalk'); ?>
|
57 |
</div>
|
@@ -63,18 +59,8 @@ function ct_show_users_page()
|
|
63 |
?>
|
64 |
</div>
|
65 |
<h3 id="ct_checking_users_status" style="text-align:center;width:90%;"></h3>
|
|
|
66 |
<?php
|
67 |
-
$args_spam = array(
|
68 |
-
'meta_query' => array(
|
69 |
-
Array(
|
70 |
-
'key' => 'ct_marked_as_spam',
|
71 |
-
'compare' => 'EXISTS'
|
72 |
-
)
|
73 |
-
)
|
74 |
-
);
|
75 |
-
$cnt_spam=sizeof(get_users($args_spam));
|
76 |
-
|
77 |
-
|
78 |
$page=1;
|
79 |
if(isset($_GET['spam_page']))
|
80 |
{
|
@@ -93,7 +79,7 @@ function ct_show_users_page()
|
|
93 |
);
|
94 |
|
95 |
$c_spam=get_users($args_spam);
|
96 |
-
if($
|
97 |
{
|
98 |
?>
|
99 |
<table class="widefat fixed comments" id="ct_check_users_table">
|
@@ -168,25 +154,14 @@ function ct_show_users_page()
|
|
168 |
</tr>
|
169 |
<?php
|
170 |
}
|
171 |
-
$
|
172 |
-
'meta_query' => array(
|
173 |
-
Array(
|
174 |
-
'key' => 'ct_marked_as_spam',
|
175 |
-
'value' => '1',
|
176 |
-
'compare' => 'NUMERIC'
|
177 |
-
)
|
178 |
-
|
179 |
-
)
|
180 |
-
);
|
181 |
-
$cnt_spam=sizeof(get_users($args_spam));
|
182 |
-
if($cnt_spam>30)
|
183 |
{
|
184 |
?>
|
185 |
<tr class="comment even thread-even depth-1 approved">
|
186 |
<td colspan="4">
|
187 |
<?php
|
188 |
|
189 |
-
$pages=ceil(intval($
|
190 |
for($i=1;$i<=$pages;$i++)
|
191 |
{
|
192 |
if($i==$page)
|
@@ -214,7 +189,7 @@ function ct_show_users_page()
|
|
214 |
<br /><br />
|
215 |
<div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?>
|
216 |
<?php
|
217 |
-
if($
|
218 |
{
|
219 |
print "<br />
|
220 |
There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.<br /><br />";
|
@@ -295,7 +270,7 @@ function ct_ajax_check_users()
|
|
295 |
}
|
296 |
else
|
297 |
{
|
298 |
-
$data[]='
|
299 |
}
|
300 |
$data[]=$u[$i]->data->user_email;
|
301 |
}
|
@@ -336,12 +311,12 @@ function ct_ajax_check_users()
|
|
336 |
{
|
337 |
$uip='127.0.0.1';
|
338 |
}
|
339 |
-
|
340 |
$uim=$u[$i]->data->user_email;
|
341 |
if(empty($uim))continue;
|
342 |
|
343 |
//print "uip: $uip, uim: $uim\n";
|
344 |
-
if($result->data->$uip->appears==1
|
345 |
{
|
346 |
update_user_meta($u[$i]->ID,'ct_marked_as_spam','1',true);
|
347 |
}
|
@@ -361,42 +336,18 @@ add_action( 'wp_ajax_ajax_info_users', 'ct_ajax_info_users' );
|
|
361 |
function ct_ajax_info_users()
|
362 |
{
|
363 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
);
|
375 |
-
|
376 |
-
$cnt_spam=sizeof(get_users($args_spam));
|
377 |
-
|
378 |
-
$args_checked1=array(
|
379 |
-
'meta_query' => array(
|
380 |
-
Array(
|
381 |
-
'key' => 'ct_hash',
|
382 |
-
'compare' => 'EXISTS'
|
383 |
-
)
|
384 |
-
)
|
385 |
-
);
|
386 |
-
$args_checked2=array(
|
387 |
-
'meta_query' => array(
|
388 |
-
Array(
|
389 |
-
'key' => 'ct_checked',
|
390 |
-
'compare' => 'EXISTS'
|
391 |
-
)
|
392 |
-
)
|
393 |
-
);
|
394 |
-
|
395 |
-
$cnt_checked1=sizeof(get_users($args_checked1));
|
396 |
-
$cnt_checked2=sizeof(get_users($args_checked2));
|
397 |
-
$cnt_checked=$cnt_checked1+$cnt_checked2;
|
398 |
|
399 |
-
printf (__("Total users %s, checked %s, found %s spam users.", 'cleantalk'), $cnt, $cnt_checked, $
|
400 |
die();
|
401 |
}
|
402 |
|
@@ -483,5 +434,5 @@ function ct_ajax_clear_users()
|
|
483 |
global $wpdb;
|
484 |
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
485 |
die();
|
486 |
-
}
|
487 |
?>
|
1 |
<?php
|
|
|
2 |
add_action('admin_menu', 'ct_add_users_menu');
|
3 |
|
4 |
function ct_add_users_menu()
|
15 |
<div class="wrap">
|
16 |
<h2><?php _e("Anti-spam by CleanTalk", 'cleantalk'); ?></h2><br />
|
17 |
<?php
|
18 |
+
/*$args_unchecked = array(
|
19 |
'meta_query' => array(
|
20 |
'relation' => 'AND',
|
21 |
Array(
|
29 |
'compare' => 'NOT EXISTS'
|
30 |
)
|
31 |
)
|
32 |
+
);*/
|
33 |
+
global $wpdb;
|
34 |
+
$r=$wpdb->get_results("select distinct count($wpdb->users.ID) as cnt from $wpdb->users inner join $wpdb->usermeta on $wpdb->users.ID=$wpdb->usermeta.user_id where $wpdb->usermeta.meta_key='ct_checked' or $wpdb->usermeta.meta_key='ct_hash';");
|
35 |
+
$cnt_checked=$r[0]->cnt;
|
36 |
+
$r=$wpdb->get_results("select count(ID) as cnt from $wpdb->users;");
|
37 |
+
$cnt_all=$r[0]->cnt;
|
38 |
+
|
39 |
+
$cnt_unchecked=$cnt_all-$cnt_checked;
|
40 |
+
/*$args_spam = array(
|
41 |
'meta_query' => array(
|
42 |
Array(
|
43 |
'key' => 'ct_marked_as_spam',
|
44 |
'compare' => 'EXISTS'
|
45 |
)
|
46 |
)
|
47 |
+
);*/
|
48 |
+
$r=$wpdb->get_results("select distinct count($wpdb->users.ID) as cnt from $wpdb->users inner join $wpdb->usermeta on $wpdb->users.ID=$wpdb->usermeta.user_id where $wpdb->usermeta.meta_key='ct_marked_as_spam';", ARRAY_A);
|
49 |
+
$cnt_spam1=$r[0]['cnt'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
?>
|
|
|
51 |
<div id="ct_working_message" style="margin:auto;padding:3px;width:70%;border:2px dotted gray;display:none;background:#ffff99;">
|
52 |
<?php _e("Please wait for a while. CleanTalk is checking all users via blacklist database at cleantalk.org. You will have option to delete found spam users after plugin finish.", 'cleantalk'); ?>
|
53 |
</div>
|
59 |
?>
|
60 |
</div>
|
61 |
<h3 id="ct_checking_users_status" style="text-align:center;width:90%;"></h3>
|
62 |
+
<div style="text-align:center;width:100%;display:none;" id="ct_preloader"><img border=0 src="<?php print plugin_dir_url(__FILE__); ?>images/preloader.gif" /></div>
|
63 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
$page=1;
|
65 |
if(isset($_GET['spam_page']))
|
66 |
{
|
79 |
);
|
80 |
|
81 |
$c_spam=get_users($args_spam);
|
82 |
+
if($cnt_spam1>0)
|
83 |
{
|
84 |
?>
|
85 |
<table class="widefat fixed comments" id="ct_check_users_table">
|
154 |
</tr>
|
155 |
<?php
|
156 |
}
|
157 |
+
if($cnt_spam1>30)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
{
|
159 |
?>
|
160 |
<tr class="comment even thread-even depth-1 approved">
|
161 |
<td colspan="4">
|
162 |
<?php
|
163 |
|
164 |
+
$pages=ceil(intval($cnt_spam1)/30);
|
165 |
for($i=1;$i<=$pages;$i++)
|
166 |
{
|
167 |
if($i==$page)
|
189 |
<br /><br />
|
190 |
<div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?>
|
191 |
<?php
|
192 |
+
if($cnt_spam1>0)
|
193 |
{
|
194 |
print "<br />
|
195 |
There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.<br /><br />";
|
270 |
}
|
271 |
else
|
272 |
{
|
273 |
+
$data[]='8.8.8.8';
|
274 |
}
|
275 |
$data[]=$u[$i]->data->user_email;
|
276 |
}
|
311 |
{
|
312 |
$uip='127.0.0.1';
|
313 |
}
|
314 |
+
if($uip=='127.0.0.1')continue;
|
315 |
$uim=$u[$i]->data->user_email;
|
316 |
if(empty($uim))continue;
|
317 |
|
318 |
//print "uip: $uip, uim: $uim\n";
|
319 |
+
if(isset($result->data->$uip) && $result->data->$uip->appears==1 || isset($result->data->$uim) && $result->data->$uim->appears==1)
|
320 |
{
|
321 |
update_user_meta($u[$i]->ID,'ct_marked_as_spam','1',true);
|
322 |
}
|
336 |
function ct_ajax_info_users()
|
337 |
{
|
338 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
339 |
+
global $wpdb;
|
340 |
+
$r=$wpdb->get_results("select distinct count($wpdb->users.ID) as cnt from $wpdb->users inner join $wpdb->usermeta on $wpdb->users.ID=$wpdb->usermeta.user_id where $wpdb->usermeta.meta_key='ct_checked' or $wpdb->usermeta.meta_key='ct_hash';");
|
341 |
+
$cnt_checked=$r[0]->cnt;
|
342 |
+
$r=$wpdb->get_results("select count(ID) as cnt from $wpdb->users;");
|
343 |
+
$cnt=$r[0]->cnt;
|
344 |
+
|
345 |
+
$cnt_unchecked=$cnt_all-$cnt_checked;
|
346 |
+
|
347 |
+
$r=$wpdb->get_results("select distinct count($wpdb->users.ID) as cnt from $wpdb->users inner join $wpdb->usermeta on $wpdb->users.ID=$wpdb->usermeta.user_id where $wpdb->usermeta.meta_key='ct_marked_as_spam';", ARRAY_A);
|
348 |
+
$cnt_spam1=$r[0]['cnt'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
|
350 |
+
printf (__("Total users %s, checked %s, found %s spam users.", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam1);
|
351 |
die();
|
352 |
}
|
353 |
|
434 |
global $wpdb;
|
435 |
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
436 |
die();
|
437 |
+
}
|
438 |
?>
|
inc/cleantalk_nocache.js
CHANGED
@@ -130,4 +130,80 @@ if(ct_nocache_executed==undefined)
|
|
130 |
//alert('set!');
|
131 |
sendRequest(ct_ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
}
|
130 |
//alert('set!');
|
131 |
sendRequest(ct_ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');
|
132 |
}
|
133 |
+
|
134 |
+
if(ct_info_flag)
|
135 |
+
{
|
136 |
+
|
137 |
+
var cleantalk_user_info={};
|
138 |
+
|
139 |
+
var cleantalk_screen_info={};
|
140 |
+
for(var prop in screen)
|
141 |
+
{
|
142 |
+
if (navigator[prop] instanceof Object || screen[prop]==='') continue
|
143 |
+
cleantalk_screen_info[prop]=screen[prop];
|
144 |
+
}
|
145 |
+
|
146 |
+
cleantalk_user_info.screen=cleantalk_screen_info;
|
147 |
+
|
148 |
+
var cleantalk_plugins=Array();
|
149 |
+
var prev
|
150 |
+
var cnt=0;
|
151 |
+
for(var i=0;i<navigator.plugins.length;i++)
|
152 |
+
{
|
153 |
+
var plugin = navigator.plugins[i];
|
154 |
+
var plugin = plugin.name+" "+(plugin.version || '')
|
155 |
+
if (prev == plugin ) continue;
|
156 |
+
cleantalk_plugins[cnt]=plugin;
|
157 |
+
cnt++;
|
158 |
+
prev = plugin
|
159 |
+
}
|
160 |
+
cleantalk_user_info.plugins=cleantalk_plugins;
|
161 |
+
|
162 |
+
cleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;
|
163 |
+
cleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);
|
164 |
+
|
165 |
+
cleantalk_user_info.browser_x=document.documentElement.clientWidth;
|
166 |
+
cleantalk_user_info.browser_y=document.documentElement.clientHeight;
|
167 |
+
|
168 |
+
var ua = navigator.userAgent.toLowerCase();
|
169 |
+
var flashInstalled = 0;
|
170 |
+
if (typeof(navigator.plugins)!="undefined"&&typeof(navigator.plugins["Shockwave Flash"])=="object")
|
171 |
+
{
|
172 |
+
flashInstalled = 1;
|
173 |
+
}
|
174 |
+
else if (typeof window.ActiveXObject != "undefined")
|
175 |
+
{
|
176 |
+
try
|
177 |
+
{
|
178 |
+
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))
|
179 |
+
{
|
180 |
+
flashInstalled = 1;
|
181 |
+
}
|
182 |
+
} catch(e) {};
|
183 |
+
};
|
184 |
+
|
185 |
+
cleantalk_user_info.is_flash=flashInstalled;
|
186 |
+
|
187 |
+
isVisitedMain=-1;
|
188 |
+
if(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')
|
189 |
+
{
|
190 |
+
isVisitedMain=1;
|
191 |
+
setTimeout(function() { document.cookie = "ct_visited_main = 1; path = /;"}, 500);
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
ct_visited_main = ct_getCookie('ct_visited_main');
|
196 |
+
if(ct_visited_main==undefined && isVisitedMain==-1)
|
197 |
+
{
|
198 |
+
isVisitedMain=0;
|
199 |
+
}
|
200 |
+
else
|
201 |
+
{
|
202 |
+
isVisitedMain=1;
|
203 |
+
}
|
204 |
+
|
205 |
+
cleantalk_user_info.is_main=isVisitedMain;
|
206 |
+
|
207 |
+
setTimeout(function() { document.cookie = "ct_user_info = "+escape(JSON.stringify(cleantalk_user_info))+"; path = /;"}, 500);
|
208 |
+
}
|
209 |
}
|
inc/images/preloader.gif
ADDED
Binary file
|
readme.txt
CHANGED
@@ -27,7 +27,7 @@ No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam b
|
|
27 |
> *Oliver Dale. <a href="http://wplift.com/wordpress-anti-spam-plugin" target="_blank">WPLift.com</a>.*
|
28 |
|
29 |
= Comments spam protection =
|
30 |
-
Supports native WordPress, JetPack comments and any other comments plugins. Plugin moves spam comments to SPAM folder or set option to silent ban spam comments.
|
31 |
|
32 |
= Spam bots registrations filter =
|
33 |
Filers spam bots on registrations forms WordPress, BuddyPress, bbPress, S2Member, WooCommerce, Profile builder and any other registrations plugins.
|
@@ -62,6 +62,24 @@ With the help of anti-spam by CleanTalk you can check existing comments, to fin
|
|
62 |
= Low false/positive rate =
|
63 |
This plugin uses multiple anti-spam tests to filter spam bots with lower false/positive rate as possible. Multiple anti-spam tests avoid false/positive blocks for real website visitors even if one of the tests failed.
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
= Spam attacks log =
|
66 |
Service CleanTalk (this plugin is a client application for CleanTalk anti-spam service) records all filtered comments, registration and other spam attacks in the "Log of spam attacks" and stores the data in the log up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
|
67 |
|
@@ -119,6 +137,29 @@ The most popular method is CAPTCHA - the annoying picture with curved and slopin
|
|
119 |
Sometimes CAPTCHA reminds doodle 2x year old child. For users with vision problems captcha is just an insurmountable obstacle. Users hate captcha. Captcha for users means "hate". Unreadable CAPTCHA stops about 80% of site visitors. After 2 failed attempts to bring it up to 95% reject further attempts.
|
120 |
At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource both from bots and visitors. CAPTCHA is not a panacea from spam. Doubts Concerning the Need for CAPTCHA?
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
= We recommend =
|
123 |
Audience engagement plugin <a href="http://wordpress.org/plugins/feedweb/">Feedweb</a>
|
124 |
|
@@ -375,10 +416,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
|
|
375 |
|
376 |
== Changelog ==
|
377 |
= 5.33.1 2015-12-04 =
|
378 |
-
* Fixed issue with BBPress
|
379 |
-
* Fixed anti-spam comments checking
|
380 |
-
* Fixed bulk checking
|
381 |
-
* Fixed trackback and pingback checking
|
382 |
|
383 |
= 5.33 2015-12-01 =
|
384 |
* Backend interface fixes
|
@@ -891,10 +932,10 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
|
|
891 |
|
892 |
== Upgrade Notice ==
|
893 |
= 5.33.1 2015-12-04 =
|
894 |
-
* Fixed issue with BBPress
|
895 |
-
* Fixed anti-spam comments checking
|
896 |
-
* Fixed bulk checking
|
897 |
-
* Fixed trackback and pingback checking
|
898 |
|
899 |
= 5.33 2015-12-01 =
|
900 |
* Backend interface fixes
|
@@ -903,7 +944,7 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
|
|
903 |
|
904 |
= 5.32 2015-11-26 =
|
905 |
* Added improvements for manual spam detection
|
906 |
-
* Fixed errors in backend
|
907 |
* Fixed bulk users anti spam checking
|
908 |
* Added indicator for bulk spam checking
|
909 |
* Added "Get access key automatically" feature
|
27 |
> *Oliver Dale. <a href="http://wplift.com/wordpress-anti-spam-plugin" target="_blank">WPLift.com</a>.*
|
28 |
|
29 |
= Comments spam protection =
|
30 |
+
Supports native WordPress, JetPack comments and any other comments plugins. Plugin moves spam comments to SPAM folder or set option to silent ban spam comments. You can enable option in plugin settings to auto delete comments from SPAM folder.
|
31 |
|
32 |
= Spam bots registrations filter =
|
33 |
Filers spam bots on registrations forms WordPress, BuddyPress, bbPress, S2Member, WooCommerce, Profile builder and any other registrations plugins.
|
62 |
= Low false/positive rate =
|
63 |
This plugin uses multiple anti-spam tests to filter spam bots with lower false/positive rate as possible. Multiple anti-spam tests avoid false/positive blocks for real website visitors even if one of the tests failed.
|
64 |
|
65 |
+
= CleanTalk works faster than most of the other anti-spam plugins =
|
66 |
+
Everyone knows about why the faster your site loads, the better your customer experience is, the higher your Pagerank will be, and the higher your site will convert. Speed is becoming increasingly important in Search Engine Optimization , conversion and user experience. Today, site speed is one of the most important ranking factors on Google. A site that loads slowly will lose visitors and potential revenue.
|
67 |
+
|
68 |
+
There are different ways of improving your site's loading performance, an important parameter for the performance site to install well-developed plugins from a reputable source.
|
69 |
+
|
70 |
+
Among anti spam plugins CleanTalk Anti Spam is one of the fastest. Despite the large plug-in functionality, the developers manage to optimize the performance of the plugin so that CleanTalk faster than most analogs. This contributes to the cloud service architecture, as all calculations take place in the cloud, not on the server, the server receives the finished result for further action.
|
71 |
+
|
72 |
+
https://s.w.org/plugins/cleantalk-spam-protect/screenshot-5.png?r=1288723
|
73 |
+
|
74 |
+
= How CleanTalk works? =
|
75 |
+
* A visitor writes a comment or registers.
|
76 |
+
* CleanTalk plugin sends action parameters into the CleanTalk cloud
|
77 |
+
* Service analyzes the parameters.
|
78 |
+
* If this is a visitor, the comment will be published. If it’s a spam bot, then CleanTalk blocks this comment or registering.
|
79 |
+
* Parameters are written to the log which can be viewed in the Control Panel service.
|
80 |
+
|
81 |
+
The team CleanTalk has been developing a cloud spam protection system for 5 years and has created a truly reliable anti spam service designed for you to ensure your safety.
|
82 |
+
|
83 |
= Spam attacks log =
|
84 |
Service CleanTalk (this plugin is a client application for CleanTalk anti-spam service) records all filtered comments, registration and other spam attacks in the "Log of spam attacks" and stores the data in the log up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
|
85 |
|
137 |
Sometimes CAPTCHA reminds doodle 2x year old child. For users with vision problems captcha is just an insurmountable obstacle. Users hate captcha. Captcha for users means "hate". Unreadable CAPTCHA stops about 80% of site visitors. After 2 failed attempts to bring it up to 95% reject further attempts.
|
138 |
At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource both from bots and visitors. CAPTCHA is not a panacea from spam. Doubts Concerning the Need for CAPTCHA?
|
139 |
|
140 |
+
*“Ultimately, Captchas are useless for spam because they’re designed to tell you if someone is ‘human’ or not, but not whether something is spam or not.” Matt Mullenweg*
|
141 |
+
|
142 |
+
You do not have to work in IT to know what spam is. Besides piles of unwanted e-mail, there are spam bots, or special software programs designed to act as human Web site visitors that are posting unwelcome messages over the Internet to advertise dubious services, while more often spammer messages do not even make much sense. Similarly to bacteria and viruses mutations developing antibiotic resistance in real world, spam bots are becoming more resilient penetrating Internet firewalls and security layers.
|
143 |
+
|
144 |
+
*Why are they spamming me?*
|
145 |
+
|
146 |
+
Spammers want to get backlinks from your site to improve their site's PageRank or redirect your visitors to malicious sites.This level of spam can damage your reputation with readers and commentators if you fail to tackle it. It is not uncommon for some WordPress websites to receive hundreds or even thousands of comments every week. However, by using a CleanTalk plugin, spam can be easily handled by your WordPress website.
|
147 |
+
|
148 |
+
= CleanTalk's features =
|
149 |
+
CleanTalk one of the fastest plug-in that allows you to lower the server load. One of the important parameters for each Web master is the speed of the site, so we make sure that our plug-in to consume as little as possible of server resources. Cloud service provides the advantage that all the checks take place in the cloud.
|
150 |
+
|
151 |
+
The CleanTalk company developed unique algorithms to assess the behavior of the visitor. CleanTalk analyzes user behavior and parameter of the filled out form. Anti spam module, installed on the website, sends the behaviour parameters of the visitor or spam bot. These parameters are estimated, and service makes a decision – to post a message or to define it as spam and reject. On the basis of such checks, the service forms its own list of email addresses used by spam bots. Likewise the registrations of visitors are checked. The service adds not only email addresses to the blacklist, but also IP addresses and domains of the websites that are promoted through spam mailout. All of this happens automatically and requires no action from the administration of the website. At 2.5 million queries the service makes a mistake in 40-45 cases, i.e. CleanTalk detects spam with 99.9982% accuracy. We constantly monitor these errors and make adjustments to our algorithms”, so the team is aiming to improve those figures over time.
|
152 |
+
|
153 |
+
All-in-one. CleanTalk immediately protects all forms – comments, registration, feedback, contacts. No need to install additional plug-ins for each form. You get save resources and increase performance of your website.
|
154 |
+
|
155 |
+
Spam attacks log. Service CleanTalk records all filtered comments, registration and other spam attacks in the “Log of spam attacks” and stores the data in the log up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
|
156 |
+
|
157 |
+
With the help of anti-spam by CleanTalk you can check existing comments and users, to find and quickly delete spam comments at once. This allows administrators of the Web sites automatically to check and identify spam bots, comments and users, which were not detected by conventional anti-spam tools. Checking existing comments and users is made on the basis of the nearly 2 million of certain spam bots. Detailed statistic allows CleanTalk customers to control the whole process.
|
158 |
+
|
159 |
+
CleanTalk has got an advanced option “Spam FireWall”, this option allows blocking the most active spam bots before they get access to web site. It prevents loading of pages of the web site by spam bots, so your web server doesn’t need perform all scripts on these pages. Also it prevents scanning of pages of the web site spam bots. Therefore Spam FireWall significantly can reduce the load on your web server. Spam FireWall can mitigate HTTP/HTTPS DDoS attacks. When an intruder makes GET requests to attack your website. Spam FireWall blocks all requests from bad IP addresses. Your website gives infringer a special page with description of DDoS rejection instead of the website pages. Therefore Spam FireWall can help to reduce of CPU usage on your server.
|
160 |
+
|
161 |
+
“CleanTalk team has been developing a cloud spam protection system for four years and has created a truly reliable anti-spam service designed for you to guarantee your safety”.
|
162 |
+
|
163 |
= We recommend =
|
164 |
Audience engagement plugin <a href="http://wordpress.org/plugins/feedweb/">Feedweb</a>
|
165 |
|
416 |
|
417 |
== Changelog ==
|
418 |
= 5.33.1 2015-12-04 =
|
419 |
+
* Fixed issue with BBPress: restored old user permission checking mechanism
|
420 |
+
* Fixed anti-spam comments checking: sometimes get_comments returned wrong comments number
|
421 |
+
* Fixed bulk checking: made numeric indexes in users and comments arrays
|
422 |
+
* Fixed trackback and pingback checking: removed exception for checking
|
423 |
|
424 |
= 5.33 2015-12-01 =
|
425 |
* Backend interface fixes
|
932 |
|
933 |
== Upgrade Notice ==
|
934 |
= 5.33.1 2015-12-04 =
|
935 |
+
* Fixed issue with BBPress
|
936 |
+
* Fixed anti-spam comments checking
|
937 |
+
* Fixed bulk checking
|
938 |
+
* Fixed trackback and pingback checking
|
939 |
|
940 |
= 5.33 2015-12-01 =
|
941 |
* Backend interface fixes
|
944 |
|
945 |
= 5.32 2015-11-26 =
|
946 |
* Added improvements for manual spam detection
|
947 |
+
* Fixed errors in backend
|
948 |
* Fixed bulk users anti spam checking
|
949 |
* Added indicator for bulk spam checking
|
950 |
* Added "Get access key automatically" feature
|