PluginUpdateLicensePool
Use this trait together in `PluginUpdate`.
Table of Contents
Properties
- $suppressGetLicensesWpDie : mixed
- $licenseActivationClient : LicenseActivation
- License activation client.
- $licenseCache : array<string|int, License>
- License instances cached, can be also partial within a multisite (not all subsites).
- $licenses : array<string|int, License>
- License instances of the complete multisite.
Methods
- getCurrentBlogLicense() : License
- Get the license for the current blog id.
- getFirstFoundLicense() : mixed
- Get first found license as we can not update per-site in multisite (?).
- getLicenseActivationClient() : mixed
- Get license activation client.
- getLicensedBlogIds() : array<string|int, mixed>|false
- Get a list of licensed blog IDs.
- getLicenses() : array<string|int, License>
- Get all licenses for each blog (when multisite is enabled). Attention: If a blog uses the same hostname as a previous known blog, they share the same `License` instance.
- getUniqueLicenses() : array<string|int, License>
- The same as `getLicenses`, but only get unique `License` instances.
- updateLicenseSettings() : mixed
- Update license settings for this plugin.
- constructPluginUpdateLicensePool() : mixed
- C'tor.
- validateLicenseCodes() : mixed
- Validate license codes.
Properties
$suppressGetLicensesWpDie
public
mixed
$suppressGetLicensesWpDie
= false
$licenseActivationClient
License activation client.
private
LicenseActivation
$licenseActivationClient
$licenseCache
License instances cached, can be also partial within a multisite (not all subsites).
private
array<string|int, License>
$licenseCache
= []
$licenses
License instances of the complete multisite.
private
array<string|int, License>
$licenses
Methods
getCurrentBlogLicense()
Get the license for the current blog id.
public
getCurrentBlogLicense() : License
Return values
LicensegetFirstFoundLicense()
Get first found license as we can not update per-site in multisite (?).
public
getFirstFoundLicense() : mixed
getLicenseActivationClient()
Get license activation client.
public
getLicenseActivationClient() : mixed
Tags
getLicensedBlogIds()
Get a list of licensed blog IDs.
public
getLicensedBlogIds([bool|string $invalidate = false ][, bool $returnCurrentOnNonMultisite = false ]) : array<string|int, mixed>|false
Parameters
- $invalidate : bool|string = false
-
If
true
it will invalidate the transient, or"never"
to get the value independent of cache expiration - $returnCurrentOnNonMultisite : bool = false
Return values
array<string|int, mixed>|false —Array with hostname as key and blog IDs as value. If it is not multisite, it returns false
(see also $returnCurrentOnNonMultisite
)
getLicenses()
Get all licenses for each blog (when multisite is enabled). Attention: If a blog uses the same hostname as a previous known blog, they share the same `License` instance.
public
getLicenses([bool $checkRemoteStatus = false ][, array<string|int, int> $inBlogIds = null ]) : array<string|int, License>
Parameters
- $checkRemoteStatus : bool = false
- $inBlogIds : array<string|int, int> = null
-
If set only return the list of this blog IDs
Return values
array<string|int, License>getUniqueLicenses()
The same as `getLicenses`, but only get unique `License` instances.
public
getUniqueLicenses([bool $skipNoUsage = false ]) : array<string|int, License>
Use this with caution as it leads to iterate all subsites within your multisite!
Parameters
- $skipNoUsage : bool = false
-
Pass
true
to skip licenses which are not in usage
Return values
array<string|int, License>updateLicenseSettings()
Update license settings for this plugin.
public
updateLicenseSettings(array<string|int, mixed> $licenses[, bool $telemetry = false ][, bool $newsletterOptIn = false ][, string $firstName = '' ][, string $email = '' ]) : mixed
Parameters
- $licenses : array<string|int, mixed>
-
Pass
null
to activate all unlicensed, free sites - $telemetry : bool = false
- $newsletterOptIn : bool = false
- $firstName : string = ''
- $email : string = ''
constructPluginUpdateLicensePool()
C'tor.
protected
constructPluginUpdateLicensePool() : mixed
validateLicenseCodes()
Validate license codes.
protected
validateLicenseCodes(array<string|int, mixed> $licenses, bool $telemetry, bool $newsletterOptIn, string $firstName, string $email) : mixed
Parameters
- $licenses : array<string|int, mixed>
- $telemetry : bool
- $newsletterOptIn : bool
- $firstName : string
- $email : string