PHP code example of jeffreyvanrossum / wp-plugin-updater
1. Go to this page and download the library: Download jeffreyvanrossum/wp-plugin-updater library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jeffreyvanrossum / wp-plugin-updater example snippets
(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);