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 information if the WP Staging plugin is installed on the child site.

Type

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

Methods

instance()

instance() : \MainWP\Child\MainWP_Child_Staging|null

Create a public static instance of MainWP_Child_Staging.

Returns

\MainWP\Child\MainWP_Child_Staging|null

__construct()

__construct() 

MainWP_Child_Staging constructor.

Run any time class is called.

init()

init() 

Initiate actions & filters.

sync_others_data()

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

Sync others data.

Get an array of available clones of this Child Sites.

Parameters

array $information

Holder for available clones.

array $data

Array of existing clones.

Returns

array —

$information An array of available clones.

get_sync_data()

get_sync_data() : array

Fires off MainWP_Child_Staging::get_overview().

Returns

array —

An array of available clones.

set_showhide()

set_showhide() : array

Sets whether or not to hide the WP Staging Plugin.

Returns

array —

$information Action result.

save_settings()

save_settings() : array<mixed,string>

Save WP Staging settings.

Returns

array<mixed,string> —

Return 'Success'.

get_overview()

get_overview() : array

Get array of available clones.

Returns

array —

$return Action result.

get_scan()

get_scan() : array

Get WP Staging Jobs.

Returns

array —

$return Action result.

ajax_check_clone_name()

ajax_check_clone_name() : array|array<mixed,string>

Check if clone name already exists & it's length.

Returns

array|array<mixed,string> —

Action result array[status, message] or return 'success'.

ajax_start_clone()

ajax_start_clone() : false|string|void

Start clone via ajax.

Returns

false|string|void —

Return FALSE on failure, ajax response string on success, ELSE returns VOID.

ajax_clone_database()

ajax_clone_database() : mixed

Clone database via ajax.

Returns

mixed —

Action result.

ajax_prepare_directories()

ajax_prepare_directories() : mixed

Ajax Prepare Directories (get listing of files).

Returns

mixed —

Action result.

ajax_copy_files()

ajax_copy_files() : mixed

Ajax Clone Files.

Returns

mixed —

Action result.

ajax_replace_data()

ajax_replace_data() : mixed

Ajax Replace Data.

Returns

mixed —

Action result.

ajax_finish()

ajax_finish() : mixed

Ajax Finish

Returns

mixed —

$return Action result.

ajax_delete_confirmation()

ajax_delete_confirmation() : array

Ajax Delete Confirmation.

Returns

array —

$result Action result.

ajax_delete_clone()

ajax_delete_clone() : mixed

Ajax Delete clone.

Returns

mixed —

Action result.

ajax_cancel_clone()

ajax_cancel_clone() 

Ajax Cancel clone.

ajax_cancel_update()

ajax_cancel_update() : mixed

Ajax Cancel Update.

Returns

mixed —

Action result.

ajax_update_process()

ajax_update_process() : false|string|void

Ajax Update Process.

Returns

false|string|void —

Return FALSE on failure, ajax response string on success, ELSE returns VOID.

ajax_check_free_space()

ajax_check_free_space() : array|null

Ajax check for free disk space.

Returns

array|null —

Action result or null

has_free_disk_space()

has_free_disk_space() : array|null

Ajax check for free disk space.

Returns

array|null —

Action result or null

get_directory_size_incl_subdirs()

get_directory_size_incl_subdirs(string  $dir) : false|integer

Get size of directory & subdirectories.

Parameters

string $dir

Directory to size.

Returns

false|integer —

FALSE on failure, int $size Directory size,

format_size()

format_size(string  $bytes, integer  $precision = 2) : string

Format file size into human readable string.

Parameters

string $bytes

Original size of file.

integer $precision

Number of digits after the decimal point.

Returns

string —

Returned Size.

all_plugins()

all_plugins(array  $plugins) : mixed

Get list of all plugins except WPStaging.

Parameters

array $plugins

All installed plugins.

Returns

mixed —

Returned array of plugins without WPStaging included.

remove_menu()

remove_menu() 

Remove WPStaging WordPress Menu.

hide_update_notice()

hide_update_notice(array  $slugs) : mixed

Hide all admin update notices.

Parameters

array $slugs

WPStaging plugin slug.

Returns

mixed —

Returned $slugs.

remove_update_nag()

remove_update_nag(array  $value) : mixed

Remove WPStaging update Nag message.

Parameters

array $value

WPStaging slug.

Returns

mixed —

$value Response array.