Version Description
November 29 2018 = * Integration: BuddyPress ActivityWall spam protection. * Add: GDPR setting for shortcode. * Add: Support different BuddyPress templates on activity wall. * Fix: Admin/moderator checking for validate post data.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.110 |
Comparing to | |
See all releases |
Code changes from version 5.109 to 5.110
- cleantalk.php +66 -54
- css/cleantalk-admin-settings-page.css +16 -20
- css/cleantalk-admin.css +5 -0
- inc/cleantalk-admin.php +0 -23
- inc/cleantalk-ajax.php +5 -2
- inc/cleantalk-public.php +107 -40
- inc/cleantalk-settings.php +39 -8
- inc/cleantalk-updater.php +7 -0
- lib/Cleantalk.php +0 -1
- lib/CleantalkAPI.php +1 -1
- lib/CleantalkDB_Wordpress.php +2 -0
- lib/CleantalkState.php +23 -7
- readme.txt +26 -13
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 |
*/
|
@@ -52,7 +52,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
52 |
|
53 |
// Global ArrayObject with settings and other global varables
|
54 |
global $apbct;
|
55 |
-
$apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors'), is_multisite());
|
56 |
|
57 |
$apbct->white_label = defined('APBCT_WHITELABEL') && APBCT_WHITELABEL == true ? true : false;
|
58 |
|
@@ -210,7 +210,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
210 |
add_action('wp_dashboard_setup', 'ct_dashboard_statistics_widget' );
|
211 |
}
|
212 |
|
213 |
-
if (defined( 'DOING_AJAX' ) && DOING_AJAX||isset($_POST['cma-action'])){
|
214 |
|
215 |
// Feedback for comments
|
216 |
if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_comment'){
|
@@ -248,6 +248,12 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
248 |
add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
|
249 |
add_action('user_register', 'ct_user_register');
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
}
|
252 |
|
253 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
@@ -323,7 +329,8 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
323 |
}
|
324 |
|
325 |
// Short code for GDPR
|
326 |
-
|
|
|
327 |
|
328 |
}
|
329 |
|
@@ -334,61 +341,43 @@ function apbct_remote_call__perform()
|
|
334 |
{
|
335 |
global $apbct;
|
336 |
|
337 |
-
|
338 |
-
* Temporary disabled IP check because of false blocks
|
339 |
-
* @date 04.09.2018
|
340 |
-
*/
|
341 |
-
/*
|
342 |
-
// Comparing with cleantalk's IP
|
343 |
-
$spbc_remote_ip = CleantalkHelper::ip_get(array('real'), false);
|
344 |
|
345 |
-
if(
|
346 |
-
|
347 |
-
$
|
348 |
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
|
|
356 |
$apbct->saveData();
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error_string'])));
|
371 |
-
// SFW send logs
|
372 |
-
}elseif($_GET['spbc_remote_call_action'] == 'sfw_send_logs'){
|
373 |
-
$rc_result = ct_sfw_send_logs();
|
374 |
-
die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error_string'])));
|
375 |
-
// Update plugin
|
376 |
-
}elseif($_GET['spbc_remote_call_action'] == 'update_plugin'){
|
377 |
-
add_action('wp', 'apbct_update', 1);
|
378 |
-
}else
|
379 |
-
die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION')));
|
380 |
-
}else
|
381 |
-
die('FAIL '.json_encode(array('error' => 'WRONG_TOKEN')));
|
382 |
}else
|
383 |
-
die('FAIL '.json_encode(array('error' => '
|
384 |
-
/*
|
385 |
}else
|
386 |
-
die('FAIL '.json_encode(array('error' => '
|
387 |
}else
|
388 |
-
die('FAIL '.json_encode(array('error' => '
|
389 |
}else
|
390 |
-
die('FAIL '.json_encode(array('error' => '
|
391 |
-
*/
|
392 |
}
|
393 |
|
394 |
/**
|
@@ -774,7 +763,7 @@ function apbct_cookie(){
|
|
774 |
|
775 |
// Cookies test
|
776 |
$cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
|
777 |
-
setcookie('apbct_cookies_test', json_encode($cookie_test_value), 0, '/');
|
778 |
|
779 |
$apbct->flags__cookies_setuped = true;
|
780 |
|
@@ -791,7 +780,7 @@ function apbct_cookies_test()
|
|
791 |
|
792 |
if(isset($_COOKIE['apbct_cookies_test'])){
|
793 |
|
794 |
-
$cookie_test = json_decode(
|
795 |
|
796 |
if(!is_array($cookie_test))
|
797 |
return 0;
|
@@ -974,4 +963,27 @@ function apbct_sfw__delete_tables( $blog_id, $drop ) {
|
|
974 |
$wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
|
975 |
|
976 |
switch_to_blog($initial_blog);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
977 |
}
|
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.110
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
52 |
|
53 |
// Global ArrayObject with settings and other global varables
|
54 |
global $apbct;
|
55 |
+
$apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors', 'remote_calls'), is_multisite());
|
56 |
|
57 |
$apbct->white_label = defined('APBCT_WHITELABEL') && APBCT_WHITELABEL == true ? true : false;
|
58 |
|
210 |
add_action('wp_dashboard_setup', 'ct_dashboard_statistics_widget' );
|
211 |
}
|
212 |
|
213 |
+
if (defined( 'DOING_AJAX' ) && DOING_AJAX || isset($_POST['cma-action'])){
|
214 |
|
215 |
// Feedback for comments
|
216 |
if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_comment'){
|
248 |
add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
|
249 |
add_action('user_register', 'ct_user_register');
|
250 |
|
251 |
+
if(class_exists('BuddyPress')){
|
252 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
253 |
+
add_filter('bp_activity_is_spam_before_save', 'apbct_integration__buddyPres__activityWall', 999 ,2); /* ActivityWall */
|
254 |
+
add_action('bp_locate_template', 'apbct_integration__buddyPres__getTemplateName', 10, 6);
|
255 |
+
}
|
256 |
+
|
257 |
}
|
258 |
|
259 |
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
|
329 |
}
|
330 |
|
331 |
// Short code for GDPR
|
332 |
+
if($apbct->settings['gdpr_enabled'])
|
333 |
+
add_shortcode('cleantalk_gdpr_form', 'apbct_shrotcode_handler__GDPR_public_notice__form');
|
334 |
|
335 |
}
|
336 |
|
341 |
{
|
342 |
global $apbct;
|
343 |
|
344 |
+
$remote_action = $_GET['spbc_remote_call_action'];
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
|
346 |
+
if(array_key_exists($remote_action, $apbct->remote_calls)){
|
347 |
+
|
348 |
+
if(time() - $apbct->remote_calls[$remote_action]['last_call'] > APBCT_REMOTE_CALL_SLEEP){
|
349 |
|
350 |
+
$apbct->remote_calls[$remote_action]['last_call'] = time();
|
351 |
+
$apbct->save('remote_calls');
|
352 |
+
|
353 |
+
if(strtolower($_GET['spbc_remote_call_token']) == strtolower(md5($apbct->api_key))){
|
354 |
+
|
355 |
+
// Close renew banner
|
356 |
+
if($_GET['spbc_remote_call_action'] == 'close_renew_banner'){
|
357 |
+
$apbct->data['notice_trial'] = 0;
|
358 |
+
$apbct->data['notice_renew'] = 0;
|
359 |
$apbct->saveData();
|
360 |
+
CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
|
361 |
+
die('OK');
|
362 |
+
// SFW update
|
363 |
+
}elseif($_GET['spbc_remote_call_action'] == 'sfw_update'){
|
364 |
+
$result = ct_sfw_update();
|
365 |
+
die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error_string'])));
|
366 |
+
// SFW send logs
|
367 |
+
}elseif($_GET['spbc_remote_call_action'] == 'sfw_send_logs'){
|
368 |
+
$rc_result = ct_sfw_send_logs();
|
369 |
+
die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error_string'])));
|
370 |
+
// Update plugin
|
371 |
+
}elseif($_GET['spbc_remote_call_action'] == 'update_plugin'){
|
372 |
+
add_action('wp', 'apbct_update', 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
}else
|
374 |
+
die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION_2')));
|
|
|
375 |
}else
|
376 |
+
die('FAIL '.json_encode(array('error' => 'WRONG_TOKEN')));
|
377 |
}else
|
378 |
+
die('FAIL '.json_encode(array('error' => 'TOO_MANY_ATTEMPTS')));
|
379 |
}else
|
380 |
+
die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION')));
|
|
|
381 |
}
|
382 |
|
383 |
/**
|
763 |
|
764 |
// Cookies test
|
765 |
$cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
|
766 |
+
setcookie('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/');
|
767 |
|
768 |
$apbct->flags__cookies_setuped = true;
|
769 |
|
780 |
|
781 |
if(isset($_COOKIE['apbct_cookies_test'])){
|
782 |
|
783 |
+
$cookie_test = json_decode(urldecode($_COOKIE['apbct_cookies_test']),true);
|
784 |
|
785 |
if(!is_array($cookie_test))
|
786 |
return 0;
|
963 |
$wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
|
964 |
|
965 |
switch_to_blog($initial_blog);
|
966 |
+
}
|
967 |
+
|
968 |
+
/**
|
969 |
+
* Checks if the current user has role
|
970 |
+
*
|
971 |
+
* @param array $roles
|
972 |
+
* @param int $user User ID to check
|
973 |
+
* @return boolean Does the user has this role|roles
|
974 |
+
*/
|
975 |
+
function apbct_is_user_role_in( $roles, $user = false ){
|
976 |
+
|
977 |
+
if( is_numeric($user) ) $user = get_userdata( $user );
|
978 |
+
if( ! $user ) $user = wp_get_current_user();
|
979 |
+
|
980 |
+
if( empty($user->ID) )
|
981 |
+
return false;
|
982 |
+
|
983 |
+
foreach( (array) $roles as $role ){
|
984 |
+
if( isset($user->caps[ $role ]) || in_array($role, $user->roles) )
|
985 |
+
return true;
|
986 |
+
}
|
987 |
+
|
988 |
+
return false;
|
989 |
}
|
css/cleantalk-admin-settings-page.css
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
#apbctTopWarning h4{margin: 10px;}
|
4 |
#apbctTopWarning h4 span{margin-top: 5px;}
|
5 |
|
|
|
6 |
.apbct_settings-title{ display: inline-block; }
|
7 |
.apbct_settings-subtitle{
|
8 |
position: relative;
|
@@ -10,10 +11,23 @@
|
|
10 |
margin: 0;
|
11 |
}
|
12 |
|
|
|
13 |
.apbct_settings-field_wrapper{ margin: 15px 0; }
|
14 |
.apbct_settings-field_wrapper--sub{ margin-left: 30px !important; }
|
15 |
|
16 |
.apbct_settings-field_title{ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
.apbct_settings-field_title--checkbox{ }
|
18 |
.apbct_settings-field_title--radio{
|
19 |
display: inline-block;
|
@@ -23,26 +37,8 @@
|
|
23 |
font-size: 14px;
|
24 |
vertical-align: top;
|
25 |
}
|
26 |
-
.
|
27 |
-
.
|
28 |
-
.apbct_settings-field_content--radio{ width: 70%; }
|
29 |
-
|
30 |
-
.apbct_settings__label{
|
31 |
-
margin-right: 10px;
|
32 |
-
font-size: 17px;
|
33 |
-
vertical-align: text-bottom;
|
34 |
-
}
|
35 |
-
|
36 |
-
.apbct_settings__text_feld{
|
37 |
-
font-size: 14pt;
|
38 |
-
}
|
39 |
-
|
40 |
-
.apbct_settings-field--checkbox{
|
41 |
-
vertical-align: middle;
|
42 |
-
top: -1px;
|
43 |
-
}
|
44 |
-
|
45 |
-
.gray{ color: gray; }
|
46 |
|
47 |
.cleantalk_manual_link {padding: 10px; background: #3399FF; color: #fff; border:0 none;
|
48 |
cursor:pointer;
|
3 |
#apbctTopWarning h4{margin: 10px;}
|
4 |
#apbctTopWarning h4 span{margin-top: 5px;}
|
5 |
|
6 |
+
/* Main title */
|
7 |
.apbct_settings-title{ display: inline-block; }
|
8 |
.apbct_settings-subtitle{
|
9 |
position: relative;
|
11 |
margin: 0;
|
12 |
}
|
13 |
|
14 |
+
/* Setting fields */
|
15 |
.apbct_settings-field_wrapper{ margin: 15px 0; }
|
16 |
.apbct_settings-field_wrapper--sub{ margin-left: 30px !important; }
|
17 |
|
18 |
.apbct_settings-field_title{ }
|
19 |
+
.apbct_settings__label{
|
20 |
+
margin-right: 10px;
|
21 |
+
font-size: 17px;
|
22 |
+
vertical-align: text-bottom;
|
23 |
+
}
|
24 |
+
|
25 |
+
.apbct_settings-field_content{ display: inline-block; }
|
26 |
+
.apbct_settings-field_content--checkbox{ }
|
27 |
+
.apbct_settings-field_content--radio{ width: 70%; }
|
28 |
+
.apbct_settings-field_content--text{ }
|
29 |
+
|
30 |
+
.apbct_settings-field_title{}
|
31 |
.apbct_settings-field_title--checkbox{ }
|
32 |
.apbct_settings-field_title--radio{
|
33 |
display: inline-block;
|
37 |
font-size: 14px;
|
38 |
vertical-align: top;
|
39 |
}
|
40 |
+
.apbct_input_text{min-width: 255px;}
|
41 |
+
.apbct_input_text-width--500px{width: 500px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
.cleantalk_manual_link {padding: 10px; background: #3399FF; color: #fff; border:0 none;
|
44 |
cursor:pointer;
|
css/cleantalk-admin.css
CHANGED
@@ -1,5 +1,10 @@
|
|
|
|
1 |
:disabled{cursor: not-allowed !important;}
|
|
|
|
|
|
|
2 |
|
|
|
3 |
.ct_meta_links{
|
4 |
|
5 |
}
|
1 |
+
/* Common styles for admin pages */
|
2 |
:disabled{cursor: not-allowed !important;}
|
3 |
+
.apbct_color--gray{color: gray;}
|
4 |
+
.apbct_display--none{display: none;}
|
5 |
+
.apbct_font-size--14pt{font-size: 14pt;}
|
6 |
|
7 |
+
/* Additional styles for admin pages */
|
8 |
.ct_meta_links{
|
9 |
|
10 |
}
|
inc/cleantalk-admin.php
CHANGED
@@ -730,27 +730,4 @@ function apbct_user__delete__hook($user_id, $reassign = null){
|
|
730 |
if ($hash !== '') {
|
731 |
ct_feedback($hash, 0);
|
732 |
}
|
733 |
-
}
|
734 |
-
|
735 |
-
/**
|
736 |
-
* Checks if the current user has role
|
737 |
-
*
|
738 |
-
* @param array $roles
|
739 |
-
* @param int $user User ID to check
|
740 |
-
* @return boolean Does the user has this role|roles
|
741 |
-
*/
|
742 |
-
function apbct_is_user_role_in( $roles, $user = false ){
|
743 |
-
|
744 |
-
if( is_numeric($user) ) $user = get_userdata( $user );
|
745 |
-
if( ! $user ) $user = wp_get_current_user();
|
746 |
-
|
747 |
-
if( empty($user->ID) )
|
748 |
-
return false;
|
749 |
-
|
750 |
-
foreach( (array) $roles as $role ){
|
751 |
-
if( isset($user->caps[ $role ]) || in_array($role, $user->roles) )
|
752 |
-
return true;
|
753 |
-
}
|
754 |
-
|
755 |
-
return false;
|
756 |
}
|
730 |
if ($hash !== '') {
|
731 |
ct_feedback($hash, 0);
|
732 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
733 |
}
|
inc/cleantalk-ajax.php
CHANGED
@@ -131,6 +131,9 @@ $cleantalk_hooked_actions[]='smuzform_form_submit';
|
|
131 |
/* hooks for reviewer plugin*/
|
132 |
add_action( 'wp_ajax_nopriv_rwp_ajax_action_rating', 'ct_ajax_hook',1 );
|
133 |
$cleantalk_hooked_actions[]='rwp-submit-wrap';
|
|
|
|
|
|
|
134 |
function ct_validate_email_ajaxlogin($email=null, $is_ajax=true){
|
135 |
|
136 |
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
@@ -316,7 +319,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
316 |
$ct_post_temp['email'] = $_POST['user_email'];
|
317 |
$ct_post_temp['comment'] = $_POST['comment'];
|
318 |
}
|
319 |
-
|
320 |
$ct_temp_msg_data = isset($ct_post_temp)
|
321 |
? ct_get_fields_any($ct_post_temp)
|
322 |
: ct_get_fields_any($_POST);
|
@@ -612,7 +615,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
612 |
);
|
613 |
print json_encode($result);
|
614 |
die();
|
615 |
-
}
|
616 |
else
|
617 |
{
|
618 |
die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $ct_result->comment,))));
|
131 |
/* hooks for reviewer plugin*/
|
132 |
add_action( 'wp_ajax_nopriv_rwp_ajax_action_rating', 'ct_ajax_hook',1 );
|
133 |
$cleantalk_hooked_actions[]='rwp-submit-wrap';
|
134 |
+
|
135 |
+
$cleantalk_hooked_actions[]='post_update';
|
136 |
+
|
137 |
function ct_validate_email_ajaxlogin($email=null, $is_ajax=true){
|
138 |
|
139 |
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
319 |
$ct_post_temp['email'] = $_POST['user_email'];
|
320 |
$ct_post_temp['comment'] = $_POST['comment'];
|
321 |
}
|
322 |
+
|
323 |
$ct_temp_msg_data = isset($ct_post_temp)
|
324 |
? ct_get_fields_any($ct_post_temp)
|
325 |
: ct_get_fields_any($_POST);
|
615 |
);
|
616 |
print json_encode($result);
|
617 |
die();
|
618 |
+
}
|
619 |
else
|
620 |
{
|
621 |
die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $ct_result->comment,))));
|
inc/cleantalk-public.php
CHANGED
@@ -147,9 +147,9 @@ function apbct_init() {
|
|
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')){
|
@@ -240,7 +240,12 @@ function apbct_init() {
|
|
240 |
$ct_check_post_result=false;
|
241 |
ct_contact_form_validate();
|
242 |
}
|
243 |
-
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' &&
|
|
|
|
|
|
|
|
|
|
|
244 |
$ct_check_post_result=false;
|
245 |
ct_contact_form_validate_postdata();
|
246 |
}
|
@@ -391,26 +396,96 @@ function ct_woocommerce_wishlist_check($args){
|
|
391 |
return $args;
|
392 |
}
|
393 |
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
|
|
398 |
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
global $apbct;
|
401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
//Check for enabled option
|
405 |
if($apbct->settings['bp_private_messages'] == 0)
|
406 |
return;
|
407 |
|
408 |
//Check for quantity of comments
|
409 |
-
$
|
410 |
-
|
411 |
-
|
412 |
-
else
|
413 |
-
$comments_check_number = 3;
|
414 |
|
415 |
if($apbct->settings['check_comments_number']){
|
416 |
$args = array(
|
@@ -427,41 +502,33 @@ function ct_bp_private_msg_check( $bp_message_obj){
|
|
427 |
$args['box'] = 'inbox';
|
428 |
$inbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
|
429 |
$cnt_inbox_msgs = $inbox_msgs['total'];
|
|
|
430 |
if(($cnt_inbox_msgs + $cnt_sentbox_msgs) >= $comments_check_number)
|
431 |
$is_max_comments = true;
|
432 |
}
|
433 |
|
434 |
-
if($is_max_comments)
|
435 |
return;
|
436 |
-
|
437 |
-
//Getting request params
|
438 |
|
439 |
$sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
|
440 |
|
441 |
-
$message = $bp_message_obj->message;
|
442 |
-
$subject = $bp_message_obj->subject;
|
443 |
-
$email = $sender_user_obj->data->user_email;
|
444 |
-
$nickname = $sender_user_obj->data->user_login;
|
445 |
-
|
446 |
-
$post_info['comment_type'] = 'buddypress_comment';
|
447 |
-
$post_info['post_url'] = $_SERVER['HTTP_REFERER'];
|
448 |
-
|
449 |
-
$checkjs = !apbct_js_test('ct_checkjs', $_COOKIE, true)
|
450 |
-
? apbct_js_test('ct_checkjs', $_COOKIE, true)
|
451 |
-
: apbct_js_test('ct_checkjs', $_POST, true);
|
452 |
-
|
453 |
//Making a call
|
454 |
-
|
455 |
$base_call_result = apbct_base_call(
|
456 |
array(
|
457 |
-
'message' => $subject." ".$message,
|
458 |
-
'sender_email' => $
|
459 |
-
'sender_nickname' => $
|
460 |
-
'post_info' =>
|
461 |
-
|
|
|
|
|
|
|
|
|
|
|
462 |
'sender_info' => array('sender_url' => null),
|
463 |
)
|
464 |
);
|
|
|
465 |
$ct_result = $base_call_result['ct_result'];
|
466 |
|
467 |
if ($ct_result->allow == 0)
|
@@ -1777,15 +1844,15 @@ function apbct_form__contactForm7__changeMailNotification($component){
|
|
1777 |
|
1778 |
$component['body'] =
|
1779 |
__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
1780 |
-
.
|
1781 |
-
.
|
1782 |
-
.
|
1783 |
-
.
|
1784 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1785 |
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam" target="_blank">',
|
1786 |
'</a>'
|
1787 |
)
|
1788 |
-
.
|
1789 |
.$component['body'];
|
1790 |
|
1791 |
return (array) $component;
|
@@ -2676,12 +2743,12 @@ function ct_enqueue_scripts_public($hook){
|
|
2676 |
wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.js', array('jquery'), APBCT_VERSION, false /*in header*/);
|
2677 |
|
2678 |
// GDPR script
|
2679 |
-
if(
|
2680 |
|
2681 |
wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
|
2682 |
|
2683 |
wp_localize_script('ct_public_gdpr', 'ctPublic', array(
|
2684 |
-
'gdpr_forms' => $apbct->settings['
|
2685 |
'gdpr_text' => $apbct->settings['gdpr_text'] ? $apbct->settings['gdpr_text'] : __('By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.', 'cleantalk'),
|
2686 |
));
|
2687 |
}
|
147 |
// BuddyPress
|
148 |
if(class_exists('BuddyPress')){
|
149 |
add_action('bp_before_registration_submit_buttons','ct_register_form',1);
|
150 |
+
add_action('messages_message_before_save', 'apbct_integration__buddyPres__private_msg_check', 1);
|
151 |
add_filter('bp_signup_validate', 'ct_registration_errors',1);
|
152 |
add_filter('bp_signup_validate', 'ct_check_registration_erros', 999999);
|
|
|
153 |
}
|
154 |
|
155 |
if(defined('PROFILEPRESS_SYSTEM_FILE_PATH')){
|
240 |
$ct_check_post_result=false;
|
241 |
ct_contact_form_validate();
|
242 |
}
|
243 |
+
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' &&
|
244 |
+
$apbct->settings['general_postdata_test'] == 1 &&
|
245 |
+
!isset($_POST['ct_checkjs_cf7']) &&
|
246 |
+
!is_admin() &&
|
247 |
+
!apbct_is_user_role_in(array('administrator', 'moderator'))
|
248 |
+
){
|
249 |
$ct_check_post_result=false;
|
250 |
ct_contact_form_validate_postdata();
|
251 |
}
|
396 |
return $args;
|
397 |
}
|
398 |
|
399 |
+
function apbct_integration__buddyPres__getTemplateName( $located, $template_name, $template_names, $template_locations, $load, $require_once ) {
|
400 |
+
global $apbct;
|
401 |
+
preg_match("/\/([a-z-_]+)\/buddypress-functions\.php$/", $located, $matches);
|
402 |
+
$apbct->buddy_press_tmpl = $matches[1];
|
403 |
+
}
|
404 |
|
405 |
+
/**
|
406 |
+
* Test BuddyPress activity for spam (post update only)
|
407 |
+
*
|
408 |
+
* @global SpbcState $apbct
|
409 |
+
* @param bool $is_spam
|
410 |
+
* @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
|
411 |
+
* @return boolean Spam flag
|
412 |
+
*/
|
413 |
+
function apbct_integration__buddyPres__activityWall( $is_spam, $activity_obj = null ){
|
414 |
+
|
415 |
global $apbct;
|
416 |
|
417 |
+
if($activity_obj === null || !isset($_POST['action']) || $_POST['action'] && $_POST['action'] !== 'post_update')
|
418 |
+
return;
|
419 |
+
|
420 |
+
$curr_user = get_user_by('id', $activity_obj->user_id);
|
421 |
+
|
422 |
+
//Making a call
|
423 |
+
$base_call_result = apbct_base_call(
|
424 |
+
array(
|
425 |
+
'message' => is_string($activity_obj->content) ? $activity_obj->content : '',
|
426 |
+
'sender_email' => $curr_user->data->user_email,
|
427 |
+
'sender_nickname' => $curr_user->data->user_login,
|
428 |
+
'post_info' => array(
|
429 |
+
'post_url' => 'buddypress_activitywall',
|
430 |
+
'comment_type' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null,
|
431 |
+
),
|
432 |
+
'checkjs' => apbct_js_test('ct_checkjs', $_COOKIE, true),
|
433 |
+
'sender_info' => array('sender_url' => null),
|
434 |
+
)
|
435 |
+
);
|
436 |
+
|
437 |
+
$ct_result = $base_call_result['ct_result'];
|
438 |
+
|
439 |
+
if ($ct_result->allow == 0){
|
440 |
+
add_action('bp_activity_after_save', 'apbct_integration__buddyPres__activityWall_showResponse', 1, 1);
|
441 |
+
$apbct->spam_notification = $ct_result->comment;
|
442 |
+
return true;
|
443 |
+
}else
|
444 |
+
return $is_spam;
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* Outputs message to AJAX frontend handler
|
449 |
+
*
|
450 |
+
* @global SpbcState $apbct
|
451 |
+
* @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
|
452 |
+
*/
|
453 |
+
function apbct_integration__buddyPres__activityWall_showResponse( $activity_obj ){
|
454 |
+
|
455 |
+
global $apbct;
|
456 |
|
457 |
+
// Legacy template
|
458 |
+
if($apbct->buddy_press_tmpl === 'bp-legacy'){
|
459 |
+
die('<div id="message" class="error bp-ajax-message"><p>'. $apbct->spam_notification .'</p></div>');
|
460 |
+
// Nouveau tamplate and others
|
461 |
+
}else{
|
462 |
+
@header( 'Content-Type: application/json; charset=' . get_option('blog_charset'));
|
463 |
+
die(json_encode(array(
|
464 |
+
'success' => false,
|
465 |
+
'data' => array('message' => $apbct->spam_notification),
|
466 |
+
)));
|
467 |
+
}
|
468 |
+
}
|
469 |
|
470 |
+
/**
|
471 |
+
* Public function - Tests new private messages (dialogs)
|
472 |
+
*
|
473 |
+
* @global SpbcState $apbct
|
474 |
+
* @param type $bp_message_obj
|
475 |
+
* @return array with errors if spam has found
|
476 |
+
*/
|
477 |
+
function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
|
478 |
+
|
479 |
+
global $apbct;
|
480 |
+
|
481 |
//Check for enabled option
|
482 |
if($apbct->settings['bp_private_messages'] == 0)
|
483 |
return;
|
484 |
|
485 |
//Check for quantity of comments
|
486 |
+
$comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER')
|
487 |
+
? CLEANTALK_CHECK_COMMENTS_NUMBER
|
488 |
+
: 3;
|
|
|
|
|
489 |
|
490 |
if($apbct->settings['check_comments_number']){
|
491 |
$args = array(
|
502 |
$args['box'] = 'inbox';
|
503 |
$inbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
|
504 |
$cnt_inbox_msgs = $inbox_msgs['total'];
|
505 |
+
|
506 |
if(($cnt_inbox_msgs + $cnt_sentbox_msgs) >= $comments_check_number)
|
507 |
$is_max_comments = true;
|
508 |
}
|
509 |
|
510 |
+
if(!empty($is_max_comments))
|
511 |
return;
|
|
|
|
|
512 |
|
513 |
$sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
|
514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
//Making a call
|
|
|
516 |
$base_call_result = apbct_base_call(
|
517 |
array(
|
518 |
+
'message' => $bp_message_obj->subject." ".$bp_message_obj->message,
|
519 |
+
'sender_email' => $sender_user_obj->data->user_email,
|
520 |
+
'sender_nickname' => $sender_user_obj->data->user_login,
|
521 |
+
'post_info' => array(
|
522 |
+
'comment_type' => 'buddypress_comment',
|
523 |
+
'post_url' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null,
|
524 |
+
),
|
525 |
+
'checkjs' => !apbct_js_test('ct_checkjs', $_COOKIE, true)
|
526 |
+
? apbct_js_test('ct_checkjs', $_COOKIE, true)
|
527 |
+
: apbct_js_test('ct_checkjs', $_POST, true),
|
528 |
'sender_info' => array('sender_url' => null),
|
529 |
)
|
530 |
);
|
531 |
+
|
532 |
$ct_result = $base_call_result['ct_result'];
|
533 |
|
534 |
if ($ct_result->allow == 0)
|
1844 |
|
1845 |
$component['body'] =
|
1846 |
__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
|
1847 |
+
.'</br>' . __('CleanTalk\'s anti-spam database:', 'cleantalk')
|
1848 |
+
.'</br>' . '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>'
|
1849 |
+
.'</br>' . '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>'
|
1850 |
+
.'</br>' . sprintf(
|
1851 |
__('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
|
1852 |
'<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam" target="_blank">',
|
1853 |
'</a>'
|
1854 |
)
|
1855 |
+
.'</br>' . '---' . '</br>' . '</br>'
|
1856 |
.$component['body'];
|
1857 |
|
1858 |
return (array) $component;
|
2743 |
wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.js', array('jquery'), APBCT_VERSION, false /*in header*/);
|
2744 |
|
2745 |
// GDPR script
|
2746 |
+
if($apbct->settings['gdpr_enabled']){
|
2747 |
|
2748 |
wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
|
2749 |
|
2750 |
wp_localize_script('ct_public_gdpr', 'ctPublic', array(
|
2751 |
+
'gdpr_forms' => $apbct->settings['gdpr_forms'] ? explode(', ', $apbct->settings['gdpr_forms']) : array(),
|
2752 |
'gdpr_text' => $apbct->settings['gdpr_text'] ? $apbct->settings['gdpr_text'] : __('By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.', 'cleantalk'),
|
2753 |
));
|
2754 |
}
|
inc/cleantalk-settings.php
CHANGED
@@ -115,7 +115,7 @@ function apbct_settings__add_page() {
|
|
115 |
'default_params' => array(),
|
116 |
'description' => '',
|
117 |
'html_before' => '<hr><br><span id="ct_adv_showhide">'
|
118 |
-
.'<a href="#"
|
119 |
.__('Advanced settings', 'cleantalk')
|
120 |
.'</a>'
|
121 |
.'</span>'
|
@@ -266,6 +266,19 @@ function apbct_settings__add_page() {
|
|
266 |
'title' => __('Async JavaScript loading', 'cleantalk'),
|
267 |
'description' => __('Use async loading for scripts. Warning: This could reduce filtration quality.', 'cleantalk'),
|
268 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
),
|
270 |
),
|
271 |
);
|
@@ -315,7 +328,7 @@ function apbct_settings_page() {
|
|
315 |
|
316 |
// Subtitle for IP license
|
317 |
if($apbct->moderate_ip)
|
318 |
-
echo '<h4 class="apbct_settings-subtitle gray">'. __('Hosting AntiSpam', 'cleantalk').'</h4>';
|
319 |
|
320 |
echo '<form action="options.php" method="post">';
|
321 |
|
@@ -585,7 +598,7 @@ function apbct_settings__field__api_key(){
|
|
585 |
|
586 |
global $apbct;
|
587 |
|
588 |
-
echo '<div id="cleantalk_apikey_wrapper" class="apbct_settings-field_wrapper
|
589 |
|
590 |
// White label
|
591 |
if($apbct->white_label){
|
@@ -602,11 +615,11 @@ function apbct_settings__field__api_key(){
|
|
602 |
.__('Access key', 'cleantalk')
|
603 |
.'</label>'
|
604 |
.'<input
|
605 |
-
|
606 |
name="cleantalk_settings[apikey]"
|
607 |
-
size="20" type="text"
|
608 |
value="'.$apbct->api_key.'"
|
609 |
-
|
|
|
610 |
placeholder="' . __('Enter the key', 'cleantalk') . '" />';
|
611 |
|
612 |
// Key is correct
|
@@ -632,7 +645,7 @@ function apbct_settings__field__api_key(){
|
|
632 |
}
|
633 |
|
634 |
// Manual get key
|
635 |
-
echo '<a
|
636 |
echo '<br />';
|
637 |
echo '<br />';
|
638 |
|
@@ -732,7 +745,7 @@ function apbct_settings__field__draw($params = array()){
|
|
732 |
echo '<input type="checkbox" id="apbct_setting_'.$params['name'].'" name="cleantalk_settings['.$params['name'].']" value="1" '
|
733 |
.($apbct->settings[$params['name']] == '1' ? ' checked' : '')
|
734 |
.($params['parent'] && !$apbct->settings[$params['parent']] ? ' disabled="disabled"' : '')
|
735 |
-
.(!$params['childrens'] ? '' : ' onchange="apbctSettingsDependencies([\''.implode("','",$params['
|
736 |
.' />'
|
737 |
.'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
|
738 |
.$params['title']
|
@@ -770,6 +783,24 @@ function apbct_settings__field__draw($params = array()){
|
|
770 |
|
771 |
echo '</div>';
|
772 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
}
|
774 |
|
775 |
echo '</div>';
|
115 |
'default_params' => array(),
|
116 |
'description' => '',
|
117 |
'html_before' => '<hr><br><span id="ct_adv_showhide">'
|
118 |
+
.'<a href="#" class="apbct_color--gray" onclick="event.preventDefault(); apbct_show_hide_elem(\'#apbct_settings__davanced_settings\');">'
|
119 |
.__('Advanced settings', 'cleantalk')
|
120 |
.'</a>'
|
121 |
.'</span>'
|
266 |
'title' => __('Async JavaScript loading', 'cleantalk'),
|
267 |
'description' => __('Use async loading for scripts. Warning: This could reduce filtration quality.', 'cleantalk'),
|
268 |
),
|
269 |
+
'gdpr_enabled' => array(
|
270 |
+
'type' => 'checkbox',
|
271 |
+
'title' => __('Allow to add GDPR notice via shortcode', 'cleantalk'),
|
272 |
+
'description' => __('Adds small checkbox under the form. To add it you should you use shortcode on the page with a form: [cleantalk_gdpr_form id="FORM_ID"]', 'cleantalk'),
|
273 |
+
'childrens' => array('gdpr_text'),
|
274 |
+
),
|
275 |
+
'gdpr_text' => array(
|
276 |
+
'type' => 'text',
|
277 |
+
'title' => __('GDPR text notice', 'cleantalk'),
|
278 |
+
'description' => __('This text will be added as a description to the GDPR checkbox.', 'cleantalk'),
|
279 |
+
'parent' => 'gdpr_enabled',
|
280 |
+
'class' => 'apbct_settings-field_wrapper--sub',
|
281 |
+
),
|
282 |
),
|
283 |
),
|
284 |
);
|
328 |
|
329 |
// Subtitle for IP license
|
330 |
if($apbct->moderate_ip)
|
331 |
+
echo '<h4 class="apbct_settings-subtitle apbct_color--gray">'. __('Hosting AntiSpam', 'cleantalk').'</h4>';
|
332 |
|
333 |
echo '<form action="options.php" method="post">';
|
334 |
|
598 |
|
599 |
global $apbct;
|
600 |
|
601 |
+
echo '<div id="cleantalk_apikey_wrapper" class="apbct_settings-field_wrapper '.(apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok ? 'apbct_display--none"' : '').'">';
|
602 |
|
603 |
// White label
|
604 |
if($apbct->white_label){
|
615 |
.__('Access key', 'cleantalk')
|
616 |
.'</label>'
|
617 |
.'<input
|
618 |
+
type="text"
|
619 |
name="cleantalk_settings[apikey]"
|
|
|
620 |
value="'.$apbct->api_key.'"
|
621 |
+
class="apbct_font-size--14pt"
|
622 |
+
size="20"
|
623 |
placeholder="' . __('Enter the key', 'cleantalk') . '" />';
|
624 |
|
625 |
// Key is correct
|
645 |
}
|
646 |
|
647 |
// Manual get key
|
648 |
+
echo '<a class="apbct_color--gray" target="__blank" href="https://cleantalk.org/register?platform=wordpress&email='.urlencode(ct_get_admin_email()).'&website='.urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST)).'">'.__('Get access key manually', 'cleantalk').'</a>';
|
649 |
echo '<br />';
|
650 |
echo '<br />';
|
651 |
|
745 |
echo '<input type="checkbox" id="apbct_setting_'.$params['name'].'" name="cleantalk_settings['.$params['name'].']" value="1" '
|
746 |
.($apbct->settings[$params['name']] == '1' ? ' checked' : '')
|
747 |
.($params['parent'] && !$apbct->settings[$params['parent']] ? ' disabled="disabled"' : '')
|
748 |
+
.(!$params['childrens'] ? '' : ' onchange="apbctSettingsDependencies([\''.implode("','",$params['childrens']).'\'])"')
|
749 |
.' />'
|
750 |
.'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
|
751 |
.$params['title']
|
783 |
|
784 |
echo '</div>';
|
785 |
break;
|
786 |
+
|
787 |
+
// Text type
|
788 |
+
case 'text':
|
789 |
+
|
790 |
+
echo '<input type="text" id="apbct_setting_'.$params['name'].'" name="cleantalk_settings['.$params['name'].']"'
|
791 |
+
.'class="apbct_input_text apbct_input_text-width--500px"'
|
792 |
+
.' value="'. $apbct->settings[$params['name']] .'" '
|
793 |
+
.($params['parent'] && !$apbct->settings[$params['parent']] ? ' disabled="disabled"' : '')
|
794 |
+
.(!$params['childrens'] ? '' : ' onchange="apbctSettingsDependencies([\''.implode("','",$params['children']).'\'])"')
|
795 |
+
.' />'
|
796 |
+
. ' '
|
797 |
+
.'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
|
798 |
+
.$params['title']
|
799 |
+
.'</label>';
|
800 |
+
echo '<div class="apbct_settings-field_description">'
|
801 |
+
.$params['description']
|
802 |
+
.'</div>';
|
803 |
+
break;
|
804 |
}
|
805 |
|
806 |
echo '</div>';
|
inc/cleantalk-updater.php
CHANGED
@@ -147,4 +147,11 @@ function apbct_update_to_5_109_0(){
|
|
147 |
}
|
148 |
switch_to_blog($initial_blog);
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
147 |
}
|
148 |
switch_to_blog($initial_blog);
|
149 |
}
|
150 |
+
}
|
151 |
+
|
152 |
+
function apbct_update_to_5_110_0(){
|
153 |
+
global $apbct;
|
154 |
+
unset($apbct->data['last_remote_call']);
|
155 |
+
$apbct->saveData;
|
156 |
+
$apbct->save('remote_calls');
|
157 |
}
|
lib/Cleantalk.php
CHANGED
@@ -218,7 +218,6 @@ class Cleantalk {
|
|
218 |
$request->$param = CleantalkHelper::removeNonUTF8FromString($value);
|
219 |
}
|
220 |
|
221 |
-
$request->message = unserialize($request->message);
|
222 |
$request->message = is_array($request->message) ? json_encode($request->message) : $request->message;
|
223 |
|
224 |
return $request;
|
218 |
$request->$param = CleantalkHelper::removeNonUTF8FromString($value);
|
219 |
}
|
220 |
|
|
|
221 |
$request->message = is_array($request->message) ? json_encode($request->message) : $request->message;
|
222 |
|
223 |
return $request;
|
lib/CleantalkAPI.php
CHANGED
@@ -43,7 +43,7 @@ class CleantalkAPI
|
|
43 |
|
44 |
if($date) $request['date'] = $date;
|
45 |
|
46 |
-
$result = self::send_request($request);
|
47 |
$result = $do_check ? self::check_response($result, 'spam_check_cms') : $result;
|
48 |
|
49 |
return $result;
|
43 |
|
44 |
if($date) $request['date'] = $date;
|
45 |
|
46 |
+
$result = self::send_request($request, self::URL, 15);
|
47 |
$result = $do_check ? self::check_response($result, 'spam_check_cms') : $result;
|
48 |
|
49 |
return $result;
|
lib/CleantalkDB_Wordpress.php
CHANGED
@@ -40,10 +40,12 @@ class CleantalkDB_Wordpress
|
|
40 |
public function fetch()
|
41 |
{
|
42 |
$this->result = $this->db->get_row($this->query, ARRAY_A);
|
|
|
43 |
}
|
44 |
|
45 |
public function fetch_all()
|
46 |
{
|
47 |
$this->result = $this->db->get_results($this->query, ARRAY_A);
|
|
|
48 |
}
|
49 |
}
|
40 |
public function fetch()
|
41 |
{
|
42 |
$this->result = $this->db->get_row($this->query, ARRAY_A);
|
43 |
+
return $this->result;
|
44 |
}
|
45 |
|
46 |
public function fetch_all()
|
47 |
{
|
48 |
$this->result = $this->db->get_results($this->query, ARRAY_A);
|
49 |
+
return $this->result;
|
50 |
}
|
51 |
}
|
lib/CleantalkState.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
|
16 |
class CleantalkState
|
17 |
{
|
18 |
-
public $option_prefix = '';
|
19 |
public $storage = array();
|
20 |
public $integrations = array();
|
21 |
public $def_settings = array(
|
@@ -66,14 +66,10 @@ class CleantalkState
|
|
66 |
'debug_ajax' => 0,
|
67 |
|
68 |
// GDPR
|
69 |
-
'
|
70 |
-
'gdpr_text'
|
71 |
);
|
72 |
|
73 |
-
public $settings_fields_description = array();
|
74 |
-
|
75 |
-
public $settings_groups_description = array();
|
76 |
-
|
77 |
public $def_data = array(
|
78 |
|
79 |
// Plugin data
|
@@ -153,6 +149,21 @@ class CleantalkState
|
|
153 |
'service_id' => 0,
|
154 |
);
|
155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
public function __construct($option_prefix, $options = array('settings'), $wpms = false)
|
157 |
{
|
158 |
$this->option_prefix = $option_prefix;
|
@@ -182,6 +193,11 @@ class CleantalkState
|
|
182 |
$option = $option ? $option : array();
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
185 |
$this->$option_name = is_array($option) ? new ArrayObject($option) : $option;
|
186 |
}
|
187 |
}
|
15 |
|
16 |
class CleantalkState
|
17 |
{
|
18 |
+
public $option_prefix = 'cleantalk';
|
19 |
public $storage = array();
|
20 |
public $integrations = array();
|
21 |
public $def_settings = array(
|
66 |
'debug_ajax' => 0,
|
67 |
|
68 |
// GDPR
|
69 |
+
'gdpr_enabled' => 0,
|
70 |
+
'gdpr_text' => 'By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.',
|
71 |
);
|
72 |
|
|
|
|
|
|
|
|
|
73 |
public $def_data = array(
|
74 |
|
75 |
// Plugin data
|
149 |
'service_id' => 0,
|
150 |
);
|
151 |
|
152 |
+
public $def_remote_calls = array(
|
153 |
+
'close_renew_banner' => array(
|
154 |
+
'last_call' => 0,
|
155 |
+
),
|
156 |
+
'sfw_update' => array(
|
157 |
+
'last_call' => 0,
|
158 |
+
),
|
159 |
+
'sfw_send_logs' => array(
|
160 |
+
'last_call' => 0,
|
161 |
+
),
|
162 |
+
'update_plugin' => array(
|
163 |
+
'last_call' => 0,
|
164 |
+
),
|
165 |
+
);
|
166 |
+
|
167 |
public function __construct($option_prefix, $options = array('settings'), $wpms = false)
|
168 |
{
|
169 |
$this->option_prefix = $option_prefix;
|
193 |
$option = $option ? $option : array();
|
194 |
}
|
195 |
|
196 |
+
// Setting default errors
|
197 |
+
if($this->option_prefix.'_'.$option_name === 'cleantalk_remote_calls'){
|
198 |
+
$option = is_array($option) ? array_merge($this->def_remote_calls, $option) : $this->def_remote_calls;
|
199 |
+
}
|
200 |
+
|
201 |
$this->$option_name = is_array($option) ? new ArrayObject($option) : $option;
|
202 |
}
|
203 |
}
|
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.
|
@@ -547,13 +547,19 @@ Yes, it is. Please read this article,
|
|
547 |
10. Website's options.
|
548 |
|
549 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
= 5.109 November 15 2018 =
|
551 |
-
Fix: Added URL and IP exclusions to Contact Form 7.
|
552 |
-
Fix: js error when responseText is not exists
|
553 |
-
Fix: Sitename when getting key automatically under WPMS.
|
554 |
-
Mod: SpamFireWall is now fully compatible with WPMS.
|
555 |
-
Mod: Setting 'Tell others about CleanTalk' was deleted.
|
556 |
-
Mod: Protection from spam improved.
|
557 |
|
558 |
= 5.108.1 November 8 2018 =
|
559 |
* Fix: Errors with integration class.
|
@@ -1730,13 +1736,20 @@ Yes, it is. Please read this article,
|
|
1730 |
* First version
|
1731 |
|
1732 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1733 |
= 5.109 November 15 2018 =
|
1734 |
-
Fix: Added URL and IP exclusions to Contact Form 7.
|
1735 |
-
Fix: js error when responseText is not exists
|
1736 |
-
Fix: Sitename when getting key automatically under WPMS.
|
1737 |
-
Mod: SpamFireWall is now fully compatible with WPMS.
|
1738 |
-
Mod: Setting 'Tell others about CleanTalk' was deleted.
|
1739 |
-
Mod: Protection from spam improved.
|
1740 |
|
1741 |
= 5.108.1 November 8 2018 =
|
1742 |
* Fix: Errors with integration class.
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.0
|
6 |
+
Stable tag: 5.110
|
7 |
License: GPLv2
|
8 |
|
9 |
Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
547 |
10. Website's options.
|
548 |
|
549 |
== Changelog ==
|
550 |
+
= 5.110 November 29 2018 =
|
551 |
+
* Integration: BuddyPress ActivityWall spam protection.
|
552 |
+
* Add: GDPR setting for shortcode.
|
553 |
+
* Add: Support different BuddyPress templates on activity wall.
|
554 |
+
* Fix: Admin/moderator checking for validate post data.
|
555 |
+
|
556 |
= 5.109 November 15 2018 =
|
557 |
+
* Fix: Added URL and IP exclusions to Contact Form 7.
|
558 |
+
* Fix: js error when responseText is not exists
|
559 |
+
* Fix: Sitename when getting key automatically under WPMS.
|
560 |
+
* Mod: SpamFireWall is now fully compatible with WPMS.
|
561 |
+
* Mod: Setting 'Tell others about CleanTalk' was deleted.
|
562 |
+
* Mod: Protection from spam improved.
|
563 |
|
564 |
= 5.108.1 November 8 2018 =
|
565 |
* Fix: Errors with integration class.
|
1736 |
* First version
|
1737 |
|
1738 |
== Upgrade Notice ==
|
1739 |
+
= 5.110 November 29 2018 =
|
1740 |
+
* Integration: BuddyPress ActivityWall spam protection.
|
1741 |
+
* Add: Support different BuddyPress templates on activity wall.
|
1742 |
+
* Fix: Admin/moderator checking for validate post data.
|
1743 |
+
* Add: GDPR setting for shortcode.
|
1744 |
+
* Fix: Increase timeout for spam_check_cms to 15.
|
1745 |
+
|
1746 |
= 5.109 November 15 2018 =
|
1747 |
+
* Fix: Added URL and IP exclusions to Contact Form 7.
|
1748 |
+
* Fix: js error when responseText is not exists
|
1749 |
+
* Fix: Sitename when getting key automatically under WPMS.
|
1750 |
+
* Mod: SpamFireWall is now fully compatible with WPMS.
|
1751 |
+
* Mod: Setting 'Tell others about CleanTalk' was deleted.
|
1752 |
+
* Mod: Protection from spam improved.
|
1753 |
|
1754 |
= 5.108.1 November 8 2018 =
|
1755 |
* Fix: Errors with integration class.
|