WooCommerce Code Reference

Init extends RemoteSpecsEngine
in package

Marketing Recommendations engine.

This goes through the specs and gets marketing recommendations.

Table of Contents

MARKETING_CHANNEL_SUBCATEGORY_SLUG  = 'sales-channels'
Slug of the subcategory specifying marketing channels on the WooCommerce.com store.
MARKETING_EXTENSION_CATEGORY_SLUG  = 'marketing'
Slug of the category specifying marketing extensions on the WooCommerce.com store.
__construct()  : mixed
Constructor.
delete_specs_transient()  : mixed
Delete the specs transient.
get_recommended_marketing_channels()  : array<string|int, mixed>
Return only the recommended marketing channels from WooCommerce.com.
get_recommended_marketing_extensions_excluding_channels()  : array<string|int, mixed>
Return all recommended marketing extensions EXCEPT the marketing channels from WooCommerce.com.
get_recommended_plugins()  : array<string|int, mixed>
Load recommended plugins from WooCommerce.com
get_specs()  : mixed
Get specs or fetch remotely if they don't exist.
log_errors()  : mixed
Log errors.
object_to_array()  : array<string|int, mixed>
Convert an object to an array.
evaluate_specs()  : array<string|int, mixed>
Process specs.
is_marketing_channel_plugin()  : bool
Returns whether a plugin is a marketing channel.
is_marketing_plugin()  : bool
Returns whether a plugin is a marketing extension.

Constants

Methods

Return only the recommended marketing channels from WooCommerce.com.

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

Return all recommended marketing extensions EXCEPT the marketing channels from WooCommerce.com.

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

log_errors()

Log errors.

public static log_errors([array<string|int, mixed> $errors = array() ]) : mixed
Parameters
$errors : array<string|int, mixed> = array()

Array of errors from \Throwable interface.

Return values
mixed

object_to_array()

Convert an object to an array.

public static object_to_array(mixed $obj[, array<string|int, mixed> &$visited = array() ]) : array<string|int, mixed>

This is used to convert the specs to an array so that they can be returned by the API.

Parameters
$obj : mixed

Object to convert.

$visited : array<string|int, mixed> = array()

Reference to an array keeping track of all seen objects to detect circular references.

Return values
array<string|int, mixed>

evaluate_specs()

Process specs.

protected static evaluate_specs([array<string|int, mixed>|null $specs = null ]) : array<string|int, mixed>
Parameters
$specs : array<string|int, mixed>|null = null

Marketing recommendations spec array.

Return values
array<string|int, mixed>

is_marketing_channel_plugin()

Returns whether a plugin is a marketing channel.

protected static is_marketing_channel_plugin(array<string|int, mixed> $plugin_data) : bool
Parameters
$plugin_data : array<string|int, mixed>

The plugin properties returned by the API.

Return values
bool

is_marketing_plugin()

Returns whether a plugin is a marketing extension.

protected static is_marketing_plugin(array<string|int, mixed> $plugin_data) : bool
Parameters
$plugin_data : array<string|int, mixed>

The plugin properties returned by the API.

Return values
bool