Documentation

PluginUpdateChecker
in package
Uses UtilsProvider

Enable external updates with the help of PUC. This should be only done in non-free plugins!

Tags
see
https://github.com/YahnisElsts/plugin-update-checker

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

Properties

Methods

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
string

getPluginUpdate()

Get plugin update instance.

public getPluginUpdate() : mixed
Tags
codeCoverageIgnore

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>

        
On this page

Search results