AbstractInitiator
in package
This is the main class. You need to create an own class extending from this one to initiate the client. The configuration is done by an abstract schema. That means, all configurations need to be implemented through methods.
Table of Contents
Properties
- $pluginUpdate : PluginUpdate
- Plugin update instance.
Methods
- buildTelemetryData() : mixed
- Allows you to build telemetry data.
- formAdditionalCheckboxes() : array<string|int, mixed>
- Allows to configure additional checkboxes in the license activation form.
- getAccountSiteUrl() : mixed
- getHost() : mixed
- getLicenseKeyHelpUrl() : mixed
- getMigrationOption() : null|string
- Get the option value if we want to migrate a plugin. Please override with your implementation and simply return the "old" used license key.
- getPluginAssets() : Assets
- Get the plugin's assets instance. It is need to enqueue scripts and styles.
- getPluginBase() : Base
- Get the plugin's base instance. It is needed so our initiator can access dynamically constants and configurations.
- getPluginFile() : mixed
- getPluginName() : mixed
- getPluginSlug() : mixed
- getPluginUpdater() : PluginUpdate
- Get the plugin updater instance.
- getPluginVersion() : mixed
- getPrivacyPolicy() : string
- Get the link to the privacy policy.
- getPrivacyProvider() : string
- Get the privacy provider.
- getProductAndVariant() : array<string|int, int>
- Get the plugin's product ID and product variant ID.
- isAdminNoticeLicenseVisible() : bool
- Return `true` if you want to show a notice in the current admin page when the plugin is not fully licensed. There are multiple texts depending on the day since the first initialization. See also `PluginUpdateView#getAdminNoticeLicenseText`.
- isAutoUpdatesEnabled() : bool
- Returns `true` if the current WordPress installations allows automatic updates for this plugin.
- isExternalUpdateEnabled() : bool
- Return `true` if you want to enable external updates instead of wordpress.org.
- isLocalAnnouncementVisible() : bool
- Return `true` if you want to show a local announcement on the current page.
- isMultisiteLicensed() : bool
- Return `false` if you want to disable license per site in multisite.
- isNewsletterEnabled() : bool
- Return `false` if you want to disable sending newsletter signup.
- isTelemetryEnabled() : bool
- Return `false` if you want to disable sending telemetry data.
- start() : mixed
- Initialize all available things depending on the configuration.
Properties
$pluginUpdate
Plugin update instance.
private
PluginUpdate
$pluginUpdate
Methods
buildTelemetryData()
Allows you to build telemetry data.
public
buildTelemetryData(TelemetryData $telemetry) : mixed
Parameters
- $telemetry : TelemetryData
formAdditionalCheckboxes()
Allows to configure additional checkboxes in the license activation form.
public
formAdditionalCheckboxes() : array<string|int, mixed>
It should return an array in form of:
[
[
'id' => 'my-checkbox',
'text' => 'This is my awesome checkbox',
'stateFn' => function($state) {
// Do anything with $state
// You can also return `WP_Error`
}
]
]
Return values
array<string|int, mixed>getAccountSiteUrl()
public
getAccountSiteUrl() : mixed
getHost()
public
getHost() : mixed
getLicenseKeyHelpUrl()
public
getLicenseKeyHelpUrl() : mixed
getMigrationOption()
Get the option value if we want to migrate a plugin. Please override with your implementation and simply return the "old" used license key.
public
getMigrationOption() : null|string
Return values
null|stringgetPluginAssets()
Get the plugin's assets instance. It is need to enqueue scripts and styles.
public
abstract getPluginAssets() : Assets
Return values
AssetsgetPluginBase()
Get the plugin's base instance. It is needed so our initiator can access dynamically constants and configurations.
public
abstract getPluginBase() : Base
Return values
BasegetPluginFile()
public
getPluginFile() : mixed
getPluginName()
public
getPluginName() : mixed
getPluginSlug()
public
getPluginSlug() : mixed
getPluginUpdater()
Get the plugin updater instance.
public
getPluginUpdater() : PluginUpdate
Return values
PluginUpdategetPluginVersion()
public
getPluginVersion() : mixed
getPrivacyPolicy()
Get the link to the privacy policy.
public
abstract getPrivacyPolicy() : string
Return values
stringgetPrivacyProvider()
Get the privacy provider.
public
getPrivacyProvider() : string
Return values
stringgetProductAndVariant()
Get the plugin's product ID and product variant ID.
public
abstract getProductAndVariant() : array<string|int, int>
Return values
array<string|int, int>isAdminNoticeLicenseVisible()
Return `true` if you want to show a notice in the current admin page when the plugin is not fully licensed. There are multiple texts depending on the day since the first initialization. See also `PluginUpdateView#getAdminNoticeLicenseText`.
public
isAdminNoticeLicenseVisible() : bool
Return values
boolisAutoUpdatesEnabled()
Returns `true` if the current WordPress installations allows automatic updates for this plugin.
public
isAutoUpdatesEnabled() : bool
Returns false
if the current plugin is already enabled for auto updates.
Attention: We have implemented to only update minor and patch versions, no major versions!
Tags
Return values
boolisExternalUpdateEnabled()
Return `true` if you want to enable external updates instead of wordpress.org.
public
abstract isExternalUpdateEnabled() : bool
Return values
boolisLocalAnnouncementVisible()
Return `true` if you want to show a local announcement on the current page.
public
isLocalAnnouncementVisible() : bool
Return values
boolisMultisiteLicensed()
Return `false` if you want to disable license per site in multisite.
public
isMultisiteLicensed() : bool
For wordpress.org plugins (free) the multisite-license is disabled.
Return values
boolisNewsletterEnabled()
Return `false` if you want to disable sending newsletter signup.
public
isNewsletterEnabled() : bool
Return values
boolisTelemetryEnabled()
Return `false` if you want to disable sending telemetry data.
public
isTelemetryEnabled() : bool
Return values
boolstart()
Initialize all available things depending on the configuration.
public
start() : mixed