Skip to content

v3.5.3

Choose a tag to compare

@j7-dev j7-dev released this 09 May 06:36
· 65 commits to master since this release
f9303ae

🐛 修正

ECPay gateway add_email_action TypeError 導致 cart/checkout 500(#108 / #109

  • 根因:includes/ry-woocommerce-tools/woocommerce/gateways/ecpay/ecpay-gateway.php:51 註冊了 add_filter( 'woocommerce_email_actions', [ CLASS, 'add_email_action' ] ),但 RY_ECPay_Gateway class 並不存在 add_email_action method。PHP 8 strict callable 驗證在 WC_Emails::init_transactional_emails() 觸發時直接 TypeError,前台 /cart/、/checkout/ 整頁 500
  • 修補:刪除該行 fatal 註冊。Canonical 實作位於 Woomp_Admin->add_email_action(admin/class-woomp-admin.php:280)已涵蓋全部 5 個 email actions;RY_ECPay_Shipping::add_email_action 也已整合進好用版。刪除後不會少註冊任何 email action
  • 影響:超商取貨/到店通知 / 到貨提醒 / 即將過期 / ATM 轉帳提醒 五封 email 行為不變

✅ 防護機制

新增 HookCallableValidityTest 整合測試,遍歷 4 個 critical filter(woocommerce_email_actions / woocommerce_email_classes / woocommerce_payment_gateways / woocommerce_shipping_methods)上的所有 array callable,跑 is_callable() 驗證避免同類問題復發;註冊到 smoke testsuite,pre-commit / CI 都會跑到。

📦 安裝

下載 woomp.zip,於 WordPress 後台「外掛 → 新增 → 上傳外掛」安裝。
已安裝舊版者透過 Plugin Update Checker 自動更新。