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
3 changed files with 10 additions and 6 deletions

View file

@ -20,11 +20,11 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}

if ( class_exists( 'WenPai_Updater' ) ) {
if ( class_exists( 'WPCY_Template_Connector_Updater' ) ) {
return;
}

class WenPai_Updater {
class WPCY_Template_Connector_Updater {

/**
* 更新器版本号。

View file

@ -5,7 +5,7 @@ Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Requires Plugins: elementor
Stable tag: 1.0.4
Stable tag: 1.0.5
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

@ -47,6 +47,10 @@ The plugin declares Update URI: https://updates.wenpai.net and bundles the WenPa

== Changelog ==

= 1.0.5 =
* Fix a fatal error ("Cannot declare class WenPai_Updater, because the name is already in use") when this plugin is installed alongside other WenPai plugins such as WPBridge.
* Rename the bundled updater class to WPCY_Template_Connector_Updater so it no longer occupies a shared global class name.

= 1.0.4 =
* Complete plugin metadata: author, author URI, WordPress/PHP requirements, license, tested version, and readme details.
* Set author to WPCY.COM.

View file

@ -3,7 +3,7 @@
* Plugin Name: WPCY Template Connector
* Plugin URI: https://wpcy.com
* Description: Connects Elementor's remote template library to templates.wpcy.net and routes template imports through the WPCY template repository.
* Version: 1.0.4
* Version: 1.0.5
* Author: WPCY.COM
* Author URI: https://wpcy.com
* Requires at least: 6.0
@ -19,11 +19,11 @@ if (!defined('ABSPATH')) {
exit;
}

define('WPCY_TEMPLATE_CONNECTOR_VERSION', '1.0.4');
define('WPCY_TEMPLATE_CONNECTOR_VERSION', '1.0.5');

if (is_admin()) {
require_once __DIR__ . '/includes/class-wenpai-updater.php';
new WenPai_Updater(plugin_basename(__FILE__), WPCY_TEMPLATE_CONNECTOR_VERSION);
new WPCY_Template_Connector_Updater(plugin_basename(__FILE__), WPCY_TEMPLATE_CONNECTOR_VERSION);
}

class WPCY_Template_Connector {