Skip to content

WooCommerce integration UI - #855

Open
alexander-b-clean wants to merge 2 commits into
devfrom
woo-commerce-update.ab
Open

WooCommerce integration UI #855
alexander-b-clean wants to merge 2 commits into
devfrom
woo-commerce-update.ab

Conversation

@alexander-b-clean

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.42%. Comparing base (cc913e2) to head (bccf9f8).

Files with missing lines Patch % Lines
lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php 0.00% 117 Missing ⚠️
...ntalk/Antispam/IntegrationsByClass/Woocommerce.php 0.00% 33 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #855      +/-   ##
============================================
- Coverage     28.55%   28.42%   -0.13%     
- Complexity     6212     6254      +42     
============================================
  Files           286      286              
  Lines         25662    25774     +112     
============================================
  Hits           7327     7327              
- Misses        18335    18447     +112     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WooCommerce integration to present blocked (spam) orders in an admin list-table UI closer to WooCommerce’s native orders screen, while also adjusting how blocked checkouts are handled and enabling blocked-order storage by default.

Changes:

  • Reworks the spam orders list table: new “Order / Date / Status / Total” columns, views (“All / On hold / Spam”), and sortable columns (including total).
  • Adjusts WooCommerce checkout blocking behavior to store blocked orders, clear cart, and redirect in both classic and Store API flows.
  • Adds admin CSS to style the spam-orders table like WooCommerce’s orders list and flips the default setting to store blocked orders.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php Updates the spam orders WP_List_Table UI (columns, views, sorting, total/status rendering).
lib/Cleantalk/ApbctWP/State.php Enables storing blocked WooCommerce orders by default.
lib/Cleantalk/Antispam/IntegrationsByClass/Woocommerce.php Changes blocked-checkout handling (storage, cart emptying, redirect responses).
css/src/cleantalk-admin.css Adds styles for the new WooCommerce-like spam orders table layout.
css/cleantalk-admin.min.css Minified CSS update reflecting the new admin styles.
Files not reviewed (1)
  • css/cleantalk-admin.min.css: Generated file
Suppressed comments (1)

lib/Cleantalk/Antispam/IntegrationsByClass/Woocommerce.php:259

  • Same issue as above: this early return disables spam checking for Store API checkouts when data__wc_store_blocked_orders is off. It should only skip persistence of blocked orders, not the spam check itself.
        if ( ! $apbct->settings['data__wc_store_blocked_orders'] ) {
            // The checkout is left to WooCommerce as is: no check, no blocked order to store.
            return;
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +180 to +183
if ( ! $apbct->settings['data__wc_store_blocked_orders'] ) {
// The checkout is left to WooCommerce as is: no check, no blocked order to store.
return;
}
Comment on lines +102 to +110
$order_column = sprintf(
'%1$s %2$s',
$this->renderOrderColumn($wc_spam_order->id, $wc_spam_order->customer_details),
$this->row_actions($actions)
);

$order_details_column = $this->renderOrderDetailsColumn($wc_spam_order->order_details);
$customer_details_column = $this->renderCustomerDetailsColumn($wc_spam_order->customer_details);
$order_date_column = $this->renderOrderDateColumn($wc_spam_order->order_date);
$order_date_column = $this->renderOrderDateColumn($wc_spam_order->order_date);
$status_column = $this->renderStatusColumn();
$total_column = $this->renderTotalColumn($wc_spam_order->order_details);
Comment on lines +325 to +332
private function handleBlockedOrder()
{
$this->storeBlockedOrder();

if ( function_exists('wc') && ! is_null(wc()->cart) ) {
wc()->cart->empty_cart();
}
}
Comment on lines +340 to +343
private function getBlockedOrderRedirectUrl()
{
return wc_get_endpoint_url('order-received', '', wc_get_checkout_url());
}
Comment on lines +386 to +393
// Fresh orders are shown as "5 minutes ago", the older ones as a date. Same as WooCommerce does.
$diff = time() - $timestamp;
if ( $diff >= 0 && $diff < DAY_IN_SECONDS ) {
/* translators: %s: human-readable time difference */
$show_date = sprintf(__('%s ago', 'cleantalk-spam-protect'), human_time_diff($timestamp, time()));
} else {
$show_date = date_i18n('M j, Y', $timestamp); // Feb 15, 2023
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants