Properties

$instance

$instance : mixed

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

Type

mixed — Default null

$filterFunction

$filterFunction : null

Class used to represent anonymous functions.

Type

null

Methods

get_class_name()

get_class_name() : string

Method get_class_name()

Get class name.

Returns

string —

CLASS Class name.

__construct()

__construct() 

MainWP_Child_Stats constructor.

Run any time class is called.

get_instance()

get_instance() : mixed

Method get_instance()

Create a public static instance.

Returns

mixed —

Class instance.

get_site_stats_no_auth()

get_site_stats_no_auth(array  $information = array()) 

Show stats without login. only allowed while no account is added yet.

Parameters

array $information

Child Site Stats.

default_option_active_plugins()

default_option_active_plugins(array  $values) : array

Check if ManageWP is installed.

Parameters

array $values

Active plugins.

Returns

array —

$values Active plugins array with managewp/init.php appended.

get_site_stats()

get_site_stats(array  $information = array(), boolean  $exit_done = true) : array

Get Child Site Stats.

Parameters

array $information

Holder for return array.

boolean $exit_done

Whether or not to exit the method. Default: true.

Returns

array —

$information Child Site Stats.

update_external_settings()

update_external_settings() 

Update options: mainwp_child_clone_sites, mainwp_child_siteid, mainwp_child_pluginDir.

get_total_file_size()

get_total_file_size(string  $directory = WP_CONTENT_DIR) : float|integer

Get total size of wp_content directory.

Parameters

string $directory

WordPress content directory.

Returns

float|integer —

Return $size or 0.

scan_dir()

scan_dir(string  $pDir, string  $pLvl) : array|null

Scan directory.

Parameters

string $pDir

Directory to scan.

string $pLvl

How deep to scan.

Returns

array|null —

$output|$files

int_scan_dir()

int_scan_dir(string  $dir) : array|boolean

Initiate directory scan.

Parameters

string $dir

Directory to scan.

Returns

array|boolean —

$out|FALSE Returns the entry name on success or FALSE on failure.

get_all_themes()

get_all_themes() 

Get all themes.

get_all_themes_int()

get_all_themes_int(string  $filter, string  $keyword = '', string  $status = '', boolean  $get_un_criteria = false) : array

Initiate get all themes.

Parameters

string $filter

Sites filter field.

string $keyword

Keyword Search field.

string $status

Active or Inactive filed.

boolean $get_un_criteria

Get criteria or un-criteria items.

Returns

array —

$rslt Returned themes results.

get_all_plugins()

get_all_plugins() 

Get all Plugins.

get_all_plugins_int()

get_all_plugins_int(string  $filter, string  $keyword = '', string  $status = '', boolean  $get_un_criteria = false) : array

Initiate get all plugins.

Parameters

string $filter

Sites filter field.

string $keyword

Keyword Search field.

string $status

Active or Inactive filed.

boolean $get_un_criteria

Get criteria or un-criteria items.

Returns

array —

$rslt Returned themes results.

multi_find_keywords()

multi_find_keywords(string  $name_str, array  $words = array()) : boolean

Find for multi keywords.

Parameters

string $name_str

string find on.

array $words

Array string input.

Returns

boolean —

True|False.

get_health_check_site_status()

get_health_check_site_status() : array

Get WP Site Health issues.

Returns

array —

$issue_counts Returned issues.

stats_before_sync_data()

stats_before_sync_data(array  $information, array  $others_data) 

Process before sync data.

Parameters

array $information

Child Site Stats array.

array $others_data

Others sync data.

stats_others_data()

stats_others_data(array  $information) 

Get other stats data.

Parameters

array $information

Child Site Stats array.

stats_translation_updates()

stats_translation_updates() : array

Translation update stats.

Returns

array —

$results Returned results.

stats_theme_update()

stats_theme_update(array  $premiumThemes) : array

Premium theme update stats.

Parameters

array $premiumThemes

Array of premium themes.

Returns

array —

$results Array of premium theme slugs.

stats_wp_update()

stats_wp_update() : string|boolean|null

Get WordPress update stats.

Returns

string|boolean|null —

Return TRUE if the relationship is the one specified by the operator <=, FALSE otherwise, null by default.

check_premium_updates()

check_premium_updates(array  $information, array  $premiumPlugins, array  $premiumThemes) 

Check for premium updates.

Parameters

array $information

Child Site stats.

array $premiumPlugins

Active premium plugins.

array $premiumThemes

Active premium themes.

stats_plugin_update()

stats_plugin_update(array  $premiumPlugins) : array

Premium plugin update stats.

Parameters

array $premiumPlugins

Active premium plugins.

Returns

array —

$results Array of premium plugin slugs.

stats_get_categories()

stats_get_categories() : array

Ger category stats.

Returns

array —

$categories Available Child Site Categories.

stats_get_total_size()

stats_get_total_size() : float|integer|null

Get total size of Child Site installation.

Returns

float|integer|null —

$total Total file size or 0 or null.

get_recent_number()

get_recent_number() : integer

Get recent number.

Returns

integer —

$recent_number Recent number.