From 98774c5035167e0a37f1179e4a62726d355c3c96 Mon Sep 17 00:00:00 2001 From: wpdev Date: Fri, 31 Jul 2026 05:35:54 +0800 Subject: [PATCH] =?UTF-8?q?docs(plan):=20=E6=A8=99=E8=A8=98=E9=9A=8E?= =?UTF-8?q?=E6=AE=B5=201-2=20=E5=AE=8C=E6=88=90=E4=B8=A6=E8=A8=98=E9=8C=84?= =?UTF-8?q?=20lessons=20learned?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY --- PLAN.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PLAN.md b/PLAN.md index 0cd9e18..3c3d5c5 100644 --- a/PLAN.md +++ b/PLAN.md @@ -203,8 +203,8 @@ | 階段 | 內容 | 狀態 | |---|---|---| | 0 | 回歸網:composer dev 依賴、test bootstrap FSM guard、`failOnWarning=true`、12 個 repo `git init` | ✅ 2026-07-31(unit 379 / integration 398 全綠) | -| 1 | 安全與正確性 A1–A14(13 個 admin GET→POST、REST allowlist、DDL 白名單、Logger 3-arity fatal…) | ⬜ | -| 2 | DDL 與並發 B1–B4(warm UNIQUE KEY → Zone_Cold save_patch → Zone_Warm increment) | ⬜ | +| 1 | 安全與正確性 A1–A14(13 個 admin GET→POST、REST allowlist、DDL 白名單、Logger 3-arity fatal…) | ✅ 2026-07-31 | +| 2 | DDL 與並發 B1–B4(warm UNIQUE KEY → Zone_Cold save_patch → Zone_Warm increment) | ✅ 2026-07-31 | | 3 | 架構回填(Zone_Router + Routing_Predicate;13 個 Migration Phase 類別) | ⬜ | | 4 | 相容層 E1–E7(雙向 hook 橋、67 個 AddOn alias、38 個 CLI 子指令、選單 slug redirect) | ⬜ | | 5 | AddOn 同步 F1–F5(Standard_Post_Interceptor、HP detector v3.4.5、WC) | ⬜ | @@ -218,6 +218,11 @@ - `composer update` 後 autoload 出現 `WPDO_Entity_Adapter_Interface` 三重宣告警告(`includes/adapters/interface-entity-adapter.php`、`back-compat/interface-wpdo-entity-adapter-alias.php`、`back-compat/trait-wpdo-anti-eav-aware-alias.php`)→ 階段 4 E2 要刪掉重複的那一份。 - `TMDO_FSM_GUARD_DISABLED` 兩個 test bootstrap 原本都沒 define,但 `class-tmdo-feature-flags.php:128` 會檢查它 → 強制 FSM 轉換的測試會被 guard 擋掉(A 在 v3.4.6 踩過同一個坑)。 - integration 測試需要 `TMDO_TEST_DB_PASS`(或 `WPDO_TEST_DB_PASS`)環境變數,DB 為本機 `wp_wpdo_test`。 +- **A 不是照抄對象,有兩處自身缺陷不可照搬**: + 1. `A/includes/engine/class-wpdo-hook-bus.php:511,522` 傳 3 個 string 給 `Logger::warning( string $event, array $context )` → A 有 `strict_types`,mass-clear 路徑必炸。B 用正確簽章。 + 2. `A/admin/class-wpdo-dashboard-widget.php:191` 的 `wpdo_postmeta_cleanup` 仍是 `wp_nonce_url` GET 連結,但其 handler 已只收 POST → 該按鈕在 A 是壞的。B 改成 form。 +- B 有 7 處 `Logger::error( 'event', array(...) )` 兩參數呼叫(4 個 stress tester、auto-promoter、conflict-detector、hook-bus),全部是 array→string 的 TypeError。用 token 掃描器(`scan_logger.php`)找出來的,肉眼與 grep 都容易漏。 +- `Zone_Warm::set()` 改 upsert 後,**測試表也要有 `UNIQUE KEY ui_post_meta`**,否則 integration 會出現「set 沒覆蓋舊值」的假失敗。 ---