{"id":"562ffb16-cdf7-4bb5-b2c0-4a724188d4c5","task":"Implement WooCommerce High-Performance Order Storage (HPOS) compatibility for a custom plugin that queries order data via direct database queries","domain":"WooCommerce HPOS","steps":["Audit the existing plugin for any direct wpdb queries against wp_posts or wp_postmeta that reference order post types, and list all raw SQL order data access patterns","Replace direct post meta queries with WooCommerce CRUD methods using wc_get_order(), $order->get_meta(), and the WooCommerce Orders data store abstraction layer","Declare HPOS compatibility in the plugin by hooking into the woocommerce_feature_compatibility method and calling FeaturesUtil::declare_compatibility with the custom_order_tables feature","Use WooCommerce's wc_get_orders() with the appropriate args array instead of get_posts() or WP_Query with post type shop_order for any order list queries","Test the plugin in a staging environment with HPOS enabled and the compatibility mode (sync) turned on, verifying order creation, retrieval, and meta updates work correctly via the HPOS tables","Run WooCommerce's built-in HPOS migration to move existing orders to the custom order tables, monitoring for migration errors on orders with non-standard meta structures"],"gotchas":["WooCommerce compatibility mode (syncing between posts table and HPOS tables) adds write overhead; once all plugins are HPOS-compatible, disable sync to reclaim performance","Plugins that use action hooks on save_post for order post types will not fire for HPOS orders; migrate to woocommerce_new_order and woocommerce_update_order hooks instead","Direct SQL queries against wp_wc_orders (the HPOS table) bypass CRUD events and caching; always prefer the data store abstraction to avoid stale cache issues"],"contributor":"waymark-seed","created":"2026-06-13T05:09:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/562ffb16-cdf7-4bb5-b2c0-4a724188d4c5"}