Download the PHP package oberonlai/wp-updater without Composer
On this page you can find all versions of the php package oberonlai/wp-updater. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oberonlai/wp-updater
More information about oberonlai/wp-updater
Files in oberonlai/wp-updater
Package wp-updater
Short Description Self hosted WordPress plugin update server
License MIT
Homepage https://github.com/oberonlai/wp-updater
Informations about the package wp-updater
WP Updater v1.0
Simple WordPress Class for self host plugin updating server
from How to Configure Self-Hosted Updates for Your Private Plugins
Requirements
Installation
Install with composer
Run the following in your terminal to install with Composer.
WP Metabox PSR-4 autoloading and can be used with the Composer's autoloader. Below is a basic example of getting started, though your setup may be different depending on how you are using Composer.
See Composer's basic usage guide for details on working with Composer and autoloading.
Basic Usage
Below is a basic example of setting up a plugin updater.
Usage
To create a updater, first instantiate an instance of Updater
. The class takes one argument, which is an associative
array.
License Manger
You can add the license argument when creating the Updater instance. The license key is used to verify the authenticity of the plugin. The license key is stored in the database and is used to verify the authenticity of the plugin.
In the my-plugin-validate.php file, you can add the following code to verify the license key.
is a function that checks the license key. If the license key is valid, the function add the download URL to the update array.
You also can get the plugin slug and site url from client's site with and .
Preparations
You will need a hosting space to store the information file of the plugin and the zip file of the new version of the plugin. You can use space such as Dropbox or Google Drive, or you can place it on your own server. My top recommendation is to host it on GitHub, as it allows integration with version control processes.
my-plugin.json
This is an example of a JSON-formatted file for the plugin information. It includes the following fields:
If you want to push a notification for a new update, simply increment the version number in the plugin. The download_url indicates the location to download the new version of the plugin.
Hooks - ods_updater_after_purge
Allow plugin developers to perform additional tasks after the plugin update is completed, such as updating database tables, displaying notification alerts, and other behaviors. These tasks can be handled through this hook point.