Skip to content

Commit bc16f31

Browse files
authored
Merge pull request #643 from CleanTalk/release_6.60
Release 6.60
2 parents 6b03b0c + 0760841 commit bc16f31

File tree

62 files changed

+962
-343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+962
-343
lines changed

cleantalk.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Anti-Spam by CleanTalk
55
Plugin URI: https://cleantalk.org
66
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.
7-
Version: 6.59
7+
Version: 6.60
88
Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org>
99
Author URI: https://cleantalk.org
1010
Text Domain: cleantalk-spam-protect
@@ -46,6 +46,11 @@
4646
use Cleantalk\Common\Schema;
4747
use Cleantalk\Common\TT;
4848

49+
// Prevent direct call
50+
if ( ! defined('ABSPATH') ) {
51+
die('Not allowed!');
52+
}
53+
4954
global $apbct, $wpdb, $pagenow;
5055

5156
$cleantalk_executed = false;
@@ -365,6 +370,7 @@ function apbct_register_my_rest_routes()
365370

366371
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-integrations-by-hook.php');
367372
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-integrations-by-class.php');
373+
require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-integrations-by-route.php');
368374

369375
// Form protection by shortcode
370376
new ProtectByShortcode();

css/cleantalk-admin-settings-page.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/src/cleantalk-admin-settings-page.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,52 @@ button[value="save_changes"]:disabled {
419419
flex-direction: row;
420420
}
421421

422+
.apbct_warning_red_point {
423+
display: inline-block;
424+
width: 4px;
425+
height: 4px;
426+
background: red;
427+
border-radius: 100%;
428+
margin-left: 10px;
429+
margin-bottom: 10px;
430+
vertical-align: middle;
431+
position: relative;
432+
}
433+
.apbct_warning_red_point::after {
434+
content: '';
435+
position: absolute;
436+
left: -5px;
437+
top: -5px;
438+
width: 12px;
439+
height: 12px;
440+
border: 1.5px solid rgba(255, 2, 2, .65);
441+
border-radius: 50%;
442+
animation: apbct_pulsate 1.2s ease-out infinite;
443+
opacity: .7;
444+
pointer-events: none;
445+
}
446+
447+
#apbct_statistics {
448+
display: flex;
449+
flex-wrap: wrap;
450+
gap: 40px;
451+
}
452+
453+
@keyframes apbct_pulsate {
454+
0% {
455+
transform: scale(1);
456+
opacity: 0.7;
457+
}
458+
50% {
459+
transform: scale(1.4);
460+
opacity: 0.2;
461+
}
462+
100% {
463+
transform: scale(1);
464+
opacity: 0.7;
465+
}
466+
}
467+
422468
@media (max-width: 768px) {
423469
.apbct_settings_top_info__btn {
424470
display: inline-grid;

inc/cleantalk-admin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
use Cleantalk\ApbctWP\LinkConstructor;
1515
use Cleantalk\Common\TT;
1616

17+
// Prevent direct call
18+
if ( ! defined('ABSPATH') ) {
19+
die('Not allowed!');
20+
}
21+
1722
require_once('cleantalk-settings.php');
1823

1924
// Add buttons to comments list table

inc/cleantalk-ajax.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
use Cleantalk\ApbctWP\Variables\Server;
1111
use Cleantalk\Common\TT;
1212

13+
// Prevent direct call
14+
if ( ! defined('ABSPATH') ) {
15+
die('Not allowed!');
16+
}
17+
1318
$_cleantalk_ajax_actions_to_check = array();
1419
$_cleantalk_ajax_actions_to_check[] = 'qcf_validate_form'; //Quick Contact Form
1520
$_cleantalk_ajax_actions_to_check[] = 'amoforms_submit'; //amoForms

inc/cleantalk-common.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
use Cleantalk\ApbctWP\RequestParameters\RequestParameters;
2222
use Cleantalk\Common\TT;
2323

24+
// Prevent direct call
25+
if ( ! defined('ABSPATH') ) {
26+
die('Not allowed!');
27+
}
28+
2429
function apbct_array($array)
2530
{
2631
return new \Cleantalk\Common\Arr($array);
@@ -559,7 +564,14 @@ function apbct_get_sender_info()
559564
$cache_plugins_detected = json_encode($cache_plugins_detected);
560565

561566
$apbct_urls = RequestParameters::getCommonStorage('apbct_urls');
562-
$apbct_urls = $apbct_urls ? json_encode(json_decode($apbct_urls, true)) : null;
567+
if (!empty($apbct_urls)) {
568+
if (is_string($apbct_urls)) {
569+
$apbct_urls = json_encode(json_decode($apbct_urls, true));
570+
} else {
571+
$apbct_urls = json_encode($apbct_urls);
572+
}
573+
}
574+
$apbct_urls = !empty($apbct_urls) ? $apbct_urls : null;
563575

564576
$site_landing_ts = RequestParameters::get('apbct_site_landing_ts', true);
565577
$site_landing_ts = !empty($site_landing_ts) ? TT::toString($site_landing_ts) : null;

inc/cleantalk-find-spam.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// Adding menu items for USERS and COMMENTS spam checking pages
44
use Cleantalk\ApbctWP\FindSpam\ListTable\Users;
55

6+
// Prevent direct call
7+
if ( ! defined('ABSPATH') ) {
8+
die('Not allowed!');
9+
}
10+
611
add_action('admin_menu', 'ct_add_find_spam_pages');
712
function ct_add_find_spam_pages()
813
{

inc/cleantalk-integrations-by-class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
// Prevent direct call
4+
if ( ! defined('ABSPATH') ) {
5+
die('Not allowed!');
6+
}
7+
38
$apbct_integrations_by_class = array(
49
'BuddyPress' => array(
510
'plugin_path' => 'buddypress/bp-loader.php',

inc/cleantalk-integrations-by-hook.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
// Prevent direct call
4+
if ( ! defined('ABSPATH') ) {
5+
die('Not allowed!');
6+
}
7+
38
$apbct_active_integrations = array(
49
'CleantalkInternalForms' => array(
510
'hook' => 'ct_check_internal',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
$apbct_active_rest_integrations = array(
4+
'SureForms' => array(
5+
'rest_route' => '/sureforms/v1/submit-form',
6+
'setting' => 'forms__contact_forms_test',
7+
'rest' => true,
8+
)
9+
);
10+
11+
add_filter('rest_pre_dispatch', function ($result, $_, $request) use ($apbct_active_rest_integrations) {
12+
global $apbct;
13+
$route = $request->get_route();
14+
foreach ($apbct_active_rest_integrations as $integration_name => $rest_data) {
15+
if (isset($rest_data['rest_route']) && $rest_data['rest_route'] === $route) {
16+
$apbct_settings = isset($apbct->settings) && is_array($apbct->settings) ? $apbct->settings : array();
17+
$integrations = new \Cleantalk\Antispam\Integrations($apbct_active_rest_integrations, $apbct_settings);
18+
$params = $request->get_params();
19+
if (isset($params['POST']) && is_array($params['POST'])) {
20+
$params = $params['POST'];
21+
}
22+
$response = $integrations->checkSpam($params, $integration_name);
23+
24+
if ($response instanceof \WP_REST_Response || is_array($response)) {
25+
return $response;
26+
}
27+
break;
28+
}
29+
}
30+
return $result;
31+
}, 999, 3);

0 commit comments

Comments
 (0)