WooCommerce Code Reference

RemoteInboxNotificationsEngine
in package

Remote Inbox Notifications engine.

This goes through the specs and runs (creates admin notes) for those specs that are able to be triggered.

Table of Contents

STORED_STATE_OPTION_NAME  = 'wc_remote_inbox_notifications_stored_state'
WCA_UPDATED_OPTION_NAME  = 'wc_remote_inbox_notifications_wca_updated'
get_note_from_db()  : Note
Get the note. This is used to display localized note.
get_stored_state()  : object
Gets the stored state option, and does the initial set up if it doesn't already exist.
init()  : mixed
Initialize the engine.
on_admin_init()  : mixed
Init is continued via admin_init so that WC is loaded when the product query is used, otherwise the query generates a "0 = 1" in the WHERE condition and thus doesn't return any results.
on_init()  : mixed
An init hook is used here so that StoredStateSetupForProducts can set up a hook that gets triggered by action-scheduler - this is needed because the admin_init hook doesn't get triggered by WP Cron.
run()  : mixed
Go through the specs and run them.
run_on_deactivated_plugin()  : mixed
The deactivated_plugin hook happens before the option is updated (https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/plugin.php#L826) so this captures the deactivated plugin path and pushes it into the PluginsProvider.
run_on_woocommerce_admin_updated()  : mixed
Set an option indicating that WooCommerce Admin has just been updated, run the specs, then clear that option. This lets the WooCommerceAdminUpdatedRuleProcessor trigger on WCA update.
update_profile_option()  : mixed
This is triggered when the profile option is updated and if the profiler is being completed, triggers a run of the engine.
update_stored_state()  : mixed
Update the stored state option.

Constants

Methods

run_on_deactivated_plugin()

The deactivated_plugin hook happens before the option is updated (https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/plugin.php#L826) so this captures the deactivated plugin path and pushes it into the PluginsProvider.

public static run_on_deactivated_plugin(string $plugin) : mixed
Parameters
$plugin : string

Path to the plugin file relative to the plugins directory.

Return values
mixed

run_on_woocommerce_admin_updated()

Set an option indicating that WooCommerce Admin has just been updated, run the specs, then clear that option. This lets the WooCommerceAdminUpdatedRuleProcessor trigger on WCA update.

public static run_on_woocommerce_admin_updated() : mixed
Return values
mixed

update_profile_option()

This is triggered when the profile option is updated and if the profiler is being completed, triggers a run of the engine.

public static update_profile_option(mixed $old_value, mixed $new_value) : mixed
Parameters
$old_value : mixed

Old value.

$new_value : mixed

New value.

Return values
mixed