refactor(2meet-data-optimizer-woocommerce-addon): drop the product/order hot fields and the user hot group

- Stop registering WC product/order/subscription zone fields and the user hot group; WC reads its meta directly and writes stock by SQL, so a flat copy drifts
- Keep the custom tables registration, the HPOS notice and the commissions
- Verify: composer test / test:integration; dev36 customer save, order stock reduce/restore with no DB errors
- PR: PR-085
This commit is contained in:
2026-09-27 09:48:33 +08:00
parent c76e474cbc
commit c3c4e1de44
2 changed files with 24 additions and 331 deletions
+18
View File
@@ -230,4 +230,22 @@ class WooCommerceIntegrationTest extends TestCase {
$pp->setValue( $registry, $original );
}
}
// ── 2.2 PR-085: WooCommerce data stays in native meta ───────────────────
/**
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_register_keeps_woocommerce_meta_out_of_the_flat_tables(): void {
eval( 'class WooCommerce {}' ); // phpcs:ignore Squiz.PHP.Eval -- WooCommerce stand-in.
$GLOBALS['_wp_filter_callbacks'] = array();
TMDO_WooCommerce::register();
$hooks = $GLOBALS['_wp_filter_callbacks'];
$this->assertArrayNotHasKey( 'wpdo_register_fields', $hooks, 'no product / order / subscription zone fields' );
$this->assertArrayNotHasKey( 'wpdo_register_entity_fields', $hooks, 'no user hot group' );
$this->assertArrayHasKey( 'wpdo_register_custom_tables', $hooks, 'WooCommerce custom tables stay registered' );
}
}