8 Commits

Author SHA1 Message Date
wpdev fa356a63b1 fix(bootstrap): 舊外掛互斥偵測改查 active_plugins
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 8s
Tests / Unit Tests (push) Successful in 10s
Tests / Integration Tests (push) Successful in 33s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Successful in 22s
Release / Test Gate (lint + phpcs + phpstan + unit + integration) (push) Successful in 1m2s
Release / release (push) Successful in 11s
WPDO_VERSION 由 class-tmdo-back-compat.php 自行 define 為 TMDO_VERSION,
兩者永遠相等,admin notice 從未觸發;PHPStan L6 認出 notIdentical.alwaysFalse
並卡掉 main run #8 與 v1.0.0 tag 的 Test Gate。改查 active_plugins basename,
與 HP AddOn detector 的偵測方式一致。
2026-07-31 09:50:23 +08:00
wpdev fbe41e2130 release: v1.0.0 — 取代 wp-data-optimizer v3.4.6
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 9s
Tests / Unit Tests (push) Successful in 10s
Tests / Integration Tests (push) Successful in 33s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Failing after 25s
Release / Test Gate (lint + phpcs + phpstan + unit + integration) (push) Failing after 36s
Release / release (push) Has been skipped
版本 0.1.0 → 1.0.0(含 TMDO_VERSION / TWO_MEET_DATA_OPTIMIZER_VERSION /
WP_DATA_OPTIMIZER_VERSION 與 unit bootstrap)。姊妹外掛只在診斷 CLI 顯示
WP_DATA_OPTIMIZER_VERSION、無版本比較,故報 1.0.0 安全。

wp-data-optimizer 退休:兩站台已停用,本機三個目錄改名為 *.retired
(wp-data-optimizer / -v3.1.1 / _audit),git 歷史保留在 gitea。

CHANGELOG 記錄本次 backport 全貌與 4 項 ABI/行為變更。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:45:22 +08:00
wpdev 76c01e44df refactor: 全部 128 個生產檔加入 declare(strict_types=1)(PR-H)
對齊 A v3.2.0。型別強制會把隱式轉換變成 TypeError,所以一次全檔加入
並跑完整測試(unit 451 / integration 398 全綠,無迴歸)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:13:33 +08:00
wpdev 56d534619e feat(interceptors): 核心加入 Standard_Post_Interceptor 抽象基底(F1)
Template Method 基底(A v3.0.1),收斂 action_delete_post /
filter_update_meta / action_insert_post 三件套。子類只需宣告
public const FIELD_MAP + get_post_type() + get_table_key() +
build_insert_data()。

HP AddOn 的 4 個 interceptor 隨即改為繼承它(573 → 344 行);未來
LatePoint / bookings / quotation 等 post↔自訂表 1:1 鏡射也可直接用。
back-compat 補 WPDO_Standard_Post_Interceptor alias。

unit 451 / integration 398 GREEN

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:07:20 +08:00
wpdev c46814ce83 refactor(migration): 回填 Migration Phase Strategy 體系(PR-D)
A v3.0.1 把 orchestrator 的 11 個 phase 抽成可注入的 Phase 物件,B 仍是
1107 行單體、以 'phase_' . $current 字串魔法分派、completed 甚至 inline
在 tick() 裡。本 commit 對齊:

新增 13 檔
- includes/migration/interface-migration-phase.php
- includes/migration/class-tmdo-migration-phase-base.php(log/get_managed_keys/
  execute_bulk_pivot/values_loose_equal 等共用 helper)
- includes/migration/phases/ 11 個 phase 類別

orchestrator 1107 → 640 行
- tick() 改 make_phase() 工廠 + $phase->execute($job)
- 移除 final、self::ENTITY_TYPE → static::(A v3.3.0 late static binding)
- 保留 B 原有的 '✓ %s (%.2fs)' 耗時 log(改為 tick 自行量測,A 版已簡化掉)
- 公開介面(preflight/start/tick/get_status/cancel/resume/needs_attention/
  cron_tick)經 diff 確認與 A 完全一致,呼叫端零影響

連帶
- Schema_Manager 補 table_exists 的 request-scoped cache 與
  flush_table_exists_cache()(A v3.1.6 + v3.4.6),Phase 測試需要它
- back-compat 補 12 個 Phase 類別的 WPDO_ alias
- 移植 MigrationPhaseTest + MigrationPhaseRemainingTest(527 行)

測試隔離差異(B 的 unit bootstrap 會載入 Member_Fields / Post_Fields,
A 的不會):MigrationPhaseRemainingTest 的 setUp 需額外清空 Entity_Registry
與 wpdo_register_entity_fields listener,否則 install_schema 會真的走進
dbDelta。MigrationPhaseTest 的 interface 斷言改用 TMDO_ 正式名稱
(PHP 無法 class_alias 介面,且該契約是核心內部擴充點)。

unit 451 / integration 398 GREEN

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 05:54:49 +08:00
wpdev f187ac5401 refactor(zones): 回填 Zone_Router + Routing_Predicate(PR-C)
A v3.0.1/v3.4.0 的架構深化,B 完全缺席:

新增
- includes/zones/class-tmdo-zone-router.php:module_name / read / write /
  delete_field / delete_post 五個 static 分派點
- includes/class-tmdo-routing-predicate.php:entity_bridge_owns(含
  request-level cache,B 原本沒有)+ should_{write,read,query}_from_zone
  + flush_cache

改寫
- Sync_Bridge 改用兩者,移除 5 個 private wrapper(get_zone_module /
  read_from_zone / write_to_zone / delete_from_zone / is_owned_by_entity_bridge)
  與 44 行 inline cleanup_post → Zone_Router::delete_post 一行(400→269 行)
- Query_Router 抽出 extract_hot_clauses() public static,pre_get_posts 變薄殼
- 收斂 5 處重複的 'hot_'/'cold_' . sanitize_key()(rest-api ×3、
  hot/cold-migration ×2)
- back-compat 補 WPDO_Zone_Router / WPDO_Routing_Predicate alias

測試
- 移植 ZoneRouterTest(250 行)+ RoutingPredicateTest(85 行)
- SyncBridgeEntityGuardTest 的 setUp/tearDownAfterClass 補 flush_cache(),
  否則 entity_bridge_cache 會跨測試污染(A v3.4.6 踩過同一個坑)

unit 409 / integration 398 GREEN

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 05:47:08 +08:00
wpdev a0847a27bf fix(audit,sso): audit 表補 group_name/action 欄 + 註冊 Audit_Logger + known_login_ips(A11/A12/A14)
- wpdo_audit CREATE 補 group_name varchar(50) 與 action varchar(20):
  TMDO_Audit_Logger::write_row() 一直在寫這兩個 key,表卻沒有該欄位。
  SCHEMA_VERSION 2.0.0 → 2.1.0 觸發既有站台 dbDelta ALTER;主檔與兩個
  test bootstrap 的 TMDO_DB_VERSION 同步(BackCompatTest 守門要求一致)。
- TMDO_Core::run() 註冊 TMDO_Audit_Logger::init():先前完全沒掛,
  wpdo_after_write / wpdo_after_delete 的稽核監聽器形同不存在。
- register_sso_group() 補 known_login_ips(A v3.4.4):2meet-spoke-sso 的
  TMSO_Login_Notify 以 set_entity 寫此欄,未註冊時降級落 wp_usermeta。
  對應測試改為 test_sso_group_has_eight_fields。

unit 379 / integration 398 GREEN

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 05:16:33 +08:00
wpdev d36bb954d1 chore: initial snapshot of 2meet-data-optimizer v0.1.0
Baseline before backporting wp-data-optimizer v3.0.1-v3.4.6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 05:06:36 +08:00