Version Description
Download this release
Release Info
Developer | Vlad Cleantalk |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.3-dev |
Comparing to | |
See all releases |
Code changes from version 5.2 to 5.3-dev
- cleantalk-admin.js +17 -0
- cleantalk-admin.php +27 -0
- cleantalk-ajax.php +383 -1
- cleantalk-common.php +1 -1
- cleantalk-public.php +10 -2
- cleantalk.php +2 -2
- readme.txt +14 -2
cleantalk-admin.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function(){
|
2 |
+
var d = new Date();
|
3 |
+
var n = d.getTimezoneOffset();
|
4 |
+
var data = {
|
5 |
+
'action': 'ajax_get_timezone',
|
6 |
+
'security': ajax_nonce,
|
7 |
+
'offset': n
|
8 |
+
};
|
9 |
+
jQuery.ajax({
|
10 |
+
type: "POST",
|
11 |
+
url: ajaxurl,
|
12 |
+
data: data,
|
13 |
+
success: function(msg){
|
14 |
+
//
|
15 |
+
}
|
16 |
+
});
|
17 |
+
});
|
cleantalk-admin.php
CHANGED
@@ -5,6 +5,30 @@ $ct_plugin_basename = 'cleantalk-spam-protect/cleantalk.php';
|
|
5 |
// Timeout to get app server
|
6 |
$ct_server_timeout = 10;
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
/**
|
9 |
* Admin action 'admin_enqueue_scripts' - Enqueue admin script of reloading admin page after needed AJAX events
|
10 |
* @param string $hook URL of hooked page
|
@@ -58,6 +82,8 @@ function ct_admin_init() {
|
|
58 |
$data['email'] = get_option('admin_email');
|
59 |
$data['website'] = parse_url(get_option('siteurl'),PHP_URL_HOST);
|
60 |
$data['platform'] = 'wordpress';
|
|
|
|
|
61 |
|
62 |
$ch = curl_init();
|
63 |
curl_setopt($ch, CURLOPT_URL, $url);
|
@@ -210,6 +236,7 @@ function ct_input_apikey() {
|
|
210 |
$def_value = '';
|
211 |
echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\"/>";
|
212 |
if (ct_valid_key($value) === false) {
|
|
|
213 |
echo "<a target='__blank' style='margin-left: 10px' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Click here to get access key manually', 'cleantalk')."</a>";
|
214 |
if (function_exists('curl_init') && function_exists('json_decode')) {
|
215 |
echo '<br /><br /><input name="get_apikey_auto" type="submit" value="' . __('Get access key automatically', 'cleantalk') . '" />';
|
5 |
// Timeout to get app server
|
6 |
$ct_server_timeout = 10;
|
7 |
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Admin action 'admin_print_footer_scripts' - Enqueue admin script for checking if timezone offset is saved in settings
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Admin action 'wp_ajax_ajax_get_timezone' - Ajax method for getting timezone offset
|
16 |
+
*/
|
17 |
+
|
18 |
+
function ct_ajax_get_timezone()
|
19 |
+
{
|
20 |
+
check_ajax_referer( 'ct_secret_nonce', 'security' );
|
21 |
+
$ct_data = ct_get_data();
|
22 |
+
if(isset($_POST['offset']))
|
23 |
+
{
|
24 |
+
$ct_data['timezone'] = intval($_POST['offset']);
|
25 |
+
update_option('cleantalk_data', $ct_data);
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
add_action( 'wp_ajax_ajax_get_timezone', 'ct_ajax_get_timezone' );
|
30 |
+
|
31 |
+
|
32 |
/**
|
33 |
* Admin action 'admin_enqueue_scripts' - Enqueue admin script of reloading admin page after needed AJAX events
|
34 |
* @param string $hook URL of hooked page
|
82 |
$data['email'] = get_option('admin_email');
|
83 |
$data['website'] = parse_url(get_option('siteurl'),PHP_URL_HOST);
|
84 |
$data['platform'] = 'wordpress';
|
85 |
+
$data['timezone'] = $ct_data['timezone'];
|
86 |
+
$data['locale'] = get_locale();
|
87 |
|
88 |
$ch = curl_init();
|
89 |
curl_setopt($ch, CURLOPT_URL, $url);
|
236 |
$def_value = '';
|
237 |
echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\"/>";
|
238 |
if (ct_valid_key($value) === false) {
|
239 |
+
echo "<script src='".plugins_url( 'cleantalk-admin.js', __FILE__ )."'></script>\n";
|
240 |
echo "<a target='__blank' style='margin-left: 10px' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(get_option('admin_email'))."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'>".__('Click here to get access key manually', 'cleantalk')."</a>";
|
241 |
if (function_exists('curl_init') && function_exists('json_decode')) {
|
242 |
echo '<br /><br /><input name="get_apikey_auto" type="submit" value="' . __('Get access key automatically', 'cleantalk') . '" />';
|
cleantalk-ajax.php
CHANGED
@@ -15,6 +15,36 @@ add_action( 'user_register', 'ct_user_register_ajaxlogin',1 );
|
|
15 |
add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
|
16 |
add_action( 'wp_ajax_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
function ct_validate_email_ajaxlogin($email=null, $is_ajax=true)
|
20 |
{
|
@@ -236,4 +266,356 @@ function ct_wpuf_submit_register()
|
|
236 |
}
|
237 |
}
|
238 |
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
|
16 |
add_action( 'wp_ajax_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
|
17 |
|
18 |
+
/*hooks for MyMail */
|
19 |
+
add_action( 'wp_ajax_nopriv_mymail_form_submit', 'ct_mymail_form_submit',1 );
|
20 |
+
add_action( 'wp_ajax_mymail_form_submit', 'ct_mymail_form_submit',1 );
|
21 |
+
|
22 |
+
/*hooks for MailPoet */
|
23 |
+
add_action( 'wp_ajax_nopriv_wysija_ajax', 'ct_wysija_ajax',1 );
|
24 |
+
add_action( 'wp_ajax_wysija_ajax', 'ct_wysija_ajax',1 );
|
25 |
+
|
26 |
+
/*hooks for cs_registration_validation */
|
27 |
+
add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_cs_registration_validation',1 );
|
28 |
+
add_action( 'wp_ajax_cs_registration_validation', 'ct_cs_registration_validation',1 );
|
29 |
+
|
30 |
+
/*hooks for cs_registration_validation */
|
31 |
+
add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_cs_registration_validation',1 );
|
32 |
+
add_action( 'wp_ajax_cs_registration_validation', 'ct_cs_registration_validation',1 );
|
33 |
+
|
34 |
+
/*hooks for send_message and request_appointment */
|
35 |
+
add_action( 'wp_ajax_nopriv_send_message', 'ct_sm_ra',1 );
|
36 |
+
add_action( 'wp_ajax_send_message', 'ct_sm_ra',1 );
|
37 |
+
add_action( 'wp_ajax_nopriv_request_appointment', 'ct_sm_ra',1 );
|
38 |
+
add_action( 'wp_ajax_request_appointment', 'ct_sm_ra',1 );
|
39 |
+
|
40 |
+
/*hooks for zn_do_login */
|
41 |
+
add_action( 'wp_ajax_nopriv_zn_do_login', 'ct_zn_do_login',1 );
|
42 |
+
add_action( 'wp_ajax_zn_do_login', 'ct_zn_do_login',1 );
|
43 |
+
|
44 |
+
/*hooks for clean and simple form */
|
45 |
+
add_action( 'wp_ajax_nopriv_cscf-submitform', 'ct_cscf_submitform',1 );
|
46 |
+
add_action( 'wp_ajax_cscf-submitform', 'ct_cscf_submitform',1 );
|
47 |
+
|
48 |
|
49 |
function ct_validate_email_ajaxlogin($email=null, $is_ajax=true)
|
50 |
{
|
266 |
}
|
267 |
}
|
268 |
|
269 |
+
function ct_mymail_form_submit()
|
270 |
+
{
|
271 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
272 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
273 |
+
|
274 |
+
$ct_data=ct_get_data();
|
275 |
+
|
276 |
+
$ct_options=ct_get_options();
|
277 |
+
|
278 |
+
$sender_email = null;
|
279 |
+
$message = '';
|
280 |
+
|
281 |
+
ct_get_fields($sender_email,$message,$_POST);
|
282 |
+
|
283 |
+
if($sender_email!=null)
|
284 |
+
{
|
285 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
286 |
+
$submit_time = submit_time_test();
|
287 |
+
$sender_info = get_sender_info();
|
288 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
289 |
+
|
290 |
+
$sender_info = json_encode($sender_info);
|
291 |
+
if ($sender_info === false)
|
292 |
+
{
|
293 |
+
$sender_info= '';
|
294 |
+
}
|
295 |
+
|
296 |
+
$ct_base_call_result = ct_base_call(array(
|
297 |
+
'message' => $message,
|
298 |
+
'example' => null,
|
299 |
+
'sender_email' => $sender_email,
|
300 |
+
'sender_nickname' => null,
|
301 |
+
'sender_info' => $sender_info,
|
302 |
+
'post_info'=>null,
|
303 |
+
'checkjs' => $checkjs));
|
304 |
+
|
305 |
+
$ct = $ct_base_call_result['ct'];
|
306 |
+
$ct_result = $ct_base_call_result['ct_result'];
|
307 |
+
if ($ct_result->allow == 0)
|
308 |
+
{
|
309 |
+
$result=Array('success'=>false,'html'=>$ct_result->comment);
|
310 |
+
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
311 |
+
print json_encode($result);
|
312 |
+
die();
|
313 |
+
}
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
function ct_wysija_ajax()
|
318 |
+
{
|
319 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
320 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
321 |
+
|
322 |
+
$ct_data=ct_get_data();
|
323 |
+
|
324 |
+
$ct_options=ct_get_options();
|
325 |
+
|
326 |
+
$sender_email = null;
|
327 |
+
$message = '';
|
328 |
+
|
329 |
+
ct_get_fields($sender_email,$message,$_POST);
|
330 |
+
|
331 |
+
|
332 |
+
if($sender_email!=null&&isset($_GET['callback']))
|
333 |
+
{
|
334 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
335 |
+
$submit_time = submit_time_test();
|
336 |
+
$sender_info = get_sender_info();
|
337 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
338 |
+
|
339 |
+
$sender_info = json_encode($sender_info);
|
340 |
+
if ($sender_info === false)
|
341 |
+
{
|
342 |
+
$sender_info= '';
|
343 |
+
}
|
344 |
+
|
345 |
+
$ct_base_call_result = ct_base_call(array(
|
346 |
+
'message' => $message,
|
347 |
+
'example' => null,
|
348 |
+
'sender_email' => $sender_email,
|
349 |
+
'sender_nickname' => null,
|
350 |
+
'sender_info' => $sender_info,
|
351 |
+
'post_info'=>null,
|
352 |
+
'checkjs' => $checkjs));
|
353 |
+
|
354 |
+
$ct = $ct_base_call_result['ct'];
|
355 |
+
$ct_result = $ct_base_call_result['ct_result'];
|
356 |
+
if ($ct_result->allow == 0)
|
357 |
+
{
|
358 |
+
$result=Array('result'=>false,'msgs'=>Array('updated'=>Array($ct_result->comment)));
|
359 |
+
//@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
360 |
+
print $_GET['callback'].'('.json_encode($result).');';
|
361 |
+
die();
|
362 |
+
}
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
function ct_cs_registration_validation()
|
367 |
+
{
|
368 |
+
|
369 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
370 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
371 |
+
|
372 |
+
$ct_data=ct_get_data();
|
373 |
+
|
374 |
+
$ct_options=ct_get_options();
|
375 |
+
|
376 |
+
$sender_email = null;
|
377 |
+
$message = '';
|
378 |
+
|
379 |
+
ct_get_fields($sender_email,$message,$_POST);
|
380 |
+
|
381 |
+
if($sender_email!=null)
|
382 |
+
{
|
383 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
384 |
+
$submit_time = submit_time_test();
|
385 |
+
$sender_info = get_sender_info();
|
386 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
387 |
+
|
388 |
+
$sender_info = json_encode($sender_info);
|
389 |
+
if ($sender_info === false)
|
390 |
+
{
|
391 |
+
$sender_info = '';
|
392 |
+
}
|
393 |
+
if(isset($_POST['user_login']))
|
394 |
+
{
|
395 |
+
$nickname=$_POST['user_login'];
|
396 |
+
}
|
397 |
+
else
|
398 |
+
{
|
399 |
+
$nickname='';
|
400 |
+
}
|
401 |
+
require_once('cleantalk.class.php');
|
402 |
+
|
403 |
+
$config = get_option('cleantalk_server');
|
404 |
+
$ct = new Cleantalk();
|
405 |
+
$ct->work_url = $config['ct_work_url'];
|
406 |
+
$ct->server_url = $ct_options['server'];
|
407 |
+
|
408 |
+
$ct->server_ttl = $config['ct_server_ttl'];
|
409 |
+
$ct->server_changed = $config['ct_server_changed'];
|
410 |
+
$ct->ssl_on = $ct_options['ssl_on'];
|
411 |
+
|
412 |
+
|
413 |
+
$ct_request = new CleantalkRequest();
|
414 |
+
$ct_request->auth_key = $ct_options['apikey'];
|
415 |
+
$ct_request->sender_email = $sender_email;
|
416 |
+
$ct_request->sender_ip = $_SERVER['REMOTE_ADDR'];
|
417 |
+
$ct_request->sender_nickname = $nickname;
|
418 |
+
$ct_request->agent = $ct_agent_version;
|
419 |
+
$ct_request->sender_info = $sender_info;
|
420 |
+
$ct_request->js_on = $checkjs;
|
421 |
+
$ct_request->submit_time = $submit_time;
|
422 |
+
|
423 |
+
$ct_result = $ct->isAllowUser($ct_request);
|
424 |
+
|
425 |
+
if ($ct_result->allow == 0)
|
426 |
+
{
|
427 |
+
$result=Array("type"=>"error","message"=>$ct_result->comment);
|
428 |
+
print json_encode($result);
|
429 |
+
die();
|
430 |
+
}
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
function ct_sm_ra()
|
435 |
+
{
|
436 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
437 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
438 |
+
|
439 |
+
$ct_data=ct_get_data();
|
440 |
+
|
441 |
+
$ct_options=ct_get_options();
|
442 |
+
|
443 |
+
$sender_email = null;
|
444 |
+
$message = '';
|
445 |
+
|
446 |
+
if(isset($_POST['target']))
|
447 |
+
{
|
448 |
+
$tmp=$_POST['target'];
|
449 |
+
$_POST['target']=1;
|
450 |
+
}
|
451 |
+
|
452 |
+
ct_get_fields($sender_email,$message,$_POST);
|
453 |
+
|
454 |
+
if(isset($_POST['target']))
|
455 |
+
{
|
456 |
+
$_POST['target']=$tmp;
|
457 |
+
}
|
458 |
+
|
459 |
+
|
460 |
+
if($sender_email!=null)
|
461 |
+
{
|
462 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
463 |
+
$submit_time = submit_time_test();
|
464 |
+
$sender_info = get_sender_info();
|
465 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
466 |
+
|
467 |
+
$sender_info = json_encode($sender_info);
|
468 |
+
if ($sender_info === false)
|
469 |
+
{
|
470 |
+
$sender_info= '';
|
471 |
+
}
|
472 |
+
|
473 |
+
$ct_base_call_result = ct_base_call(array(
|
474 |
+
'message' => $message,
|
475 |
+
'example' => null,
|
476 |
+
'sender_email' => $sender_email,
|
477 |
+
'sender_nickname' => null,
|
478 |
+
'sender_info' => $sender_info,
|
479 |
+
'post_info'=>null,
|
480 |
+
'checkjs' => $checkjs));
|
481 |
+
|
482 |
+
$ct = $ct_base_call_result['ct'];
|
483 |
+
$ct_result = $ct_base_call_result['ct_result'];
|
484 |
+
if ($ct_result->allow == 0)
|
485 |
+
{
|
486 |
+
print $ct_result->comment;
|
487 |
+
die();
|
488 |
+
}
|
489 |
+
}
|
490 |
+
}
|
491 |
+
|
492 |
+
function ct_zn_do_login()
|
493 |
+
{
|
494 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
495 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
496 |
+
|
497 |
+
$ct_data=ct_get_data();
|
498 |
+
|
499 |
+
$ct_options=ct_get_options();
|
500 |
+
|
501 |
+
$sender_email = null;
|
502 |
+
$message = '';
|
503 |
+
|
504 |
+
ct_get_fields($sender_email,$message,$_POST);
|
505 |
+
|
506 |
+
|
507 |
+
if($sender_email!=null&&$_POST['zn_form_action']=='register')
|
508 |
+
{
|
509 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
510 |
+
$submit_time = submit_time_test();
|
511 |
+
$sender_info = get_sender_info();
|
512 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
513 |
+
|
514 |
+
$sender_info = json_encode($sender_info);
|
515 |
+
if ($sender_info === false)
|
516 |
+
{
|
517 |
+
$sender_info= '';
|
518 |
+
}
|
519 |
+
|
520 |
+
$ct_base_call_result = ct_base_call(array(
|
521 |
+
'message' => $message,
|
522 |
+
'example' => null,
|
523 |
+
'sender_email' => $sender_email,
|
524 |
+
'sender_nickname' => null,
|
525 |
+
'sender_info' => $sender_info,
|
526 |
+
'post_info'=>null,
|
527 |
+
'checkjs' => $checkjs));
|
528 |
+
|
529 |
+
$ct = $ct_base_call_result['ct'];
|
530 |
+
$ct_result = $ct_base_call_result['ct_result'];
|
531 |
+
if ($ct_result->allow == 0)
|
532 |
+
{
|
533 |
+
print '<div id="login_error">'.$ct_result->comment.'</div>';
|
534 |
+
die();
|
535 |
+
}
|
536 |
+
}
|
537 |
+
}
|
538 |
+
|
539 |
+
function ct_cscf_submitform()
|
540 |
+
{
|
541 |
+
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
542 |
+
global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
|
543 |
+
|
544 |
+
$ct_data=ct_get_data();
|
545 |
+
|
546 |
+
$ct_options=ct_get_options();
|
547 |
+
|
548 |
+
$sender_email = null;
|
549 |
+
$message = '';
|
550 |
+
|
551 |
+
if(isset($_POST['cscf']['confirm-email']))
|
552 |
+
{
|
553 |
+
$tmp=$_POST['cscf']['confirm-email'];
|
554 |
+
$_POST['cscf']['confirm-email']=1;
|
555 |
+
}
|
556 |
+
|
557 |
+
ct_get_fields($sender_email,$message,$_POST);
|
558 |
+
|
559 |
+
if(isset($_POST['cscf']['confirm-email']))
|
560 |
+
{
|
561 |
+
$_POST['cscf']['confirm-email']=$tmp;
|
562 |
+
}
|
563 |
+
|
564 |
+
|
565 |
+
if($sender_email!=null)
|
566 |
+
{
|
567 |
+
$checkjs = js_test('ct_checkjs', $_COOKIE, true);
|
568 |
+
$submit_time = submit_time_test();
|
569 |
+
$sender_info = get_sender_info();
|
570 |
+
$sender_info['post_checkjs_passed']=$checkjs;
|
571 |
+
|
572 |
+
$sender_info = json_encode($sender_info);
|
573 |
+
if ($sender_info === false)
|
574 |
+
{
|
575 |
+
$sender_info= '';
|
576 |
+
}
|
577 |
+
|
578 |
+
$ct_base_call_result = ct_base_call(array(
|
579 |
+
'message' => $message,
|
580 |
+
'example' => null,
|
581 |
+
'sender_email' => $sender_email,
|
582 |
+
'sender_nickname' => null,
|
583 |
+
'sender_info' => $sender_info,
|
584 |
+
'post_info'=>null,
|
585 |
+
'checkjs' => $checkjs));
|
586 |
+
|
587 |
+
$ct = $ct_base_call_result['ct'];
|
588 |
+
$ct_result = $ct_base_call_result['ct_result'];
|
589 |
+
if ($ct_result->allow == 0)
|
590 |
+
{
|
591 |
+
$result=Array('sent'=>true,'valid'=>false,'errorlist'=>Array('name'=>$ct_result->comment));
|
592 |
+
print json_encode($result);
|
593 |
+
die();
|
594 |
+
}
|
595 |
+
}
|
596 |
+
}
|
597 |
+
|
598 |
+
|
599 |
+
function ct_get_fields(&$email,&$message,$arr)
|
600 |
+
{
|
601 |
+
foreach($arr as $key=>$value)
|
602 |
+
{
|
603 |
+
if(!is_array($value))
|
604 |
+
{
|
605 |
+
if ($email === null && preg_match("/^\S+@\S+\.\S+$/", $value))
|
606 |
+
{
|
607 |
+
$email = $value;
|
608 |
+
}
|
609 |
+
else
|
610 |
+
{
|
611 |
+
$message.="$value\n";
|
612 |
+
}
|
613 |
+
}
|
614 |
+
else
|
615 |
+
{
|
616 |
+
ct_get_fields($email,$message,$value);
|
617 |
+
}
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
?>
|
cleantalk-common.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
$ct_agent_version = 'wordpress-
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
1 |
<?php
|
2 |
|
3 |
+
$ct_agent_version = 'wordpress-53';
|
4 |
$ct_plugin_name = 'Anti-spam by CleanTalk';
|
5 |
$ct_checkjs_frm = 'ct_checkjs_frm';
|
6 |
$ct_checkjs_register_form = 'ct_checkjs_register_form';
|
cleantalk-public.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Init functions
|
5 |
* @return mixed[] Array of options
|
6 |
*/
|
7 |
-
function
|
8 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $ct_formtime_label, $ct_direct_post, $ct_options, $ct_data;
|
9 |
|
10 |
$ct_options = ct_get_options();
|
@@ -491,7 +491,15 @@ function ct_die($comment_id, $comment_status) {
|
|
491 |
global $ct_comment;
|
492 |
$err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
|
493 |
$err_text .= '<script>setTimeout("history.back()", 5000);</script>';
|
494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
}
|
496 |
|
497 |
/**
|
4 |
* Init functions
|
5 |
* @return mixed[] Array of options
|
6 |
*/
|
7 |
+
function cleantalk_init() {
|
8 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $ct_formtime_label, $ct_direct_post, $ct_options, $ct_data;
|
9 |
|
10 |
$ct_options = ct_get_options();
|
491 |
global $ct_comment;
|
492 |
$err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
|
493 |
$err_text .= '<script>setTimeout("history.back()", 5000);</script>';
|
494 |
+
if(isset($_POST['et_pb_contact_email']))
|
495 |
+
{
|
496 |
+
$mes='<div id="et_pb_contact_form_1" class="et_pb_contact_form_container clearfix"><h1 class="et_pb_contact_main_title">Blacklisted</h1><div class="et-pb-contact-message"><p>'.$ct_comment.'</p></div></div>';
|
497 |
+
wp_die($mes, 'Blacklisted', array('back_link' => true,'response'=>200));
|
498 |
+
}
|
499 |
+
else
|
500 |
+
{
|
501 |
+
wp_die($err_text, 'Blacklisted', array('back_link' => true));
|
502 |
+
}
|
503 |
}
|
504 |
|
505 |
/**
|
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, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
-
Version: 5.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
@@ -55,7 +55,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
|
|
55 |
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
56 |
|
57 |
// Init action.
|
58 |
-
add_action('init', '
|
59 |
|
60 |
// Hourly run hook
|
61 |
add_action('ct_hourly_event_hook', 'ct_do_this_hourly');
|
3 |
Plugin Name: Anti-spam by CleanTalk
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
+
Version: 5.3
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
55 |
require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
|
56 |
|
57 |
// Init action.
|
58 |
+
add_action('init', 'cleantalk_init', 1);
|
59 |
|
60 |
// Hourly run hook
|
61 |
add_action('ct_hourly_event_hook', 'ct_do_this_hourly');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, vlad-cleantalk
|
|
3 |
Tags: akismet, anti-spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, fast secure contact form spam, form, Formidable spam, jetpack spam, landing pages, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam, widget, widget antispam
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.1.1
|
6 |
-
Stable tag: 5.
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -32,7 +32,7 @@ No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam b
|
|
32 |
* Any WordPress form (option 'Custom contact forms').
|
33 |
|
34 |
= Check existing comments for spam =
|
35 |
-
With the help of anti-spam CleanTalk you can check existing comments, to find and quickly delete spam comments. For use
|
36 |
|
37 |
= Cloud anti-spam for WordPress. CAPTCHA less, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
|
38 |
Spam is one of the most irritating factors. Spam become every year more and conventional anti-spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
|
@@ -181,6 +181,12 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
|
|
181 |
1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
|
182 |
|
183 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
= 5.2 2015-04-01 =
|
185 |
* Added link for anti-spam statistics
|
186 |
* Added WP User Frontend Pro registration form protection
|
@@ -540,6 +546,12 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
|
|
540 |
* First version
|
541 |
|
542 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
= 5.2 2015-04-01 =
|
544 |
* Added link for anti-spam statistics
|
545 |
* Added WP User Frontend Pro registration form protection
|
3 |
Tags: akismet, anti-spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, fast secure contact form spam, form, Formidable spam, jetpack spam, landing pages, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam, widget, widget antispam
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.1.1
|
6 |
+
Stable tag: 5.3
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
32 |
* Any WordPress form (option 'Custom contact forms').
|
33 |
|
34 |
= Check existing comments for spam =
|
35 |
+
With the help of anti-spam CleanTalk you can check existing comments, to find and quickly delete spam comments. For use this function, go to WP Console->Comments->Find spam comments.
|
36 |
|
37 |
= Cloud anti-spam for WordPress. CAPTCHA less, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
|
38 |
Spam is one of the most irritating factors. Spam become every year more and conventional anti-spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
|
181 |
1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
|
182 |
|
183 |
== Changelog ==
|
184 |
+
= 5.3 2015-04-13 =
|
185 |
+
* Added anti-spam protection for Divi theme contact forms
|
186 |
+
* Added anti-spam protection for MyMail contact forms
|
187 |
+
* Added anti-spam protection for MailPoet Newsletters
|
188 |
+
* Some interface and functionality changes in backend
|
189 |
+
|
190 |
= 5.2 2015-04-01 =
|
191 |
* Added link for anti-spam statistics
|
192 |
* Added WP User Frontend Pro registration form protection
|
546 |
* First version
|
547 |
|
548 |
== Upgrade Notice ==
|
549 |
+
= 5.3 2015-04-13 =
|
550 |
+
* Added anti-spam protection for Divi theme contact forms
|
551 |
+
* Added anti-spam protection for MyMail contact forms
|
552 |
+
* Added anti-spam protection for MailPoet Newsletters
|
553 |
+
* Some interface and functionality changes in backend
|
554 |
+
|
555 |
= 5.2 2015-04-01 =
|
556 |
* Added link for anti-spam statistics
|
557 |
* Added WP User Frontend Pro registration form protection
|