Properties

$is_plugin_installed

$is_plugin_installed : boolean

Public variable to state if supported plugin is installed on the child site.

Type

boolean — If supported plugin is installed, return true, if not, return false.

$instance

$instance : mixed

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

Type

mixed — Default null

Methods

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

__construct()

__construct() 

MainWP_Child_Cache_Purge constructor.

Run any time class is called.

Add filter to sync data to & from the MainWP Dashboard. Add action to check for supported cache plugins.

sync_others_data()

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

Method sync_others_data()

Sync data to & from the MainWP Dashboard.

Parameters

array $information

Array containing the data to be sent to the Dashboard.

array $data

Array containing the data sent from the Dashboard; to be saved to the Child Site.

Returns

array —

$information Array containing the data to be sent to the Dashboard.

check_cache_solution()

check_cache_solution() : void

Check which supported plugin is installed, Set wp_option 'mainwp_cache_control_cache_solution' to active plugin, and set public variable 'is_plugin_installed' to TRUE.

If a supported plugin is not installed check to see if CloudFlair solution is enabled.

auto_purge_cache()

auto_purge_cache(string  $bulk = '') : void

Auto purge cache based on which cache plugin is installed & activated.

Parameters

string $bulk

Bulk update distinguisher.

purge_result()

purge_result(string  $message, string  $action) : array

Build purge results array for return to dashboard.

Parameters

string $message

Result message.

string $action

Action result.

Returns

array —

Purge results array.

swis_performance_auto_purge_cache()

swis_performance_auto_purge_cache() : array

Purge Swis Performance plugin cache.

Returns

array —

Purge results array.

seraphinite_auto_purge_cache()

seraphinite_auto_purge_cache() : array

Purge Seraphinite Accelerator plugin cache.

Returns

array —

Purge results array.

cdn_cache_plugin_auto_purge_cache()

cdn_cache_plugin_auto_purge_cache() : array

Purge CDN Cache Plugin cache.

Returns

array —

Purge results array.

comet_cache_auto_purge_cache()

comet_cache_auto_purge_cache() : array

Purge Comet Cache.

Returns

array —

Purge results array.

wp_optimize_auto_purge_cache()

wp_optimize_auto_purge_cache() : array

Purge WP Optimize cache.

Returns

array —

Purge results array.

wp_optimize_preload_cache()

wp_optimize_preload_cache() : boolean

Preload WP Optimize cache after purge.

Returns

boolean —

True if successful, false if not.

wp_optimize_activated_check()

wp_optimize_activated_check() 

Check if WP Optimize is installed and cache is enabled.

wp_optimize_purge_cache()

wp_optimize_purge_cache() : boolean

Preload WP Optimize cache after purge.

Returns

boolean —

True if successful, false if not.

wp_super_cache_auto_purge_cache()

wp_super_cache_auto_purge_cache() : array

Purge WP Super Cache.

Returns

array —

Purge results array.

flyingpress_auto_purge_cache()

flyingpress_auto_purge_cache() : array

Purge FlyingPress cache.

Returns

array —

Purge results array.

autoptimize_auto_purge_cache()

autoptimize_auto_purge_cache() : array

Purge Autoptimize cache.

Returns

array —

Purge results array.

nitropack_auto_purge_cache()

nitropack_auto_purge_cache() : array

Purge Nitropack cache.

Nitropack_purge($url = NULL, $tag = NULL, $reason = NULL);

In case you want to do a full purge, you must leave the values for URL and Tag empty. In case you want to create a targeted purge you can replace them with the URL or tag of the page.

Returns

array —

Purge results array.

nginx_helper_auto_purge_cache()

nginx_helper_auto_purge_cache() : array

Purge Nginx Helper cache.

Returns

array —

Purge results array.

wp_hummingbird_auto_purge_cache()

wp_hummingbird_auto_purge_cache() : array

Purge WP Hummingbird cache.

Returns

array —

Purge results array.

cache_enabler_auto_purge_cache()

cache_enabler_auto_purge_cache() : array

Purge Cache Enabler cache.

Returns

array —

Purge results array.

w3_total_cache_auto_purge_cache()

w3_total_cache_auto_purge_cache() : array

Purge W3 Total Cache.

Returns

array —

Purge results array.

wp_fastest_cache_auto_purge_cache()

wp_fastest_cache_auto_purge_cache() : array

Purge WP Fastest Cache.

Returns

array —

Purge results array.

swift_performance_lite_auto_purge_cache()

swift_performance_lite_auto_purge_cache() : array

Purge Swift Performance Lite Cache.

Returns

array —

Purge results array.

swift_performance_auto_purge_cache()

swift_performance_auto_purge_cache() : array

Purge Swift Performance Cache.

Returns

array —

Purge results array.

sitegrounds_optimizer_auto_purge_cache()

sitegrounds_optimizer_auto_purge_cache() : array

Purge SiteGrounds Optimiser Cache.

Returns

array —

Purge results array.

cloudflair_auto_purge_cache()

cloudflair_auto_purge_cache() : array

Purge Cloudflair Cache.

Returns

array —

Purge results array.

litespeed_auto_purge_cache()

litespeed_auto_purge_cache() : array

Purge LiteSpeed Cache.

Returns

array —

Purge results array.

breeze_auto_purge_cache()

breeze_auto_purge_cache() : array

Purge Breeze cache.

Returns

array —

Purge results array.

wprocket_auto_cache_purge()

wprocket_auto_cache_purge() : array

Purge WP-Rocket cache.

Returns

array —

Purge results array.

record_results()

record_results(array  $information) 

Record last Purge.

Create log file & Save in /Upload dir.

Parameters

array $information

Array containing the data to be sent to the Dashboard.

strip_subdomains()

strip_subdomains(string  $url) : string

Strip subdomains from a url.

Parameters

string $url

string The url to strip subdomains from.

Returns

string —

The url without subdomains (if any).