Documentation

AbstractInitiator
in package

AbstractYes

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

Methods

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>

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|string

getPluginAssets()

Get the plugin's assets instance. It is need to enqueue scripts and styles.

public abstract getPluginAssets() : Assets
Return values
Assets

getPluginBase()

Get the plugin's base instance. It is needed so our initiator can access dynamically constants and configurations.

public abstract getPluginBase() : Base
Return values
Base

getPrivacyPolicy()

Get the link to the privacy policy.

public abstract getPrivacyPolicy() : string
Return values
string

getPrivacyProvider()

Get the privacy provider.

public getPrivacyProvider() : string
Return values
string

getProductAndVariant()

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
bool

isAutoUpdatesEnabled()

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
see
https://wordpress.org/support/wordpress-version/version-5-5/#security
see
https://developer.wordpress.org/reference/hooks/auto_update_type/
see
https://wordpress.org/support/article/configuring-automatic-background-updates/#plugin-theme-updates-via-filter
Return values
bool

isExternalUpdateEnabled()

Return `true` if you want to enable external updates instead of wordpress.org.

public abstract isExternalUpdateEnabled() : bool
Return values
bool

isLocalAnnouncementVisible()

Return `true` if you want to show a local announcement on the current page.

public isLocalAnnouncementVisible() : bool
Return values
bool

isMultisiteLicensed()

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
bool

isNewsletterEnabled()

Return `false` if you want to disable sending newsletter signup.

public isNewsletterEnabled() : bool
Return values
bool

isTelemetryEnabled()

Return `false` if you want to disable sending telemetry data.

public isTelemetryEnabled() : bool
Return values
bool

start()

Initialize all available things depending on the configuration.

public start() : mixed

        
On this page

Search results