refactor(2meet-data-optimizer): remove HPCT legacy from core

- Feature flags keep only the live AddOn modules (wc_orders, latepoint) as ADDON_MODULES / addon_modules(); drop map_hpct_status() and the 7 HivePress HPCT modules whose interceptors were removed in PR-014
- Remove HPCT detection/notice (Compatibility, core), the admin HPCT import tab and status row, CLI import-hpct, the 7 advisor rules for dead modules, and the removed interceptors from COEXIST_WHITELIST
- Verify: NoHpctLegacyTest guard; core unit 635 / integration 449, HP 145/49, WC 10/22 OK; all sites have every module idle and never imported HPCT
- PR: PR-020c
This commit is contained in:
2026-09-26 00:14:18 +08:00
parent 1eedaa9b3c
commit 8a1c9c0353
13 changed files with 110 additions and 378 deletions
+6 -33
View File
@@ -27,17 +27,9 @@ class TMDO_Feature_Flags {
private const OPTION_KEY = 'wpdo_features';
/**
* All known HPCT-inherited modules.
* These modules operate on existing hpct_* tables.
* Modules driven by AddOn interceptors (WooCommerce commissions, LatePoint).
*/
public const HPCT_MODULES = array(
'reviews',
'messages',
'favorites',
'memberships',
'statistics',
'requests',
'listing_meta',
public const ADDON_MODULES = array(
'wc_orders',
'latepoint',
);
@@ -300,7 +292,7 @@ class TMDO_Feature_Flags {
$saved = array();
}
$all_modules = array_merge( self::HPCT_MODULES, self::ZONE_MODULES );
$all_modules = array_merge( self::ADDON_MODULES, self::ZONE_MODULES );
$defaults = array_fill_keys( $all_modules, 'idle' );
self::$cache = array_merge( $defaults, $saved );
@@ -308,13 +300,13 @@ class TMDO_Feature_Flags {
}
/**
* Return only HPCT-inherited module states.
* Return only AddOn module states.
*
* @return array<string, string>
*/
public static function hpct_modules(): array {
public static function addon_modules(): array {
$all = self::all();
return array_intersect_key( $all, array_flip( self::HPCT_MODULES ) );
return array_intersect_key( $all, array_flip( self::ADDON_MODULES ) );
}
/**
@@ -326,23 +318,4 @@ class TMDO_Feature_Flags {
$all = self::all();
return array_intersect_key( $all, array_flip( self::ZONE_MODULES ) );
}
/**
* Map an HPCT feature flag status to a WPDO state.
*
* Used during HPCT import to translate HPCT's 4-state model
* to WPDO's 7-state model.
*
* @param string $hpct_status HPCT status (disabled/migrating/verified/enabled).
* @return string WPDO state.
*/
public static function map_hpct_status( string $hpct_status ): string {
return match ( $hpct_status ) {
'disabled' => 'idle',
'migrating' => 'backfill',
'verified' => 'cutover',
'enabled' => 'complete',
default => 'idle',
};
}
}