wpdev
f089b0934b
fix(2meet-data-optimizer-hivepress-addon): map marketplace hot field to hp_price
...
- hivepress-marketplace stores its filterable, sortable listing price as
hp_price; hp_purchase_price never existed (dev34: 588 hp_price rows)
- Drop hp_purchase_count: the addon keeps no per-listing sales counter
- Remove the stale docblock note about the legacy core registration path
Verify: vendor/bin/phpunit --filter test_on_register_fields_registers_hot_hp_price;
addon unit 156 OK, integration 57 OK
PR: PR-011
2026-09-25 22:39:57 +08:00
wpdev
d3ddbb8933
fix(2meet-data-optimizer-hivepress-addon): register enabled social links as hp_{name}
...
- hivepress-social-links stores each link as hp_{name} (hp_facebook, not
hp_facebook_url) and lets admins enable links separately for listings
and vendors; the hardcoded 7 *_url vendor keys never matched real meta
- Read hp_listing_social_links / hp_vendor_social_links and register each
enabled link on its own post type, so custom links (e.g. line_oa) work
- dev34 check: meta holds hp_instagram / hp_website, and zero *_url keys
Verify: vendor/bin/phpunit --filter HivePressSocialLinksAdapterTest;
addon unit 156 OK, integration 57 OK
PR: PR-010
2026-09-25 22:35:30 +08:00
wpdev
e443f20edb
fix(2meet-data-optimizer-hivepress-addon): map bookings hot field to hp_quantity
...
- hivepress-bookings has no guests field; the places booked are stored as
hp_quantity (only when "Allow multiple places" is enabled)
- Verified against hivepress-bookings 1.5.5: start_time / end_time were
already correct and stay unchanged
Verify: vendor/bin/phpunit --filter test_on_register_fields_uses_real_booking_meta_keys;
addon unit 155 OK, integration 57 OK
PR: PR-009
2026-09-25 22:28:54 +08:00
wpdev
2540bee0d1
docs: CHANGELOG 記錄 integration 測試套件與 ListingStatsTest
Tests / PHP Lint (push) Successful in 5s
Tests / Unit Tests (push) Successful in 15s
Tests / Integration Tests (push) Successful in 18s
2026-07-31 10:44:14 +08:00
wpdev
80ed7b1bb2
test: 移植 ListingStatsTest(9 tests)
...
Tests / PHP Lint (push) Successful in 6s
Tests / Unit Tests (push) Successful in 18s
Tests / Integration Tests (push) Successful in 21s
unit bootstrap 改載入真實 TMDO_Listing_Stats:先 define
TMDO_TEST_SKIP_LISTING_STATS_STUB,核心 bootstrap 便會跳過它的 stub。
145 → 154 tests。
2026-07-31 10:41:13 +08:00
wpdev
59c9b698b7
test: 加入 integration 測試套件(連真實 MariaDB)
...
Tests / PHP Lint (push) Successful in 5s
Tests / Unit Tests (push) Successful in 16s
Tests / Integration Tests (push) Successful in 20s
從 wp-data-optimizer v3.4.6 移植 5 個 integration 測試檔,並新增
tests/integration/bootstrap.php(複用核心的 integration bootstrap,不重複
與 WP stub)+ phpunit-integration.xml + CI integration job。
2026-07-31 09:56:48 +08:00
wpdev
843a8e2156
ci: 加入 test workflow(lint + unit)
...
Tests / PHP Lint (push) Successful in 5s
Tests / Unit Tests (push) Successful in 15s
unit job 會一併 checkout 核心 plugin — 本 AddOn 的測試 bootstrap 直接
require 核心的 tests/bootstrap.php。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:20:07 +08:00
wpdev
0a3b05789e
test: 建立 phpunit 測試基建並移植 25 個 HivePress 測試
...
AddOn 先前 tests=0。新增:
- composer.json(dev 依賴 + phpunit/phpcs script)
- phpunit.xml(failOnWarning=true)
- tests/bootstrap.php:直接 require 核心 plugin 的 unit bootstrap,避免複製
~700 行 WP stub,再載入本 AddOn 的類別;補 trait wrapper 與自動 WPDO_ alias
(includes/back-compat-aliases.php 掛在 plugins_loaded:7,PHPUnit 下不會跑)
- tests/unit/ 25 個測試 + WpdbMockTrait(自 A 移植)
生產碼一併修對外契約:interface-tmdo-hp-adapter.php 改為先宣告空的
WPDO_HivePress_Adapter、再讓 TMDO_HivePress_Adapter extends 它(PHP 無法
class_alias 介面,只有繼承能讓 instanceof WPDO_HivePress_Adapter 對
implements TMDO_ 名稱的 adapter 成立)。與核心 interface-entity-adapter.php
同一模式。這也讓第三方自訂 adapter 用舊介面名仍可通過核心檢查。
145 tests / 357 assertions GREEN
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:19:01 +08:00
wpdev
b96b041445
fix(hivepress): detector active-plugin 偵測 + 4 個 interceptor 改繼承核心基底(F2/F3/F4)
...
F3 detector(A v3.4.5):HivePress addon 不暴露任何 per-addon class/const,
它們是透過 add_filter('hivepress/v1/extensions') 註冊目錄,所以原本的
class_exists / defined 偵測永遠只認得 core → 反 EAV 覆蓋率卡在 1/13。
改以 get_option('active_plugins') 為第一級訊號(新增 active_plugin_files()),
version_for() 對 addon 改讀其主檔 Version: header。覆蓋率回到 7/13。
F2 interceptor:reviews / messages / memberships / requests 改繼承核心的
TMDO_Standard_Post_Interceptor,573 → 344 行。FIELD_MAP 由 private
提升為 public(late static binding 從基底讀取)。
bootstrap 的 require 迴圈加核心版本守衛:這 4 個檔案在舊核心下會於
parse 階段就 fatal,class_exists 守衛來不及。
F4 listing-stats:view 計數改用 Zone_Warm::increment() 原子遞增,
flush 改原子 UPDATE,消除 get()+set() 的 lost-update race。
F5:主檔補 TablePrefix header(打包終檢 §10 schema drift 主路徑)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:07:39 +08:00
wpdev
e3ede89197
feat(back-compat): 加入 WPDO_* class alias(E3)
...
核心的 class-tmdo-back-compat.php 在 plugins_loaded:4 執行,AddOn 於 :6
才載入,所以核心的 alias 表涵蓋不到 AddOn 類別 —— 姊妹外掛或第三方若
以 WPDO_* 名稱引用本 AddOn 的類別會直接 fatal。
新增 includes/back-compat-aliases.php,於 plugins_loaded:7 為本 AddOn
自有類別建立 WPDO_ alias;主檔加入 require。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:03:47 +08:00
wpdev
b4400a68e5
chore: initial snapshot of 2meet-data-optimizer-hivepress-addon 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