fix(2meet-data-optimizer): stop auto-activating entity bridge on install

- install() no longer switches the Hook Bus on or puts user/term/comment
  into dual_write; the now-unused maybe_autoactivate_entity_bridge() is gone
- Hook Bus and Mode_Manager defaults are off/disabled; sites with stored
  modes (incl. aeav_only) keep them since only unset keys use defaults
- Guard run_dbdelta()'s upgrade.php require like install_v2_tables() so
  install() can run under the integration test stub

Verify: InstallerV2Test::test_install_does_not_enable_entity_bridge,
  ModeManagerDefaultsTest; unit 602 OK, integration 421 OK
PR: PR-007
This commit is contained in:
2026-09-25 21:48:23 +08:00
parent 151aadd661
commit fc0f018a94
7 changed files with 77 additions and 46 deletions
+5 -6
View File
@@ -65,16 +65,15 @@ final class TMDO_Mode_Manager {
private static ?array $cache = null;
/**
* 預設模式(v2.5.4 起):
* post → disabled(由 Legacy Feature_Flags FSM 管理,不由 Mode_Manager 控制)
* user / term / comment → dual_write(安全雙寫:寫入 flat table + 原生 EAV,讀取仍走 EAV)
* 預設模式:全部 disabled,由管理者明確選擇後才啟用 entity bridge。
* 已存在 wpdo_bridge_modes 的站台(包含 aeav_only)以儲存值為準,不受影響。
*/
private static function defaults(): array {
return array(
'post' => self::MODE_DISABLED,
'user' => self::MODE_DUAL_WRITE,
'term' => self::MODE_DUAL_WRITE,
'comment' => self::MODE_DUAL_WRITE,
'user' => self::MODE_DISABLED,
'term' => self::MODE_DISABLED,
'comment' => self::MODE_DISABLED,
);
}