PluginUpdateChecker
in package
Uses
UtilsProvider
Enable external updates with the help of PUC. This should be only done in non-free plugins!
Tags
Table of Contents
Constants
- ENDPOINT = '1.0.0/wp/product/version'
Properties
- $pluginUpdate : PluginUpdate
- PluginUpdate instance.
- $puc : UpdateChecker|null
- Plugin Update Checker instance.
Methods
- getCheckUpdateLink() : mixed
- Generate a "Check for Updates" link so users can trigger this manually.
- getLicense() : mixed
- Get the first found license as we do not differ between multiple licenses in a multisite environment. WordPress does not allow to update per-site because a plugin is installed network-wide.
- getPluginConstantPrefix() : string
- Get the prefix of this package so we can utils package natively.
- getPluginUpdate() : mixed
- Get plugin update instance.
- getPuc() : mixed
- Get the instance of `Puc_v4_Factory`.
- instance() : mixed
- New instance.
- isEnabled() : mixed
- Check if Plugin Update Checker is currently active.
- probablyEnableExternalUpdates() : mixed
- Enable it, probably!
- queryArg() : mixed
- Add the license key to the update request.
- setupConstants() : mixed
- Make sure the RPM_WP_CLIENT constants are available.
- validateResult() : mixed
- The metadata JSON can also return error codes in case of license expiration / revoke.
- __construct() : mixed
- C'tor.
Constants
ENDPOINT
public
mixed
ENDPOINT
= '1.0.0/wp/product/version'
Properties
$pluginUpdate
PluginUpdate instance.
private
PluginUpdate
$pluginUpdate
$puc
Plugin Update Checker instance.
private
UpdateChecker|null
$puc
Tags
Methods
getCheckUpdateLink()
Generate a "Check for Updates" link so users can trigger this manually.
public
getCheckUpdateLink() : mixed
getLicense()
Get the first found license as we do not differ between multiple licenses in a multisite environment. WordPress does not allow to update per-site because a plugin is installed network-wide.
public
getLicense() : mixed
getPluginConstantPrefix()
Get the prefix of this package so we can utils package natively.
public
getPluginConstantPrefix() : string
Return values
stringgetPluginUpdate()
Get plugin update instance.
public
getPluginUpdate() : mixed
Tags
getPuc()
Get the instance of `Puc_v4_Factory`.
public
getPuc() : mixed
instance()
New instance.
public
static instance(PluginUpdate $pluginUpdate) : mixed
Parameters
- $pluginUpdate : PluginUpdate
Tags
isEnabled()
Check if Plugin Update Checker is currently active.
public
isEnabled() : mixed
probablyEnableExternalUpdates()
Enable it, probably!
public
probablyEnableExternalUpdates() : mixed
queryArg()
Add the license key to the update request.
public
queryArg(array<string|int, mixed> $queryArgs) : mixed
Parameters
- $queryArgs : array<string|int, mixed>
setupConstants()
Make sure the RPM_WP_CLIENT constants are available.
public
static setupConstants() : mixed
validateResult()
The metadata JSON can also return error codes in case of license expiration / revoke.
public
validateResult(WP_Error|array<string|int, mixed> $response) : mixed
Let's check against this and save the error code to our WP instance.
Parameters
- $response : WP_Error|array<string|int, mixed>
__construct()
C'tor.
private
__construct(PluginUpdate $pluginUpdate) : mixed
Parameters
- $pluginUpdate : PluginUpdate