Commit e25cb836640 for woocommerce

commit e25cb83664076a5a849a3d328d22c5497023216d
Author: Asim Sulehria <de.asimhabib@gmail.com>
Date:   Mon May 4 18:14:49 2026 +0500

    Use %i placeholder for table name in set_customer_first_order() SQL query (#64435)

    * Use %i placeholder for table name in set_customer_first_order() prepared query

    WooCommerce now requires WordPress 6.8. The %i identifier placeholder was
    introduced in WordPress 6.2, so the TODO blocking its use is now resolved.
    Removes two phpcs:ignore suppressions and uses proper identifier escaping.

    * Add changefile(s) from automation for the following project(s): woocommerce

    ---------

    Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>

diff --git a/plugins/woocommerce/changelog/64435-fix-use-wpdb-identifier-placeholder-in-order-stats b/plugins/woocommerce/changelog/64435-fix-use-wpdb-identifier-placeholder-in-order-stats
new file mode 100644
index 00000000000..4b292f96687
--- /dev/null
+++ b/plugins/woocommerce/changelog/64435-fix-use-wpdb-identifier-placeholder-in-order-stats
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Use %i placeholder for table name in set_customer_first_order() SQL query.
\ No newline at end of file
diff --git a/plugins/woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php b/plugins/woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php
index c6517783cf5..c532501ef37 100644
--- a/plugins/woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php
+++ b/plugins/woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php
@@ -807,10 +807,8 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {

 		$wpdb->query(
 			$wpdb->prepare(
-				// phpcs:ignore Generic.Commenting.Todo.TaskFound
-				// TODO: use the %i placeholder to prepare the table name when available in the minimum required WordPress version.
-				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-				"UPDATE {$orders_stats_table} SET returning_customer = CASE WHEN order_id = %d THEN false ELSE true END WHERE customer_id = %d",
+				'UPDATE %i SET returning_customer = CASE WHEN order_id = %d THEN false ELSE true END WHERE customer_id = %d',
+				$orders_stats_table,
 				$order_id,
 				$customer_id
 			)