Version Description
Nov 23 2022 = * Fix. Woocommerce. Marking orders as spam fixed. * Fix. Settings. Some text has been localized-ready.
Download this release
Release Info
Developer | glomberg |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.189.1 |
Comparing to | |
See all releases |
Code changes from version 5.189 to 5.189.1
- cleantalk.php +1 -1
- inc/cleantalk-public-integrations.php +28 -94
- inc/cleantalk-settings.php +1 -1
- readme.txt +5 -1
cleantalk.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
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: 5.189
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
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: 5.189.1
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
inc/cleantalk-public-integrations.php
CHANGED
@@ -3500,43 +3500,12 @@ function apbct_advanced_classifieds_directory_pro__check_register($response, $_f
|
|
3500 |
return $response;
|
3501 |
}
|
3502 |
|
|
|
|
|
3503 |
/**
|
3504 |
-
*
|
3505 |
*/
|
3506 |
-
add_filter('
|
3507 |
-
function apbct__wc_add_orders_to_spam_get_column()
|
3508 |
-
{
|
3509 |
-
if (get_post_status() === 'wc-spamorder') {
|
3510 |
-
return [
|
3511 |
-
'k' => 'not_spam_order',
|
3512 |
-
'v' => __('Mark as not spam', 'cleantalk-spam-protect')
|
3513 |
-
];
|
3514 |
-
}
|
3515 |
-
|
3516 |
-
return [
|
3517 |
-
'k' => 'spam_order',
|
3518 |
-
'v' => __('Mark as spam', 'cleantalk-spam-protect')
|
3519 |
-
];
|
3520 |
-
}
|
3521 |
-
|
3522 |
-
function apbct__wc_add_orders_to_spam($columns)
|
3523 |
-
{
|
3524 |
-
$reordered_columns = array();
|
3525 |
-
|
3526 |
-
foreach ($columns as $key => $column) {
|
3527 |
-
$reordered_columns[$key] = $column;
|
3528 |
-
|
3529 |
-
if ($key === 'order_status') {
|
3530 |
-
$column_key_value = apbct__wc_add_orders_to_spam_get_column();
|
3531 |
-
$reordered_columns[$column_key_value['k']] = $column_key_value['v'];
|
3532 |
-
}
|
3533 |
-
}
|
3534 |
-
|
3535 |
-
return $reordered_columns;
|
3536 |
-
}
|
3537 |
-
|
3538 |
-
add_filter('woocommerce_register_shop_order_post_statuses', 'apbct__wc_add_orders_spam_status'); // add order spam status
|
3539 |
-
|
3540 |
function apbct__wc_add_orders_spam_status($order_statuses)
|
3541 |
{
|
3542 |
$order_statuses['wc-spamorder'] = array(
|
@@ -3554,6 +3523,9 @@ function apbct__wc_add_orders_spam_status($order_statuses)
|
|
3554 |
return $order_statuses;
|
3555 |
}
|
3556 |
|
|
|
|
|
|
|
3557 |
add_filter('wc_order_statuses', 'apbct__wc_add_orders_spam_status_select'); // make spam selectable
|
3558 |
function apbct__wc_add_orders_spam_status_select($order_statuses)
|
3559 |
{
|
@@ -3561,6 +3533,9 @@ function apbct__wc_add_orders_spam_status_select($order_statuses)
|
|
3561 |
return $order_statuses;
|
3562 |
}
|
3563 |
|
|
|
|
|
|
|
3564 |
add_action('parse_query', 'apbct__wc_add_orders_spam_status_hide_from_list'); // hide spam orders from total list
|
3565 |
function apbct__wc_add_orders_spam_status_hide_from_list($query)
|
3566 |
{
|
@@ -3576,13 +3551,23 @@ function apbct__wc_add_orders_spam_status_hide_from_list($query)
|
|
3576 |
}
|
3577 |
}
|
3578 |
|
|
|
|
|
|
|
3579 |
add_filter('bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk'); // add spam action to bulk
|
3580 |
function apbct__wc_add_spam_action_to_bulk($actions)
|
3581 |
{
|
3582 |
-
|
|
|
|
|
|
|
|
|
3583 |
return $actions;
|
3584 |
}
|
3585 |
|
|
|
|
|
|
|
3586 |
add_filter('handle_bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk_handle', 10, 3); // handle bulk action
|
3587 |
/**
|
3588 |
* @param $redirect
|
@@ -3594,75 +3579,24 @@ add_filter('handle_bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_
|
|
3594 |
*/
|
3595 |
function apbct__wc_add_spam_action_to_bulk_handle($redirect, $action, $ids)
|
3596 |
{
|
3597 |
-
if ($action !== 'spamorder') {
|
3598 |
return $redirect;
|
3599 |
}
|
3600 |
|
3601 |
foreach ($ids as $order_id) {
|
3602 |
$order = new WC_Order((int)$order_id);
|
3603 |
-
$
|
|
|
|
|
|
|
|
|
3604 |
}
|
3605 |
|
3606 |
return add_query_arg(
|
3607 |
array(
|
3608 |
-
'bulk_action' => '
|
3609 |
'changed' => count($ids),
|
3610 |
),
|
3611 |
$redirect
|
3612 |
);
|
3613 |
}
|
3614 |
-
|
3615 |
-
add_action('manage_shop_order_posts_custom_column', 'apbct__wc_add_orders_to_spam_button'); // add button
|
3616 |
-
|
3617 |
-
function apbct__wc_add_orders_to_spam_button_render($id, $action, $name)
|
3618 |
-
{
|
3619 |
-
$uurl = [
|
3620 |
-
'url' => wp_nonce_url(add_query_arg(['post' => $id, 'action' => $action]), $action),
|
3621 |
-
'name' => __($name, 'cleantalk-spam-protect')
|
3622 |
-
];
|
3623 |
-
|
3624 |
-
echo "<a href=" . $uurl['url'] . ">" . $uurl['name'] . "</a>";
|
3625 |
-
}
|
3626 |
-
|
3627 |
-
function apbct__wc_add_orders_to_spam_button($column)
|
3628 |
-
{
|
3629 |
-
global $the_order;
|
3630 |
-
|
3631 |
-
if (isset($the_order) && $column === 'spam_order') {
|
3632 |
-
apbct__wc_add_orders_to_spam_button_render($the_order->id, 'spamorder', 'spam');
|
3633 |
-
}
|
3634 |
-
|
3635 |
-
if (isset($the_order) && $column === 'not_spam_order') {
|
3636 |
-
apbct__wc_add_orders_to_spam_button_render($the_order->id, 'unspamorder', 'not spam');
|
3637 |
-
}
|
3638 |
-
}
|
3639 |
-
|
3640 |
-
add_action('wp_loaded', 'apbct__wc_add_orders_to_spam_button_handle'); // handle spam button
|
3641 |
-
/**
|
3642 |
-
* @param $action
|
3643 |
-
* @param $status
|
3644 |
-
*
|
3645 |
-
* @return void
|
3646 |
-
* @psalm-suppress UndefinedClass
|
3647 |
-
*/
|
3648 |
-
function apbct__wc_add_orders_to_spam_button_handle_check($action, $status)
|
3649 |
-
{
|
3650 |
-
if (isset($_GET['action'])
|
3651 |
-
&& $_GET['action'] === $action
|
3652 |
-
&& isset($_GET['_wpnonce'])
|
3653 |
-
&& wp_verify_nonce($_GET['_wpnonce'], $action)
|
3654 |
-
&& isset($_GET['post'])
|
3655 |
-
) {
|
3656 |
-
$order = new WC_Order((int)$_GET['post']);
|
3657 |
-
$order->update_status($status);
|
3658 |
-
|
3659 |
-
wp_redirect(esc_url_raw(remove_query_arg(array('post', 'action', '_wpnonce'))));
|
3660 |
-
exit();
|
3661 |
-
}
|
3662 |
-
}
|
3663 |
-
|
3664 |
-
function apbct__wc_add_orders_to_spam_button_handle()
|
3665 |
-
{
|
3666 |
-
apbct__wc_add_orders_to_spam_button_handle_check('spamorder', "wc-spamorder");
|
3667 |
-
apbct__wc_add_orders_to_spam_button_handle_check('unspamorder', "wc-processing");
|
3668 |
-
}
|
3500 |
return $response;
|
3501 |
}
|
3502 |
|
3503 |
+
/*********** Woocommerce able add orders to spam ***********/
|
3504 |
+
|
3505 |
/**
|
3506 |
+
* Register the new 'spam' status
|
3507 |
*/
|
3508 |
+
add_filter('woocommerce_register_shop_order_post_statuses', 'apbct__wc_add_orders_spam_status');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3509 |
function apbct__wc_add_orders_spam_status($order_statuses)
|
3510 |
{
|
3511 |
$order_statuses['wc-spamorder'] = array(
|
3523 |
return $order_statuses;
|
3524 |
}
|
3525 |
|
3526 |
+
/**
|
3527 |
+
* Enable orders filtering by 'spam' status
|
3528 |
+
*/
|
3529 |
add_filter('wc_order_statuses', 'apbct__wc_add_orders_spam_status_select'); // make spam selectable
|
3530 |
function apbct__wc_add_orders_spam_status_select($order_statuses)
|
3531 |
{
|
3533 |
return $order_statuses;
|
3534 |
}
|
3535 |
|
3536 |
+
/**
|
3537 |
+
* Don't show orders marked 'spam' in the common order list
|
3538 |
+
*/
|
3539 |
add_action('parse_query', 'apbct__wc_add_orders_spam_status_hide_from_list'); // hide spam orders from total list
|
3540 |
function apbct__wc_add_orders_spam_status_hide_from_list($query)
|
3541 |
{
|
3551 |
}
|
3552 |
}
|
3553 |
|
3554 |
+
/**
|
3555 |
+
* Add bulk actions: 'Mark as spam' and 'Unmark as spam'
|
3556 |
+
*/
|
3557 |
add_filter('bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk'); // add spam action to bulk
|
3558 |
function apbct__wc_add_spam_action_to_bulk($actions)
|
3559 |
{
|
3560 |
+
if ( get_query_var('post_status') === 'wc-spamorder' ) {
|
3561 |
+
$actions['unspamorder'] = __('Unmark as spam', 'cleantalk-spam-protect');
|
3562 |
+
} else {
|
3563 |
+
$actions['spamorder'] = __('Mark as spam', 'cleantalk-spam-protect');
|
3564 |
+
}
|
3565 |
return $actions;
|
3566 |
}
|
3567 |
|
3568 |
+
/**
|
3569 |
+
* The bulk actions 'Mark as spam' and 'Unmark as spam' handler
|
3570 |
+
*/
|
3571 |
add_filter('handle_bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk_handle', 10, 3); // handle bulk action
|
3572 |
/**
|
3573 |
* @param $redirect
|
3579 |
*/
|
3580 |
function apbct__wc_add_spam_action_to_bulk_handle($redirect, $action, $ids)
|
3581 |
{
|
3582 |
+
if ( $action !== 'spamorder' && $action !== 'unspamorder' ) {
|
3583 |
return $redirect;
|
3584 |
}
|
3585 |
|
3586 |
foreach ($ids as $order_id) {
|
3587 |
$order = new WC_Order((int)$order_id);
|
3588 |
+
if ( $action === 'unspamorder' ) {
|
3589 |
+
$order->update_status('wc-on-hold');
|
3590 |
+
} else {
|
3591 |
+
$order->update_status('wc-spamorder');
|
3592 |
+
}
|
3593 |
}
|
3594 |
|
3595 |
return add_query_arg(
|
3596 |
array(
|
3597 |
+
'bulk_action' => 'marked_' . $action,
|
3598 |
'changed' => count($ids),
|
3599 |
),
|
3600 |
$redirect
|
3601 |
);
|
3602 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/cleantalk-settings.php
CHANGED
@@ -1131,7 +1131,7 @@ function apbct_settings__display()
|
|
1131 |
) {
|
1132 |
// Sync button
|
1133 |
if ( apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok ) {
|
1134 |
-
echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
|
1135 |
. '<i class="apbct-icon-upload-cloud"></i> '
|
1136 |
. __('Synchronize with Cloud', 'cleantalk-spam-protect')
|
1137 |
. '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
1131 |
) {
|
1132 |
// Sync button
|
1133 |
if ( apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok ) {
|
1134 |
+
echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="' . esc_html__('Synchronizing account status, SpamFireWall database, all kind of journals', 'cleantalk-spam-protect') . '">'
|
1135 |
. '<i class="apbct-icon-upload-cloud"></i> '
|
1136 |
. __('Synchronize with Cloud', 'cleantalk-spam-protect')
|
1137 |
. '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.189
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -451,6 +451,10 @@ Yes, it is. Please read this article,
|
|
451 |
|
452 |
== Changelog ==
|
453 |
|
|
|
|
|
|
|
|
|
454 |
= 5.189 Nov 17 2022 =
|
455 |
#### Cookies enhancements 🔥, StrongTestimonials plugin integration 💣, let Woocommerce orders interface to report spam, checking existing users and comments improvements🎈 and some minor issues fixed 💪🏼
|
456 |
* New. Cookies. Do not run cookies setting process if no access key provided.
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.189.1
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
451 |
|
452 |
== Changelog ==
|
453 |
|
454 |
+
= 5.189.1 Nov 23 2022 =
|
455 |
+
* Fix. Woocommerce. Marking orders as spam fixed.
|
456 |
+
* Fix. Settings. Some text has been localized-ready.
|
457 |
+
|
458 |
= 5.189 Nov 17 2022 =
|
459 |
#### Cookies enhancements 🔥, StrongTestimonials plugin integration 💣, let Woocommerce orders interface to report spam, checking existing users and comments improvements🎈 and some minor issues fixed 💪🏼
|
460 |
* New. Cookies. Do not run cookies setting process if no access key provided.
|