Version Description
February 12 2018 = * Integration: ConvertPro. * Improvement: Search for visitor's names in request. * Fix: Contact Form 7 message recognition. * Preparation for the remote plugin update. * Minor fixes.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.88 |
Comparing to | |
See all releases |
Code changes from version 5.87 to 5.88
- cleantalk.php +54 -10
- css/cleantalk-admin-settings-page.css +1 -1
- inc/cleantalk-admin.php +43 -37
- inc/cleantalk-ajax.php +24 -6
- inc/cleantalk-common.php +6 -3
- inc/cleantalk-public.php +10 -21
- js/cleantalk-admin.js +5 -5
- lib/CleantalkUpgrader.php +120 -0
- lib/CleantalkUpgraderSkin.php +40 -0
- readme.txt +16 -2
cleantalk.php
CHANGED
@@ -3,17 +3,17 @@
|
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
-
Version: 5.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
|
11 |
-
$cleantalk_plugin_version='5.
|
12 |
-
$ct_agent_version = 'wordpress-
|
13 |
$cleantalk_executed = false;
|
14 |
|
15 |
-
define('APBCT_VERSION', '5.
|
16 |
-
define('APBCT_AGENT', 'wordpress-
|
17 |
|
18 |
define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
|
19 |
|
@@ -67,10 +67,10 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
67 |
|
68 |
}
|
69 |
|
70 |
-
if(isset($_SERVER['REQUEST_URI']) && stripos($_SERVER['REQUEST_URI'],'admin-ajax.php')!==false && sizeof($_POST)>0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
|
71 |
$_POST['action']='ninja_forms_ajax_submit';
|
72 |
|
73 |
-
|
74 |
if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) && ($_GET['plugin_name'] == 'antispam' || $_GET['plugin_name'] == 'anti-spam')){
|
75 |
|
76 |
if(isset($ct_data['last_remote_call']) && time() - $ct_data['last_remote_call'] < CLEANTALK_REMOTE_CALL_SLEEP){
|
@@ -83,29 +83,36 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
83 |
|
84 |
$spbc_remote_call_token = md5($ct_options['apikey']);
|
85 |
|
86 |
-
if($_GET['spbc_remote_call_token'] == $spbc_remote_call_token){
|
87 |
-
|
|
|
88 |
if($_GET['spbc_remote_call_action'] == 'close_renew_banner'){
|
89 |
$ct_data['show_ct_notice_trial'] = 0;
|
90 |
$ct_data['show_ct_notice_renew'] = 0;
|
91 |
update_option('cleantalk_data', $ct_data);
|
92 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
|
93 |
-
echo
|
94 |
die();
|
|
|
95 |
}elseif($_GET['spbc_remote_call_action'] == 'sfw_update'){
|
96 |
$rc_result = ct_sfw_update();
|
97 |
echo $rc_result === true ? 'OK' : 'FAIL '.$rc_result;
|
98 |
die();
|
|
|
99 |
}elseif($_GET['spbc_remote_call_action'] == 'sfw_send_logs'){
|
100 |
$rc_result = ct_sfw_send_logs();
|
101 |
echo $rc_result === true ? 'OK' : 'FAIL '.$rc_result;
|
102 |
die();
|
|
|
|
|
|
|
103 |
}
|
104 |
}else{
|
105 |
echo "FAIL WRONG_TOKEN";
|
106 |
die();
|
107 |
}
|
108 |
}
|
|
|
109 |
|
110 |
// SFW start
|
111 |
$value = (isset($ct_options['spam_firewall']) ? intval($ct_options['spam_firewall']) : 0);
|
@@ -512,6 +519,43 @@ function ct_sfw_send_logs()
|
|
512 |
return 'SFW_DISABLED';
|
513 |
}
|
514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
function cleantalk_get_brief_data(){
|
516 |
$ct_options = ct_get_options();
|
517 |
$ct_data = ct_get_data();
|
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.
|
6 |
+
Version: 5.88
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
|
11 |
+
$cleantalk_plugin_version='5.88';
|
12 |
+
$ct_agent_version = 'wordpress-588';
|
13 |
$cleantalk_executed = false;
|
14 |
|
15 |
+
define('APBCT_VERSION', '5.88');
|
16 |
+
define('APBCT_AGENT', 'wordpress-588');
|
17 |
|
18 |
define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
|
19 |
|
67 |
|
68 |
}
|
69 |
|
70 |
+
if(isset($_SERVER['REQUEST_URI']) && stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') !== false && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
|
71 |
$_POST['action']='ninja_forms_ajax_submit';
|
72 |
|
73 |
+
//*/ REMOTE CALLS
|
74 |
if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) && ($_GET['plugin_name'] == 'antispam' || $_GET['plugin_name'] == 'anti-spam')){
|
75 |
|
76 |
if(isset($ct_data['last_remote_call']) && time() - $ct_data['last_remote_call'] < CLEANTALK_REMOTE_CALL_SLEEP){
|
83 |
|
84 |
$spbc_remote_call_token = md5($ct_options['apikey']);
|
85 |
|
86 |
+
if(strtolower($_GET['spbc_remote_call_token']) == $spbc_remote_call_token){
|
87 |
+
|
88 |
+
// Close renew banner
|
89 |
if($_GET['spbc_remote_call_action'] == 'close_renew_banner'){
|
90 |
$ct_data['show_ct_notice_trial'] = 0;
|
91 |
$ct_data['show_ct_notice_renew'] = 0;
|
92 |
update_option('cleantalk_data', $ct_data);
|
93 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
|
94 |
+
echo 'OK';
|
95 |
die();
|
96 |
+
// SFW update
|
97 |
}elseif($_GET['spbc_remote_call_action'] == 'sfw_update'){
|
98 |
$rc_result = ct_sfw_update();
|
99 |
echo $rc_result === true ? 'OK' : 'FAIL '.$rc_result;
|
100 |
die();
|
101 |
+
// SFW send logs
|
102 |
}elseif($_GET['spbc_remote_call_action'] == 'sfw_send_logs'){
|
103 |
$rc_result = ct_sfw_send_logs();
|
104 |
echo $rc_result === true ? 'OK' : 'FAIL '.$rc_result;
|
105 |
die();
|
106 |
+
// Update plugin
|
107 |
+
}elseif($_GET['spbc_remote_call_action'] == 'update_plugin'){
|
108 |
+
add_action('template_redirect', 'apbct_update', 1);
|
109 |
}
|
110 |
}else{
|
111 |
echo "FAIL WRONG_TOKEN";
|
112 |
die();
|
113 |
}
|
114 |
}
|
115 |
+
//*/ END OF REMOTE CALLS
|
116 |
|
117 |
// SFW start
|
118 |
$value = (isset($ct_options['spam_firewall']) ? intval($ct_options['spam_firewall']) : 0);
|
519 |
return 'SFW_DISABLED';
|
520 |
}
|
521 |
|
522 |
+
function apbct_update(){
|
523 |
+
|
524 |
+
//Upgrade params
|
525 |
+
$plugin = 'cleantalk-spam-protect/cleantalk.php';
|
526 |
+
$title = __('Update Plugin');
|
527 |
+
$nonce = 'upgrade-plugin_' . $plugin;
|
528 |
+
$url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
|
529 |
+
|
530 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
531 |
+
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
532 |
+
include_once( ABSPATH . 'wp-admin/includes/file.php' );
|
533 |
+
include_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
534 |
+
|
535 |
+
include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
|
536 |
+
include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
|
537 |
+
|
538 |
+
$upgrader = new CleantalkUpgrader( new CleantalkUpgraderSkin( compact('title', 'nonce', 'url', 'plugin') ) );
|
539 |
+
$upgrader->upgrade($plugin);
|
540 |
+
|
541 |
+
if($upgrader->apbct_result === 'OK'){
|
542 |
+
|
543 |
+
$result = activate_plugins( $plugin );
|
544 |
+
|
545 |
+
if(is_wp_error($result))
|
546 |
+
die('COULD_NOT_ACTIVATE WP_ERROR' . $result->get_error_message());
|
547 |
+
if($result === false)
|
548 |
+
die('COULD_NOT_ACTIVATE');
|
549 |
+
|
550 |
+
$plugin_data = get_plugin_data(__FILE__);
|
551 |
+
$apbct_agent = 'wordpress-'.str_replace('.', '', $plugin_data['Version']);
|
552 |
+
ct_send_feedback('0:' . $apbct_agent);
|
553 |
+
|
554 |
+
}
|
555 |
+
|
556 |
+
die($upgrader->apbct_result);
|
557 |
+
}
|
558 |
+
|
559 |
function cleantalk_get_brief_data(){
|
560 |
$ct_options = ct_get_options();
|
561 |
$ct_data = ct_get_data();
|
css/cleantalk-admin-settings-page.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.apbct_status_icon{
|
2 |
vertical-align: text-bottom;
|
3 |
-
margin: 0 5px;
|
4 |
}
|
5 |
|
6 |
a.ct_support_link{
|
1 |
.apbct_status_icon{
|
2 |
vertical-align: text-bottom;
|
3 |
+
margin: 0 5px 0 8px;
|
4 |
}
|
5 |
|
6 |
a.ct_support_link{
|
inc/cleantalk-admin.php
CHANGED
@@ -345,10 +345,7 @@ function ct_account_status_check(){
|
|
345 |
$result = CleantalkHelper::noticePaidTill($api_key);
|
346 |
|
347 |
if(empty($result['error'])){
|
348 |
-
|
349 |
-
if (isset($result['data']) && is_array($result['data']))
|
350 |
-
$result = $result['data'];
|
351 |
-
|
352 |
if(isset($result['spam_count']))
|
353 |
$ct_data['admin_blocked'] = $result['spam_count'];
|
354 |
|
@@ -372,8 +369,10 @@ function ct_account_status_check(){
|
|
372 |
if ($result['show_notice'] == 0)
|
373 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
|
374 |
|
375 |
-
$ct_data['show_ct_notice_trial']
|
376 |
-
$ct_data['show_ct_notice_renew']
|
|
|
|
|
377 |
}
|
378 |
|
379 |
if (isset($result['moderate_ip']) && $result['moderate_ip'] == 1){
|
@@ -434,23 +433,7 @@ function apbct_admin_init(){
|
|
434 |
'0:' . $ct_agent_version // 0 - request_id, agent version.
|
435 |
);
|
436 |
}
|
437 |
-
|
438 |
-
/*$show_ct_notice_trial = false;
|
439 |
-
if (isset($_COOKIE[$ct_notice_trial_label]))
|
440 |
-
{
|
441 |
-
if ($_COOKIE[$ct_notice_trial_label] == 1)
|
442 |
-
{
|
443 |
-
$show_ct_notice_trial = true;
|
444 |
-
}
|
445 |
-
}
|
446 |
-
$show_ct_notice_renew = false;
|
447 |
-
if (isset($_COOKIE[$ct_notice_renew_label]))
|
448 |
-
{
|
449 |
-
if ($_COOKIE[$ct_notice_renew_label] == 1)
|
450 |
-
{
|
451 |
-
$show_ct_notice_renew = true;
|
452 |
-
}
|
453 |
-
}*/
|
454 |
$show_ct_notice_autokey = false;
|
455 |
if (isset($_COOKIE[$ct_notice_autokey_label]) && !empty($_COOKIE[$ct_notice_autokey_label]))
|
456 |
{
|
@@ -867,6 +850,7 @@ function ct_section_settings_state() {
|
|
867 |
|
868 |
$img = $path_to_img."yes.png";
|
869 |
$img_no = $path_to_img."no.png";
|
|
|
870 |
$color="black";
|
871 |
$test_failed=false;
|
872 |
|
@@ -891,24 +875,30 @@ function ct_section_settings_state() {
|
|
891 |
$test_failed=false;
|
892 |
}
|
893 |
print "<div style='color:$color'>";
|
894 |
-
|
895 |
-
if(isset($ct_data['moderate_ip']) && $ct_data['moderate_ip'] == 1)
|
896 |
-
$ct_moderate = true;
|
897 |
-
else
|
898 |
-
$ct_moderate = false;
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
|
|
|
|
|
|
|
|
904 |
|
905 |
// SFW + current network count
|
906 |
$sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->base_prefix."cleantalk_sfw`", ARRAY_A);
|
907 |
$alt_for_sfw = sprintf(__('Networks in database: %d.', 'cleantalk'), $sfw_netwoks_amount[0]['cnt']);
|
908 |
-
echo '<img class="apbct_status_icon" src="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $img : $img_no).'" title="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $alt_for_sfw : '').'"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
909 |
// WooCommerce
|
910 |
if(class_exists('WooCommerce'))
|
911 |
-
echo '<img src="'.($ct_options['wc_checkout_test']==1 || $ct_moderate ? $img : $img_no).'"/>
|
912 |
|
913 |
if($ct_data['moderate_ip'] == 1)
|
914 |
print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$ct_data['ip_license'].".<br />";
|
@@ -1680,8 +1670,8 @@ function cleantalk_admin_notice_message(){
|
|
1680 |
//General notice control flags
|
1681 |
$moderate_ip = (empty($ct_data['moderate_ip']) ? 0 : $ct_data['moderate_ip']);
|
1682 |
$self_owned_key = (!$moderate_ip && !defined('CLEANTALK_ACCESS_KEY') ? true : false);
|
1683 |
-
$
|
1684 |
-
$
|
1685 |
$show_notice = true;
|
1686 |
|
1687 |
//Notice control flags
|
@@ -1689,13 +1679,29 @@ function cleantalk_admin_notice_message(){
|
|
1689 |
$show_ct_notice_renew = (isset($ct_data['show_ct_notice_renew']) ? intval($ct_data['show_ct_notice_renew']) : 0);
|
1690 |
$show_ct_notice_review = (isset($ct_data['show_ct_notice_review']) ? intval($ct_data['show_ct_notice_review']) : 0);
|
1691 |
$next_notice_show = (isset($ct_data['next_notice_show']) ? intval($ct_data['next_notice_show']) : 0); //inactive
|
|
|
|
|
|
|
|
|
1692 |
$page_is_ct_settings = ($page->id == 'settings_page_cleantalk' || $page->id == 'settings_page_cleantalk-network' ? true : false);
|
1693 |
|
1694 |
//Misc
|
1695 |
$user_token = (isset($ct_data['user_token']) && $ct_data['user_token'] != '' ? "&user_token={$ct_data['user_token']}" : "");
|
1696 |
$settings_link = (is_network_admin() ? "settings.php?page=cleantalk" : "options-general.php?page=cleantalk");
|
1697 |
|
1698 |
-
if($self_owned_key && $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1699 |
|
1700 |
//Unable to get key automatically (if apbct_admin_init().getAutoKey() returns error)
|
1701 |
if ($show_notice && $show_ct_notice_autokey){
|
345 |
$result = CleantalkHelper::noticePaidTill($api_key);
|
346 |
|
347 |
if(empty($result['error'])){
|
348 |
+
|
|
|
|
|
|
|
349 |
if(isset($result['spam_count']))
|
350 |
$ct_data['admin_blocked'] = $result['spam_count'];
|
351 |
|
369 |
if ($result['show_notice'] == 0)
|
370 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
|
371 |
|
372 |
+
$ct_data['show_ct_notice_trial'] = (int) $show_ct_notice_trial;
|
373 |
+
$ct_data['show_ct_notice_renew'] = (int) $show_ct_notice_renew;
|
374 |
+
$ct_data['show_ct_notice_auto_update'] = isset($result['show_auto_update_notice']) ? $result['show_auto_update_notice'] : 0;
|
375 |
+
$ct_data['auto_update_app'] = isset($result['auto_update_app']) ? $result['auto_update_app'] : 0;
|
376 |
}
|
377 |
|
378 |
if (isset($result['moderate_ip']) && $result['moderate_ip'] == 1){
|
433 |
'0:' . $ct_agent_version // 0 - request_id, agent version.
|
434 |
);
|
435 |
}
|
436 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
$show_ct_notice_autokey = false;
|
438 |
if (isset($_COOKIE[$ct_notice_autokey_label]) && !empty($_COOKIE[$ct_notice_autokey_label]))
|
439 |
{
|
850 |
|
851 |
$img = $path_to_img."yes.png";
|
852 |
$img_no = $path_to_img."no.png";
|
853 |
+
$img_no_gray = $path_to_img."no_gray.png";
|
854 |
$color="black";
|
855 |
$test_failed=false;
|
856 |
|
875 |
$test_failed=false;
|
876 |
}
|
877 |
print "<div style='color:$color'>";
|
|
|
|
|
|
|
|
|
|
|
878 |
|
879 |
+
$ct_moderate = isset($ct_data['moderate_ip']) && $ct_data['moderate_ip'] == 1 ? true : false;
|
880 |
+
$show_ct_notice_auto_update = isset($ct_data['show_ct_notice_auto_update']) ? $ct_data['show_ct_notice_auto_update'] : 0;
|
881 |
+
$auto_update_app = isset($ct_data['auto_update_app']) ? $ct_data['auto_update_app'] : 0;
|
882 |
+
|
883 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['registrations_test']==1 || $ct_moderate ? $img : $img_no).'" />'.__('Registration forms', 'cleantalk');
|
884 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['comments_test']==1 || $ct_moderate ? $img : $img_no).'"/>'.__('Comments forms', 'cleantalk');
|
885 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['contact_forms_test']==1 || $ct_moderate ? $img : $img_no).'"/>'.__('Contact forms', 'cleantalk');
|
886 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['general_contact_forms_test']==1 || $ct_moderate ? $img : $img_no).'"/>'.__('Custom contact forms', 'cleantalk');
|
887 |
|
888 |
// SFW + current network count
|
889 |
$sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->base_prefix."cleantalk_sfw`", ARRAY_A);
|
890 |
$alt_for_sfw = sprintf(__('Networks in database: %d.', 'cleantalk'), $sfw_netwoks_amount[0]['cnt']);
|
891 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $img : $img_no).'" title="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $alt_for_sfw : '').'"/>'.__('SpamFireWall', 'cleantalk');
|
892 |
+
|
893 |
+
// Autoupdate status
|
894 |
+
if($show_ct_notice_auto_update == 1){
|
895 |
+
echo '<img class="apbct_status_icon" src="'.($auto_update_app == 1 ? $img : ($auto_update_app == -1 ? $img_no : $img_no_gray)).'"/>'.__('Auto update', 'cleantalk')
|
896 |
+
.' <sup><a href="http://cleantalk.org/help/auto-update" target="_blank">?</a></sup>';
|
897 |
+
}
|
898 |
+
|
899 |
// WooCommerce
|
900 |
if(class_exists('WooCommerce'))
|
901 |
+
echo '<img src="'.($ct_options['wc_checkout_test']==1 || $ct_moderate ? $img : $img_no).'"/>'.__('WooCommerce checkout form', 'cleantalk');
|
902 |
|
903 |
if($ct_data['moderate_ip'] == 1)
|
904 |
print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$ct_data['ip_license'].".<br />";
|
1670 |
//General notice control flags
|
1671 |
$moderate_ip = (empty($ct_data['moderate_ip']) ? 0 : $ct_data['moderate_ip']);
|
1672 |
$self_owned_key = (!$moderate_ip && !defined('CLEANTALK_ACCESS_KEY') ? true : false);
|
1673 |
+
$is_dashboard = (is_network_admin() || is_admin() ? true : false);
|
1674 |
+
$is_admin = (current_user_can('activate_plugins') ? true : false);
|
1675 |
$show_notice = true;
|
1676 |
|
1677 |
//Notice control flags
|
1679 |
$show_ct_notice_renew = (isset($ct_data['show_ct_notice_renew']) ? intval($ct_data['show_ct_notice_renew']) : 0);
|
1680 |
$show_ct_notice_review = (isset($ct_data['show_ct_notice_review']) ? intval($ct_data['show_ct_notice_review']) : 0);
|
1681 |
$next_notice_show = (isset($ct_data['next_notice_show']) ? intval($ct_data['next_notice_show']) : 0); //inactive
|
1682 |
+
|
1683 |
+
$show_ct_notice_auto_update = (isset($ct_data['show_ct_notice_auto_update']) ? intval($ct_data['show_ct_notice_auto_update']) : 0);
|
1684 |
+
$auto_update_app = (isset($ct_data['auto_update_app']) ? $ct_data['auto_update_app'] : 0);
|
1685 |
+
|
1686 |
$page_is_ct_settings = ($page->id == 'settings_page_cleantalk' || $page->id == 'settings_page_cleantalk-network' ? true : false);
|
1687 |
|
1688 |
//Misc
|
1689 |
$user_token = (isset($ct_data['user_token']) && $ct_data['user_token'] != '' ? "&user_token={$ct_data['user_token']}" : "");
|
1690 |
$settings_link = (is_network_admin() ? "settings.php?page=cleantalk" : "options-general.php?page=cleantalk");
|
1691 |
|
1692 |
+
if($self_owned_key && $is_dashboard && $is_admin){
|
1693 |
+
// Auto update notice
|
1694 |
+
if($show_ct_notice_auto_update && $auto_update_app != -1 && empty($_COOKIE['apbct_update_banner_closed'])){
|
1695 |
+
$link = '<a href="http://cleantalk.org/help/auto-update" target="_blank">%s</a>';
|
1696 |
+
$button = sprintf($link, '<input type="button" class="button button-primary" value="'.__('Learn more', 'cleantalk').'" />');
|
1697 |
+
echo '<div class="error notice is-dismissible apbct_update_notice">'
|
1698 |
+
.'<h3>'
|
1699 |
+
.__('Do you know that Anti-Spam by CleanTalk has auto update option?', 'cleantalk')
|
1700 |
+
.'</br></br>'
|
1701 |
+
.$button
|
1702 |
+
.'</h3>'
|
1703 |
+
.'</div>';
|
1704 |
+
}
|
1705 |
|
1706 |
//Unable to get key automatically (if apbct_admin_init().getAutoKey() returns error)
|
1707 |
if ($show_notice && $show_ct_notice_autokey){
|
inc/cleantalk-ajax.php
CHANGED
@@ -341,7 +341,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
341 |
if($subject != '') {
|
342 |
$message['subject'] = $subject;
|
343 |
}
|
344 |
-
|
345 |
// Skip submission if no data found
|
346 |
if ($sender_email === ''|| !$contact_form)
|
347 |
return false;
|
@@ -351,12 +351,20 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
351 |
return false;
|
352 |
|
353 |
// WP Foto Vote Fix
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
return;
|
358 |
-
|
359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
|
361 |
$base_call_result = apbct_base_call(
|
362 |
array(
|
@@ -628,6 +636,16 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
628 |
);
|
629 |
die(json_encode($result));
|
630 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
631 |
else
|
632 |
{
|
633 |
print $ct_result->comment;
|
341 |
if($subject != '') {
|
342 |
$message['subject'] = $subject;
|
343 |
}
|
344 |
+
|
345 |
// Skip submission if no data found
|
346 |
if ($sender_email === ''|| !$contact_form)
|
347 |
return false;
|
351 |
return false;
|
352 |
|
353 |
// WP Foto Vote Fix
|
354 |
+
if (!empty($_FILES)){
|
355 |
+
foreach($message as $key => $value){
|
356 |
+
if(strpos($key, 'oje') !== false)
|
357 |
return;
|
358 |
+
} unset($key ,$value);
|
359 |
+
}
|
360 |
+
|
361 |
+
//Ninja Forms xml fix
|
362 |
+
if (isset($_POST['action']) && $_POST['action'] === 'nf_ajax_submit'){
|
363 |
+
foreach ($message as $key => $value){
|
364 |
+
if (strpos($value, '<xml>') !== false)
|
365 |
+
unset($message[$key]);
|
366 |
+
}
|
367 |
+
}
|
368 |
|
369 |
$base_call_result = apbct_base_call(
|
370 |
array(
|
636 |
);
|
637 |
die(json_encode($result));
|
638 |
}
|
639 |
+
//ConvertPro
|
640 |
+
elseif(isset($_POST['action']) && $_POST['action']='cp_v2_notify_admin' || $_POST['action']=='cpro_notify_via_email')
|
641 |
+
{
|
642 |
+
$result = Array(
|
643 |
+
'success' => false,
|
644 |
+
'data' => array('error'=>$ct_result->comment,'style_slug'=>'convertprot-form'),
|
645 |
+
);
|
646 |
+
print json_encode($result);
|
647 |
+
die();
|
648 |
+
}
|
649 |
else
|
650 |
{
|
651 |
print $ct_result->comment;
|
inc/cleantalk-common.php
CHANGED
@@ -680,6 +680,7 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
680 |
'formData_id',
|
681 |
'formData_settings',
|
682 |
'formData_fields_\d+_id',
|
|
|
683 |
// E_signature
|
684 |
'recipient_signature',
|
685 |
'output_\d+_\w{0,2}',
|
@@ -691,6 +692,8 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
691 |
'_facebook',
|
692 |
'_social',
|
693 |
'user_login-',
|
|
|
|
|
694 |
);
|
695 |
|
696 |
// Reset $message if we have a sign-up data
|
@@ -748,9 +751,9 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
748 |
// Names
|
749 |
}elseif (preg_match("/name/i", $key)){
|
750 |
|
751 |
-
preg_match("/(
|
752 |
-
preg_match("/(
|
753 |
-
preg_match("
|
754 |
|
755 |
if(count($match_forename) > 1)
|
756 |
$nickname['first'] = $value;
|
680 |
'formData_id',
|
681 |
'formData_settings',
|
682 |
'formData_fields_\d+_id',
|
683 |
+
'formData_fields_\d+_files.*',
|
684 |
// E_signature
|
685 |
'recipient_signature',
|
686 |
'output_\d+_\w{0,2}',
|
692 |
'_facebook',
|
693 |
'_social',
|
694 |
'user_login-',
|
695 |
+
// Contact Form 7
|
696 |
+
'_wpcf7',
|
697 |
);
|
698 |
|
699 |
// Reset $message if we have a sign-up data
|
751 |
// Names
|
752 |
}elseif (preg_match("/name/i", $key)){
|
753 |
|
754 |
+
preg_match("/((name.?)?(your|first|for)(.?name)?)$/", $key, $match_forename);
|
755 |
+
preg_match("/((name.?)?(last|family|second|sur)(.?name)?)$/", $key, $match_surname);
|
756 |
+
preg_match("/^(name.?)?(nick|user)(.?name)?$/", $key, $match_nickname);
|
757 |
|
758 |
if(count($match_forename) > 1)
|
759 |
$nickname['first'] = $value;
|
inc/cleantalk-public.php
CHANGED
@@ -1635,27 +1635,16 @@ function ct_wpcf7_spam($param) {
|
|
1635 |
? js_test('ct_checkjs', $_COOKIE, true)
|
1636 |
: js_test($ct_checkjs_cf7, $_POST, true);
|
1637 |
|
1638 |
-
|
1639 |
-
|
1640 |
-
$
|
1641 |
-
$
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
}else if ($sender_nickname === null && preg_match("/-name$/", $k)){
|
1649 |
-
$sender_nickname = $v;
|
1650 |
-
}else if ($subject === '' && ct_get_data_from_submit($k, 'subject')){
|
1651 |
-
$subject = $v;
|
1652 |
-
}else if (preg_match("/(\-message|\w*message\w*|contact|comment|contact\-)$/", $k)){
|
1653 |
-
$message[$k]= $v;
|
1654 |
-
}
|
1655 |
-
}
|
1656 |
-
if($subject != ''){
|
1657 |
-
$message['subject'] = $subject;
|
1658 |
-
}
|
1659 |
|
1660 |
$base_call_result = apbct_base_call(
|
1661 |
array(
|
1635 |
? js_test('ct_checkjs', $_COOKIE, true)
|
1636 |
: js_test($ct_checkjs_cf7, $_POST, true);
|
1637 |
|
1638 |
+
$ct_temp_msg_data = ct_get_fields_any($_POST);
|
1639 |
+
|
1640 |
+
$sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
|
1641 |
+
$sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
|
1642 |
+
$subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
|
1643 |
+
$contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
|
1644 |
+
$message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
|
1645 |
+
if ($subject != '') {
|
1646 |
+
$message = array_merge(array('subject' => $subject), $message);
|
1647 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1648 |
|
1649 |
$base_call_result = apbct_base_call(
|
1650 |
array(
|
js/cleantalk-admin.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
jQuery(document).ready(function(){
|
2 |
|
3 |
-
//
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
|
9 |
});
|
1 |
jQuery(document).ready(function(){
|
2 |
|
3 |
+
// Auto update banner close handler
|
4 |
+
jQuery('.apbct_update_notice').on('click', 'button', function(){
|
5 |
+
var ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );
|
6 |
+
document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
|
7 |
+
});
|
8 |
|
9 |
});
|
lib/CleantalkUpgrader.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CleantalkUpgrader extends Plugin_Upgrader
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Plugin upgrade result.
|
7 |
+
*
|
8 |
+
* @since 2.8.0
|
9 |
+
* @var array|WP_Error $result
|
10 |
+
*
|
11 |
+
* @see WP_Upgrader::$result
|
12 |
+
*/
|
13 |
+
public $result;
|
14 |
+
|
15 |
+
public $apbct_result = 'OK';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Initialize the upgrade strings.
|
19 |
+
*
|
20 |
+
* @since 2.8.0
|
21 |
+
*/
|
22 |
+
public function upgrade_strings() {
|
23 |
+
$this->strings['up_to_date'] = __('UP_TO_DATE');
|
24 |
+
$this->strings['no_package'] = __('PACKAGE_NOT_AVAILABLE');
|
25 |
+
/* translators: %s: package URL */
|
26 |
+
$this->strings['remove_old_failed'] = __('COULD_NOT_REMOVE_OLD_PLUGIN');
|
27 |
+
$this->strings['process_failed'] = __('PLUGIN_UPDATE_FAILED');
|
28 |
+
$this->strings['process_success'] = __('OK');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function run( $options ) {
|
32 |
+
|
33 |
+
$defaults = array(
|
34 |
+
'package' => '', // Please always pass this.
|
35 |
+
'destination' => '', // And this
|
36 |
+
'clear_destination' => false,
|
37 |
+
'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
|
38 |
+
'clear_working' => true,
|
39 |
+
'is_multi' => false,
|
40 |
+
'hook_extra' => array() // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
|
41 |
+
);
|
42 |
+
|
43 |
+
$options = wp_parse_args( $options, $defaults );
|
44 |
+
|
45 |
+
$options = apply_filters( 'upgrader_package_options', $options );
|
46 |
+
|
47 |
+
if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
|
48 |
+
$this->skin->header();
|
49 |
+
}
|
50 |
+
|
51 |
+
// Connect to the Filesystem first.
|
52 |
+
$res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
|
53 |
+
// Mainly for non-connected filesystem.
|
54 |
+
if ( ! $res ) {
|
55 |
+
if ( ! $options['is_multi'] ) {
|
56 |
+
$this->skin->footer();
|
57 |
+
}
|
58 |
+
return false;
|
59 |
+
}
|
60 |
+
|
61 |
+
$this->skin->before();
|
62 |
+
|
63 |
+
if ( is_wp_error($res) ) {
|
64 |
+
$this->skin->error($res);
|
65 |
+
$this->skin->after();
|
66 |
+
if ( ! $options['is_multi'] ) {
|
67 |
+
$this->skin->footer();
|
68 |
+
}
|
69 |
+
return $res;
|
70 |
+
}
|
71 |
+
|
72 |
+
/*
|
73 |
+
* Download the package (Note, This just returns the filename
|
74 |
+
* of the file if the package is a local file)
|
75 |
+
*/
|
76 |
+
$download = $this->download_package( $options['package'] );
|
77 |
+
if ( is_wp_error($download) ) {
|
78 |
+
$this->skin->error($download);
|
79 |
+
$this->skin->after();
|
80 |
+
if ( ! $options['is_multi'] ) {
|
81 |
+
$this->skin->footer();
|
82 |
+
}
|
83 |
+
return $download;
|
84 |
+
}
|
85 |
+
|
86 |
+
$delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
|
87 |
+
|
88 |
+
// Unzips the file into a temporary directory.
|
89 |
+
$working_dir = $this->unpack_package( $download, $delete_package );
|
90 |
+
if ( is_wp_error($working_dir) ) {
|
91 |
+
$this->skin->error($working_dir);
|
92 |
+
$this->skin->after();
|
93 |
+
if ( ! $options['is_multi'] ) {
|
94 |
+
$this->skin->footer();
|
95 |
+
}
|
96 |
+
return $working_dir;
|
97 |
+
}
|
98 |
+
|
99 |
+
// With the given options, this installs it to the destination directory.
|
100 |
+
$result = $this->install_package( array(
|
101 |
+
'source' => $working_dir,
|
102 |
+
'destination' => $options['destination'],
|
103 |
+
'clear_destination' => $options['clear_destination'],
|
104 |
+
'abort_if_destination_exists' => $options['abort_if_destination_exists'],
|
105 |
+
'clear_working' => $options['clear_working'],
|
106 |
+
'hook_extra' => $options['hook_extra']
|
107 |
+
) );
|
108 |
+
|
109 |
+
$this->skin->set_result($result);
|
110 |
+
if ( is_wp_error($result) ) {
|
111 |
+
$this->skin->error($result);
|
112 |
+
$this->skin->feedback('process_failed');
|
113 |
+
} else {
|
114 |
+
// Installation succeeded.
|
115 |
+
$this->skin->feedback('process_success');
|
116 |
+
}
|
117 |
+
|
118 |
+
return $result;
|
119 |
+
}
|
120 |
+
}
|
lib/CleantalkUpgraderSkin.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CleantalkUpgraderSkin extends WP_Upgrader_Skin
|
4 |
+
{
|
5 |
+
|
6 |
+
public $upgrader;
|
7 |
+
public $done_header = false;
|
8 |
+
public $done_footer = false;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Holds the result of an upgrade.
|
12 |
+
*
|
13 |
+
* @since 2.8.0
|
14 |
+
* @var string|bool|WP_Error
|
15 |
+
*/
|
16 |
+
public $result = false;
|
17 |
+
public $options = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
*/
|
21 |
+
public function header() { }
|
22 |
+
|
23 |
+
/**
|
24 |
+
*/
|
25 |
+
public function footer() { }
|
26 |
+
|
27 |
+
/**
|
28 |
+
*
|
29 |
+
* @param string $string
|
30 |
+
*/
|
31 |
+
public function feedback($string) { }
|
32 |
+
|
33 |
+
/**
|
34 |
+
*
|
35 |
+
* @param string|WP_Error $errors
|
36 |
+
*/
|
37 |
+
public function error($errors) {
|
38 |
+
$this->upgrader->apbct_result = $this->upgrader->strings[$errors];
|
39 |
+
}
|
40 |
+
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: znaeff, shagimuratov, sartemd174
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 4.9.
|
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.
|
@@ -504,6 +504,13 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
504 |
1. The plugin deletes/removes the existing spam comments and users accounts.
|
505 |
|
506 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
= 5.87 February 2 2018 =
|
508 |
* Filtration quality improved.
|
509 |
* Fix: WP Foto Vote downloading images.
|
@@ -1510,6 +1517,13 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
1510 |
* First version
|
1511 |
|
1512 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1513 |
= 5.87 February 2 2018 =
|
1514 |
* Filtration quality improved.
|
1515 |
* Fix: WP Foto Vote downloading images.
|
2 |
Contributors: znaeff, shagimuratov, sartemd174
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 4.9.3
|
6 |
+
Stable tag: 5.88
|
7 |
License: GPLv2
|
8 |
|
9 |
Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
|
504 |
1. The plugin deletes/removes the existing spam comments and users accounts.
|
505 |
|
506 |
== Changelog ==
|
507 |
+
= 5.88 February 12 2018 =
|
508 |
+
* Integration: ConvertPro.
|
509 |
+
* Improvement: Search for visitor's names in request.
|
510 |
+
* Fix: Contact Form 7 message recognition.
|
511 |
+
* Preparation for the remote plugin update.
|
512 |
+
* Minor fixes.
|
513 |
+
|
514 |
= 5.87 February 2 2018 =
|
515 |
* Filtration quality improved.
|
516 |
* Fix: WP Foto Vote downloading images.
|
1517 |
* First version
|
1518 |
|
1519 |
== Upgrade Notice ==
|
1520 |
+
= 5.88 February 12 2018 =
|
1521 |
+
* Integration: ConvertPro.
|
1522 |
+
* Improvement: Search for visitor's names in request.
|
1523 |
+
* Fix: Contact Form 7 message recognition.
|
1524 |
+
* Preparation for the remote plugin update.
|
1525 |
+
* Minor fixes.
|
1526 |
+
|
1527 |
= 5.87 February 2 2018 =
|
1528 |
* Filtration quality improved.
|
1529 |
* Fix: WP Foto Vote downloading images.
|