diff --git a/includes/class-tmdo-woocommerce.php b/includes/class-tmdo-woocommerce.php index e868a99..60df4df 100644 --- a/includes/class-tmdo-woocommerce.php +++ b/includes/class-tmdo-woocommerce.php @@ -583,6 +583,27 @@ final class TMDO_WooCommerce { 'type' => 'integer', 'label' => 'WC customer last order ID', ), + // WC runtime stats — written on order/session events, high-frequency + // on busy stores. Unregistered they land back in wp_usermeta. + array( + 'key' => 'wc_last_active', + 'type' => 'integer', + 'label' => 'WC last customer activity timestamp (Unix)', + ), + array( + // WooCommerce stores this per-site via Users::update_site_user_meta(), + // which appends the de-suffixed blog prefix ('wc_order_count' + '_wp' + // on the main site, '_wp_2' on a subsite). Compute it the same way + // rather than hardcoding the main-site form. + 'key' => 'wc_order_count_' . rtrim( $GLOBALS['wpdb']->get_blog_prefix(), '_' ), + 'type' => 'integer', + 'label' => 'WC order count for the current site (blog-aware key)', + ), + array( + 'key' => 'last_update', + 'type' => 'integer', + 'label' => 'WC customer last profile update timestamp (Unix)', + ), ) ); }