fix: 修復 partner 偵測時序 bug(AddOn 從未生效)+ IG meta_key 錯配 #1
Reference in New Issue
Block a user
Delete Branch "fix/partner-detection-timing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
本 AddOn 從未掛上任何 hook,等同未啟用(嚴重)
TMDO_Infocards::register()舊版在 bootstrap 當下就以class_exists('TMEETIC_*')偵測 partner,失敗即 early return。但本 AddOn bootstrap 掛在plugins_loaded:6,而 2meet-infocards 要到:20(tmeetic_run)才 require 自身類別——在:6當下 TMEETIC_* 一律不存在,偵測必定失敗。實測:
TMEETIC_Frontend在 prio 6 = MISSING、prio 21 = EXISTS。三處修法
plugins_loaded:30有 late-bind safety net 會重新 fire,唯有延後偵測才會正確生效。TMEETIC_VERSION/TMEETIC_PLUGIN_DIR常數優先(檔案解析當下即 define,早於plugins_loaded),class_exists()退為後備。核心fire_registration()最早在:4觸發,該時點只有常數可用。wpdo_register_custom_tablescallback prio 設 5。Custom_Table_Registry對同一provider:table_name是「先註冊者勝」,主外掛的 closure 在檔案解析當下就掛上 prio 10,不提前會被無expected_columns的版本佔走 key。同時修正 IG token 兩個欄位的
meta_key錯配,以及 registry 索引 config keyexpected_indexes→indexes。實證驗證
wpdo_register_fields掛載wpdo_register_custom_tables掛載2meet_vendor_profiles註冊者expected_columnswp wpdo doctor60 OK / 0 FAIL;anti-EAV lint 通過;站台 200/200。🤖 Generated with Claude Code
TMDO_Infocards::register() 舊版在 bootstrap 當下以 class_exists('TMEETIC_*') 偵測 partner,失敗即 early return。但本 AddOn bootstrap 掛在 plugins_loaded:6, 而 2meet-infocards 要到 :20(tmeetic_run)才 require 自身類別——在 :6 當下 TMEETIC_* 一律不存在,偵測必定失敗,兩個註冊 hook 從未被掛上,整個 AddOn 等同未啟用。 三處修法: 1. 偵測從 bootstrap 移進 hook callback 內執行,hook 一律先掛上 2. 偵測改以 TMEETIC_VERSION / TMEETIC_PLUGIN_DIR 常數優先(檔案解析當下即 define,早於 plugins_loaded),class_exists() 退為後備 3. bootstrap priority 6 → 3;wpdo_register_custom_tables callback prio 設 5, 讓本 AddOn 較豐富的定義勝過主外掛無 expected_columns 的版本 同時修正 IG token 兩個欄位的 meta_key 錯配(tmeetic_ig_access_token_enc / tmeetic_ig_token_expiry),以及 registry 索引 config key expected_indexes → indexes。 實測驗證: - wpdo_register_fields 掛載 prio 10、wpdo_register_custom_tables prio 5 - 2meet_vendor_profiles 由本 AddOn 註冊(16 欄位 / 1 索引 / doctor_callback) - 缺 expected_columns 由 26/29 降為 0/46 - wp wpdo doctor 60 OK / 0 FAIL;anti-EAV lint 通過;站台 200/200View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.