onstage2426 / wp-hub-updater
WordPress plugin and theme updater powered by GitHub releases. Requires PHP 8.3+ and WordPress 6.6+. Includes a bundler (bin/wp-hub-updater) to copy and namespace-prefix the library into any plugin for conflict-free shipping.
Requires
- php: >=8.3
Requires (Dev)
- php-stubs/wordpress-stubs: ^7.0
- phpstan/phpstan: ^2.2
- rector/rector: ^2.0
Suggests
- wp-cli/wp-cli-bundle: Enables `wp hu <slug> check|status|clear|enable-auto-updates|disable-auto-updates` commands for each configured updater
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 --dev onstage2426/wp-hub-updater
Requirements: PHP 8.3+, WordPress 6.6+
This is a build-time tool — it generates a prefixed copy of itself into your project and is excluded from the final ZIP. See Distribution → Namespace isolation.
Quick start
Examples below use MyPlugin as the namespace prefix. Replace it with whatever you passed to vendor/bin/wp-hub-updater.
Plugin — add two lines to your main plugin file:
use MyPlugin\WpHubUpdater\Plugin\PluginUpdater; PluginUpdater::build('https://github.com/your-org/your-plugin', __FILE__) ->setAccessToken('ghp_xxxx'); // omit for public repos
Theme — add two lines to functions.php:
use MyPlugin\WpHubUpdater\Theme\ThemeUpdater; ThemeUpdater::build('https://github.com/your-org/your-theme', 'your-theme') ->setAccessToken('ghp_xxxx'); // omit for public repos
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
hu.json— metadata schema, changelog, local assets- Advanced — MU-plugins, debugging, WP-CLI, reliability features
License
MIT — see LICENSE.