Files
2meet-data-optimizer-quotat…/2meet-data-optimizer-quotation-addon.php
T
wpdev 471348f947
Tests / PHP Lint (pull_request) Successful in 5s
fix: partner 偵測符號對齊實際存在的常數 + schema 期望值補齊
TMDO_Quotation::register() 舊版偵測 TMQUO_Main / TMQUO_Plugin 兩個類別,
在 partner 外掛中並不存在(或載入太晚),偵測實際完全靠 file_exists() 後備
撐著——程式碼讀起來像在驗證「partner 已載入」,實際只驗證了「目錄存在」。

改用 TMQUO_VERSION / TMQUO_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% 完整。
2026-08-09 00:47:26 +08:00

41 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Plugin Name: 2meet Data Optimizer — Quotation AddOn
* Plugin URI: https://2meet.io/2meet-data-optimizer/quotation
* Description: 2meet-quotation 8 張自訂表 (2mq_*) 註冊(含 hp_vendor post_type_link
* Version: 0.1.1
* Requires at least: 6.0
* Tested up to: 6.9.4
* Requires PHP: 8.1
* Requires Plugins: 2meet-data-optimizer, 2meet-quotation
* Author: 2meet
* Author URI: https://2meet.io
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: tmdo-quotation
*
* TablePrefix: ^2mq_[a-z_0-9]+$
* Domain Path: /languages
*
* @package TMDO_QUOTATION
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'TMDO_QUOTATION_VERSION', '0.1.1' );
define( 'TMDO_QUOTATION_PATH', plugin_dir_path( __FILE__ ) );
define( 'TMDO_QUOTATION_URL', plugin_dir_url( __FILE__ ) );
define( 'TMDO_QUOTATION_FILE', __FILE__ );
require_once TMDO_QUOTATION_PATH . 'includes/class-tmdo-quotation-bootstrap.php';
require_once TMDO_QUOTATION_PATH . 'includes/back-compat-aliases.php';
/**
* Phase 4 任務:完成本 AddOn 的 includes/ 實作。
*
* @see ~/.claude/plans/wp-data-optimizer-2meet-data-optimizer-zesty-liskov.md
*/
add_action( 'plugins_loaded', array( 'TMDO_Quotation_Bootstrap', 'init' ), 6 );