1. Go to this page and download the library: Download contexis/wp-github-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/ */
contexis / wp-github-updater example snippets
use Contexis\WpGitHubUpdater\WordPressPluginUpdater;
WordPressPluginUpdater::fromPluginFile(
pluginFile: __FILE__,
owner: 'vendor',
repositoryName: 'plugin-repo',
)->registerHooks();
use Contexis\WpGitHubUpdater\GitHubReleaseProvider;
use Contexis\WpGitHubUpdater\GitHubRepository;
use Contexis\WpGitHubUpdater\PluginMetadata;
use Contexis\WpGitHubUpdater\WordPressPluginUpdater;
$plugin = PluginMetadata::fromPluginFile(__FILE__);
$repository = GitHubRepository::from('vendor', 'plugin-repo');
$releaseProvider = GitHubReleaseProvider::forPlugin($repository, $plugin);
$updater = new WordPressPluginUpdater(
plugin: $plugin,
repository: $repository,
releaseProvider: $releaseProvider,
);
$updater->registerHooks();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.