\DevOwl\RealProductManagerWpClient\licenseLicenseActivation

Handle license activation.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
setupConstants()
__construct()
skip()
activate()
deactivate()
hasInteractedWithFormOnce()
getHint()
getReceived()
getReceivedClientProperties()
getReceivedClientProperty()
getCode()
getInstallationType()
getLicense()
No public properties found
ERROR_CODE_ALREADY_ACTIVATED
No protected methods found
No protected properties found
N/A
No private methods found
$license
N/A

Constants

ERROR_CODE_ALREADY_ACTIVATED

ERROR_CODE_ALREADY_ACTIVATED ='rpm_wpc_already_exists'

Properties

$license

$license :\DevOwl\RealProductManagerWpClient\license\License

License instance.

Type

\DevOwl\RealProductManagerWpClient\license\License

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this package so we can utils package natively.

Returns

string

setupConstants()

setupConstants()

Make sure the RPM_WP_CLIENT constants are available.

__construct()

__construct(\DevOwl\RealProductManagerWpClient\license\License  $license)

C'tor.

Parameters

\DevOwl\RealProductManagerWpClient\license\License $license

skip()

skip(boolean  $noUsage = false)

Mark the license as "ever seen form once", see also `#hasInteractedWithFormOnce`.

You should use the REST API endpoint plugin-update/:slug/skip for this.

$noUsage = true:

Mark the license as "no usage". That means, the license code is not needed and not considered for "fully licensed" or "partial licensed".

Use case: User has installed the plugin network wide, but want to use the premium plugin only on one sub site.

Parameters

boolean $noUsage

activate()

activate(string  $code,string  $installationType,boolean  $telemetry,boolean  $newsletterOptIn,string  $firstName,string  $email)

Activate this license with a given code. It returns a `WP_Error` if a code is already active.

Parameters

string $code
string $installationType
boolean $telemetry
boolean $newsletterOptIn
string $firstName
string $email

deactivate()

deactivate(boolean  $remote = false,string  $validateStatus = null,string  $help = ''): \WP_Error|true

Deactivate the license for this blog and plugin.

Parameters

boolean $remote

If true, the license is also deactivate remotely

string $validateStatus
string $help

Returns

\WP_Error|true

hasInteractedWithFormOnce()

hasInteractedWithFormOnce()

Check if the form for this license was shown the user once. This allows you e.g.

show a form of the license activation directly after using the plugin for the first time.

getHint()

getHint(): string

Get a hint for this license activation. This can happen e.g. the remote status changed (revoked, expired) and we want to user show a notice for this. Can be `false` if none given.

Returns

string

getReceived()

getReceived(): false|array

Get the license activation we received from our remote license server. This returns also a result if you have deactivated your license already.

Returns

false|array

getReceivedClientProperties()

getReceivedClientProperties(): false|array

Get the received client properties from the last contact to our license server for this activation.

This returns also a result if you have deactivated your license already.

Returns

false|array

getReceivedClientProperty()

getReceivedClientProperty(string  $key,mixed  $default = false)

Get a received client property by key from the last contact to our license server for this activation.

This returns also a result if you have deactivated your license already.

Parameters

string $key
mixed $default

getCode()

getCode(): string|false

Get entered license code for this activation. Can be `false` if none given. If it is an empty string, the form got skipped through `#skip()`.

Returns

string|false

getInstallationType()

getInstallationType()

See `License#INSTALLATION_TYPE_*` constants.

getLicense()

getLicense()

Get license instance.