Store Locator Plus®

SLP_AddOns extends SLPlus_BaseClass_Object
in package

Add On Manager

Table of Contents

Properties

$available  : array<string|int, mixed>
$available  : mixed
$instances  : array<string|int, SLP_BaseClass_Addon>
$instances  : mixed
$list  : SLP_AddOn
$list  : mixed
$network_notified  : bool
$network_notified  : mixed
$premier_subscription_error  : mixed
$premier_subscription_valid  : bool
$recommended_upgrades  : array<string|int, string>
$recommended_upgrades  : mixed
$slplus  : SLPlus
$upgrade_paths  : array<string|int, mixed>
$upgrades_already_recommended  : array<string|int, string>
$uses_slplus  : bool
$wpdk_url  : string
$slplus  : mixed
$uses_slplus  : mixed
$premier_subscription_valid  : mixed
$upgrade_paths  : mixed
$upgrades_already_recommended  : mixed
$wpdk_url  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
activate_global_ajax_hooks()  : mixed
Activate global AJAX hooks to provide hooks/filters that may not run in AJAX.
get()  : mixed
Get the add on (SLP_AddOn object)
get_installed_version()  : string
Get the most recently installed version, does not have to be active currently.
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
get_product_url()  : string
Return the product URL of the specified registered/active add-on pack.
get_recommendations_text()  : string
Create the recommended upgrades notification text.
get_versions()  : array<string|int, mixed>
Fetched installed and active version info.
is_premier_subscription_valid()  : bool
Is the premier subscription valid?
network_notice()  : mixed
Network notice.
recommend_upgrade()  : string
Recommend an add-on for upgrading a legacy plugin.
register()  : mixed
Register an add on object to the manager class.
set_properties()  : mixed
Set our properties.
was_active()  : bool
Was the specified SLP add on ever active?
initialize()  : mixed
Do these things when this object is invoked. Override in your class.
create_string_for_recommendations()  : string
Return an upgrade recommended notice.
create_string_product_link()  : string
Given the text to display and the leaf (end) portion of the product URL, return a full HTML link to the product page.
get_premier_license_status()  : string
Get Premier License Status
make_available()  : mixed
Add a sanctioned add on pack to the available add ons array.
na_multisite_premier_license_is_valid()  : mixed
Check Premier License for NA Multisite
saving_new_subscription()  : mixed
Check to make sure we are not saving a new subscription first.
set_upgrade_paths()  : mixed
Set the add-on upgrade paths.
valid_license_format()  : bool
Is the license format valid.

Properties

$available

public array<string|int, mixed> $available

An array of all the available add-on packs we know about. $this->slplus->add_ons->available['slp-pro']['link']

$instances

public array<string|int, SLP_BaseClass_Addon> $instances

The add on objects in a named array. The slug is the key. $instances['slp-pro'] => \SLPPro instance.

$network_notified

public bool $network_notified

Network notified?

$network_notified

public mixed $network_notified = \false

$premier_subscription_error

public mixed $premier_subscription_error = \null

$premier_subscription_valid read-only

public bool $premier_subscription_valid

Is the subscription valid?

public array<string|int, string> $recommended_upgrades

Array of add-on slugs that have recommended upgrades.

public mixed $recommended_upgrades = array()

$upgrade_paths

public array<string|int, mixed> $upgrade_paths

key = the add-on slug to be upgraded, value = the slug for the add-on to upgrade to.

public array<string|int, string> $upgrades_already_recommended

Array of add-on slugs for those we already told the user about.

$uses_slplus

public bool $uses_slplus

Set to true (default) if the object needs access to the SLPlus plugin object.

$premier_subscription_valid

private mixed $premier_subscription_valid

$upgrade_paths

private mixed $upgrade_paths = array()
private mixed $upgrades_already_recommended = array()

$wpdk_url

private mixed $wpdk_url = 'https://wordpress.storelocatorplus.com/wp-json/wp-dev-kit/v1/'

Methods

__construct()

public __construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

activate_global_ajax_hooks()

Activate global AJAX hooks to provide hooks/filters that may not run in AJAX.

public activate_global_ajax_hooks() : mixed

get()

Get the add on (SLP_AddOn object)

public get(string $slug[, string|null $property = null ]) : mixed
Parameters
$slug : string
$property : string|null = null

if provided will try to get this property

Return values
mixed

Returns the AddOn object if no property is specified, otherwise it returns the property value

get_installed_version()

Get the most recently installed version, does not have to be active currently.

public get_installed_version(string $slug) : string
Parameters
$slug : string
Return values
string

get_instance()

Return an instance of the object which is also registered to the slplus global less the SLP_ part.

public static get_instance([bool $no_global = false ][, mixed $params = array() ]) : SLPlus_BaseClass_Object

TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object

Parameters
$no_global : bool = false

set to true to skip assigning object to SLP global as a property.

$params : mixed = array()

object init params

Return values
SLPlus_BaseClass_Object

get_product_url()

Return the product URL of the specified registered/active add-on pack.

public get_product_url(string $slug) : string
Parameters
$slug : string
Return values
string

get_recommendations_text()

Create the recommended upgrades notification text.

public get_recommendations_text() : string
Return values
string

get_versions()

Fetched installed and active version info.

public get_versions() : array<string|int, mixed>
Return values
array<string|int, mixed>

is_premier_subscription_valid()

Is the premier subscription valid?

public is_premier_subscription_valid() : bool
Return values
bool

network_notice()

Network notice.

public network_notice() : mixed

recommend_upgrade()

Recommend an add-on for upgrading a legacy plugin.

public recommend_upgrade(string $slug) : string
Parameters
$slug : string
Return values
string

the slug of the add-on to upgrade to.

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

was_active()

Was the specified SLP add on ever active?

public was_active(string $slug) : bool
Parameters
$slug : string

the add on slug

Return values
bool

true if the add on appears to have ever been active

initialize()

Do these things when this object is invoked. Override in your class.

protected initialize() : mixed

create_string_for_recommendations()

Return an upgrade recommended notice.

private create_string_for_recommendations(string $slug) : string
Parameters
$slug : string

The slug for the add-on needed an upgrade.

Return values
string

Given the text to display and the leaf (end) portion of the product URL, return a full HTML link to the product page.

private create_string_product_link(string $text, string $addon_slug) : string
Parameters
$text : string
$addon_slug : string
Return values
string

get_premier_license_status()

Get Premier License Status

private get_premier_license_status([mixed $uid = null ][, mixed $sid = null ]) : string

Use transients so we only check once per week.

Parameters
$uid : mixed = null
$sid : mixed = null
Tags
params

string $uid

params

string $sid

Return values
string

make_available()

Add a sanctioned add on pack to the available add ons array.

private make_available(string $slug, string $name[, bool $active = false ][, SLP_BaseClass_Addon $instance = null ]) : mixed
Parameters
$slug : string
$name : string
$active : bool = false
$instance : SLP_BaseClass_Addon = null

na_multisite_premier_license_is_valid()

Check Premier License for NA Multisite

private na_multisite_premier_license_is_valid() : mixed

Use transients so we only check once per week.

saving_new_subscription()

Check to make sure we are not saving a new subscription first.

private saving_new_subscription() : mixed

set_upgrade_paths()

Set the add-on upgrade paths.

private set_upgrade_paths() : mixed

valid_license_format()

Is the license format valid.

private valid_license_format(mixed $uid, mixed $sid) : bool
Parameters
$uid : mixed
$sid : mixed
Return values
bool

        
On this page

Search results