Licensed plugins
Plugins hosted on WunderUpdates can be licensed in three different ways:
- No license - the user can download the plugin without any restrictions.
- Static keys - the user must supply a valid license key to download the plugin. The license keys are managed by the plugin developer and uploaded to WunderUpdates using the API.
- Lemon Squeezy - the user must supply a license key from Lemon Squeezy to download the plugin. Lemon Squeezy is a service that handles selling digital products and can create and manage license keys as part of a purchase.
The WordPress way of handling licenses
The de-facto standard way to handle licensed plugins in WordPress is to hijack the plugin update discovery process to redirect the update requests to the plugin's private update server, in our case that's WunderUpdates.
As WordPress searches for updates, it will send a request to the plugin update server with the plugin's slug and some other information. The update server then replies with the plugin's metadata including the new version number and some other information, most importantly, the download URL. WordPress then compares the version number in the response with the current plugin version installed on the site, and if the new version is higher, it will prompt the user to update the plugin.
But a private update server, like WunderUpdates, can reply with all the plugin metadata, including the new version, but avoid including the download URL in the response unless a valid license key is provided. This way, WordPress will know about the new version being available and can even display information about the new version.
When the reply from the update server does not include a download URL for the new version, WordPress will display a message to the user that the plugin needs to be updated, but the update cannot be performed automatically.
But when a valid license key is provided, WordPress can handle the update process as usual just as if the plugin was hosted on the WordPress.org repository.