Version Description
April 17 2017 = * Fix for the dashboard spam statistics widget. * Fix for users spam check. * Small appearance changes.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.62 |
Comparing to | |
See all releases |
Code changes from version 5.61 to 5.62
- assets/css/cleantalk-admin.css +9 -7
- assets/css/cleantalk-dashboard-widget.css +18 -2
- assets/js/cleantalk-admin-settings-page.js +1 -1
- assets/js/{cleantalk-admin-notices.js → cleantalk-admin.js} +0 -0
- assets/js/cleantalk-dashboard-widget.js +4 -3
- cleantalk.php +3 -3
- inc/cleantalk-admin.php +21 -12
- inc/cleantalk-users-checkspam.js +1 -1
- inc/cleantalk-users.php +47 -30
- inc/cleantalk.class.php +21 -21
- readme.txt +11 -1
assets/css/cleantalk-admin.css
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
.ct_meta_links{
|
2 |
|
3 |
}
|
4 |
-
.
|
5 |
-
.
|
6 |
-
.
|
7 |
-
|
8 |
-
|
9 |
-
.
|
10 |
-
.
|
|
|
|
1 |
.ct_meta_links{
|
2 |
|
3 |
}
|
4 |
+
.ct_translate_links{color: rgba(150, 150, 20, 1);}
|
5 |
+
.ct_support_links {color: rgba(150, 20, 20, 1);}
|
6 |
+
.ct_faq_links {color: rgba(20, 150, 20, 1);}
|
7 |
+
.ct_setting_links {color: rgba(20, 20, 150, 1);}
|
8 |
+
|
9 |
+
.ct_translate_links:hover{color: rgba(210, 210, 20, 1) !important;}
|
10 |
+
.ct_support_links:hover {color: rgba(250, 20, 20, 1) !important;}
|
11 |
+
.ct_faq_links :hover {color: rgba(20, 250, 20, 1) !important;}
|
12 |
+
.ct_setting_links:hover {color: rgba(20, 20, 250, 1) !important;}
|
assets/css/cleantalk-dashboard-widget.css
CHANGED
@@ -92,5 +92,21 @@
|
|
92 |
margin-right: 1em;
|
93 |
vertical-align: middle;
|
94 |
}
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
margin-right: 1em;
|
93 |
vertical-align: middle;
|
94 |
}
|
95 |
+
#ct_widget_button_view_all{
|
96 |
+
cursor: pointer;
|
97 |
+
border: 1px solid #0074a2;
|
98 |
+
-webkit-appearance: none;
|
99 |
+
-webkit-border-radius: 2px;
|
100 |
+
border-radius: 2px;
|
101 |
+
white-space: nowrap;
|
102 |
+
-webkit-box-sizing: border-box;
|
103 |
+
-moz-box-sizing: border-box;
|
104 |
+
box-sizing: border-box;
|
105 |
+
background: #2ea2cc;
|
106 |
+
background: #0085ba;
|
107 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
108 |
+
box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
109 |
+
color: #fff;
|
110 |
+
}
|
111 |
+
#ct_widget_button_view_all:hover{color: #000 !important;}
|
112 |
+
|
assets/js/cleantalk-admin-settings-page.js
CHANGED
@@ -24,7 +24,7 @@ jQuery(document).ready(function(){
|
|
24 |
jQuery('.form-table').first().hide();
|
25 |
|
26 |
banner_html="<div id='ct_stats_banner'>"+cleantalk_blocked_message;
|
27 |
-
banner_html+=cleantalk_statistics_link+'</div>';
|
28 |
jQuery('.form-table').first().before(banner_html);
|
29 |
if(!cleantalk_wpmu)
|
30 |
{
|
24 |
jQuery('.form-table').first().hide();
|
25 |
|
26 |
banner_html="<div id='ct_stats_banner'>"+cleantalk_blocked_message;
|
27 |
+
banner_html+=cleantalk_statistics_link+" "+cleantalk_support_link+'</div>';
|
28 |
jQuery('.form-table').first().before(banner_html);
|
29 |
if(!cleantalk_wpmu)
|
30 |
{
|
assets/js/{cleantalk-admin-notices.js → cleantalk-admin.js}
RENAMED
File without changes
|
assets/js/cleantalk-dashboard-widget.js
CHANGED
@@ -15,10 +15,11 @@ jQuery(document).ready(function(){
|
|
15 |
|
16 |
|
17 |
// Chart
|
18 |
-
var ct_chart = jQuery("#ct_widget_chart")
|
19 |
-
|
|
|
20 |
function ctParseData(date){
|
21 |
-
var date_formatter = new Intl.DateTimeFormat(
|
22 |
month: "short",
|
23 |
day: "numeric"
|
24 |
});
|
15 |
|
16 |
|
17 |
// Chart
|
18 |
+
var ct_chart = jQuery("#ct_widget_chart"),
|
19 |
+
locale = navigator.language || navigator.userLanguage;
|
20 |
+
|
21 |
function ctParseData(date){
|
22 |
+
var date_formatter = new Intl.DateTimeFormat(locale, {
|
23 |
month: "short",
|
24 |
day: "numeric"
|
25 |
});
|
cleantalk.php
CHANGED
@@ -3,12 +3,12 @@
|
|
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.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
-
$cleantalk_plugin_version='5.
|
11 |
-
$ct_agent_version = 'wordpress-
|
12 |
$cleantalk_executed=false;
|
13 |
$ct_sfw_updated = false;
|
14 |
|
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.62
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
+
$cleantalk_plugin_version='5.62';
|
11 |
+
$ct_agent_version = 'wordpress-562';
|
12 |
$cleantalk_executed=false;
|
13 |
$ct_sfw_updated = false;
|
14 |
|
inc/cleantalk-admin.php
CHANGED
@@ -12,15 +12,17 @@ $ct_server_timeout = 10;
|
|
12 |
|
13 |
//Adding widjet
|
14 |
function ct_dashboard_statistics_widget() {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
24 |
}
|
25 |
|
26 |
// Outputs statistics widget content
|
@@ -103,7 +105,7 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
|
|
103 |
if(!empty($ct_data['user_token'])){
|
104 |
?>
|
105 |
<a target='_blank' href='https://cleantalk.org/my?user_token=<?php echo $ct_data['user_token']; ?>&cp_mode=antispam'>
|
106 |
-
<input class='ct_widget_button' type='button' value='View all'>
|
107 |
</a>
|
108 |
<?php
|
109 |
}
|
@@ -196,7 +198,7 @@ function ct_enqueue_scripts($hook) {
|
|
196 |
//*/
|
197 |
|
198 |
// Scripts to all admin pages
|
199 |
-
wp_enqueue_script('ct_admin_js_notices', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-admin
|
200 |
wp_enqueue_style ('ct_admin_css', plugins_url('/cleantalk-spam-protect/assets/css/cleantalk-admin.css'), array(), $cleantalk_plugin_version, 'all');
|
201 |
|
202 |
// Scripts & Styles to main dashboard page
|
@@ -912,7 +914,9 @@ function ct_input_apikey() {
|
|
912 |
{
|
913 |
echo "<script>var cleantalk_blocked_message=\"\";\n";
|
914 |
}
|
915 |
-
echo "var cleantalk_statistics_link=\"<a class='cleantalk_manual_link' target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."&cp_mode=antispam'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>\";
|
|
|
|
|
916 |
</script>";
|
917 |
|
918 |
$value = $ct_options['apikey'];
|
@@ -1836,6 +1840,11 @@ function ct_register_plugin_links($links, $file) {
|
|
1836 |
// ? '<a class="ct_meta_links ct_setting_links" href="settings.php?page=cleantalk">' . __( 'Settings' ) . '</a>'
|
1837 |
// : '<a class="ct_meta_links ct_setting_links" href="options-general.php?page=cleantalk">' . __( 'Settings' ) . '</a>';
|
1838 |
|
|
|
|
|
|
|
|
|
|
|
1839 |
$links[] = '<a class="ct_meta_links ct_faq_links" href="http://wordpress.org/plugins/cleantalk-spam-protect/faq/" target="_blank">' . __( 'FAQ','cleantalk' ) . '</a>';
|
1840 |
$links[] = '<a class="ct_meta_links ct_support_links"href="https://wordpress.org/support/plugin/cleantalk-spam-protect" target="_blank">' . __( 'Support','cleantalk' ) . '</a>';
|
1841 |
|
12 |
|
13 |
//Adding widjet
|
14 |
function ct_dashboard_statistics_widget() {
|
15 |
+
if(current_user_can('activate_plugins')){
|
16 |
+
$plugin_settings_link = (is_network_admin() ? "settings.php" : "options-general.php" )."?page=cleantalk";
|
17 |
+
wp_add_dashboard_widget(
|
18 |
+
'ct_dashboard_statistics_widget',
|
19 |
+
__("CleanTalk Anti-Spam Statistics")
|
20 |
+
.sprintf(__("%sConfigure%s"), "<a href='$plugin_settings_link' class='ct_widget_top_link ct_widget_settings_link'>", "</a>")
|
21 |
+
.sprintf(__("%sRefresh%s"), "<a href='#ct_widget' class='ct_widget_settings_link ct_widget_refresh_link'>", "</a>")
|
22 |
+
."<img src='".plugins_url('/cleantalk-spam-protect/inc/images/preloader.gif')."' class='ct_preloader'>",
|
23 |
+
'ct_dashboard_statistics_widget_output'
|
24 |
+
);
|
25 |
+
}
|
26 |
}
|
27 |
|
28 |
// Outputs statistics widget content
|
105 |
if(!empty($ct_data['user_token'])){
|
106 |
?>
|
107 |
<a target='_blank' href='https://cleantalk.org/my?user_token=<?php echo $ct_data['user_token']; ?>&cp_mode=antispam'>
|
108 |
+
<input class='ct_widget_button' id='ct_widget_button_view_all' type='button' value='View all'>
|
109 |
</a>
|
110 |
<?php
|
111 |
}
|
198 |
//*/
|
199 |
|
200 |
// Scripts to all admin pages
|
201 |
+
wp_enqueue_script('ct_admin_js_notices', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-admin.js'), array(), $cleantalk_plugin_version);
|
202 |
wp_enqueue_style ('ct_admin_css', plugins_url('/cleantalk-spam-protect/assets/css/cleantalk-admin.css'), array(), $cleantalk_plugin_version, 'all');
|
203 |
|
204 |
// Scripts & Styles to main dashboard page
|
914 |
{
|
915 |
echo "<script>var cleantalk_blocked_message=\"\";\n";
|
916 |
}
|
917 |
+
echo "var cleantalk_statistics_link=\"<a class='cleantalk_manual_link' target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."&cp_mode=antispam'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>\";";
|
918 |
+
echo "var cleantalk_support_link=\"<a class='cleantalk_auto_link' target='__blank' href='https://wordpress.org/support/plugin/cleantalk-spam-protect'>"
|
919 |
+
.__('Support', 'cleantalk')."</a>\";
|
920 |
</script>";
|
921 |
|
922 |
$value = $ct_options['apikey'];
|
1840 |
// ? '<a class="ct_meta_links ct_setting_links" href="settings.php?page=cleantalk">' . __( 'Settings' ) . '</a>'
|
1841 |
// : '<a class="ct_meta_links ct_setting_links" href="options-general.php?page=cleantalk">' . __( 'Settings' ) . '</a>';
|
1842 |
|
1843 |
+
$links[] = '<a class="ct_meta_links ct_translate_links" href="'
|
1844 |
+
.sprintf('https://translate.wordpress.org/locale/%s/default/wp-plugins/cleantalk-spam-protect', substr(get_locale(), 0, 2))
|
1845 |
+
.'" target="_blank">'
|
1846 |
+
.__('Translate', 'cleantalk')
|
1847 |
+
.'</a>';
|
1848 |
$links[] = '<a class="ct_meta_links ct_faq_links" href="http://wordpress.org/plugins/cleantalk-spam-protect/faq/" target="_blank">' . __( 'FAQ','cleantalk' ) . '</a>';
|
1849 |
$links[] = '<a class="ct_meta_links ct_support_links"href="https://wordpress.org/support/plugin/cleantalk-spam-protect" target="_blank">' . __( 'Support','cleantalk' ) . '</a>';
|
1850 |
|
inc/cleantalk-users-checkspam.js
CHANGED
@@ -366,7 +366,7 @@ jQuery(document).ready(function(){
|
|
366 |
if(parseInt(msg)==0)
|
367 |
alert(ctUsersCheck.ct_bad_csv);
|
368 |
else
|
369 |
-
jQuery("#ct_csv_wrapper").html("<iframe src='
|
370 |
},
|
371 |
});
|
372 |
});
|
366 |
if(parseInt(msg)==0)
|
367 |
alert(ctUsersCheck.ct_bad_csv);
|
368 |
else
|
369 |
+
jQuery("#ct_csv_wrapper").html("<iframe src='"+location.protocol+"//"+location.hostname+"/wp-content/plugins/cleantalk-spam-protect/check-results/"+ctUsersCheck.ct_csv_filename+".csv'></iframe>");
|
370 |
},
|
371 |
});
|
372 |
});
|
inc/cleantalk-users.php
CHANGED
@@ -253,19 +253,23 @@ function ct_ajax_check_users()
|
|
253 |
|
254 |
$args_unchecked = array(
|
255 |
'meta_query' => array(
|
256 |
-
|
257 |
'key' => 'ct_checked',
|
258 |
'value' => '1',
|
259 |
'compare' => 'NOT EXISTS'
|
260 |
),
|
|
|
|
|
|
|
|
|
|
|
261 |
),
|
262 |
'orderby' => 'registered',
|
263 |
'order' => 'ASC',
|
264 |
'number' => 100
|
265 |
);
|
266 |
-
|
267 |
$u = get_users($args_unchecked);
|
268 |
-
|
269 |
if(sizeof($u)>0){
|
270 |
|
271 |
foreach($u as $user_index => $user){
|
@@ -280,27 +284,30 @@ function ct_ajax_check_users()
|
|
280 |
unset($user_index, $user);
|
281 |
|
282 |
$data=Array();
|
283 |
-
for($i=0
|
284 |
-
|
285 |
$user_meta=get_user_meta($u[$i]->ID, 'session_tokens', true);
|
286 |
-
|
287 |
if(is_array($user_meta))
|
288 |
-
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
}
|
291 |
-
|
292 |
-
{
|
293 |
-
$data[]=$user_meta[0]['ip'];
|
294 |
-
$u[$i]->data->user_ip = $user_meta[0]['ip'];
|
295 |
-
} else {
|
296 |
-
$u[$i]->data->user_ip = null;
|
297 |
-
}
|
298 |
-
if (isset($u[$i]->data->user_email) && $u[$i]->data->user_email) {
|
299 |
-
$data[]=$u[$i]->data->user_email;
|
300 |
-
}
|
301 |
}
|
302 |
if(count($data) == 0){
|
303 |
-
print
|
304 |
die();
|
305 |
}
|
306 |
|
@@ -330,15 +337,16 @@ function ct_ajax_check_users()
|
|
330 |
$filename = WP_PLUGIN_DIR."/cleantalk-spam-protect/check-results/user_check_by_{$current_user->user_login}.csv";
|
331 |
$text = "";
|
332 |
|
333 |
-
if(
|
334 |
$file_desc = fopen($filename, 'w');
|
335 |
$text .= "blacklisted".PHP_EOL;
|
336 |
-
}else
|
337 |
$file_desc = fopen($filename, 'a+');
|
|
|
338 |
|
339 |
foreach($result_to_csv['data'] as $key => $value){
|
340 |
-
|
341 |
-
if(
|
342 |
$text .= "$key".PHP_EOL;
|
343 |
|
344 |
} unset($key, $value);
|
@@ -419,15 +427,19 @@ function ct_ajax_info_users($direct_call = false)
|
|
419 |
|
420 |
// Checked
|
421 |
$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';");
|
422 |
-
$cnt_checked
|
423 |
|
424 |
//Spam
|
425 |
$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);
|
426 |
-
$
|
|
|
|
|
|
|
|
|
427 |
|
428 |
-
printf (__("Total users %s, checked %s, found %s spam users", 'cleantalk'), $cnt, $cnt_checked, $
|
429 |
$backup_notice = ' ';
|
430 |
-
if ($
|
431 |
$backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk');
|
432 |
}
|
433 |
print "<p>$backup_notice</p>";
|
@@ -447,12 +459,17 @@ function ct_ajax_insert_users()
|
|
447 |
/* DELETION
|
448 |
$users = get_users(array('search' => '*user_*', 'search_columns' => array('login', 'nicename')));
|
449 |
$inserted = 0;
|
450 |
-
|
|
|
|
|
|
|
451 |
if(wp_delete_user($user->ID))
|
452 |
$inserted++;
|
|
|
453 |
//*/
|
454 |
|
455 |
$result = $wpdb->get_results("SELECT network FROM `".$wpdb->base_prefix."cleantalk_sfw` LIMIT 200;", ARRAY_A);
|
|
|
456 |
if($result){
|
457 |
$ip = array();
|
458 |
foreach($result as $value){
|
@@ -462,7 +479,7 @@ function ct_ajax_insert_users()
|
|
462 |
|
463 |
$inserted = 0;
|
464 |
$use_id = 0;
|
465 |
-
for($i=0; $i<
|
466 |
$rnd=mt_rand(1,10000000);
|
467 |
|
468 |
$user_name = "user_$rnd";
|
@@ -534,7 +551,7 @@ function ct_ajax_clear_users()
|
|
534 |
{
|
535 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
536 |
global $wpdb;
|
537 |
-
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam';");
|
538 |
die();
|
539 |
}
|
540 |
|
253 |
|
254 |
$args_unchecked = array(
|
255 |
'meta_query' => array(
|
256 |
+
array(
|
257 |
'key' => 'ct_checked',
|
258 |
'value' => '1',
|
259 |
'compare' => 'NOT EXISTS'
|
260 |
),
|
261 |
+
array(
|
262 |
+
'key' => 'ct_bad',
|
263 |
+
'value' => '1',
|
264 |
+
'compare' => 'NOT EXISTS'
|
265 |
+
),
|
266 |
),
|
267 |
'orderby' => 'registered',
|
268 |
'order' => 'ASC',
|
269 |
'number' => 100
|
270 |
);
|
|
|
271 |
$u = get_users($args_unchecked);
|
272 |
+
|
273 |
if(sizeof($u)>0){
|
274 |
|
275 |
foreach($u as $user_index => $user){
|
284 |
unset($user_index, $user);
|
285 |
|
286 |
$data=Array();
|
287 |
+
for($i=0; $i < sizeof($u); $i++){
|
288 |
+
|
289 |
$user_meta=get_user_meta($u[$i]->ID, 'session_tokens', true);
|
290 |
+
|
291 |
if(is_array($user_meta))
|
292 |
+
$user_meta = array_values($user_meta);
|
293 |
+
|
294 |
+
$curr_ip = !empty($user_meta[0]['ip']) ? $user_meta[0]['ip'] : null;
|
295 |
+
$curr_email = !empty($u[$i]->data->user_email) ? $u[$i]->data->user_email : null;
|
296 |
+
|
297 |
+
if(empty($user_meta[0]['ip']))
|
298 |
+
$u[$i]->data->user_ip = null;
|
299 |
+
|
300 |
+
if(empty($curr_ip) && empty($curr_email)){
|
301 |
+
update_user_meta($u[$i]->ID,'ct_bad','1',true);
|
302 |
+
}else{
|
303 |
+
$data[] = $curr_ip;
|
304 |
+
$data[] = $curr_email;
|
305 |
+
$u[$i]->data->user_ip = $curr_ip;
|
306 |
}
|
307 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
}
|
309 |
if(count($data) == 0){
|
310 |
+
print 1;
|
311 |
die();
|
312 |
}
|
313 |
|
337 |
$filename = WP_PLUGIN_DIR."/cleantalk-spam-protect/check-results/user_check_by_{$current_user->user_login}.csv";
|
338 |
$text = "";
|
339 |
|
340 |
+
if(isset($_POST['new_check']) && $_POST['new_check'] == 'true'){
|
341 |
$file_desc = fopen($filename, 'w');
|
342 |
$text .= "blacklisted".PHP_EOL;
|
343 |
+
}else{
|
344 |
$file_desc = fopen($filename, 'a+');
|
345 |
+
}
|
346 |
|
347 |
foreach($result_to_csv['data'] as $key => $value){
|
348 |
+
|
349 |
+
if($value['appears'])
|
350 |
$text .= "$key".PHP_EOL;
|
351 |
|
352 |
} unset($key, $value);
|
427 |
|
428 |
// Checked
|
429 |
$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';");
|
430 |
+
$cnt_checked = $r[0]->cnt;
|
431 |
|
432 |
//Spam
|
433 |
$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);
|
434 |
+
$cnt_spam = $r[0]['cnt'];
|
435 |
+
|
436 |
+
//Bad
|
437 |
+
$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_bad';", ARRAY_A);
|
438 |
+
$cnt_bad = $r[0]['cnt'];
|
439 |
|
440 |
+
printf (__("Total users %s, checked %s, found %s spam users and %s bad users (without IP or email)", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam, $cnt_bad);
|
441 |
$backup_notice = ' ';
|
442 |
+
if ($cnt_spam > 0) {
|
443 |
$backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk');
|
444 |
}
|
445 |
print "<p>$backup_notice</p>";
|
459 |
/* DELETION
|
460 |
$users = get_users(array('search' => '*user_*', 'search_columns' => array('login', 'nicename')));
|
461 |
$inserted = 0;
|
462 |
+
$amount_to_delete = 0;
|
463 |
+
foreach($users as $user){
|
464 |
+
if($inserted >= $amount_to_delete)
|
465 |
+
break;
|
466 |
if(wp_delete_user($user->ID))
|
467 |
$inserted++;
|
468 |
+
}
|
469 |
//*/
|
470 |
|
471 |
$result = $wpdb->get_results("SELECT network FROM `".$wpdb->base_prefix."cleantalk_sfw` LIMIT 200;", ARRAY_A);
|
472 |
+
|
473 |
if($result){
|
474 |
$ip = array();
|
475 |
foreach($result as $value){
|
479 |
|
480 |
$inserted = 0;
|
481 |
$use_id = 0;
|
482 |
+
for($i=0; $i<20 ;$i++){
|
483 |
$rnd=mt_rand(1,10000000);
|
484 |
|
485 |
$user_name = "user_$rnd";
|
551 |
{
|
552 |
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
553 |
global $wpdb;
|
554 |
+
$wpdb->query("delete from $wpdb->usermeta where meta_key='ct_hash' or meta_key='ct_checked' or meta_key='ct_marked_as_spam' or meta_key='ct_bad';");
|
555 |
die();
|
556 |
}
|
557 |
|
inc/cleantalk.class.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Cleantalk base class
|
4 |
*
|
5 |
-
* @version 2.1.
|
6 |
* @package Cleantalk
|
7 |
* @subpackage Base
|
8 |
* @author Cleantalk team (welcome@cleantalk.org)
|
@@ -11,8 +11,8 @@
|
|
11 |
* @see https://github.com/CleanTalk/php-antispam
|
12 |
*
|
13 |
*/
|
14 |
-
|
15 |
-
|
16 |
* Creating apache_request_headers() if not exists
|
17 |
*/
|
18 |
if( !function_exists('apache_request_headers') ) {
|
@@ -182,7 +182,7 @@ class CleantalkResponse {
|
|
182 |
$this->stop_queue = (isset($obj->stop_queue)) ? $obj->stop_queue : 0;
|
183 |
$this->inactive = (isset($obj->inactive)) ? $obj->inactive : 0;
|
184 |
$this->account_status = (isset($obj->account_status)) ? $obj->account_status : -1;
|
185 |
-
|
186 |
|
187 |
if ($this->errno !== 0 && $this->errstr !== null && $this->comment === null)
|
188 |
$this->comment = '*** ' . $this->errstr . ' Antispam service cleantalk.org ***';
|
@@ -625,10 +625,10 @@ class Cleantalk {
|
|
625 |
}
|
626 |
$data = $tmp_data;
|
627 |
unset($key, $value, $tmp_data);
|
628 |
-
|
629 |
// Convert to JSON
|
630 |
$data = json_encode($data);
|
631 |
-
|
632 |
if (isset($this->api_version)) {
|
633 |
$url = $url . $this->api_version;
|
634 |
}
|
@@ -637,7 +637,7 @@ class Cleantalk {
|
|
637 |
if ($this->ssl_on && !preg_match("/^https:/", $url)) {
|
638 |
$url = preg_replace("/^(http)/i", "$1s", $url);
|
639 |
}
|
640 |
-
|
641 |
$result = false;
|
642 |
$curl_error = null;
|
643 |
if(function_exists('curl_init')) {
|
@@ -688,8 +688,8 @@ class Cleantalk {
|
|
688 |
$context = stream_context_create($opts);
|
689 |
$result = @file_get_contents($url, false, $context);
|
690 |
}
|
691 |
-
}
|
692 |
-
|
693 |
if (!$result || !cleantalk_is_JSON($result)) {
|
694 |
$response = null;
|
695 |
$response['errno'] = 1;
|
@@ -729,7 +729,7 @@ class Cleantalk {
|
|
729 |
*/
|
730 |
private function httpRequest($msg) {
|
731 |
$result = false;
|
732 |
-
|
733 |
if($msg->method_name != 'send_feedback'){
|
734 |
$ct_tmp = apache_request_headers();
|
735 |
|
@@ -748,7 +748,7 @@ class Cleantalk {
|
|
748 |
), '', $ct_tmp[$cookie_name]);
|
749 |
$msg->all_headers=json_encode($ct_tmp);
|
750 |
}
|
751 |
-
|
752 |
//$msg->remote_addr=$_SERVER['REMOTE_ADDR'];
|
753 |
//$msg->sender_info['remote_addr']=$_SERVER['REMOTE_ADDR'];
|
754 |
$si=(array)json_decode($msg->sender_info,true);
|
@@ -811,7 +811,7 @@ class Cleantalk {
|
|
811 |
}
|
812 |
}
|
813 |
}
|
814 |
-
|
815 |
$response = new CleantalkResponse(null, $result);
|
816 |
|
817 |
if (!empty($this->data_codepage) && $this->data_codepage !== 'UTF-8') {
|
@@ -1061,7 +1061,7 @@ class Cleantalk {
|
|
1061 |
* @return JSON/array
|
1062 |
*/
|
1063 |
public function get_2s_blacklists_db ($api_key) {
|
1064 |
-
|
1065 |
$request['method_name'] = '2s_blacklists_db';
|
1066 |
$request['auth_key'] = $api_key;
|
1067 |
$url='https://api.cleantalk.org';
|
@@ -1083,12 +1083,13 @@ if(!function_exists('getAutoKey'))
|
|
1083 |
{
|
1084 |
function getAutoKey($email, $host, $platform, $timezone = null)
|
1085 |
{
|
1086 |
-
$request=
|
1087 |
$request['method_name'] = 'get_api_key';
|
1088 |
$request['email'] = $email;
|
1089 |
$request['website'] = $host;
|
1090 |
$request['platform'] = $platform;
|
1091 |
$request['timezone'] = $timezone;
|
|
|
1092 |
$url='https://api.cleantalk.org';
|
1093 |
$result=sendRawRequest($url,$request);
|
1094 |
return $result;
|
@@ -1104,7 +1105,7 @@ if(!function_exists('getAutoKey'))
|
|
1104 |
|
1105 |
function noticePaidTill($api_key)
|
1106 |
{
|
1107 |
-
$request=
|
1108 |
$request['method_name'] = 'notice_paid_till';
|
1109 |
$request['auth_key'] = $api_key;
|
1110 |
$url='https://api.cleantalk.org';
|
@@ -1222,10 +1223,10 @@ function sendRawRequest($url,$data,$isJSON=false,$timeout=3)
|
|
1222 |
{
|
1223 |
$opts = array(
|
1224 |
'http'=>array(
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
);
|
1230 |
$context = stream_context_create($opts);
|
1231 |
$result = @file_get_contents($url, 0, $context);
|
@@ -1266,7 +1267,6 @@ function cleantalk_get_real_ip()
|
|
1266 |
}
|
1267 |
else
|
1268 |
{
|
1269 |
-
|
1270 |
$headers = $_SERVER;
|
1271 |
}
|
1272 |
if ( array_key_exists( 'X-Forwarded-For', $headers ) )
|
@@ -1292,7 +1292,7 @@ function cleantalk_is_JSON($string)
|
|
1292 |
}
|
1293 |
|
1294 |
// Patch for locale_get_display_region() for old PHP versions
|
1295 |
-
if( !function_exists('
|
1296 |
function locale_get_display_region($locale){
|
1297 |
return $locale;
|
1298 |
}
|
2 |
/**
|
3 |
* Cleantalk base class
|
4 |
*
|
5 |
+
* @version 2.1.4
|
6 |
* @package Cleantalk
|
7 |
* @subpackage Base
|
8 |
* @author Cleantalk team (welcome@cleantalk.org)
|
11 |
* @see https://github.com/CleanTalk/php-antispam
|
12 |
*
|
13 |
*/
|
14 |
+
|
15 |
+
/**
|
16 |
* Creating apache_request_headers() if not exists
|
17 |
*/
|
18 |
if( !function_exists('apache_request_headers') ) {
|
182 |
$this->stop_queue = (isset($obj->stop_queue)) ? $obj->stop_queue : 0;
|
183 |
$this->inactive = (isset($obj->inactive)) ? $obj->inactive : 0;
|
184 |
$this->account_status = (isset($obj->account_status)) ? $obj->account_status : -1;
|
185 |
+
$this->received = (isset($obj->received)) ? $obj->received : -1;
|
186 |
|
187 |
if ($this->errno !== 0 && $this->errstr !== null && $this->comment === null)
|
188 |
$this->comment = '*** ' . $this->errstr . ' Antispam service cleantalk.org ***';
|
625 |
}
|
626 |
$data = $tmp_data;
|
627 |
unset($key, $value, $tmp_data);
|
628 |
+
|
629 |
// Convert to JSON
|
630 |
$data = json_encode($data);
|
631 |
+
|
632 |
if (isset($this->api_version)) {
|
633 |
$url = $url . $this->api_version;
|
634 |
}
|
637 |
if ($this->ssl_on && !preg_match("/^https:/", $url)) {
|
638 |
$url = preg_replace("/^(http)/i", "$1s", $url);
|
639 |
}
|
640 |
+
|
641 |
$result = false;
|
642 |
$curl_error = null;
|
643 |
if(function_exists('curl_init')) {
|
688 |
$context = stream_context_create($opts);
|
689 |
$result = @file_get_contents($url, false, $context);
|
690 |
}
|
691 |
+
}
|
692 |
+
|
693 |
if (!$result || !cleantalk_is_JSON($result)) {
|
694 |
$response = null;
|
695 |
$response['errno'] = 1;
|
729 |
*/
|
730 |
private function httpRequest($msg) {
|
731 |
$result = false;
|
732 |
+
|
733 |
if($msg->method_name != 'send_feedback'){
|
734 |
$ct_tmp = apache_request_headers();
|
735 |
|
748 |
), '', $ct_tmp[$cookie_name]);
|
749 |
$msg->all_headers=json_encode($ct_tmp);
|
750 |
}
|
751 |
+
|
752 |
//$msg->remote_addr=$_SERVER['REMOTE_ADDR'];
|
753 |
//$msg->sender_info['remote_addr']=$_SERVER['REMOTE_ADDR'];
|
754 |
$si=(array)json_decode($msg->sender_info,true);
|
811 |
}
|
812 |
}
|
813 |
}
|
814 |
+
|
815 |
$response = new CleantalkResponse(null, $result);
|
816 |
|
817 |
if (!empty($this->data_codepage) && $this->data_codepage !== 'UTF-8') {
|
1061 |
* @return JSON/array
|
1062 |
*/
|
1063 |
public function get_2s_blacklists_db ($api_key) {
|
1064 |
+
$request=array();
|
1065 |
$request['method_name'] = '2s_blacklists_db';
|
1066 |
$request['auth_key'] = $api_key;
|
1067 |
$url='https://api.cleantalk.org';
|
1083 |
{
|
1084 |
function getAutoKey($email, $host, $platform, $timezone = null)
|
1085 |
{
|
1086 |
+
$request=array();
|
1087 |
$request['method_name'] = 'get_api_key';
|
1088 |
$request['email'] = $email;
|
1089 |
$request['website'] = $host;
|
1090 |
$request['platform'] = $platform;
|
1091 |
$request['timezone'] = $timezone;
|
1092 |
+
$request['product_name'] = 'antispam';
|
1093 |
$url='https://api.cleantalk.org';
|
1094 |
$result=sendRawRequest($url,$request);
|
1095 |
return $result;
|
1105 |
|
1106 |
function noticePaidTill($api_key)
|
1107 |
{
|
1108 |
+
$request=array();
|
1109 |
$request['method_name'] = 'notice_paid_till';
|
1110 |
$request['auth_key'] = $api_key;
|
1111 |
$url='https://api.cleantalk.org';
|
1223 |
{
|
1224 |
$opts = array(
|
1225 |
'http'=>array(
|
1226 |
+
'method' => "POST",
|
1227 |
+
'timeout'=> $timeout,
|
1228 |
+
'content' => $data
|
1229 |
+
)
|
1230 |
);
|
1231 |
$context = stream_context_create($opts);
|
1232 |
$result = @file_get_contents($url, 0, $context);
|
1267 |
}
|
1268 |
else
|
1269 |
{
|
|
|
1270 |
$headers = $_SERVER;
|
1271 |
}
|
1272 |
if ( array_key_exists( 'X-Forwarded-For', $headers ) )
|
1292 |
}
|
1293 |
|
1294 |
// Patch for locale_get_display_region() for old PHP versions
|
1295 |
+
if( !function_exists('locale_get_display_region') ){
|
1296 |
function locale_get_display_region($locale){
|
1297 |
return $locale;
|
1298 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, serge00, sartemd174
|
|
3 |
Tags: antispam, protection, contact form, comments, spam
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag: 5.
|
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.
|
@@ -501,6 +501,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
501 |
1. The Dashboard with a map of most spam active countries per your account.
|
502 |
|
503 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
504 |
= 5.61 April 6 2017 =
|
505 |
* Improved filtration.
|
506 |
* Additional logic for the form recognizing.
|
@@ -1311,6 +1316,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
1311 |
* First version
|
1312 |
|
1313 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
1314 |
= 5.61 April 6 2017 =
|
1315 |
* Improved filtration.
|
1316 |
* Additional logic for the form recognizing.
|
3 |
Tags: antispam, protection, contact form, comments, spam
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 5.62
|
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.
|
501 |
1. The Dashboard with a map of most spam active countries per your account.
|
502 |
|
503 |
== Changelog ==
|
504 |
+
= 5.62 April 17 2017 =
|
505 |
+
* Fix for the dashboard spam statistics widget.
|
506 |
+
* Fix for users spam check.
|
507 |
+
* Small appearance changes.
|
508 |
+
|
509 |
= 5.61 April 6 2017 =
|
510 |
* Improved filtration.
|
511 |
* Additional logic for the form recognizing.
|
1316 |
* First version
|
1317 |
|
1318 |
== Upgrade Notice ==
|
1319 |
+
= 5.62 April 17 2017 =
|
1320 |
+
* Fix for the dashboard spam statistics widget.
|
1321 |
+
* Fix for users spam check.
|
1322 |
+
* Small appearance changes.
|
1323 |
+
|
1324 |
= 5.61 April 6 2017 =
|
1325 |
* Improved filtration.
|
1326 |
* Additional logic for the form recognizing.
|