\MainWP\ChildMainWP_Child_Pagespeed

Class MainWP_Child_Pagespeed

MainWP Page Speed extension handler.

Summary

Methods
Properties
Constants
instance()
__construct()
sync_others_data()
child_deactivation()
init()
hide_plugin()
hide_menu()
init_cron()
pagespeed_cron_check()
action()
save_settings()
delete_data()
set_showhide()
check_pages()
do_check_pages()
get_sync_data()
cal_pagespeed_data()
get_filter_options()
$instance
$is_plugin_installed
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

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 Google Pagespeed Insights plugin is installed on the child site.

Type

boolean — If Google Pagespeed Insights intalled, return true, if not, return false.

Methods

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

__construct()

__construct() : void

MainWP_Child_Pagespeed constructor.

Run any time class is called.

sync_others_data()

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

Method sync_others_data()

Sync the Google Pagespeed Insights plugin data.

Parameters

array $information

Array containing the sync information.

array $data

Array containing the Google Pagespeed Insights plugin data to be synced.

Returns

array —

$information Array containing the sync information.

child_deactivation()

child_deactivation() 

Method child_deactivation()

Unschedule scheduled events on MainWP Child plugin deactivation.

init()

init() : void

Method init()

Initiate action hooks.

hide_plugin()

hide_plugin(array  $plugins) : array

Method hide_plugin()

Remove the Google Pagespeed Insights 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 Google Pagespeed Insights plugin.

hide_menu()

hide_menu() 

Method hide_menu()

Remove the Google Pagespeed Insights menu item when the plugin is hidden.

init_cron()

init_cron() 

Method init_cron()

Schedule daily Page Speed checks.

pagespeed_cron_check()

pagespeed_cron_check() 

Method pagespeed_cron_check()

Schedule single Page Speed check event.

save_settings()

save_settings() : array

Method save_settings()

Save the plugin settings.

Returns

array —

Action result.

delete_data()

delete_data(string  $what) 

Method delete_data()

Delete reports or all plugin data.

Parameters

string $what

Contains information about what to delete, just reports or everything.

set_showhide()

set_showhide() : array

Method set_showhide()

Hide or unhide the Google Pagespeed Insights plugin.

Returns

array —

Action result.

check_pages()

check_pages() : array

Method check_pages()

Initiate the check pages page speed.

Returns

array —

Action result.

do_check_pages()

do_check_pages(boolean  $forceRecheck = false) : array

Method do_check_pages()

Check or force re-check pages page speed.

Parameters

boolean $forceRecheck

If true, force recheck process, if false, just regular check.

Returns

array —

Action result.

get_sync_data()

get_sync_data(string  $strategy = '') : array

Method get_sync_data()

Get the Google Pagespeed Insights plugin data and store it in the sync request.

Parameters

string $strategy

Contains the selected strategy (desktop, mobile or both).

Returns

array —

Action result.

cal_pagespeed_data()

cal_pagespeed_data(string  $strategy) : array

Method cal_pagespeed_data()

Calculate page speed scores.

Parameters

string $strategy

Contains the selected strategy (desktop, mobile or both).

Returns

array —

Array containing data including last modified timespamp, average score and number of pages.

get_filter_options()

get_filter_options(string  $restrict_type = 'all') : array

Method get_filter_options()

Parameters

string $restrict_type

Contains the restricted types.

Returns

array —

Array containing the list of item types to check (posts, pages, categories,...).