fix: 更新器改用唯一类名,消除文派插件同装致命冲突(v1.0.5) #2

Merged
feibisi merged 1 commit from fix/wenpai-updater-class-collision into main 2026-07-28 00:03:54 +08:00
Contributor

与文派云桥同装时 wp-admin 全部 500:两插件各自捆绑的更新器声明了同一个全局类 WenPai_Updater。已在客户站实测复现。改名为 WPCY_Template_Connector_Updater,并发版 1.0.5。

与文派云桥同装时 wp-admin 全部 500:两插件各自捆绑的更新器声明了同一个全局类 WenPai_Updater。已在客户站实测复现。改名为 WPCY_Template_Connector_Updater,并发版 1.0.5。
Fix fatal error when installed with other WenPai plugins
All checks were successful
Release Plugin / release (push) Successful in 13s
d7e15803d3
The bundled updater declared a shared global class name WenPai_Updater,
which 22 WenPai plugins all ship a copy of. The file-level
class_exists() + return guard is not a safe conditional declaration and
was bypassed under certain opcache states, producing:

  Fatal error: Cannot declare class WenPai_Updater, because the name is
  already in use in .../includes/class-wenpai-updater.php on line 27

Reproduced on a customer site running this plugin alongside WPBridge:
with both active, every wp-admin request returned 500.

Rename the class to WPCY_Template_Connector_Updater so it no longer
occupies a shared name. Renaming one side is sufficient to resolve the
collision, and each plugin now uses the updater version it ships
instead of whichever copy happened to load first.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kekechong/wpcy-template-connector!2
No description provided.