jeffreyvanrossum/wp-plugin-updater

Provides a way to check for plugin updates on a alternative host then wordpress.org.

0.0.1 2022-10-15 16:43 UTC

This package is auto-updated.

Last update: 2024-10-28 17:25:16 UTC


README

vanrossum.dev Logo

Total Downloads Latest Stable Version License

WP Plugin Updater

Allows you to check for updates for a plugin on a different server then wordpress.org.

🚸 As long as this package is still in development, the API might be subject to change and should not considered stable. Use at your own risk.

Made for a specific use case which may not fit everybody's needs.

Based on the example plugin from LemonSqueezy.

Example

(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);

Contributors

License

MIT. Please see the License File for more information.