Skip to content

Commit b29d916

Browse files
authored
Version: 6.78
2 parents dcb9a16 + 1e7d149 commit b29d916

42 files changed

Lines changed: 1606 additions & 358 deletions

Some content is hidden

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

cleantalk.php

Lines changed: 15 additions & 8 deletions
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.77
7+
Version: 6.78
88
Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org>
99
Author URI: https://cleantalk.org
1010
Text Domain: cleantalk-spam-protect
@@ -1582,7 +1582,7 @@ function apbct_sfw_update__create_temp_tables($direct_update = false)
15821582
return $result;
15831583
}
15841584

1585-
$result__clear_db = AntiCrawler::clearDataTable(
1585+
$result__clear_db = AntiCrawler::clearUADataTable(
15861586
\Cleantalk\ApbctWP\DB::getInstance(),
15871587
APBCT_TBL_AC_UA_BL
15881588
);
@@ -2064,7 +2064,7 @@ function apbct_antiflood__clear_table()
20642064
APBCT_TBL_AC_LOG
20652065
);
20662066
$anticrawler->setDb(DB::getInstance());
2067-
$anticrawler->clearTable();
2067+
$anticrawler->clearLogTable();
20682068
unset($anticrawler);
20692069
}
20702070
}
@@ -2132,11 +2132,18 @@ function apbct_rc__install_plugin($_wp = null, $plugin = null)
21322132
} else {
21332133
die('FAIL ' . json_encode(array('error' => $installer->apbct_result)));
21342134
}
2135+
} elseif ( $result instanceof \WP_Error ) {
2136+
die(
2137+
'FAIL ' . json_encode(array(
2138+
'error' => 'FAIL_TO_GET_LATEST_VERSION',
2139+
'details' => $result->get_error_message(),
2140+
))
2141+
);
21352142
} else {
21362143
die(
21372144
'FAIL ' . json_encode(array(
21382145
'error' => 'FAIL_TO_GET_LATEST_VERSION',
2139-
'details' => $result instanceof WP_Error ? $result->get_error_message() : '',
2146+
'details' => 'Unknown error',
21402147
))
21412148
);
21422149
}
@@ -2172,8 +2179,8 @@ function apbct_rc__activate_plugin($plugin)
21722179
$result_array = array('success' => true);
21732180
$error_msg = '';
21742181

2175-
if (!$result || is_wp_error($result)) {
2176-
if ($result instanceof WP_Error) {
2182+
if ( ! $result || is_wp_error($result) ) {
2183+
if ( $result instanceof \WP_Error ) {
21772184
$error_msg = ' ' . $result->get_error_message();
21782185
}
21792186
$result_array = array(
@@ -2292,8 +2299,8 @@ function apbct_rc__uninstall_plugin($plugin = null)
22922299
$die_string = 'OK';
22932300
$error_msg = '';
22942301

2295-
if (!$result || is_wp_error($result)) {
2296-
if ($result instanceof WP_Error) {
2302+
if ( ! $result || is_wp_error($result) ) {
2303+
if ( $result instanceof \WP_Error ) {
22972304
$error_msg = ' ' . $result->get_error_message();
22982305
}
22992306
$die_string = 'FAIL ' . json_encode(array(

inc/cleantalk-admin.php

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -751,17 +751,10 @@ function apbct_admin__admin_bar__add_structure($wp_admin_bar)
751751
* Link to project manager
752752
*/
753753
$project_manager_title_node = apbct__admin_bar__get_title_for_project_manager();
754-
if ( $project_manager_title_node ) {
754+
$gf2db_title_node = apbct__admin_bar__add_gf2db_title();
755+
if ( $project_manager_title_node && $gf2db_title_node) {
755756
$wp_admin_bar->add_node($project_manager_title_node);
756-
$gf2db_title_node = apbct__admin_bar__add_gf2db_title();
757-
if ($gf2db_title_node) {
758-
$wp_admin_bar->add_node($gf2db_title_node);
759-
} else {
760-
$gf2db_invite_to_install_title = apbct__admin_bar__get_title_for_gf2db_invite_to_install();
761-
if ($gf2db_invite_to_install_title) {
762-
$wp_admin_bar->add_node($gf2db_invite_to_install_title);
763-
}
764-
}
757+
$wp_admin_bar->add_node($gf2db_title_node);
765758
}
766759

767760
/**
@@ -823,36 +816,6 @@ function apbct__admin_bar__add_gf2db_title()
823816
);
824817
}
825818

826-
/**
827-
* Gets the title for the "Gravity Forms to doBoard" Add-On invite to install admin bar node.
828-
*
829-
* This function constructs the title for the "Gravity Forms to doBoard" Add-On invite to install admin bar node based on various conditions.
830-
* The title includes a link to the "Gravity Forms to doBoard" Add-On invite to install.
831-
*
832-
* @return array|false The node data for the "Gravity Forms to doBoard" Add-On invite to install admin bar node, or false if the "Gravity Forms to doBoard" Add-On invite to install admin bar node is not enabled.
833-
*/
834-
function apbct__admin_bar__get_title_for_gf2db_invite_to_install()
835-
{
836-
if (is_plugin_active('cleantalk-doboard-add-on-for-gravity-forms/cleantalk-doboard-add-on-for-gravity-forms.php')) {
837-
return false;
838-
}
839-
840-
$title = sprintf(
841-
'<a href="%s" target="_blank" title="%s">%s</a>',
842-
admin_url('plugin-install.php?s=GF2DB&tab=search&type=term'),
843-
esc_html__(
844-
'Organize and track all messages from your site. Gravity Forms, upgraded with project management.',
845-
'cleantalk-spam-protect'
846-
),
847-
esc_html__('Install "Gravity Forms to doBoard" Add-On', 'cleantalk-spam-protect')
848-
);
849-
850-
return array(
851-
'parent' => 'project_manager__parent_node',
852-
'id' => 'gf2db_invite_to_install_title',
853-
'title' => $title,
854-
);
855-
}
856819

857820
/**
858821
* Gets the title for the APBCT admin bar node.

inc/cleantalk-ajax.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,6 @@ function ct_ajax_hook($message_obj = null)
438438
}
439439
}
440440

441-
//divi subscription form needs to force alt cookies
442-
if ( Post::hasString('action', 'et_pb_submit_subscribe_form') ) {
443-
Cookie::$force_alt_cookies_global = true;
444-
}
445-
446441
// thriveleads modification to check gravity forms
447442
if ( Post::get('action') === 'tve_api_form_submit' ) {
448443
unset($_POST['ct_checkjs']);

inc/cleantalk-common.php

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Cleantalk\Antispam\CleantalkRequest;
55
use Cleantalk\Antispam\CleantalkResponse;
66
use Cleantalk\ApbctWP\API;
7+
use Cleantalk\ApbctWP\BaseCall\DefaultParams;
78
use Cleantalk\ApbctWP\CleantalkSettingsTemplates;
89
use Cleantalk\ApbctWP\Cron;
910
use Cleantalk\ApbctWP\DB;
@@ -12,14 +13,14 @@
1213
use Cleantalk\ApbctWP\GetFieldsAny;
1314
use Cleantalk\ApbctWP\Helper;
1415
use Cleantalk\ApbctWP\Honeypot;
16+
use Cleantalk\ApbctWP\RequestParameters\RequestParameters;
17+
use Cleantalk\ApbctWP\RequestParameters\SubmitTimeHandler;
1518
use Cleantalk\ApbctWP\Sanitize;
1619
use Cleantalk\ApbctWP\Variables\AltSessions;
1720
use Cleantalk\ApbctWP\Variables\Cookie;
1821
use Cleantalk\ApbctWP\Variables\Get;
1922
use Cleantalk\ApbctWP\Variables\Post;
2023
use Cleantalk\ApbctWP\Variables\Server;
21-
use Cleantalk\ApbctWP\RequestParameters\RequestParameters;
22-
use Cleantalk\ApbctWP\RequestParameters\SubmitTimeHandler;
2324
use Cleantalk\Common\TT;
2425

2526
// Prevent direct call
@@ -182,25 +183,8 @@ function apbct_base_call($params = array(), $reg_flag = false)
182183
);
183184
}
184185

185-
$default_params = array(
186-
187-
// IPs
188-
'sender_ip' => defined('CT_TEST_IP')
189-
? CT_TEST_IP
190-
: \Cleantalk\ApbctWP\Helper::ipGet('remote_addr', false),
191-
'x_forwarded_for' => \Cleantalk\ApbctWP\Helper::ipGet('x_forwarded_for', false),
192-
'x_real_ip' => \Cleantalk\ApbctWP\Helper::ipGet('x_real_ip', false),
193-
194-
// Misc
195-
'auth_key' => $apbct->api_key,
196-
'js_on' => apbct_js_test(Sanitize::cleanTextField(Cookie::getString('ct_checkjs')), true)
197-
? 1
198-
: apbct_js_test(Post::getString('ct_checkjs')),
199-
200-
'agent' => APBCT_AGENT,
201-
'sender_info' => $sender_info,
202-
'submit_time' => SubmitTimeHandler::getFromRequest(),
203-
);
186+
$default_params_getter = new DefaultParams($apbct->api_key, $sender_info);
187+
$default_params = $default_params_getter->get();
204188

205189
if (!isset($params['post_info']['post_url'])) {
206190
$params['post_info']['post_url'] = Server::get('HTTP_REFERER');

inc/cleantalk-pluggable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ function apbct_is_skip_request($ajax = false, $ajax_message_obj = array())
14501450
apbct_is_plugin_active('bloom/bloom.php') &&
14511451
Post::get('action') === 'bloom_subscribe'
14521452
) {
1453-
return 'Bloom';
1453+
return 'Bloom skip - has the direct integration';
14541454
}
14551455

14561456
// Ajax Search Lite - these requests will be caught by search form protection

inc/cleantalk-settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ function apbct_settings__set_fields()
651651
),
652652
'data__email_check_exist_post' => array(
653653
'title' => __('Show email existence alert when filling in the field', 'cleantalk-spam-protect'),
654-
'description' => __('Checks the email address and shows the result as an icon in the email field before submitting the form. Works for WooCommerce checkout form, FluentForms, Contact Form 7, Gravity Forms, Ninja Forms, WPForms, standard WordPress comment form and registration form.', 'cleantalk-spam-protect'),
654+
'description' => __('Checks the email address and shows the result as an icon in the email field before submitting the form. Works for WooCommerce checkout form, FluentForms, Contact Form 7, Gravity Forms, Ninja Forms, WPForms, standard WordPress comment form and registration form.', 'cleantalk-spam-protect') . ' ' . '<a href="https://cleantalk.org/help/show-email-existence-alert" target="_blank" rel="noopener noreferrer">' . __('Read more', 'cleantalk-spam-protect') . '</a>',
655655
),
656656
),
657657
),

js/apbct-public-bundle.min.js

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

js/apbct-public-bundle_ext-protection.min.js

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

js/apbct-public-bundle_ext-protection_gathering.min.js

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

js/apbct-public-bundle_full-protection.min.js

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

0 commit comments

Comments
 (0)