fix: partner 偵測符號對齊實際存在的常數 + schema 期望值補齊
Tests / PHP Lint (pull_request) Successful in 4s

TMDO_Collab::register() 舊版偵測 TMCLB_Plugin / TMCLB_Main 兩個類別,
在 partner 外掛中並不存在(或載入太晚),偵測實際完全靠 file_exists() 後備
撐著——程式碼讀起來像在驗證「partner 已載入」,實際只驗證了「目錄存在」。

改用 TMCLB_VERSION / TMCLB_PLUGIN_DIR,兩者在 partner 主檔的檔案解析當下即
define,早於 plugins_loaded,故本 AddOn bootstrap 的 :6 時點確實可用。
file_exists() 後備保留不動,行為不變;但偵測不再是死碼,即使將來移除後備也
不會重演 infocards-addon 那種「整個 AddOn 靜默失效」的事故。

同一版本另含先前未提交的 schema 工作:補齊 expected_columns / indexes,
並將 registry 索引 config key 由 expected_indexes 更正為 indexes
(wp_parse_args() 會靜默丟棄未知 key,索引期望值先前等同從未送達)。

實測驗證(mu-plugin 於 plugins_loaded:6 量測真實請求):
新常數 AVAILABLE;wp wpdo doctor 89 OK / 0 FAIL;表註冊欄位與索引 100% 完整。
This commit is contained in:
2026-08-09 00:47:26 +08:00
parent a71bc76053
commit 55e3e19ee4
3 changed files with 213 additions and 15 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
* Plugin Name: 2meet Data Optimizer — Collab AddOn
* Plugin URI: https://2meet.io/2meet-data-optimizer/collab
* Description: 2meet-collab 7 張自訂表 (2mclb_rider_instances/venue_profiles/rider_templates/collaborators/confirmations/comments/rider_history) 註冊
* Version: 0.1.0
* Version: 0.1.1
* Requires at least: 6.0
* Tested up to: 6.9.4
* Requires PHP: 8.1
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'TMDO_COLLAB_VERSION', '0.1.0' );
define( 'TMDO_COLLAB_VERSION', '0.1.1' );
define( 'TMDO_COLLAB_PATH', plugin_dir_path( __FILE__ ) );
define( 'TMDO_COLLAB_URL', plugin_dir_url( __FILE__ ) );
define( 'TMDO_COLLAB_FILE', __FILE__ );