onstage2426/wp-hub-updater
最新稳定版本:v0.1.9
Composer 安装命令:
composer require onstage2426/wp-hub-updater
包简介
WordPress plugin and theme updater powered by GitHub releases.
关键字:
README 文档
README
Delivers WordPress plugin and theme updates from a GitHub repository. Hooks into the standard WordPress update system so your entity appears in the Updates screen and can be installed with a single click.
Installation
composer require onstage2426/wp-hub-updater
Requirements: PHP 8.3+, WordPress 6.6+
Bundling in a plugin? If your plugin ships with this library, prefix the namespace so it can coexist with other plugins that bundle it too. Your release workflow handles this automatically — see Distribution → Namespace isolation.
Quick start
Plugin — call this at the top level of your main plugin file:
use WpHubUpdater\Plugin\PluginUpdater; $repo = 'https://github.com/your-org/your-plugin'; PluginUpdater::build($repo, __FILE__) ->setAccessToken('ghp_xxxx'); // omit for public repos
Theme — call this in functions.php:
use WpHubUpdater\Theme\ThemeUpdater; $repo = 'https://github.com/your-org/your-theme'; ThemeUpdater::build($repo, 'your-theme') ->setAccessToken('ghp_xxxx'); // omit for public repos
That's it. The updater registers its WordPress hooks and handles everything else automatically.
PluginUpdater::build()
PluginUpdater::build(
string $repositoryUrl,
string $pluginFile,
string $slug = "", // defaults to filename without .php
int $checkPeriod = 12, // hours between checks; 0 disables automatic checks
string $optionName = "", // defaults to external_updates-{slug}
): static
Pass __FILE__ as $pluginFile from your plugin's main PHP file.
ThemeUpdater::build()
ThemeUpdater::build(
string $repositoryUrl,
string $themeSlug, // theme directory name, e.g. "my-theme"
int $checkPeriod = 12,
string $optionName = "",
): static
Documentation
- Configuration — all chainable methods, access token, branch, cooldown, release filters, reading state
- WordPress filters — filters and actions for info, update, detection strategies, error handling
- Data classes —
Update,PluginInfo,ThemeInfoproperties - Distribution — namespace isolation, release pipeline, draft-first workflow, version stamping, ZIP
plugin.json/theme.json— metadata schema, changelog, local assets- Advanced — MU-plugins, debugging, WP-CLI, reliability features
License
MIT — see LICENSE.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-10