jeffreyvanrossum/wp-plugin-updater

提供了一种在非wordpress.org的替代主机上检查插件更新的方法。

0.0.1 2022-10-15 16:43 UTC

This package is auto-updated.

Last update: 2024-09-28 17:12:43 UTC


README

vanrossum.dev Logo

Total Downloads Latest Stable Version License

WP 插件更新器

允许您检查不同服务器上(而非wordpress.org)的插件更新。

🚸 只要此包仍在开发中,API 可能会发生变化,不应视为稳定。请自行承担风险。

为特定用例而设计,可能不满足每个人的需求。

基于 LemonSqueezy 的 示例插件

示例

(new Jeffreyvr\WPPluginUpdater\WPPluginUpdater(
    __FILE__, // plugin file path
    'your-plugin/your-plugin.php',
    'your-plugin',
    '1.0',
    "https://yourpluginsite.test/check-update",
    "https://yourpluginsite.test/validate-license"
))->setCanCheck(function() {
    // determine if check can be made
})
->setActions([
    // classes should implement Jeffreyvr\WPPluginUpdater\Action interface
    'activate-license' => ActivateLicenseAction::class,
    'deactivate-license' => DeactivateLicenseAction::class,
    'check-license' => CheckLicenseAction::class,
    'check-update' => CheckUpdateAction::class
]);

new \Jeffreyvr\WPPluginUpdater\Updater($this->updater);

贡献者

许可协议

MIT。请参阅 许可文件 以获取更多信息。