refactor(2meet-data-optimizer): stop registering the wc_product post group

- WooCommerce reads product meta directly and writes stock by SQL, so a flat copy drifted (R-2.1 V1 T4); product meta now stays in native only (plan decision 2). TMDO_Post_Fields registers wp_core, attachment and nav_menu_item. Existing wp_wpdo_post_wc_product tables are left in place and still dropped on uninstall; the orphan restore registers nothing for them while native meta holds the keys; `wp tmdo bridge-restore-native post --group=wc_product --retire` archives them.
- Tests that route products register the former group themselves (tmdo_test_register_wc_product_group(), same name and table); live router Q06 runs on wp_core's _wp_page_template instead of _sku. The post stress tester already skips flat tables that do not exist.
- Verify: PostFieldsRegistrationTest (RED before); dev36: wc_product absent from the registry and not restored as an orphan, a CLI order took stock 452 → 450 in native with no DB error (reverted), drift post 10 groups 0.
- PR: PR-077
This commit is contained in:
2026-09-27 01:11:52 +08:00
parent f15473527c
commit f48df1a33f
12 changed files with 68 additions and 174 deletions
@@ -102,7 +102,7 @@ final class TMDO_Post_Migration {
* into the group's flat table. Groups with json fields go row by row
* through backfill_group_json() instead.
*
* @param string $group_name Entity group name (e.g. 'wc_product').
* @param string $group_name Entity group name (e.g. 'hp_listing_core').
* @return array{migrated:int,group:string,post_type:string|null}
* @throws InvalidArgumentException When group is not registered, or is a restored orphan group.
* @throws RuntimeException When the pivot SQL fails.