Properties

$instance

$instance : mixed

Public static variable to hold the single instance of the class.

Type

mixed — Default null

$is_plugin_installed

$is_plugin_installed : boolean

Public variable to hold the infomration if the WP Rocket plugin is installed on the child site.

Type

boolean — If WP Rocket intalled, return true, if not, return false.

Methods

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

__construct()

__construct() 

MainWP_Child_WP_Rocket constructor.

Run any time class is called.

init()

init() : void

Method init()

Initiate action hooks.

get_rocket_default_options()

get_rocket_default_options() : array

Method get_rocket_default_options()

WP Rocket plugin settings default options.

Returns

array —

Default options.

sync_others_data()

sync_others_data(array  $information, array  $data = array()) : array

Method sync_others_data()

Sync the WP Rocket plugin settings.

Parameters

array $information

Array containing the sync information.

array $data

Array containing the WP Rocekt plugin data to be synced.

Returns

array —

$information Array containing the sync information.

remove_notices()

remove_notices() 

Method remove_notices()

Remove admin notices thrown by the WP Rocket plugin when the plugin is hidden.

remove_filters_with_method_name()

remove_filters_with_method_name(string  $hook_name = '', string  $method_name = '', integer  $priority) : boolean

Method remove_filters_with_method_name()

Remove filters with method name.

Parameters

string $hook_name

Contains the hook name.

string $method_name

Contains the method name.

integer $priority

Contains the priority value.

Returns

boolean —

Return false if filtr is not set.

wp_before_admin_bar_render()

wp_before_admin_bar_render() 

Method wp_before_admin_bar_render()

Remove the WP Rocket admin bar node when the plugin is hidden.

hide_update_notice()

hide_update_notice(array  $slugs) : array

Method hide_update_notice()

Remove the WP Rocket plugin update notice when the plugin is hidden.

Parameters

array $slugs

Array containing installed plugins slugs.

Returns

array —

$slugs Array containing installed plugins slugs.

remove_update_nag()

remove_update_nag(object  $value) : object

Method remove_update_nag()

Remove the WP Rocket plugin update notice when the plugin is hidden.

Parameters

object $value

Object containing update information.

Returns

object —

$value Object containing update information.

is_activated()

is_activated() : boolean

Method is_activated()

Check if the WP Rocket pulgin is activated.

Returns

boolean —

If the WP Rocket pulgin is active, return true, if not, return false.

remove_menu()

remove_menu() 

Method remove_menu()

Remove the WP Rocket menu item when the plugin is hidden.

all_plugins()

all_plugins(array  $plugins) : array

Method all_plugins()

Remove the WP Rocket plugin from the list of all plugins when the plugin is hidden.

Parameters

array $plugins

Array containing all installed plugins.

Returns

array —

$plugins Array containing all installed plugins without the WP Rocket.

set_showhide()

set_showhide() : array

Method set_showhide()

Hide or unhide the WP Rocket plugin.

Returns

array —

Action result.

do_admin_post_rocket_purge_opcache()

do_admin_post_rocket_purge_opcache() : array

Method do_admin_post_rocket_purge_opcache()

Do admin post to purge opcache.

Returns

array —

Action result.

purge_cloudflare()

purge_cloudflare() : array

Method purge_cloudflare()

Purge the Cloudflare cache.

Returns

array —

Action result.

purge_cache_all()

purge_cache_all() : array

Method purge_cache_all()

Purge all cache.

Returns

array —

Action result.

preload_cache()

preload_cache() : array

Method preload_cache()

Preload cache.

Throws

\Exception

Error message.

Returns

array —

Action result.

generate_critical_css()

generate_critical_css() : array

Method generate_critical_css()

Generate critical CSS.

Throws

\Exception

Error message.

Returns

array —

Action result.

save_settings()

save_settings() : array

Method save_settings()

Save the plugin settings.

Returns

array —

Action result.

optimize_database()

optimize_database() : array

Method optimize_database()

Optimize database tables.

Throws

\Exception

Error message.

Returns

array —

Action result

get_optimize_info()

get_optimize_info() : array

Method get_optimize_info()

Get the optimization information.

Throws

\Exception

Error message.

Returns

array —

Action result and optimization information.

load_existing_settings()

load_existing_settings() : array

Method load_existing_settings()

Load existing settings.

Returns

array —

Action result and settings options.