[English]
Version Pilot offers a decentralized and seamless update solution for WordPress plugin developers who host their plugins outside the official repository. It perfectly mimics the native WordPress update experience without relying on a central server.
This solution consists of two parts:
- Author-side Plugin ("Version Pilot"): You install this plugin on your own WordPress site. It provides a clean interface to manage all your plugins' update information. This information is then exposed via a secure REST API endpoint.
- Client-side Integration Code: A lightweight PHP snippet that you, the developer, embed in your distributed plugins. This code uses WordPress's built-in hooks to periodically check your Version Pilot API for updates. When a new version is detected, it integrates seamlessly into the standard WordPress update system, allowing your users to update with a single click from their admin dashboard, just like any official plugin.
Key Features in Version 2.0:
- Plugin-Centric Workflow: First, add your plugin's core information. Then, add multiple versions to that plugin. This is more intuitive and reduces data redundancy.
- Dedicated Versions List: A new "All Versions" screen gives you a complete history of all releases across all your plugins.
- AJAX-Powered UI: Enable or disable updates directly from the versions list with a single click, no page reload needed.
- Streamlined Process: The "Add New Version" screen is simplified, automatically linking to its parent plugin and requiring only version-specific details.
- Modern Codebase: Fully refactored for better performance, security, and adherence to modern WordPress best practices.
[简体中文]
"Version Pilot" 为那些在官方插件库之外托管插件的 WordPress 开发者提供了一个去中心化的、无缝的更新解决方案。它完美地模拟了 WordPress 的原生更新体验,且无需依赖任何中央服务器。
该解决方案包含两个部分:
- 作者端插件 ("Version Pilot"): 您将此插件安装在您自己的 WordPress 站点上。它提供了一个简洁的界面,用于管理您所有插件的更新信息。这些信息会通过一个安全的 REST API 端点提供。
- 用户端集成代码: 一段轻量级的 PHP 代码,由您(开发者)嵌入到您分发的插件中。该代码利用 WordPress 的内置钩子,定期向您的 "Version Pilot" API 查询更新。当检测到新版本时,它会无缝地集成到标准的 WordPress 更新系统中,让您的用户可以像更新官方插件一样,在后台一键完成更新。
2.0 版本核心特性:
- 以插件为中心的工作流: 先添加您插件的核心信息,然后再为该插件添加多个版本。流程更直观,减少数据重复。
- 专属的版本列表: 新增的“所有版本”页面,让您可以查看所有插件的完整发布历史。
- AJAX 驱动的界面: 在版本列表中,只需单击一下即可启用或禁用更新,无需刷新页面。
- 简化的流程: “添加新版本”页面更简洁,它会自动关联到父插件,仅需填写版本相关信息。
- 现代化的代码: 经过完全重构,具有更好的性能和安全性,并遵循现代 WordPress 最佳实践。
[English]
This plugin has two installation processes: one for you (the plugin author) and one for integrating the updater into your plugins.
Part 1: For You (The Plugin Author)
- Upload the
version-pilot
folder to the /wp-content/plugins/
directory on your own website.
- Activate the plugin through the 'Plugins' menu in WordPress.
- Navigate to the new "Version Pilot" menu in your admin sidebar.
- Go to "All Plugins" and click "Add New".
- Fill in your plugin's permanent information (e.g., Plugin Name, Plugin Slug, Homepage) and Publish. The "Plugin Slug" must be unique and match the one used in the client code.
- Return to the "All Plugins" list. Find your plugin and click the "Add New Version" link.
- Fill in the version-specific details (e.g., Version Number, Package URL, Changelog) and Publish.
- Your update API is now live for that version!
Part 2: Integrating the Updater into Your Plugin
- Copy the
version-pilot-client-updater.php
file (from the /client/
directory) into your own plugin's folder.
- In your plugin's main PHP file, include and instantiate the updater class.
```php
// Include the updater class.
require_once dirname(
FILE ) . '/path/to/version-pilot-client-updater.php';
// Instantiate the updater.
new Version_Pilot_Client_Updater(
'
https://your-author-site.com', // The URL where your Version Pilot plugin is installed.
'my-awesome-plugin', // The unique slug for THIS plugin.
plugin_basename(
FILE ), // The plugin's basename (e.g., my-awesome-plugin/my-awesome-plugin.php).
'1.0.0' // The CURRENT version of THIS plugin.
);
```
That's it! Your plugin will now automatically check for updates.
[简体中文]
本插件有两个安装流程:一个是为您(插件作者)自己安装,另一个是将更新器集成到您分发给用户的插件中。
第一部分:为您自己(插件作者)
- 将
version-pilot
文件夹上传到您自己网站的 /wp-content/plugins/
目录。
- 在 WordPress 的“插件”菜单中激活该插件。
- 在您的后台侧边栏中找到新增的 "Version Pilot" 菜单。
- 进入“所有插件”页面,然后点击“添加插件”。
- 填写您插件的永久性信息(如:插件名称、插件 Slug、主页等)然后发布。请注意,“插件 Slug”必须是唯一的,且与您在客户端代码中使用的 Slug 完全匹配。
- 回到“所有插件”列表,找到您刚才添加的插件,点击下方的“添加新版本”链接。
- 填写该版本专属的信息(如:版本号、压缩包 URL、更新日志等)然后发布。
- 现在,您这个版本的更新 API 已经生效!
第二部分:将更新器集成到您的插件中
- 将
version-pilot-client-updater.php
文件(位于本插件的 /client/
目录下)复制到您自己插件的文件夹中。
- 在您插件的主 PHP 文件中,引入并实例化更新器类。
```php
// 引入更新器类文件
require_once dirname(
FILE ) . '/path/to/version-pilot-client-updater.php';
// 实例化更新器
new Version_Pilot_Client_Updater(
'
https://your-author-site.com', // 您安装了 Version Pilot 插件的网站 URL
'my-awesome-plugin', // 当前插件的唯一 Slug
plugin_basename(
FILE ), // 当前插件的基准名 (例如, my-awesome-plugin/my-awesome-plugin.php)
'2.0.0' // 当前插件的当前版本号
);
```
完成了!现在,您的插件将会自动检查更新。