Version Description
November 7 2018 = * Fix: White label mode. * Fix: SpamFireWall now can be disabled. * Fix: Layout. * Integration: WPForms. * Add: Message about block for all no integrated AJAX forms. * Add: Displaying account name near api key.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.108 |
Comparing to | |
See all releases |
Code changes from version 5.107 to 5.108
- cleantalk.php +16 -14
- css/cleantalk-admin-settings-page.css +1 -1
- inc/cleantalk-ajax.php +2 -3
- inc/cleantalk-common.php +29 -1
- inc/cleantalk-integrations.php +55 -0
- inc/cleantalk-public.php +403 -105
- inc/cleantalk-settings.php +21 -13
- js/apbct-public--gdpr.js +5 -2
- js/apbct-public.js +9 -1
- js/cleantalk-admin.js +1 -1
- lib/CleantalkResponse.php +7 -1
- lib/CleantalkState.php +11 -3
- readme.txt +17 -1
cleantalk.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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 |
*/
|
@@ -77,7 +77,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
77 |
|
78 |
$apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
|
79 |
$apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
|
80 |
-
|
81 |
// START OF White label reassignments
|
82 |
$apbct->white_label = defined('APBCT_WHITELABLE') && APBCT_WHITELABLE == true ? true : false;
|
83 |
|
@@ -85,7 +85,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
85 |
|
86 |
// New plugin name
|
87 |
// $apbct->plugin_name = $apcbt->data['white_label_data']['plugin_name'];
|
88 |
-
$apbct->plugin_name = defined('
|
89 |
|
90 |
// Logotypes
|
91 |
// $apbct->logo = $apcbt->data['white_label_data']['logo']
|
@@ -313,10 +313,10 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
313 |
add_filter('comment_text', 'ct_comment_text' );
|
314 |
|
315 |
// Registrations
|
316 |
-
add_action('register_form','ct_register_form');
|
317 |
add_filter('registration_errors', 'ct_registration_errors', 1, 3);
|
318 |
add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
|
319 |
-
add_action('user_register',
|
320 |
|
321 |
// Multisite registrations
|
322 |
add_action('signup_extra_fields','ct_register_form');
|
@@ -862,15 +862,17 @@ function ct_account_status_check($api_key = null){
|
|
862 |
$apbct->data['notice_auto_update'] = isset($result['show_auto_update_notice']) ? (int)$result['show_auto_update_notice'] : 0;
|
863 |
|
864 |
// Other
|
865 |
-
$apbct->data['service_id'] = isset($result['service_id'])
|
866 |
-
$apbct->data['valid'] = isset($result['valid'])
|
867 |
-
$apbct->data['moderate'] = isset($result['moderate'])
|
868 |
-
$apbct->data['
|
869 |
-
$apbct->data['
|
870 |
-
$apbct->data['spam_count'] = isset($result['spam_count'])
|
871 |
-
$apbct->data['auto_update'] = isset($result['auto_update_app'])
|
872 |
-
$apbct->data['user_token'] = isset($result['user_token'])
|
873 |
-
$apbct->data['license_trial'] = isset($result['license_trial'])
|
|
|
|
|
874 |
|
875 |
if($apbct->data['notice_show'] == 1 && $apbct->data['notice_trial'] == 1)
|
876 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
|
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.108
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
77 |
|
78 |
$apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
|
79 |
$apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
|
80 |
+
|
81 |
// START OF White label reassignments
|
82 |
$apbct->white_label = defined('APBCT_WHITELABLE') && APBCT_WHITELABLE == true ? true : false;
|
83 |
|
85 |
|
86 |
// New plugin name
|
87 |
// $apbct->plugin_name = $apcbt->data['white_label_data']['plugin_name'];
|
88 |
+
$apbct->plugin_name = defined('APBCT_WHITELABEL_NAME') ? APBCT_WHITELABEL_NAME : $apbct->plugin_name; // For test purposes
|
89 |
|
90 |
// Logotypes
|
91 |
// $apbct->logo = $apcbt->data['white_label_data']['logo']
|
313 |
add_filter('comment_text', 'ct_comment_text' );
|
314 |
|
315 |
// Registrations
|
316 |
+
add_action('register_form', 'ct_register_form');
|
317 |
add_filter('registration_errors', 'ct_registration_errors', 1, 3);
|
318 |
add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
|
319 |
+
add_action('user_register', 'ct_user_register');
|
320 |
|
321 |
// Multisite registrations
|
322 |
add_action('signup_extra_fields','ct_register_form');
|
862 |
$apbct->data['notice_auto_update'] = isset($result['show_auto_update_notice']) ? (int)$result['show_auto_update_notice'] : 0;
|
863 |
|
864 |
// Other
|
865 |
+
$apbct->data['service_id'] = isset($result['service_id']) ? (int)$result['service_id'] : 0;
|
866 |
+
$apbct->data['valid'] = isset($result['valid']) ? (int)$result['valid'] : 0;
|
867 |
+
$apbct->data['moderate'] = isset($result['moderate']) ? (int)$result['moderate'] : 0;
|
868 |
+
$apbct->data['ip_license'] = isset($result['ip_license']) ? (int)$result['ip_license'] : 0;
|
869 |
+
$apbct->data['moderate_ip'] = isset($result['moderate_ip'], $result['ip_license']) ? (int)$result['moderate_ip'] : 0;
|
870 |
+
$apbct->data['spam_count'] = isset($result['spam_count']) ? (int)$result['spam_count'] : 0;
|
871 |
+
$apbct->data['auto_update'] = isset($result['auto_update_app']) ? (int)$result['auto_update_app'] : 0;
|
872 |
+
$apbct->data['user_token'] = isset($result['user_token']) ? (string)$result['user_token'] : '';
|
873 |
+
$apbct->data['license_trial'] = isset($result['license_trial']) ? (int)$result['license_trial'] : 0;
|
874 |
+
$apbct->data['account_name_ob'] = isset($result['account_name_ob']) ? (string)$result['account_name_ob'] : '';
|
875 |
+
|
876 |
|
877 |
if($apbct->data['notice_show'] == 1 && $apbct->data['notice_trial'] == 1)
|
878 |
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
|
css/cleantalk-admin-settings-page.css
CHANGED
@@ -90,7 +90,6 @@
|
|
90 |
text-decoration: none;
|
91 |
font-size: 13px;
|
92 |
line-height: 26px;
|
93 |
-
height: 28px;
|
94 |
margin: 0;
|
95 |
padding: 0 10px 1px;
|
96 |
cursor: pointer;
|
@@ -103,6 +102,7 @@
|
|
103 |
-webkit-box-sizing: border-box;
|
104 |
-moz-box-sizing: border-box;
|
105 |
box-sizing: border-box;
|
|
|
106 |
}
|
107 |
.cleantalk_manual_link:hover
|
108 |
{
|
90 |
text-decoration: none;
|
91 |
font-size: 13px;
|
92 |
line-height: 26px;
|
|
|
93 |
margin: 0;
|
94 |
padding: 0 10px 1px;
|
95 |
cursor: pointer;
|
102 |
-webkit-box-sizing: border-box;
|
103 |
-moz-box-sizing: border-box;
|
104 |
box-sizing: border-box;
|
105 |
+
text-align: center;
|
106 |
}
|
107 |
.cleantalk_manual_link:hover
|
108 |
{
|
inc/cleantalk-ajax.php
CHANGED
@@ -603,7 +603,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
603 |
die(json_encode($result));
|
604 |
}
|
605 |
//ConvertPro
|
606 |
-
elseif(isset($_POST['action']) && $_POST['action']
|
607 |
{
|
608 |
$result = Array(
|
609 |
'success' => false,
|
@@ -614,8 +614,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
614 |
}
|
615 |
else
|
616 |
{
|
617 |
-
|
618 |
-
die();
|
619 |
}
|
620 |
}
|
621 |
//Allow == 1
|
603 |
die(json_encode($result));
|
604 |
}
|
605 |
//ConvertPro
|
606 |
+
elseif(isset($_POST['action']) && $_POST['action'] == 'cp_v2_notify_admin' || $_POST['action'] == 'cpro_notify_via_email')
|
607 |
{
|
608 |
$result = Array(
|
609 |
'success' => false,
|
614 |
}
|
615 |
else
|
616 |
{
|
617 |
+
die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $ct_result->comment,))));
|
|
|
618 |
}
|
619 |
}
|
620 |
//Allow == 1
|
inc/cleantalk-common.php
CHANGED
@@ -205,12 +205,39 @@ function apbct_get_sender_info() {
|
|
205 |
'key_press_timestamp' => !empty($_COOKIE['ct_fkp_timestamp']) ? $_COOKIE['ct_fkp_timestamp'] : null,
|
206 |
'page_set_timestamp' => !empty($_COOKIE['ct_ps_timestamp']) ? $_COOKIE['ct_ps_timestamp'] : null,
|
207 |
'form_visible_inputs' => !empty($_COOKIE['apbct_visible_fields_count']) ? $_COOKIE['apbct_visible_fields_count'] : null,
|
208 |
-
'apbct_visible_fields' => !empty($_COOKIE['apbct_visible_fields']) ? $_COOKIE['apbct_visible_fields']
|
209 |
// Debug stuff
|
210 |
'amp_detected' => $amp_detected,
|
211 |
);
|
212 |
}
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
/**
|
215 |
* Get ct_get_checkjs_value
|
216 |
* @return string
|
@@ -434,6 +461,7 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
434 |
'security',
|
435 |
// 'action',
|
436 |
'http_referer',
|
|
|
437 |
'timestamp',
|
438 |
'captcha',
|
439 |
// Formidable Form
|
205 |
'key_press_timestamp' => !empty($_COOKIE['ct_fkp_timestamp']) ? $_COOKIE['ct_fkp_timestamp'] : null,
|
206 |
'page_set_timestamp' => !empty($_COOKIE['ct_ps_timestamp']) ? $_COOKIE['ct_ps_timestamp'] : null,
|
207 |
'form_visible_inputs' => !empty($_COOKIE['apbct_visible_fields_count']) ? $_COOKIE['apbct_visible_fields_count'] : null,
|
208 |
+
'apbct_visible_fields' => !empty($_COOKIE['apbct_visible_fields']) ? apbct_visibile_fields__process($_COOKIE['apbct_visible_fields']) : null,
|
209 |
// Debug stuff
|
210 |
'amp_detected' => $amp_detected,
|
211 |
);
|
212 |
}
|
213 |
|
214 |
+
/**
|
215 |
+
* Process visible fields for specific form to match the fields from request
|
216 |
+
*
|
217 |
+
* @param string $visible_fields
|
218 |
+
*
|
219 |
+
* @return string
|
220 |
+
*/
|
221 |
+
function apbct_visibile_fields__process($visible_fields) {
|
222 |
+
if(strpos($visible_fields, 'wpforms') !== false){
|
223 |
+
$visible_fields = preg_replace(
|
224 |
+
array('/\[/', '/\]/'),
|
225 |
+
'',
|
226 |
+
str_replace(
|
227 |
+
'][',
|
228 |
+
'_',
|
229 |
+
str_replace(
|
230 |
+
'wpforms[fields]',
|
231 |
+
'',
|
232 |
+
$visible_fields
|
233 |
+
)
|
234 |
+
)
|
235 |
+
);
|
236 |
+
}
|
237 |
+
|
238 |
+
return $visible_fields;
|
239 |
+
}
|
240 |
+
|
241 |
/**
|
242 |
* Get ct_get_checkjs_value
|
243 |
* @return string
|
461 |
'security',
|
462 |
// 'action',
|
463 |
'http_referer',
|
464 |
+
'referer-page',
|
465 |
'timestamp',
|
466 |
'captcha',
|
467 |
// Formidable Form
|
inc/cleantalk-integrations.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CleantalkIntegration {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @var string Integration name
|
7 |
+
*/
|
8 |
+
public $name;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* @var string Integration type (form || comment || registration)
|
12 |
+
*/
|
13 |
+
public $type = 'form';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var boolean Ajax or not
|
17 |
+
*/
|
18 |
+
public $ajax = false;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var mixed array|null Request param for identify integration. For example: array('action' => 'myform')
|
22 |
+
*/
|
23 |
+
public $identify = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var mixed null|string|array special JSON string for form response
|
27 |
+
*/
|
28 |
+
public $response;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var array Array with hooks.
|
32 |
+
* Example:
|
33 |
+
* array(
|
34 |
+
* 'spam_check' => array(
|
35 |
+
* 'hook_function' => 'add_filter|do_action',
|
36 |
+
* 'hook' => 'myform_test_spam',
|
37 |
+
* 'function' => 'apbct_test_spam'
|
38 |
+
* )
|
39 |
+
* )
|
40 |
+
*/
|
41 |
+
public $actions = array();
|
42 |
+
|
43 |
+
function __construct($name, $type, $params = array()) {
|
44 |
+
|
45 |
+
$this->name = $name;
|
46 |
+
$this->type = $type;
|
47 |
+
$this->ajax = isset($params['ajax']) ? true : false;
|
48 |
+
$this->identify = isset($params['idetify']) ? $params['idetify'] : null;
|
49 |
+
$this->response = isset($params['response']) ? $params['response'] : null;
|
50 |
+
$this->actions = isset($params['actions']) ? $params['actions'] : null;
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
}
|
inc/cleantalk-public.php
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
/**
|
4 |
* Init functions
|
5 |
* @return mixed[] Array of options
|
6 |
*/
|
7 |
function apbct_init() {
|
|
|
8 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $ct_check_post_result, $test_external_forms, $cleantalk_executed, $wpdb;
|
9 |
|
10 |
//Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
|
@@ -85,73 +89,68 @@ function apbct_init() {
|
|
85 |
//add_action('wp_footer','ct_ajaxurl');
|
86 |
|
87 |
// Fast Secure contact form
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
// WooCoomerse signups
|
94 |
-
if(class_exists('WooCommerce'))
|
95 |
add_filter('woocommerce_register_post', 'ct_register_post', 1, 3);
|
96 |
-
|
97 |
-
|
|
|
98 |
add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
|
99 |
-
}
|
100 |
|
101 |
|
102 |
// JetPack Contact form
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
|
128 |
// WP Maintenance Mode (wpmm)
|
129 |
-
|
130 |
|
131 |
// Contact Form7
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
add_filter('wpcf7_spam', 'apbct_form__contactForm7__testSpam');
|
137 |
-
else
|
138 |
-
add_filter('wpcf7_acceptance', 'apbct_form__contactForm7__testSpam');
|
139 |
-
|
140 |
-
}
|
141 |
|
142 |
// Formidable
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
|
148 |
// BuddyPress
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
|
156 |
if(defined('PROFILEPRESS_SYSTEM_FILE_PATH')){
|
157 |
add_filter('pp_registration_validation', 'ct_registration_errors_ppress', 11, 2);
|
@@ -159,22 +158,21 @@ function apbct_init() {
|
|
159 |
|
160 |
|
161 |
// bbPress
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
|
170 |
//Custom Contact Forms
|
171 |
-
|
172 |
-
|
173 |
-
}
|
174 |
|
175 |
add_action('comment_form', 'ct_comment_form');
|
176 |
|
177 |
-
//intercept WordPress Landing Pages POST
|
178 |
if (defined('LANDINGPAGES_CURRENT_VERSION') && !empty($_POST)){
|
179 |
if(array_key_exists('action', $_POST) && $_POST['action'] === 'inbound_store_lead'){ // AJAX action(s)
|
180 |
ct_check_wplp();
|
@@ -183,44 +181,79 @@ function apbct_init() {
|
|
183 |
}
|
184 |
}
|
185 |
|
186 |
-
// intercept
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
195 |
}
|
196 |
}
|
197 |
-
}
|
198 |
|
199 |
-
//
|
200 |
// New user approve hack
|
201 |
// https://wordpress.org/plugins/new-user-approve/
|
202 |
-
//
|
203 |
if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
|
204 |
add_action('register_post', 'ct_register_post', 1, 3);
|
205 |
}
|
206 |
|
207 |
-
//
|
208 |
// Gravity forms
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
}
|
215 |
|
216 |
-
//
|
217 |
//Pirate forms
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
-
|
224 |
//
|
225 |
// Load JS code to website footer
|
226 |
//
|
@@ -260,7 +293,7 @@ add_filter( 'mc4wp_form_messages', 'ct_add_mc4wp_error_message' );
|
|
260 |
|
261 |
/*
|
262 |
* Function to set validate fucntion for CCF form
|
263 |
-
* Input -
|
264 |
* Returns - String. Validate function
|
265 |
*/
|
266 |
function ct_ccf($callback, $value, $field_id, $type){
|
@@ -569,13 +602,11 @@ function apbct_hook__wp_footer() {
|
|
569 |
function ct_add_hidden_fields($random_key = false, $field_name = 'ct_checkjs', $return_string = false, $cookie_check = false, $no_print = false) {
|
570 |
|
571 |
global $ct_checkjs_def, $apbct;
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
$ct_checkjs_key = ct_get_checkjs_value($random_key);
|
576 |
$field_id_hash = md5(rand(0, 1000));
|
577 |
|
578 |
-
if ($cookie_check && $apbct->settings['set_cookies'] == 1) {
|
579 |
|
580 |
$html = "<script type='text/javascript'>
|
581 |
function ctSetCookie(c_name, value, def_value){
|
@@ -796,7 +827,7 @@ function ct_preprocess_comment($comment) {
|
|
796 |
// this action is called by wp-comments-post.php
|
797 |
// after processing WP makes redirect to post page with comment's form by GET request (see above)
|
798 |
global $current_user, $comment_post_id, $ct_comment_done, $ct_jp_comments, $apbct;
|
799 |
-
|
800 |
// Skip processing admin.
|
801 |
if (in_array("administrator", $current_user->roles))
|
802 |
return $comment;
|
@@ -956,13 +987,58 @@ function ct_preprocess_comment($comment) {
|
|
956 |
if($apbct->settings['remove_comments_links'] == 1){
|
957 |
$comment = preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", '[Link deleted]', $comment);
|
958 |
}
|
959 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
960 |
return $comment;
|
961 |
}
|
962 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
/**
|
964 |
* Set die page with Cleantalk comment.
|
965 |
-
* @global
|
966 |
$err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
|
967 |
* @param type $comment_status
|
968 |
*/
|
@@ -1001,14 +1077,14 @@ function apbct_js_test($field_name = 'ct_checkjs', $data = null, $random_key = f
|
|
1001 |
|
1002 |
$checkjs = null;
|
1003 |
$js_post_value = null;
|
1004 |
-
|
1005 |
if (!$data)
|
1006 |
return $checkjs;
|
1007 |
|
1008 |
if (isset($data[$field_name])) {
|
1009 |
|
1010 |
$js_post_value = $data[$field_name];
|
1011 |
-
|
1012 |
// Random key check
|
1013 |
if ($random_key) {
|
1014 |
$keys = $apbct->js_keys;
|
@@ -1408,10 +1484,48 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1408 |
setcookie($apbct_cookie_request_id_label, $ct_result->id, time()+10, '/');
|
1409 |
}
|
1410 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1411 |
|
1412 |
return $errors;
|
1413 |
}
|
1414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1415 |
/**
|
1416 |
* Checks registration error and set it if it was dropped
|
1417 |
* @return errors
|
@@ -1694,9 +1808,8 @@ function apbct_form__contactForm7__changeMailNotification($component){
|
|
1694 |
|
1695 |
global $apbct;
|
1696 |
|
1697 |
-
$component['body']
|
1698 |
-
.
|
1699 |
-
.__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
1700 |
.PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
|
1701 |
.PHP_EOL . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=cf7_spam_passed" target="_blank">' . $apbct->sender_ip . '</a>'
|
1702 |
.PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=cf7_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
@@ -1704,13 +1817,18 @@ function apbct_form__contactForm7__changeMailNotification($component){
|
|
1704 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1705 |
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam" target="_blank">',
|
1706 |
'</a>'
|
1707 |
-
)
|
|
|
|
|
1708 |
|
1709 |
return (array) $component;
|
1710 |
}
|
1711 |
|
1712 |
/**
|
1713 |
* Test Ninja Forms message for spam
|
|
|
|
|
|
|
1714 |
*/
|
1715 |
function apbct_form__ninjaForms__testSpam() {
|
1716 |
|
@@ -1796,7 +1914,7 @@ function apbct_form__ninjaForms__changeMailNotification($message, $data, $action
|
|
1796 |
.PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=ninjaform_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
1797 |
.PHP_EOL . sprintf(
|
1798 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1799 |
-
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=
|
1800 |
'</a>'
|
1801 |
));
|
1802 |
}
|
@@ -1804,6 +1922,151 @@ function apbct_form__ninjaForms__changeMailNotification($message, $data, $action
|
|
1804 |
return $message;
|
1805 |
}
|
1806 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1807 |
/**
|
1808 |
* Inserts anti-spam hidden to Fast Secure contact form
|
1809 |
*/
|
@@ -2073,6 +2336,34 @@ function ct_s2member_registration_test($post_key) {
|
|
2073 |
return true;
|
2074 |
}
|
2075 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2076 |
/**
|
2077 |
* General test for any contact form
|
2078 |
*/
|
@@ -2125,7 +2416,13 @@ function ct_contact_form_validate() {
|
|
2125 |
) {
|
2126 |
return null;
|
2127 |
}
|
2128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2129 |
// Do not execute anti-spam test for logged in users.
|
2130 |
if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
|
2131 |
return null;
|
@@ -2308,7 +2605,8 @@ function ct_contact_form_validate_postdata() {
|
|
2308 |
isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
|
2309 |
strpos($_SERVER['REQUEST_URI'],'/wc-api/')!==false ||
|
2310 |
(isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
|
2311 |
-
(isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) //WooCommerce login form
|
|
|
2312 |
) {
|
2313 |
return null;
|
2314 |
}
|
1 |
<?php
|
2 |
|
3 |
+
// File with integrations
|
4 |
+
require_once('cleantalk-integrations.php');
|
5 |
+
|
6 |
/**
|
7 |
* Init functions
|
8 |
* @return mixed[] Array of options
|
9 |
*/
|
10 |
function apbct_init() {
|
11 |
+
|
12 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $ct_check_post_result, $test_external_forms, $cleantalk_executed, $wpdb;
|
13 |
|
14 |
//Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
|
89 |
//add_action('wp_footer','ct_ajaxurl');
|
90 |
|
91 |
// Fast Secure contact form
|
92 |
+
if(defined('FSCF_VERSION')){
|
93 |
+
add_filter('si_contact_display_after_fields', 'ct_si_contact_display_after_fields');
|
94 |
+
add_filter('si_contact_form_validate', 'ct_si_contact_form_validate');
|
95 |
+
}
|
96 |
|
97 |
// WooCoomerse signups
|
98 |
+
if(class_exists('WooCommerce'))
|
99 |
add_filter('woocommerce_register_post', 'ct_register_post', 1, 3);
|
100 |
+
|
101 |
+
// WooCommerce whishlist
|
102 |
+
if(class_exists('WC_Wishlists_Wishlist'))
|
103 |
add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
|
|
|
104 |
|
105 |
|
106 |
// JetPack Contact form
|
107 |
+
$jetpack_active_modules = false;
|
108 |
+
if(defined('JETPACK__VERSION'))
|
109 |
+
{
|
110 |
+
if(isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form' ){
|
111 |
+
if(JETPACK__VERSION=='3.4-beta')
|
112 |
+
{
|
113 |
+
add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
|
114 |
+
}
|
115 |
+
else if(JETPACK__VERSION=='3.4-beta2'||JETPACK__VERSION>='3.4')
|
116 |
+
{
|
117 |
+
add_filter('jetpack_contact_form_is_spam', 'ct_contact_form_is_spam_jetpack',50,2);
|
118 |
+
}
|
119 |
+
else
|
120 |
+
{
|
121 |
+
add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
|
122 |
+
}
|
123 |
+
$jetpack_active_modules = get_option('jetpack_active_modules');
|
124 |
+
if ((class_exists( 'Jetpack', false) && $jetpack_active_modules && in_array('comments', $jetpack_active_modules)))
|
125 |
+
{
|
126 |
+
$ct_jp_comments = true;
|
127 |
+
}
|
128 |
+
}else
|
129 |
+
add_filter('grunion_contact_form_field_html', 'ct_grunion_contact_form_field_html', 10, 2);
|
130 |
+
}
|
131 |
|
132 |
// WP Maintenance Mode (wpmm)
|
133 |
+
add_action('wpmm_head', 'apbct_form__wpmm__addField', 1);
|
134 |
|
135 |
// Contact Form7
|
136 |
+
if(defined('WPCF7_VERSION')){
|
137 |
+
add_filter('wpcf7_form_elements', 'apbct_form__contactForm7__addField');
|
138 |
+
add_filter(WPCF7_VERSION >= '3.0.0' ? 'wpcf7_spam' : 'wpcf7_acceptance', 'apbct_form__contactForm7__testSpam');
|
139 |
+
}
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
// Formidable
|
142 |
+
if(class_exists('FrmSettings')){
|
143 |
+
add_action('frm_validate_entry', 'ct_frm_validate_entry', 1, 2);
|
144 |
+
add_action('frm_entries_footer_scripts', 'ct_frm_entries_footer_scripts', 20, 2);
|
145 |
+
}
|
146 |
|
147 |
// BuddyPress
|
148 |
+
if(class_exists('BuddyPress')){
|
149 |
+
add_action('bp_before_registration_submit_buttons','ct_register_form',1);
|
150 |
+
add_filter('bp_signup_validate', 'ct_registration_errors',1);
|
151 |
+
add_filter('bp_signup_validate', 'ct_check_registration_erros', 999999);
|
152 |
+
add_action('messages_message_before_save','ct_bp_private_msg_check', 1);
|
153 |
+
}
|
154 |
|
155 |
if(defined('PROFILEPRESS_SYSTEM_FILE_PATH')){
|
156 |
add_filter('pp_registration_validation', 'ct_registration_errors_ppress', 11, 2);
|
158 |
|
159 |
|
160 |
// bbPress
|
161 |
+
if(class_exists('bbPress')){
|
162 |
+
add_filter('bbp_new_topic_pre_title', 'ct_bbp_get_topic', 1);
|
163 |
+
add_filter('bbp_new_topic_pre_content', 'ct_bbp_new_pre_content', 1);
|
164 |
+
add_filter('bbp_new_reply_pre_content', 'ct_bbp_new_pre_content', 1);
|
165 |
+
add_action('bbp_theme_before_topic_form_content', 'ct_comment_form');
|
166 |
+
add_action('bbp_theme_before_reply_form_content', 'ct_comment_form');
|
167 |
+
}
|
168 |
|
169 |
//Custom Contact Forms
|
170 |
+
if(defined('CCF_VERSION'))
|
171 |
+
add_filter('ccf_field_validator', 'ct_ccf', 1, 4);
|
|
|
172 |
|
173 |
add_action('comment_form', 'ct_comment_form');
|
174 |
|
175 |
+
// intercept WordPress Landing Pages POST
|
176 |
if (defined('LANDINGPAGES_CURRENT_VERSION') && !empty($_POST)){
|
177 |
if(array_key_exists('action', $_POST) && $_POST['action'] === 'inbound_store_lead'){ // AJAX action(s)
|
178 |
ct_check_wplp();
|
181 |
}
|
182 |
}
|
183 |
|
184 |
+
// S2member. intercept POST
|
185 |
+
if (defined('WS_PLUGIN__S2MEMBER_PRO_VERSION')){
|
186 |
+
$post_keys = array_keys($_POST);
|
187 |
+
foreach($post_keys as $post_key){
|
188 |
+
|
189 |
+
// Detect POST keys like /s2member_pro.*registration/
|
190 |
+
if(strpos($post_key, 's2member') !== false && strpos($post_key, 'registration') !== false){
|
191 |
+
ct_s2member_registration_test($post_key);
|
192 |
+
break;
|
193 |
+
}
|
194 |
}
|
195 |
}
|
|
|
196 |
|
|
|
197 |
// New user approve hack
|
198 |
// https://wordpress.org/plugins/new-user-approve/
|
|
|
199 |
if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
|
200 |
add_action('register_post', 'ct_register_post', 1, 3);
|
201 |
}
|
202 |
|
|
|
203 |
// Gravity forms
|
204 |
+
if (defined('GF_MIN_WP_VERSION')) {
|
205 |
+
add_filter('gform_get_form_filter', 'apbct_form__gravityForms__addField', 10, 2);
|
206 |
+
add_filter('gform_entry_is_spam', 'apbct_form__gravityForms__testSpam', 999, 3);
|
207 |
+
add_filter('gform_confirmation', 'apbct_form__gravityForms__showResponse', 999, 4 );
|
208 |
+
}
|
|
|
209 |
|
|
|
210 |
//Pirate forms
|
211 |
+
if(defined('PIRATE_FORMS_VERSION')){
|
212 |
+
if(isset($_POST['pirate-forms-contact-name']) && $_POST['pirate-forms-contact-name'] && isset($_POST['pirate-forms-contact-email']) && $_POST['pirate-forms-contact-email'])
|
213 |
+
ct_pirate_forms_check();
|
214 |
+
}
|
215 |
+
|
216 |
+
// WPForms
|
217 |
+
$apbct->integrations[] = new CleantalkIntegration(
|
218 |
+
'wpforms',
|
219 |
+
'form',
|
220 |
+
array(
|
221 |
+
'ajax' => false,
|
222 |
+
'identify' => array('wpforms' => array('submit' => 'wpforms-submit')),
|
223 |
+
'response' => null,
|
224 |
+
'actions' => array(
|
225 |
+
'add_filed' => array(
|
226 |
+
'hook_function' => 'add_action',
|
227 |
+
'hook' => 'wpforms_frontend_output',
|
228 |
+
'function' => 'apbct_form__WPForms__addField',
|
229 |
+
'priority' => 100,
|
230 |
+
'arguments_num' => 5,
|
231 |
+
),
|
232 |
+
'gather_data' => array(
|
233 |
+
'hook_function' => 'add_filter',
|
234 |
+
'hook' => 'wpforms_process_before_filter',
|
235 |
+
'function' => 'apbct_from__WPForms__gatherData',
|
236 |
+
'priority' => 100,
|
237 |
+
'arguments_num' => 2,
|
238 |
+
),
|
239 |
+
'spam_check' => array(
|
240 |
+
'hook_function' => 'add_filter',
|
241 |
+
'hook' => 'wpforms_process_initial_errors',
|
242 |
+
'function' => 'apbct_form__WPForms__showResponse',
|
243 |
+
'priority' => 100,
|
244 |
+
'arguments_num' => 2,
|
245 |
+
),
|
246 |
+
)
|
247 |
+
)
|
248 |
+
);
|
249 |
+
|
250 |
+
// Set hooks
|
251 |
+
foreach ($apbct->integrations as $integration) {
|
252 |
+
foreach ($integration->actions as $action) {
|
253 |
+
call_user_func_array($action['hook_function'], array($action['hook'], $action['function'], $action['priority'], $action['arguments_num']));
|
254 |
+
}
|
255 |
}
|
256 |
+
|
257 |
//
|
258 |
// Load JS code to website footer
|
259 |
//
|
293 |
|
294 |
/*
|
295 |
* Function to set validate fucntion for CCF form
|
296 |
+
* Input - �onsistently each form field
|
297 |
* Returns - String. Validate function
|
298 |
*/
|
299 |
function ct_ccf($callback, $value, $field_id, $type){
|
602 |
function ct_add_hidden_fields($random_key = false, $field_name = 'ct_checkjs', $return_string = false, $cookie_check = false, $no_print = false) {
|
603 |
|
604 |
global $ct_checkjs_def, $apbct;
|
605 |
+
|
|
|
|
|
606 |
$ct_checkjs_key = ct_get_checkjs_value($random_key);
|
607 |
$field_id_hash = md5(rand(0, 1000));
|
608 |
|
609 |
+
if ($cookie_check && $apbct->settings['set_cookies'] == 1) {
|
610 |
|
611 |
$html = "<script type='text/javascript'>
|
612 |
function ctSetCookie(c_name, value, def_value){
|
827 |
// this action is called by wp-comments-post.php
|
828 |
// after processing WP makes redirect to post page with comment's form by GET request (see above)
|
829 |
global $current_user, $comment_post_id, $ct_comment_done, $ct_jp_comments, $apbct;
|
830 |
+
|
831 |
// Skip processing admin.
|
832 |
if (in_array("administrator", $current_user->roles))
|
833 |
return $comment;
|
987 |
if($apbct->settings['remove_comments_links'] == 1){
|
988 |
$comment = preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", '[Link deleted]', $comment);
|
989 |
}
|
990 |
+
|
991 |
+
// Change mail notification if license is out of date
|
992 |
+
if($apbct->data['moderate'] == 0 &&
|
993 |
+
($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
|
994 |
+
){
|
995 |
+
$apbct->sender_email = $comment['comment_author_email'];
|
996 |
+
$apbct->sender_ip = CleantalkHelper::ip_get(array('real'));
|
997 |
+
add_filter('comment_moderation_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment sent to moderation
|
998 |
+
add_filter('comment_notification_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment approved
|
999 |
+
}
|
1000 |
+
|
1001 |
return $comment;
|
1002 |
}
|
1003 |
|
1004 |
+
/**
|
1005 |
+
* Changes email notification for spam comment for native Wordpress comment system
|
1006 |
+
*
|
1007 |
+
* @param string $notify_message Body of email notification
|
1008 |
+
* @param int $comment_id Comment id
|
1009 |
+
* @return string Body for email notification
|
1010 |
+
*/
|
1011 |
+
function apbct_comment__Wordpress__changeMailNotification($notify_message, $comment_id){
|
1012 |
+
|
1013 |
+
global $apbct;
|
1014 |
+
|
1015 |
+
$notify_message = preg_replace(
|
1016 |
+
'/\n\r\n\r/',
|
1017 |
+
strrev(PHP_EOL . PHP_EOL . '---'
|
1018 |
+
.PHP_EOL
|
1019 |
+
.__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
1020 |
+
."\n".__('CleanTalk\'s anti-spam database:', 'cleantalk')
|
1021 |
+
."\n".'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_comment_passed" target="_blank">' . $apbct->sender_ip . '</a>'
|
1022 |
+
."\n".'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_comment_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
1023 |
+
."\n".PHP_EOL . sprintf(
|
1024 |
+
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1025 |
+
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_comment_passed" target="_blank">',
|
1026 |
+
'</a>'
|
1027 |
+
)
|
1028 |
+
.PHP_EOL . '---'
|
1029 |
+
.PHP_EOL
|
1030 |
+
.PHP_EOL),
|
1031 |
+
strrev($notify_message),
|
1032 |
+
1
|
1033 |
+
);
|
1034 |
+
|
1035 |
+
return strrev($notify_message);
|
1036 |
+
|
1037 |
+
}
|
1038 |
+
|
1039 |
/**
|
1040 |
* Set die page with Cleantalk comment.
|
1041 |
+
* @global array $ct_comment
|
1042 |
$err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
|
1043 |
* @param type $comment_status
|
1044 |
*/
|
1077 |
|
1078 |
$checkjs = null;
|
1079 |
$js_post_value = null;
|
1080 |
+
|
1081 |
if (!$data)
|
1082 |
return $checkjs;
|
1083 |
|
1084 |
if (isset($data[$field_name])) {
|
1085 |
|
1086 |
$js_post_value = $data[$field_name];
|
1087 |
+
|
1088 |
// Random key check
|
1089 |
if ($random_key) {
|
1090 |
$keys = $apbct->js_keys;
|
1484 |
setcookie($apbct_cookie_request_id_label, $ct_result->id, time()+10, '/');
|
1485 |
}
|
1486 |
}
|
1487 |
+
|
1488 |
+
// Change mail notification if license is out of date
|
1489 |
+
if($apbct->data['moderate'] == 0 &&
|
1490 |
+
($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
|
1491 |
+
){
|
1492 |
+
$apbct->sender_email = $user_email;
|
1493 |
+
$apbct->sender_ip = CleantalkHelper::ip_get(array('real'));
|
1494 |
+
add_filter('wp_new_user_notification_email_admin', 'apbct_registration__Wordpress__changeMailNotification', 100, 3);
|
1495 |
+
}
|
1496 |
|
1497 |
return $errors;
|
1498 |
}
|
1499 |
|
1500 |
+
/**
|
1501 |
+
* Changes email notification for newly registred user
|
1502 |
+
*
|
1503 |
+
* @param string $wp_new_user_notification_email_admin Body of email notification
|
1504 |
+
* @param array $user User inof
|
1505 |
+
* @param string $blogname Blog name
|
1506 |
+
* @return string Body for email notification
|
1507 |
+
*/
|
1508 |
+
function apbct_registration__Wordpress__changeMailNotification($wp_new_user_notification_email_admin, $user, $blogname){
|
1509 |
+
|
1510 |
+
global $apbct;
|
1511 |
+
|
1512 |
+
$wp_new_user_notification_email_admin['message'] .= PHP_EOL . '---'
|
1513 |
+
.PHP_EOL
|
1514 |
+
.__('CleanTalk AntiSpam: This registration is spam.', 'cleantalk')
|
1515 |
+
."\n" . __('CleanTalk\'s anti-spam database:', 'cleantalk')
|
1516 |
+
."\n" . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_registration_passed" target="_blank">' . $apbct->sender_ip . '</a>'
|
1517 |
+
."\n" . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_registration_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
1518 |
+
.PHP_EOL . PHP_EOL . sprintf(
|
1519 |
+
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1520 |
+
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_registration_passed" target="_blank">',
|
1521 |
+
'</a>'
|
1522 |
+
);
|
1523 |
+
|
1524 |
+
return $wp_new_user_notification_email_admin;
|
1525 |
+
|
1526 |
+
|
1527 |
+
}
|
1528 |
+
|
1529 |
/**
|
1530 |
* Checks registration error and set it if it was dropped
|
1531 |
* @return errors
|
1808 |
|
1809 |
global $apbct;
|
1810 |
|
1811 |
+
$component['body'] =
|
1812 |
+
__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
|
|
1813 |
.PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
|
1814 |
.PHP_EOL . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=cf7_spam_passed" target="_blank">' . $apbct->sender_ip . '</a>'
|
1815 |
.PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=cf7_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
1817 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1818 |
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam" target="_blank">',
|
1819 |
'</a>'
|
1820 |
+
)
|
1821 |
+
.PHP_EOL . '---' . PHP_EOL . PHP_EOL
|
1822 |
+
.$component['body'];
|
1823 |
|
1824 |
return (array) $component;
|
1825 |
}
|
1826 |
|
1827 |
/**
|
1828 |
* Test Ninja Forms message for spam
|
1829 |
+
*
|
1830 |
+
* @global SpbcState $apbct
|
1831 |
+
* @return void
|
1832 |
*/
|
1833 |
function apbct_form__ninjaForms__testSpam() {
|
1834 |
|
1914 |
.PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=ninjaform_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
1915 |
.PHP_EOL . sprintf(
|
1916 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1917 |
+
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=ninjaform_activate_antispam" target="_blank">',
|
1918 |
'</a>'
|
1919 |
));
|
1920 |
}
|
1922 |
return $message;
|
1923 |
}
|
1924 |
|
1925 |
+
/**
|
1926 |
+
* Inserts anti-spam hidden to WPForms
|
1927 |
+
*
|
1928 |
+
* @global SpbcState $apbct
|
1929 |
+
* @return void
|
1930 |
+
*/
|
1931 |
+
function apbct_form__WPForms__addField($form_data, $some, $title, $description, $errors) {
|
1932 |
+
|
1933 |
+
global $apbct;
|
1934 |
+
|
1935 |
+
if($apbct->settings['contact_forms_test'] == 1)
|
1936 |
+
ct_add_hidden_fields(true, 'checkjs_wpforms', false);
|
1937 |
+
|
1938 |
+
}
|
1939 |
+
|
1940 |
+
/**
|
1941 |
+
* Gather fields data from submission and store it
|
1942 |
+
*
|
1943 |
+
* @global SpbcState $apbct
|
1944 |
+
* @param array $entry
|
1945 |
+
* @param array $form_data
|
1946 |
+
* @return array
|
1947 |
+
*/
|
1948 |
+
function apbct_from__WPForms__gatherData($entry, $form_data){
|
1949 |
+
|
1950 |
+
global $apbct;
|
1951 |
+
|
1952 |
+
$apbct->form_data = $entry['fields'];
|
1953 |
+
|
1954 |
+
return $entry;
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
/**
|
1958 |
+
* Adding error to form entry if message is spam
|
1959 |
+
* Call spam test from here
|
1960 |
+
*
|
1961 |
+
* @param array $errors
|
1962 |
+
* @param array $form_data
|
1963 |
+
* @return array
|
1964 |
+
*/
|
1965 |
+
function apbct_form__WPForms__showResponse($errors, $form_data) {
|
1966 |
+
|
1967 |
+
if(!$errors){
|
1968 |
+
|
1969 |
+
$spam_comment = apbct_form__WPForms__testSpam();
|
1970 |
+
|
1971 |
+
if($spam_comment)
|
1972 |
+
$errors[$form_data['id']][0] = $spam_comment;
|
1973 |
+
|
1974 |
+
}
|
1975 |
+
|
1976 |
+
return $errors;
|
1977 |
+
}
|
1978 |
+
|
1979 |
+
/**
|
1980 |
+
* Test WPForms message for spam
|
1981 |
+
* Doesn't hooked anywhere.
|
1982 |
+
* Called directly from apbct_form__WPForms__showResponse()
|
1983 |
+
*
|
1984 |
+
* @global SpbcState $apbct
|
1985 |
+
* @global array $apbct->form_data Contains form data
|
1986 |
+
* @param array $errors Array of errors to write false result in
|
1987 |
+
* @return void
|
1988 |
+
*/
|
1989 |
+
function apbct_form__WPForms__testSpam() {
|
1990 |
+
|
1991 |
+
global $apbct;
|
1992 |
+
|
1993 |
+
if(
|
1994 |
+
$apbct->settings['contact_forms_test'] == 0 ||
|
1995 |
+
$apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
|
1996 |
+
){
|
1997 |
+
return;
|
1998 |
+
}
|
1999 |
+
|
2000 |
+
$checkjs = apbct_js_test('checkjs_wpforms', $_POST, true);
|
2001 |
+
|
2002 |
+
$params = ct_get_fields_any($apbct->form_data);
|
2003 |
+
|
2004 |
+
$sender_email = ($params['email'] ? $params['email'] : '');
|
2005 |
+
$sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
|
2006 |
+
$subject = ($params['subject'] ? $params['subject'] : '');
|
2007 |
+
$message = ($params['message'] ? $params['message'] : array());
|
2008 |
+
if ($subject != '') {
|
2009 |
+
$message = array_merge(array('subject' => $subject), $message);
|
2010 |
+
}
|
2011 |
+
|
2012 |
+
$base_call_result = apbct_base_call(
|
2013 |
+
array(
|
2014 |
+
'message' => $message,
|
2015 |
+
'sender_email' => $sender_email,
|
2016 |
+
'sender_nickname' => $sender_nickname,
|
2017 |
+
'post_info' => array('comment_type' => 'feedback'),
|
2018 |
+
'checkjs' => $checkjs,
|
2019 |
+
)
|
2020 |
+
);
|
2021 |
+
$ct_result = $base_call_result['ct_result'];
|
2022 |
+
|
2023 |
+
// Change mail notification if license is out of date
|
2024 |
+
if($apbct->data['moderate'] == 0 &&
|
2025 |
+
($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
|
2026 |
+
){
|
2027 |
+
$apbct->sender_email = $sender_email;
|
2028 |
+
$apbct->sender_ip = CleantalkHelper::ip_get(array('real'));
|
2029 |
+
add_filter('wpforms_email_message', 'apbct_form__WPForms__changeMailNotification', 100, 2);
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
if ($ct_result->allow == 0){
|
2033 |
+
return $ct_result->comment;
|
2034 |
+
}
|
2035 |
+
|
2036 |
+
return false;
|
2037 |
+
|
2038 |
+
}
|
2039 |
+
|
2040 |
+
/**
|
2041 |
+
* Changes email notification for succes subscription for Ninja Forms
|
2042 |
+
*
|
2043 |
+
* @param string $message Body of email notification
|
2044 |
+
* @param WPForms_WP_Emails $wpforms_email WPForms email class object
|
2045 |
+
* @return string Body for email notification
|
2046 |
+
*/
|
2047 |
+
function apbct_form__WPForms__changeMailNotification($message, $wpforms_email){
|
2048 |
+
|
2049 |
+
global $apbct;
|
2050 |
+
|
2051 |
+
$message = str_replace('</html>', '', $message);
|
2052 |
+
$message = str_replace('</body>', '', $message);
|
2053 |
+
$message .= wpautop(PHP_EOL . '---'
|
2054 |
+
.PHP_EOL
|
2055 |
+
.__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
2056 |
+
.PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
|
2057 |
+
.PHP_EOL . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_ip . '</a>'
|
2058 |
+
.PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
|
2059 |
+
.PHP_EOL . sprintf(
|
2060 |
+
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
2061 |
+
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_activate_antispam" target="_blank">',
|
2062 |
+
'</a>'
|
2063 |
+
))
|
2064 |
+
.'</body></html>';
|
2065 |
+
|
2066 |
+
return $message;
|
2067 |
+
|
2068 |
+
}
|
2069 |
+
|
2070 |
/**
|
2071 |
* Inserts anti-spam hidden to Fast Secure contact form
|
2072 |
*/
|
2336 |
return true;
|
2337 |
}
|
2338 |
|
2339 |
+
/**
|
2340 |
+
* Recursivly search for pair of key => value in array
|
2341 |
+
*
|
2342 |
+
* @param array $array_with_params
|
2343 |
+
* @param array $array_to_search_in
|
2344 |
+
* @return boolean Found or not
|
2345 |
+
*/
|
2346 |
+
function apbct_search_array_in_array__reqursive($array_with_params, $array_to_search_in) {
|
2347 |
+
|
2348 |
+
foreach($array_with_params as $key => $val){
|
2349 |
+
|
2350 |
+
if(is_array($val)){
|
2351 |
+
if(array_key_exists($key, $array_to_search_in)){
|
2352 |
+
if(apbct_search_array_in_array__reqursive($val, $array_to_search_in[$key]) === true){
|
2353 |
+
return true;
|
2354 |
+
}
|
2355 |
+
}
|
2356 |
+
}else{
|
2357 |
+
if(array_search($val, $array_to_search_in) == $key){
|
2358 |
+
return true;
|
2359 |
+
}
|
2360 |
+
}
|
2361 |
+
|
2362 |
+
}
|
2363 |
+
|
2364 |
+
return false;
|
2365 |
+
}
|
2366 |
+
|
2367 |
/**
|
2368 |
* General test for any contact form
|
2369 |
*/
|
2416 |
) {
|
2417 |
return null;
|
2418 |
}
|
2419 |
+
|
2420 |
+
// Skip check if integration exists
|
2421 |
+
foreach ($apbct->integrations as $integration) {
|
2422 |
+
if(apbct_search_array_in_array__reqursive($integration->identify, $_POST)) return;
|
2423 |
+
if(apbct_search_array_in_array__reqursive($integration->identify, $_GET)) return;
|
2424 |
+
}
|
2425 |
+
|
2426 |
// Do not execute anti-spam test for logged in users.
|
2427 |
if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
|
2428 |
return null;
|
2605 |
isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
|
2606 |
strpos($_SERVER['REQUEST_URI'],'/wc-api/')!==false ||
|
2607 |
(isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
|
2608 |
+
(isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
|
2609 |
+
(isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') //TwoFactor authorization
|
2610 |
) {
|
2611 |
return null;
|
2612 |
}
|
inc/cleantalk-settings.php
CHANGED
@@ -21,10 +21,10 @@ function apbct_settings__add_page() {
|
|
21 |
}else{
|
22 |
*/
|
23 |
// Adding settings page
|
24 |
-
|
25 |
-
|
26 |
else
|
27 |
-
|
28 |
// }
|
29 |
|
30 |
if(!in_array($pagenow, array('options.php', 'options-general.php', 'settings.php', 'admin.php')))
|
@@ -33,11 +33,6 @@ function apbct_settings__add_page() {
|
|
33 |
register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
|
34 |
|
35 |
// add_settings_section('cleantalk_section_settings_main', '', 'apbct_section__settings_main', 'cleantalk');
|
36 |
-
|
37 |
-
// KEY
|
38 |
-
// add_settings_field('apbct_action_butons', '', 'apbct_settings__field__action_buttons', 'cleantalk', 'cleantalk_section_settings_main');
|
39 |
-
// add_settings_field('cleantalk_api_key', '', 'apbct_settings__field__api_key', 'cleantalk', 'cleantalk_section_settings_main');
|
40 |
-
// add_settings_field('cleantalk_connection_reports', '', 'apbct_settings__field__connection_reports', 'cleantalk', 'cleantalk_section_settings_main');
|
41 |
|
42 |
$field_default_params = array(
|
43 |
'callback' => 'apbct_settings__field__draw',
|
@@ -76,7 +71,7 @@ function apbct_settings__add_page() {
|
|
76 |
'title' => '',
|
77 |
'default_params' => array(),
|
78 |
'description' => '',
|
79 |
-
'html_before' => '<hr>',
|
80 |
'html_after' => '',
|
81 |
'fields' => array(
|
82 |
'state' => array(
|
@@ -335,7 +330,7 @@ function apbct_settings_page() {
|
|
335 |
|
336 |
// Top info
|
337 |
if(!$apbct->white_label){
|
338 |
-
echo '<div style="float: right; padding: 15px 15px
|
339 |
|
340 |
echo __('CleanTalk\'s tech support:', 'cleantalk')
|
341 |
.' '
|
@@ -389,11 +384,12 @@ function apbct_settings_page() {
|
|
389 |
}
|
390 |
if(!$apbct->white_label){
|
391 |
// CP button
|
392 |
-
echo '<a class="cleantalk_manual_link" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
|
|
|
|
|
393 |
echo ' ';
|
394 |
// Support button
|
395 |
-
echo '<a class="cleantalk_auto_link" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support',
|
396 |
-
'cleantalk').'</a>';
|
397 |
echo '<br>'
|
398 |
.'<br>';
|
399 |
}
|
@@ -620,6 +616,15 @@ function apbct_settings__field__api_key(){
|
|
620 |
placeholder="' . __('Enter the key', 'cleantalk') . '" />';
|
621 |
|
622 |
// Key is correct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
if(!apbct_api_key__is_correct($apbct->api_key) || !$apbct->key_is_ok){
|
624 |
echo '<br /><br />';
|
625 |
|
@@ -787,6 +792,9 @@ function apbct_settings__validate($settings) {
|
|
787 |
|
788 |
global $apbct;
|
789 |
|
|
|
|
|
|
|
790 |
// validating API key
|
791 |
$settings['apikey'] = isset($settings['apikey']) ? trim($settings['apikey']) : '';
|
792 |
$settings['apikey'] = $apbct->white_label ? $apbct->settings['apikey'] : $settings['apikey'];
|
21 |
}else{
|
22 |
*/
|
23 |
// Adding settings page
|
24 |
+
if(is_network_admin() && !$apbct->white_label)
|
25 |
+
add_submenu_page("settings.php", $apbct->plugin_name.' '.__('settings'), $apbct->plugin_name, 'manage_options', 'cleantalk', 'apbct_settings_page');
|
26 |
else
|
27 |
+
add_options_page($apbct->plugin_name.' '.__('settings'), $apbct->plugin_name, 'manage_options', 'cleantalk', 'apbct_settings_page');
|
28 |
// }
|
29 |
|
30 |
if(!in_array($pagenow, array('options.php', 'options-general.php', 'settings.php', 'admin.php')))
|
33 |
register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
|
34 |
|
35 |
// add_settings_section('cleantalk_section_settings_main', '', 'apbct_section__settings_main', 'cleantalk');
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
$field_default_params = array(
|
38 |
'callback' => 'apbct_settings__field__draw',
|
71 |
'title' => '',
|
72 |
'default_params' => array(),
|
73 |
'description' => '',
|
74 |
+
'html_before' => '<hr style="width: 100%;">',
|
75 |
'html_after' => '',
|
76 |
'fields' => array(
|
77 |
'state' => array(
|
330 |
|
331 |
// Top info
|
332 |
if(!$apbct->white_label){
|
333 |
+
echo '<div style="float: right; padding: 15px 15px 5px 15px; font-size: 13px; position: relative; top: -55px; background: #f1f1f1;">';
|
334 |
|
335 |
echo __('CleanTalk\'s tech support:', 'cleantalk')
|
336 |
.' '
|
384 |
}
|
385 |
if(!$apbct->white_label){
|
386 |
// CP button
|
387 |
+
echo '<a class="cleantalk_manual_link" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
|
388 |
+
.__('Click here to get anti-spam statistics', 'cleantalk')
|
389 |
+
.'</a>';
|
390 |
echo ' ';
|
391 |
// Support button
|
392 |
+
echo '<a class="cleantalk_auto_link" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support', 'cleantalk').'</a>';
|
|
|
393 |
echo '<br>'
|
394 |
.'<br>';
|
395 |
}
|
616 |
placeholder="' . __('Enter the key', 'cleantalk') . '" />';
|
617 |
|
618 |
// Key is correct
|
619 |
+
if((apbct_api_key__is_correct($apbct->api_key) || $apbct->key_is_ok) && isset($apbct->data['account_name_ob']) && $apbct->data['account_name_ob'] != ''){
|
620 |
+
echo '<br>'
|
621 |
+
.sprintf(
|
622 |
+
__('Account at cleantalk.org is %s', 'cleantalk'),
|
623 |
+
'<b>'.$apbct->data['account_name_ob'].'</b>'
|
624 |
+
);
|
625 |
+
}
|
626 |
+
|
627 |
+
// Key is NOT correct
|
628 |
if(!apbct_api_key__is_correct($apbct->api_key) || !$apbct->key_is_ok){
|
629 |
echo '<br /><br />';
|
630 |
|
792 |
|
793 |
global $apbct;
|
794 |
|
795 |
+
// Validating settings
|
796 |
+
$settings['spam_firewall'] = isset($settings['spam_firewall']) ? $settings['spam_firewall'] : 0;
|
797 |
+
|
798 |
// validating API key
|
799 |
$settings['apikey'] = isset($settings['apikey']) ? trim($settings['apikey']) : '';
|
800 |
$settings['apikey'] = $apbct->white_label ? $apbct->settings['apikey'] : $settings['apikey'];
|
js/apbct-public--gdpr.js
CHANGED
@@ -17,12 +17,15 @@ jQuery(document).ready(function(){
|
|
17 |
// Formidable
|
18 |
else if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)
|
19 |
elem = jQuery('.frm_forms').first().children('form');
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
// Adding notice
|
23 |
if(elem.is('form') || elem.attr('role') === 'form'){
|
24 |
-
elem.append('<input id="apbct_gdpr_'+i+'" type="checkbox" required="required " style="margin-right: 10px;">')
|
25 |
-
.append('<label for="apbct_gdpr_'+i+'">'+ctPublic.gdpr_text+'</label>');
|
26 |
}
|
27 |
});
|
28 |
|
17 |
// Formidable
|
18 |
else if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)
|
19 |
elem = jQuery('.frm_forms').first().children('form');
|
20 |
+
// WPForms
|
21 |
+
else if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)
|
22 |
+
elem = jQuery('.wpforms-form');
|
23 |
}
|
24 |
|
25 |
// Adding notice
|
26 |
if(elem.is('form') || elem.attr('role') === 'form'){
|
27 |
+
elem.append('<input id="apbct_gdpr_'+i+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">')
|
28 |
+
.append('<label style="display: inline;" for="apbct_gdpr_'+i+'">'+ctPublic.gdpr_text+'</label>');
|
29 |
}
|
30 |
});
|
31 |
|
js/apbct-public.js
CHANGED
@@ -164,4 +164,12 @@ jQuery(document).ajaxComplete(function(event, xhr, settings) {
|
|
164 |
}
|
165 |
}
|
166 |
}
|
167 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
}
|
166 |
}
|
167 |
+
});
|
168 |
+
|
169 |
+
//(function(open) {
|
170 |
+
// XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
|
171 |
+
// this.addEventListener("readystatechange", function() {
|
172 |
+
// }, false);
|
173 |
+
// open.call(this, method, url, async, user, pass);
|
174 |
+
// };
|
175 |
+
//})(XMLHttpRequest.prototype.open);
|
js/cleantalk-admin.js
CHANGED
@@ -6,6 +6,6 @@ jQuery(document).ready(function(){
|
|
6 |
document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
|
7 |
});
|
8 |
|
9 |
-
jQuery('li a[href="options-general.php?page=cleantalk"]').css('
|
10 |
|
11 |
});
|
6 |
document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
|
7 |
});
|
8 |
|
9 |
+
jQuery('li a[href="options-general.php?page=cleantalk"]').css('white-space','nowrap');
|
10 |
|
11 |
});
|
lib/CleantalkResponse.php
CHANGED
@@ -112,7 +112,12 @@ class CleantalkResponse {
|
|
112 |
* @var int
|
113 |
*/
|
114 |
public $account_status = -1;
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
116 |
/**
|
117 |
* Create server response
|
118 |
*
|
@@ -146,6 +151,7 @@ class CleantalkResponse {
|
|
146 |
$this->inactive = (isset($obj->inactive)) ? $obj->inactive : 0;
|
147 |
$this->account_status = (isset($obj->account_status)) ? $obj->account_status : -1;
|
148 |
$this->received = (isset($obj->received)) ? $obj->received : -1;
|
|
|
149 |
|
150 |
if ($this->errno !== 0 && $this->errstr !== null && $this->comment === null)
|
151 |
$this->comment = '*** ' . $this->errstr . ' Antispam service cleantalk.org ***';
|
112 |
* @var int
|
113 |
*/
|
114 |
public $account_status = -1;
|
115 |
+
|
116 |
+
/**
|
117 |
+
* @var array Contains codes returned from server
|
118 |
+
*/
|
119 |
+
public $codes = array();
|
120 |
+
|
121 |
/**
|
122 |
* Create server response
|
123 |
*
|
151 |
$this->inactive = (isset($obj->inactive)) ? $obj->inactive : 0;
|
152 |
$this->account_status = (isset($obj->account_status)) ? $obj->account_status : -1;
|
153 |
$this->received = (isset($obj->received)) ? $obj->received : -1;
|
154 |
+
$this->codes = (isset($obj->codes)) ? explode(' ', $obj->codes) : array();
|
155 |
|
156 |
if ($this->errno !== 0 && $this->errstr !== null && $this->comment === null)
|
157 |
$this->comment = '*** ' . $this->errstr . ' Antispam service cleantalk.org ***';
|
lib/CleantalkState.php
CHANGED
@@ -17,6 +17,7 @@ class CleantalkState
|
|
17 |
{
|
18 |
public $option_prefix = '';
|
19 |
public $storage = array();
|
|
|
20 |
public $def_settings = array(
|
21 |
|
22 |
'spam_firewall' => 1,
|
@@ -309,23 +310,30 @@ class CleantalkState
|
|
309 |
$this->storage['data'][$name] = $value;
|
310 |
}
|
311 |
}
|
312 |
-
|
313 |
public function __get($name)
|
314 |
{
|
|
|
315 |
if (array_key_exists($name, $this->storage)){
|
316 |
return $this->storage[$name];
|
|
|
|
|
317 |
}elseif(array_key_exists($name, $this->storage['data'])){
|
318 |
$this->$name = $this->storage['data'][$name];
|
319 |
return $this->storage['data'][$name];
|
|
|
|
|
320 |
}elseif($name == 'api_key'){
|
321 |
$this->$name = $this->storage['settings']['apikey'];
|
322 |
return $this->storage['settings']['apikey'];
|
|
|
|
|
|
|
323 |
}else{
|
324 |
$this->getOption($name);
|
325 |
return $this->storage[$name];
|
326 |
}
|
327 |
-
|
328 |
-
// return !empty($this->storage[$name]) ? $this->storage[$name] : null;
|
329 |
}
|
330 |
|
331 |
public function __isset($name)
|
17 |
{
|
18 |
public $option_prefix = '';
|
19 |
public $storage = array();
|
20 |
+
public $integrations = array();
|
21 |
public $def_settings = array(
|
22 |
|
23 |
'spam_firewall' => 1,
|
310 |
$this->storage['data'][$name] = $value;
|
311 |
}
|
312 |
}
|
313 |
+
|
314 |
public function __get($name)
|
315 |
{
|
316 |
+
// First check in storage
|
317 |
if (array_key_exists($name, $this->storage)){
|
318 |
return $this->storage[$name];
|
319 |
+
|
320 |
+
// Then in data
|
321 |
}elseif(array_key_exists($name, $this->storage['data'])){
|
322 |
$this->$name = $this->storage['data'][$name];
|
323 |
return $this->storage['data'][$name];
|
324 |
+
|
325 |
+
// Maybe it's apikey?
|
326 |
}elseif($name == 'api_key'){
|
327 |
$this->$name = $this->storage['settings']['apikey'];
|
328 |
return $this->storage['settings']['apikey'];
|
329 |
+
|
330 |
+
// Otherwise try to get it from db settings table
|
331 |
+
// it will be arrayObject || scalar || null
|
332 |
}else{
|
333 |
$this->getOption($name);
|
334 |
return $this->storage[$name];
|
335 |
}
|
336 |
+
|
|
|
337 |
}
|
338 |
|
339 |
public function __isset($name)
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
|
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.0
|
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 anti-spam.
|
@@ -527,6 +527,14 @@ Yes, it is. Please read this article,
|
|
527 |
10. Website's options.
|
528 |
|
529 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
= 5.107 October 29 2018 =
|
531 |
* Fix: Ninja Forms integration.
|
532 |
* Fix: Cookie usage.
|
@@ -1691,6 +1699,14 @@ Yes, it is. Please read this article,
|
|
1691 |
* First version
|
1692 |
|
1693 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1694 |
= 5.107 October 29 2018 =
|
1695 |
* Fix: Ninja Forms integration.
|
1696 |
* Fix: Cookie usage.
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.0
|
6 |
+
Stable tag: 5.108
|
7 |
License: GPLv2
|
8 |
|
9 |
Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
527 |
10. Website's options.
|
528 |
|
529 |
== Changelog ==
|
530 |
+
= 5.108 November 7 2018 =
|
531 |
+
* Fix: White label mode.
|
532 |
+
* Fix: SpamFireWall now can be disabled.
|
533 |
+
* Fix: Layout.
|
534 |
+
* Integration: WPForms.
|
535 |
+
* Add: Message about block for all no integrated AJAX forms.
|
536 |
+
* Add: Displaying account name near api key.
|
537 |
+
|
538 |
= 5.107 October 29 2018 =
|
539 |
* Fix: Ninja Forms integration.
|
540 |
* Fix: Cookie usage.
|
1699 |
* First version
|
1700 |
|
1701 |
== Upgrade Notice ==
|
1702 |
+
= 5.108 November 7 2018 =
|
1703 |
+
* Fix: White label mode.
|
1704 |
+
* Fix: SpamFireWall now can be disabled.
|
1705 |
+
* Fix: Layout.
|
1706 |
+
* Integration: WPForms.
|
1707 |
+
* Add: Message about block for all no integrated AJAX forms.
|
1708 |
+
* Add: Displaying account name near api key.
|
1709 |
+
|
1710 |
= 5.107 October 29 2018 =
|
1711 |
* Fix: Ninja Forms integration.
|
1712 |
* Fix: Cookie usage.
|