Version Description
January 25 2018 = * Fix: High CPU load with wp-ajax.php. * Fix: Mailpoet: Newsletter. * Fix: Gravity: Forms standardization for input fields. * Fix: ajax hook checks data for contact form. * Fix: UTF8 character in requests.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.86 |
Comparing to | |
See all releases |
Code changes from version 5.85 to 5.86
- cleantalk.php +5 -5
- css/cleantalk-admin-settings-page.css +5 -0
- inc/cleantalk-admin.php +12 -8
- inc/cleantalk-ajax.php +286 -281
- inc/cleantalk-common.php +12 -6
- inc/cleantalk-public.php +12 -3
- inc/cleantalk.class.php +3 -1
- js/apbct-public.js +23 -21
- {inc → js}/cleantalk_external.js +0 -0
- {inc → js}/cleantalk_internal.js +0 -0
- readme.txt +15 -1
cleantalk.php
CHANGED
@@ -3,17 +3,17 @@
|
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
|
6 |
-
Version: 5.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
|
11 |
-
$cleantalk_plugin_version='5.
|
12 |
-
$ct_agent_version = 'wordpress-
|
13 |
$cleantalk_executed = false;
|
14 |
|
15 |
-
define('APBCT_VERSION', '5.
|
16 |
-
define('APBCT_AGENT', 'wordpress-
|
17 |
|
18 |
define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
|
19 |
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: http://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
|
6 |
+
Version: 5.86
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: http://cleantalk.org
|
9 |
*/
|
10 |
|
11 |
+
$cleantalk_plugin_version='5.86';
|
12 |
+
$ct_agent_version = 'wordpress-586';
|
13 |
$cleantalk_executed = false;
|
14 |
|
15 |
+
define('APBCT_VERSION', '5.86');
|
16 |
+
define('APBCT_AGENT', 'wordpress-586');
|
17 |
|
18 |
define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
|
19 |
|
css/cleantalk-admin-settings-page.css
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
a.ct_support_link{
|
2 |
color: #666;
|
3 |
margin-right: 0.5em;
|
1 |
+
.apbct_status_icon{
|
2 |
+
vertical-align: text-bottom;
|
3 |
+
margin: 0 5px;
|
4 |
+
}
|
5 |
+
|
6 |
a.ct_support_link{
|
7 |
color: #666;
|
8 |
margin-right: 0.5em;
|
inc/cleantalk-admin.php
CHANGED
@@ -856,7 +856,7 @@ function ct_section_debug(){
|
|
856 |
* Admin callback function - Displays description of 'state' plugin parameters section
|
857 |
*/
|
858 |
function ct_section_settings_state() {
|
859 |
-
global $ct_options, $ct_data;
|
860 |
|
861 |
$ct_options = ct_get_options();
|
862 |
$ct_data = ct_get_data();
|
@@ -897,14 +897,18 @@ function ct_section_settings_state() {
|
|
897 |
else
|
898 |
$ct_moderate = false;
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
|
|
|
|
|
|
|
|
906 |
if(class_exists('WooCommerce'))
|
907 |
-
|
908 |
|
909 |
if($ct_data['moderate_ip'] == 1)
|
910 |
print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$ct_data['ip_license'].".<br />";
|
856 |
* Admin callback function - Displays description of 'state' plugin parameters section
|
857 |
*/
|
858 |
function ct_section_settings_state() {
|
859 |
+
global $ct_options, $ct_data, $wpdb;
|
860 |
|
861 |
$ct_options = ct_get_options();
|
862 |
$ct_data = ct_get_data();
|
897 |
else
|
898 |
$ct_moderate = false;
|
899 |
|
900 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['registrations_test']==1 || $ct_moderate ? $img : $img_no).'" /> '.__('Registration forms', 'cleantalk');
|
901 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['comments_test']==1 || $ct_moderate ? $img : $img_no).'"/> '.__('Comments forms', 'cleantalk');
|
902 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['contact_forms_test']==1 || $ct_moderate ? $img : $img_no).'"/> '.__('Contact forms', 'cleantalk');
|
903 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['general_contact_forms_test']==1 || $ct_moderate ? $img : $img_no).'"/> '.__('Custom contact forms', 'cleantalk');
|
904 |
+
|
905 |
+
// SFW + current network count
|
906 |
+
$sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->base_prefix."cleantalk_sfw`", ARRAY_A);
|
907 |
+
$alt_for_sfw = sprintf(__('Networks in database: %d.', 'cleantalk'), $sfw_netwoks_amount[0]['cnt']);
|
908 |
+
echo '<img class="apbct_status_icon" src="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $img : $img_no).'" title="'.($ct_options['spam_firewall']==1 || $ct_moderate ? $alt_for_sfw : '').'"/> '.__('SpamFireWall', 'cleantalk');
|
909 |
+
// WooCommerce
|
910 |
if(class_exists('WooCommerce'))
|
911 |
+
echo '<img src="'.($ct_options['wc_checkout_test']==1 || $ct_moderate ? $img : $img_no).'"/> '.__('WooCommerce checkout form', 'cleantalk');
|
912 |
|
913 |
if($ct_data['moderate_ip'] == 1)
|
914 |
print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$ct_data['ip_license'].".<br />";
|
inc/cleantalk-ajax.php
CHANGED
@@ -342,290 +342,295 @@ function ct_ajax_hook($message_obj = false, $additional = false)
|
|
342 |
$message['subject'] = $subject;
|
343 |
}
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
-
|
|
|
|
|
360 |
{
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
}
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
401 |
-
print json_encode($result);
|
402 |
-
die();
|
403 |
-
}
|
404 |
-
else if(isset($_POST['action']) && $_POST['action']== 'cscf-submitform')
|
405 |
-
{
|
406 |
-
$message_obj['akismet_result'] = 'true';
|
407 |
-
$result = array(
|
408 |
-
'sent' => false,
|
409 |
-
'valid' => 1,
|
410 |
-
'errorlist' => array('confirm-email'=>$ct_result->comment)
|
411 |
-
);
|
412 |
-
$result = json_encode($result);
|
413 |
-
echo $result;
|
414 |
-
return $message_obj;
|
415 |
-
}
|
416 |
-
else if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout')
|
417 |
-
{
|
418 |
-
print $ct_result->comment;
|
419 |
-
die();
|
420 |
-
}
|
421 |
-
else if(isset($_POST['action']) && $_POST['action']=='frm_entries_create')
|
422 |
-
{
|
423 |
-
$result=Array('112'=>$ct_result->comment);
|
424 |
-
print json_encode($result);
|
425 |
-
die();
|
426 |
-
}
|
427 |
-
else if(isset($_POST['cma-action']) && $_POST['cma-action']=='add')
|
428 |
-
{
|
429 |
-
$result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
|
430 |
-
print json_encode($result);
|
431 |
-
die();
|
432 |
-
}
|
433 |
-
else if(isset($_POST['action']) && $_POST['action']=='td_mod_register')
|
434 |
-
{
|
435 |
-
print json_encode(array('register', 0, $ct_result->comment));
|
436 |
-
die();
|
437 |
-
}
|
438 |
-
else if(isset($_POST['action']) && $_POST['action']=='tmpl_ajax_check_user_email')
|
439 |
-
{
|
440 |
-
print "17,email";
|
441 |
-
die();
|
442 |
-
}
|
443 |
-
else if(isset($_POST['action']) && ($_POST['action']=='tevolution_submit_from_preview' || $_POST['action']=='submit_form_recaptcha_validation'))
|
444 |
-
{
|
445 |
-
print $ct_result->comment;
|
446 |
-
die();
|
447 |
-
}
|
448 |
-
else if(isset($_POST['action']) && $_POST['action']=='ninja_forms_ajax_submit')
|
449 |
-
{
|
450 |
-
print '{"form_id":'.$_POST['_form_id'].',"errors":false,"success":{"success_msg-Success":"'.$ct_result->comment.'"}}';
|
451 |
-
die();
|
452 |
-
}
|
453 |
-
else if(isset($_POST['action']) && $_POST['action']=='nf_ajax_submit')
|
454 |
-
{
|
455 |
-
$nf_data = json_decode($_POST['formData'], true);
|
456 |
-
// print '{data:{{"form_id":'.$nf_data['id'].',"errors":false,"success":{"success_msg-Success":"'.$ct_result->comment.'"}}}}'; \\Old version
|
457 |
-
print '{"data":{"form_id":"'.$nf_data['id'].'","settings":{},"extra":[],"fields":{},"processed_actions":[],"actions":{"success_message": "<font style=\"color: red\">'.$ct_result->comment.'</font><br><br>"}},"errors":[],"debug":[]}';
|
458 |
-
die();
|
459 |
-
}
|
460 |
-
|
461 |
-
// WooWaitList
|
462 |
-
// http://codecanyon.net/item/woowaitlist-woocommerce-back-in-stock-notifier/7103373
|
463 |
-
else if(isset($_POST['action']) && $_POST['action']=='wew_save_to_db_callback')
|
464 |
-
{
|
465 |
-
$result = array();
|
466 |
-
$result['error'] = 1;
|
467 |
-
$result['message'] = $ct_result->comment;
|
468 |
-
$result['code'] = 5; // Unused code number in WooWaitlist
|
469 |
-
print json_encode($result);
|
470 |
-
die();
|
471 |
-
}
|
472 |
-
// UserPro
|
473 |
-
else if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register')
|
474 |
-
{
|
475 |
-
foreach($_POST as $key => $value){
|
476 |
-
$output[$key]=$value;
|
477 |
-
}unset($key, $value);
|
478 |
-
$output['template'] = $ct_result->comment;
|
479 |
-
$output=json_encode($output);
|
480 |
-
print_r($output);
|
481 |
-
die;
|
482 |
-
}
|
483 |
-
// Quick event manager
|
484 |
-
else if(isset($_POST['action']) && $_POST['action']=='qem_validate_form'){
|
485 |
-
$errors[] = 'registration_forbidden';
|
486 |
-
$result = Array(
|
487 |
-
'success' => 'false',
|
488 |
-
'errors' => $errors,
|
489 |
-
'title' => $ct_result->comment
|
490 |
-
);
|
491 |
-
print json_encode($result);
|
492 |
-
die();
|
493 |
-
}
|
494 |
-
// Quick Contact Form
|
495 |
-
elseif(isset($_POST['action']) && $_POST['action'] == 'qcf_validate_form')
|
496 |
-
{
|
497 |
-
$result = Array(
|
498 |
-
'blurb' => "<h1>".$ct_result->comment."</h1>",
|
499 |
-
'display' => "Oops, got a few problems here",
|
500 |
-
'errors' => array(
|
501 |
-
0 => array(
|
502 |
-
error => 'error',
|
503 |
-
name => 'name'
|
504 |
-
),
|
505 |
),
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
}
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
}
|
630 |
}
|
631 |
}
|
342 |
$message['subject'] = $subject;
|
343 |
}
|
344 |
|
345 |
+
// Skip submission if no data found
|
346 |
+
if ($sender_email === ''|| !$contact_form)
|
347 |
+
return false;
|
348 |
+
|
349 |
+
// Mailpoet fix
|
350 |
+
if (isset($message['wysijaData'], $message['wysijaplugin'], $message['task'], $message['controller']) && $message['wysijaplugin'] == 'wysija-newsletters' && $message['controller'] == 'campaigns')
|
351 |
+
return false;
|
352 |
+
|
353 |
+
$base_call_result = apbct_base_call(
|
354 |
+
array(
|
355 |
+
'message' => $message,
|
356 |
+
'sender_email' => $sender_email,
|
357 |
+
'sender_nickname' => $sender_nickname,
|
358 |
+
'sender_info' => array('post_checkjs_passed' => $checkjs),
|
359 |
+
'post_info' => array('comment_type' => 'feedback_ajax'),
|
360 |
+
'checkjs' => $checkjs,
|
361 |
+
)
|
362 |
+
);
|
363 |
+
$ct_result = $base_call_result['ct_result'];
|
364 |
+
|
365 |
+
if ($ct_result->allow == 0)
|
366 |
+
{
|
367 |
+
if(isset($_POST['action']) && $_POST['action']=='wpuf_submit_register'){
|
368 |
+
$result=Array('success'=>false,'error'=>$ct_result->comment);
|
369 |
+
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
370 |
+
print json_encode($result);
|
371 |
+
die();
|
372 |
+
}
|
373 |
+
else if(isset($_POST['action']) && $_POST['action']=='mymail_form_submit')
|
374 |
+
{
|
375 |
+
$result=Array('success'=>false,'html'=>$ct_result->comment);
|
376 |
+
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
377 |
+
print json_encode($result);
|
378 |
+
die();
|
379 |
+
}
|
380 |
+
else if(isset($_POST['action'], $_POST['task']) && $_POST['action'] == 'wysija_ajax' && $_POST['task'] != 'send_preview' && $_POST['task'] != 'send_test_mail')
|
381 |
+
{
|
382 |
+
$result=Array('result'=>false,'msgs'=>Array('updated'=>Array($ct_result->comment)));
|
383 |
+
//@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
384 |
+
print $_GET['callback'].'('.json_encode($result).');';
|
385 |
+
die();
|
386 |
+
}
|
387 |
+
else if(isset($_POST['action']) && $_POST['action']=='cs_registration_validation')
|
388 |
+
{
|
389 |
+
$result=Array("type"=>"error","message"=>$ct_result->comment);
|
390 |
+
print json_encode($result);
|
391 |
+
die();
|
392 |
+
}
|
393 |
+
else if(isset($_POST['action']) && ($_POST['action']=='request_appointment' || $_POST['action']=='send_message'))
|
394 |
+
{
|
395 |
+
print $ct_result->comment;
|
396 |
+
die();
|
397 |
+
}
|
398 |
+
else if(isset($_POST['action']) && $_POST['action']=='zn_do_login')
|
399 |
+
{
|
400 |
+
print '<div id="login_error">'.$ct_result->comment.'</div>';
|
401 |
+
die();
|
402 |
+
}
|
403 |
+
else if(isset($_POST['action']) && $_POST['action']=='vfb_submit')
|
404 |
+
{
|
405 |
+
$result=Array('result'=>false,'message'=>$ct_result->comment);
|
406 |
+
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
407 |
+
print json_encode($result);
|
408 |
+
die();
|
409 |
+
}
|
410 |
+
else if(isset($_POST['action']) && $_POST['action']== 'cscf-submitform')
|
411 |
+
{
|
412 |
+
$message_obj['akismet_result'] = 'true';
|
413 |
+
$result = array(
|
414 |
+
'sent' => false,
|
415 |
+
'valid' => 1,
|
416 |
+
'errorlist' => array('confirm-email'=>$ct_result->comment)
|
417 |
+
);
|
418 |
+
$result = json_encode($result);
|
419 |
+
echo $result;
|
420 |
+
return $message_obj;
|
421 |
+
}
|
422 |
+
else if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout')
|
423 |
+
{
|
424 |
+
print $ct_result->comment;
|
425 |
+
die();
|
426 |
+
}
|
427 |
+
else if(isset($_POST['action']) && $_POST['action']=='frm_entries_create')
|
428 |
+
{
|
429 |
+
$result=Array('112'=>$ct_result->comment);
|
430 |
+
print json_encode($result);
|
431 |
+
die();
|
432 |
+
}
|
433 |
+
else if(isset($_POST['cma-action']) && $_POST['cma-action']=='add')
|
434 |
+
{
|
435 |
+
$result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
|
436 |
+
print json_encode($result);
|
437 |
+
die();
|
438 |
+
}
|
439 |
+
else if(isset($_POST['action']) && $_POST['action']=='td_mod_register')
|
440 |
+
{
|
441 |
+
print json_encode(array('register', 0, $ct_result->comment));
|
442 |
+
die();
|
443 |
+
}
|
444 |
+
else if(isset($_POST['action']) && $_POST['action']=='tmpl_ajax_check_user_email')
|
445 |
+
{
|
446 |
+
print "17,email";
|
447 |
+
die();
|
448 |
+
}
|
449 |
+
else if(isset($_POST['action']) && ($_POST['action']=='tevolution_submit_from_preview' || $_POST['action']=='submit_form_recaptcha_validation'))
|
450 |
+
{
|
451 |
+
print $ct_result->comment;
|
452 |
+
die();
|
453 |
+
}
|
454 |
+
else if(isset($_POST['action']) && $_POST['action']=='ninja_forms_ajax_submit')
|
455 |
+
{
|
456 |
+
print '{"form_id":'.$_POST['_form_id'].',"errors":false,"success":{"success_msg-Success":"'.$ct_result->comment.'"}}';
|
457 |
+
die();
|
458 |
+
}
|
459 |
+
else if(isset($_POST['action']) && $_POST['action']=='nf_ajax_submit')
|
460 |
+
{
|
461 |
+
$nf_data = json_decode($_POST['formData'], true);
|
462 |
+
// print '{data:{{"form_id":'.$nf_data['id'].',"errors":false,"success":{"success_msg-Success":"'.$ct_result->comment.'"}}}}'; \\Old version
|
463 |
+
print '{"data":{"form_id":"'.$nf_data['id'].'","settings":{},"extra":[],"fields":{},"processed_actions":[],"actions":{"success_message": "<font style=\"color: red\">'.$ct_result->comment.'</font><br><br>"}},"errors":[],"debug":[]}';
|
464 |
+
die();
|
465 |
+
}
|
466 |
|
467 |
+
// WooWaitList
|
468 |
+
// http://codecanyon.net/item/woowaitlist-woocommerce-back-in-stock-notifier/7103373
|
469 |
+
else if(isset($_POST['action']) && $_POST['action']=='wew_save_to_db_callback')
|
470 |
{
|
471 |
+
$result = array();
|
472 |
+
$result['error'] = 1;
|
473 |
+
$result['message'] = $ct_result->comment;
|
474 |
+
$result['code'] = 5; // Unused code number in WooWaitlist
|
475 |
+
print json_encode($result);
|
476 |
+
die();
|
477 |
+
}
|
478 |
+
// UserPro
|
479 |
+
else if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register')
|
480 |
+
{
|
481 |
+
foreach($_POST as $key => $value){
|
482 |
+
$output[$key]=$value;
|
483 |
+
}unset($key, $value);
|
484 |
+
$output['template'] = $ct_result->comment;
|
485 |
+
$output=json_encode($output);
|
486 |
+
print_r($output);
|
487 |
+
die;
|
488 |
+
}
|
489 |
+
// Quick event manager
|
490 |
+
else if(isset($_POST['action']) && $_POST['action']=='qem_validate_form'){
|
491 |
+
$errors[] = 'registration_forbidden';
|
492 |
+
$result = Array(
|
493 |
+
'success' => 'false',
|
494 |
+
'errors' => $errors,
|
495 |
+
'title' => $ct_result->comment
|
496 |
+
);
|
497 |
+
print json_encode($result);
|
498 |
+
die();
|
499 |
+
}
|
500 |
+
// Quick Contact Form
|
501 |
+
elseif(isset($_POST['action']) && $_POST['action'] == 'qcf_validate_form')
|
502 |
+
{
|
503 |
+
$result = Array(
|
504 |
+
'blurb' => "<h1>".$ct_result->comment."</h1>",
|
505 |
+
'display' => "Oops, got a few problems here",
|
506 |
+
'errors' => array(
|
507 |
+
0 => array(
|
508 |
+
error => 'error',
|
509 |
+
name => 'name'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
),
|
511 |
+
),
|
512 |
+
'success' => 'false',
|
513 |
+
);
|
514 |
+
print json_encode($result);
|
515 |
+
die();
|
516 |
+
}
|
517 |
+
// Usernoise Contact Form
|
518 |
+
elseif(isset($_POST['title'], $_POST['email'], $_POST['type'], $_POST['ct_checkjs']))
|
519 |
+
{
|
520 |
+
return array($ct_result->comment);
|
521 |
+
die();
|
522 |
+
}
|
523 |
+
// amoForms
|
524 |
+
elseif(isset($_POST['action']) && $_POST['action'] == 'amoforms_submit')
|
525 |
+
{
|
526 |
+
$result = Array(
|
527 |
+
'result' => true,
|
528 |
+
'type' => "html",
|
529 |
+
'value' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
|
530 |
+
'fast' => false
|
531 |
+
);
|
532 |
+
print json_encode($result);
|
533 |
+
die();
|
534 |
+
}
|
535 |
+
// MailChimp for Wordpress Premium
|
536 |
+
elseif(!empty($_POST['_mc4wp_form_id']))
|
537 |
+
{
|
538 |
+
return 'ct_mc4wp_response';
|
539 |
+
}
|
540 |
+
// QAEngine Theme answers
|
541 |
+
elseif ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['author'], $message_obj['post_content']) ){
|
542 |
+
return new WP_Error('Spam comment', $ct_result->comment);
|
543 |
+
}
|
544 |
+
//Convertplug. Strpos because action value dynamically changes and depends on mailing service
|
545 |
+
elseif (isset($_POST['action']) && strpos($_POST['action'], '_add_subscriber') !== false){
|
546 |
+
$result = Array(
|
547 |
+
'action' => "message",
|
548 |
+
'detailed_msg' => "",
|
549 |
+
'email_status' => false,
|
550 |
+
'message' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
|
551 |
+
'status' => "error",
|
552 |
+
'url' => "none"
|
553 |
+
);
|
554 |
+
print json_encode($result);
|
555 |
+
die();
|
556 |
+
}
|
557 |
+
// Ultimate Form Builder
|
558 |
+
elseif (isset($_POST['action']) && $_POST['action'] == 'ufbl_front_form_action'){
|
559 |
+
$result = Array(
|
560 |
+
'error_keys' => array(),
|
561 |
+
'error_flag' => 1,
|
562 |
+
'response_message' => $ct_result->comment
|
563 |
+
);
|
564 |
+
print json_encode($result);
|
565 |
+
die();
|
566 |
+
}
|
567 |
+
// Smart Forms
|
568 |
+
elseif (isset($_POST['action']) && $_POST['action'] == 'rednao_smart_forms_save_form_values'){
|
569 |
+
$result = Array(
|
570 |
+
'message' => $ct_result->comment,
|
571 |
+
'refreshCaptcha' => 'n',
|
572 |
+
'success' => 'n'
|
573 |
+
);
|
574 |
+
print json_encode($result);
|
575 |
+
die();
|
576 |
+
}
|
577 |
+
//cFormsII
|
578 |
+
elseif(isset($_POST['action']) && $_POST['action'] == 'submitcform')
|
579 |
+
{
|
580 |
+
header('Content-Type: application/json');
|
581 |
+
$result = Array(
|
582 |
+
'no' => "",
|
583 |
+
'result' => "failure",
|
584 |
+
'html' =>$ct_result->comment,
|
585 |
+
'hide' => false,
|
586 |
+
'redirection' => null
|
587 |
+
|
588 |
+
);
|
589 |
+
print json_encode($result);
|
590 |
+
die();
|
591 |
+
}
|
592 |
+
//Contact Form by Web-Settler
|
593 |
+
elseif(isset($_POST['smFieldData']))
|
594 |
+
{
|
595 |
+
$result = Array(
|
596 |
+
'signal' => true,
|
597 |
+
'code' => 0,
|
598 |
+
'thanksMsg' => $ct_result->comment,
|
599 |
+
'errors' => array(),
|
600 |
+
'isMsg' => true,
|
601 |
+
'redirectUrl' => null
|
602 |
+
);
|
603 |
+
print json_encode($result);
|
604 |
+
die();
|
605 |
+
}
|
606 |
+
//Reviewer
|
607 |
+
elseif(isset($_POST['action']) && $_POST['action'] == 'rwp_ajax_action_rating')
|
608 |
+
{
|
609 |
+
$result = Array(
|
610 |
+
'success' => false,
|
611 |
+
'data' => array(0=>$ct_result->comment)
|
612 |
+
);
|
613 |
+
print json_encode($result);
|
614 |
+
die();
|
615 |
+
}
|
616 |
+
// CouponXXL Theme
|
617 |
+
elseif(isset($_POST['_wp_http_referer'], $_POST['register_field'], $_POST['action']) && strpos($_POST['_wp_http_referer'],'/register/account') !== false && $_POST['action'] == 'register'){
|
618 |
+
$result = array(
|
619 |
+
'message' => '<div class="alert alert-error">'.$ct_result->comment.'</div>',
|
620 |
+
);
|
621 |
+
die(json_encode($result));
|
622 |
+
}
|
623 |
+
else
|
624 |
+
{
|
625 |
+
print $ct_result->comment;
|
626 |
+
die();
|
627 |
+
}
|
628 |
+
}
|
629 |
+
//Allow == 1
|
630 |
+
else{
|
631 |
+
//QAEngine Theme answers
|
632 |
+
if ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['author'], $message_obj['post_content']) ){
|
633 |
+
return $message_obj;
|
634 |
}
|
635 |
}
|
636 |
}
|
inc/cleantalk-common.php
CHANGED
@@ -137,7 +137,7 @@ function apbct_base_call($params = array(), $reg_flag = false){
|
|
137 |
|
138 |
// Misc
|
139 |
$ct_request->auth_key = $ct_options['apikey'];
|
140 |
-
$ct_request->message = !empty($params['message']) ?
|
141 |
$ct_request->example = !empty($params['example']) ? $params['example'] : null;
|
142 |
$ct_request->sender_email = !empty($params['sender_email']) ? $params['sender_email'] : null;
|
143 |
$ct_request->sender_nickname = !empty($params['sender_nickname']) ? $params['sender_nickname'] : null;
|
@@ -629,27 +629,32 @@ function ct_delete_spam_comments() {
|
|
629 |
*/
|
630 |
function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = array('nick' => '', 'first' => '', 'last' => ''), $subject = null, $contact = true, $prev_name = ''){
|
631 |
|
632 |
-
|
|
|
633 |
'ipn_track_id', // PayPal IPN #
|
634 |
'txn_type', // PayPal transaction type
|
635 |
'payment_status', // PayPal payment status
|
636 |
'ccbill_ipn', // CCBill IPN
|
637 |
'ct_checkjs', // skip ct_checkjs field
|
638 |
'api_mode', // DigiStore-API
|
|
|
639 |
);
|
640 |
-
|
|
|
|
|
641 |
'password',
|
642 |
'pass',
|
643 |
'pwd',
|
644 |
'pswd'
|
645 |
);
|
646 |
|
647 |
-
|
|
|
648 |
// Common
|
649 |
'ct_checkjs', //Do not send ct_checkjs
|
650 |
'nonce', //nonce for strings such as 'rsvp_nonce_name'
|
651 |
'security',
|
652 |
-
'action',
|
653 |
'http_referer',
|
654 |
'timestamp',
|
655 |
'captcha',
|
@@ -688,7 +693,8 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
688 |
'user_login-',
|
689 |
);
|
690 |
|
691 |
-
|
|
|
692 |
'edd_action', // Easy Digital Downloads
|
693 |
);
|
694 |
|
137 |
|
138 |
// Misc
|
139 |
$ct_request->auth_key = $ct_options['apikey'];
|
140 |
+
$ct_request->message = !empty($params['message']) ? serialize(ct_filter_array($params['message'])) : null;
|
141 |
$ct_request->example = !empty($params['example']) ? $params['example'] : null;
|
142 |
$ct_request->sender_email = !empty($params['sender_email']) ? $params['sender_email'] : null;
|
143 |
$ct_request->sender_nickname = !empty($params['sender_nickname']) ? $params['sender_nickname'] : null;
|
629 |
*/
|
630 |
function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = array('nick' => '', 'first' => '', 'last' => ''), $subject = null, $contact = true, $prev_name = ''){
|
631 |
|
632 |
+
//Skip request if fields exists
|
633 |
+
$skip_params = array(
|
634 |
'ipn_track_id', // PayPal IPN #
|
635 |
'txn_type', // PayPal transaction type
|
636 |
'payment_status', // PayPal payment status
|
637 |
'ccbill_ipn', // CCBill IPN
|
638 |
'ct_checkjs', // skip ct_checkjs field
|
639 |
'api_mode', // DigiStore-API
|
640 |
+
'loadLastCommentId' // Plugin: WP Discuz. ticket_id=5571
|
641 |
);
|
642 |
+
|
643 |
+
// Fields to replace with ****
|
644 |
+
$obfuscate_params = array(
|
645 |
'password',
|
646 |
'pass',
|
647 |
'pwd',
|
648 |
'pswd'
|
649 |
);
|
650 |
|
651 |
+
// Skip feilds with these strings and known service fields
|
652 |
+
$skip_fields_with_strings = array(
|
653 |
// Common
|
654 |
'ct_checkjs', //Do not send ct_checkjs
|
655 |
'nonce', //nonce for strings such as 'rsvp_nonce_name'
|
656 |
'security',
|
657 |
+
// 'action',
|
658 |
'http_referer',
|
659 |
'timestamp',
|
660 |
'captcha',
|
693 |
'user_login-',
|
694 |
);
|
695 |
|
696 |
+
// Reset $message if we have a sign-up data
|
697 |
+
$skip_message_post = array(
|
698 |
'edd_action', // Easy Digital Downloads
|
699 |
);
|
700 |
|
inc/cleantalk-public.php
CHANGED
@@ -1891,6 +1891,14 @@ function ct_gforms_spam_test ($is_spam, $form, $entry) {
|
|
1891 |
$subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
|
1892 |
$contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
|
1893 |
$message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1894 |
if($subject != '') {
|
1895 |
$message['subject'] = $subject;
|
1896 |
}
|
@@ -2341,13 +2349,14 @@ function ct_enqueue_scripts_public($hook){
|
|
2341 |
if(!empty($ct_options['use_ajax']) && stripos($_SERVER['REQUEST_URI'],'.xml') === false && stripos($_SERVER['REQUEST_URI'],'.xsl') === false){
|
2342 |
if(strpos($_SERVER['REQUEST_URI'],'jm-ajax') === false){
|
2343 |
|
2344 |
-
|
|
|
2345 |
|
2346 |
if(!empty($ct_options['check_external']))
|
2347 |
-
wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/
|
2348 |
|
2349 |
if(!empty($ct_options['check_internal']))
|
2350 |
-
wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/
|
2351 |
|
2352 |
wp_localize_script('ct_nocache', 'ctNocache', array(
|
2353 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
1891 |
$subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
|
1892 |
$contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
|
1893 |
$message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
|
1894 |
+
|
1895 |
+
// Adding 'input_' to every field /Gravity Forms fix/
|
1896 |
+
$message = array_flip($message);
|
1897 |
+
array_walk($message, function(&$value, $key){
|
1898 |
+
$value = 'input_'.$value;
|
1899 |
+
});
|
1900 |
+
$message = array_flip($message);
|
1901 |
+
|
1902 |
if($subject != '') {
|
1903 |
$message['subject'] = $subject;
|
1904 |
}
|
2349 |
if(!empty($ct_options['use_ajax']) && stripos($_SERVER['REQUEST_URI'],'.xml') === false && stripos($_SERVER['REQUEST_URI'],'.xsl') === false){
|
2350 |
if(strpos($_SERVER['REQUEST_URI'],'jm-ajax') === false){
|
2351 |
|
2352 |
+
if(!empty($ct_options['use_ajax']))
|
2353 |
+
wp_enqueue_script('ct_nocache', plugins_url('/cleantalk-spam-protect/inc/cleantalk_nocache.js'), array(), $cleantalk_plugin_version, 'in_footer');
|
2354 |
|
2355 |
if(!empty($ct_options['check_external']))
|
2356 |
+
wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/js/cleantalk_external.js'), array('jquery'), $cleantalk_plugin_version, 'in_footer');
|
2357 |
|
2358 |
if(!empty($ct_options['check_internal']))
|
2359 |
+
wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/js/cleantalk_internal.js'), array('jquery'), $cleantalk_plugin_version, 'in_footer');
|
2360 |
|
2361 |
wp_localize_script('ct_nocache', 'ctNocache', array(
|
2362 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
inc/cleantalk.class.php
CHANGED
@@ -558,7 +558,9 @@ class Cleantalk {
|
|
558 |
if(is_string($request->$param) || is_int($request->$param))
|
559 |
$request->$param = $this->removeNonUTF8FromString($value);
|
560 |
}
|
561 |
-
|
|
|
|
|
562 |
|
563 |
return $request;
|
564 |
}
|
558 |
if(is_string($request->$param) || is_int($request->$param))
|
559 |
$request->$param = $this->removeNonUTF8FromString($value);
|
560 |
}
|
561 |
+
|
562 |
+
$request->message = unserialize($request->message);
|
563 |
+
$request->message = is_array($request->message) ? json_encode($request->message) : $request->message;
|
564 |
|
565 |
return $request;
|
566 |
}
|
js/apbct-public.js
CHANGED
@@ -83,28 +83,30 @@ apbct_attach_event_handler(window, "keydown", ctFunctionFirstKey);
|
|
83 |
function apbct_ready(){
|
84 |
ctSetCookieSec("apbct_visible_fields", 0);
|
85 |
ctSetCookieSec("apbct_visible_fields_count", 0);
|
86 |
-
|
87 |
-
var
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
var
|
92 |
-
|
93 |
-
getComputedStyle(elem).
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
-
ctSetCookieSec("apbct_visible_fields", JSON.stringify(apbct_vf));
|
106 |
-
ctSetCookieSec("apbct_visible_fields_count", elem_count);
|
107 |
}
|
108 |
-
}
|
109 |
}
|
110 |
apbct_attach_event_handler(window, "DOMContentLoaded", apbct_ready);
|
83 |
function apbct_ready(){
|
84 |
ctSetCookieSec("apbct_visible_fields", 0);
|
85 |
ctSetCookieSec("apbct_visible_fields_count", 0);
|
86 |
+
setTimeout(function(){
|
87 |
+
for(var i=0; i < document.forms.length; i++){
|
88 |
+
var form = document.forms[i];
|
89 |
+
form.onsubmit = function(){
|
90 |
+
var apbct_vf = {apbct_visible_fields: ""};
|
91 |
+
for(var j=0, elem_count=form.elements.length; j < form.elements.length; j++){
|
92 |
+
var elem = form.elements[j];
|
93 |
+
if( getComputedStyle(elem).display == "none" ||
|
94 |
+
getComputedStyle(elem).visibility == "hidden" ||
|
95 |
+
getComputedStyle(elem).width == "0" ||
|
96 |
+
getComputedStyle(elem).heigth == "0" ||
|
97 |
+
getComputedStyle(elem).opacity == "0" ||
|
98 |
+
elem.getAttribute("type") == "hidden" ||
|
99 |
+
elem.getAttribute("type") == "submit"
|
100 |
+
){
|
101 |
+
elem_count--;
|
102 |
+
}else{
|
103 |
+
apbct_vf.apbct_visible_fields += elem.getAttribute("name") + (j+1 == form.elements.length ? "" : " ");
|
104 |
+
}
|
105 |
+
}
|
106 |
+
ctSetCookieSec("apbct_visible_fields", JSON.stringify(apbct_vf));
|
107 |
+
ctSetCookieSec("apbct_visible_fields_count", elem_count);
|
108 |
}
|
|
|
|
|
109 |
}
|
110 |
+
}, 1000);
|
111 |
}
|
112 |
apbct_attach_event_handler(window, "DOMContentLoaded", apbct_ready);
|
{inc → js}/cleantalk_external.js
RENAMED
File without changes
|
{inc → js}/cleantalk_internal.js
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, sartemd174
|
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9.1
|
6 |
-
Stable tag: 5.
|
7 |
License: GPLv2
|
8 |
|
9 |
Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
|
@@ -504,6 +504,13 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
504 |
1. The plugin deletes/removes the existing spam comments and users accounts.
|
505 |
|
506 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
= 5.85 January 11 2018 =
|
508 |
* Fix: Fast Secure contact form spam block message.
|
509 |
* Fix: IP license status.
|
@@ -1497,6 +1504,13 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
|
|
1497 |
* First version
|
1498 |
|
1499 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1500 |
= 5.85 January 11 2018 =
|
1501 |
* Fix: Fast Secure contact form spam block message.
|
1502 |
* Fix: IP license status.
|
3 |
Tags: spam, antispam, protection, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9.1
|
6 |
+
Stable tag: 5.86
|
7 |
License: GPLv2
|
8 |
|
9 |
Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
|
504 |
1. The plugin deletes/removes the existing spam comments and users accounts.
|
505 |
|
506 |
== Changelog ==
|
507 |
+
= 5.86 January 25 2018 =
|
508 |
+
* Fix: High CPU load with wp-ajax.php.
|
509 |
+
* Fix: Mailpoet: Newsletter.
|
510 |
+
* Fix: Gravity: Forms standardization for input fields.
|
511 |
+
* Fix: ajax hook checks data for contact form.
|
512 |
+
* Fix: UTF8 character in requests.
|
513 |
+
|
514 |
= 5.85 January 11 2018 =
|
515 |
* Fix: Fast Secure contact form spam block message.
|
516 |
* Fix: IP license status.
|
1504 |
* First version
|
1505 |
|
1506 |
== Upgrade Notice ==
|
1507 |
+
= 5.86 January 25 2018 =
|
1508 |
+
* Fix: High CPU load with wp-ajax.php.
|
1509 |
+
* Fix: Mailpoet: Newsletter.
|
1510 |
+
* Fix: Gravity: Forms standardization for input fields.
|
1511 |
+
* Fix: ajax hook checks data for contact form.
|
1512 |
+
* Fix: UTF8 character in requests.
|
1513 |
+
|
1514 |
= 5.85 January 11 2018 =
|
1515 |
* Fix: Fast Secure contact form spam block message.
|
1516 |
* Fix: IP license status.
|