Properties

$instance

$instance : static

Instance value.

Type

static — Default null

Methods

__construct()

__construct() 

Method __construct.

count_child_sites()

count_child_sites() 

Method count_child_sites().

get_timestamp()

get_timestamp(integer  $timestamp = false) : float|integer

Get timestamp.

Parameters

integer $timestamp

Holds Timestamp.

Returns

float|integer —

Return GMT offset.

format_timestamp()

format_timestamp(integer  $timestamp, boolean  $gmt = false) : string

Format timestamp.

Parameters

integer $timestamp

Holds Timestamp.

boolean $gmt

Whether to set as General mountain time. Default: FALSE.

Returns

string —

Return Timestamp.

format_datestamp()

format_datestamp(integer  $timestamp, boolean  $gmt = false) : string

Format datestamp.

Parameters

integer $timestamp

Holds Timestamp.

boolean $gmt

Whether to set as General mountain time. Default: FALSE.

Returns

string —

Return Timestamp.

map_fields()

map_fields(mixed  $website, mixed  $keys, boolean  $object_output = false) : object

Method map_fields()

Map Site.

Parameters

mixed $website

Website to map.

mixed $keys

Keys to map.

boolean $object_output

Output format array|object.

Returns

object —

$outputSite Mapped site.

array_sort()

array_sort(mixed  $arr, mixed  $key, string  $sort_flag = SORT_STRING) 

Method array_sort()

Sort given array by given flags.

Parameters

mixed $arr

Array to sort.

mixed $key

Array key.

string $sort_flag

Flags to sort by. Default = SORT_STRING.

log_info()

log_info(string  $message) 

Debugging log info.

Sets logging for debugging purpose

Parameters

string $message

Log info message.

log_debug()

log_debug(string  $message, integer  $log_color = 3) 

Debugging log.

Sets logging for debugging purpose.

Parameters

string $message

Log debug message.

integer $log_color

Log color.

save_lasttime_backup()

save_lasttime_backup(integer  $site_id, integer  $available_backups, string  $backup_api) : mixed

Method save_lasttime_backup().

Parameters

integer $site_id

site id.

integer $available_backups

Available backups.

string $backup_api

API backups provider.

Returns

mixed

show_mainwp_message()

show_mainwp_message(string  $notice_id) : boolean

Show Info Messages

Check whenther or not to show the MainWP Message.

Parameters

string $notice_id

Notice ID.

Returns

boolean —

False if hidden, true to show.

human_filesize()

human_filesize(mixed  $bytes, integer  $decimals = 2) : string

Method human_filesize()

Convert to human readable file size format, (B|kB|MB|GB|TB|PB|EB|ZB|YB).

Parameters

mixed $bytes

File in bytes.

integer $decimals

Number of decimals to output.

Returns

string —

Human readable file size.

color_code()

color_code(integer  $value) : string

Get Color Code

Returns CSS class to use correct color for the element.

Parameters

integer $value

value.

Returns

string —

CSS class.

update_option()

update_option(mixed  $option_name, mixed  $option_value) : \MainWP\Dashboard\Module\ApiBackups\(boolean)

Method update_option()

Update option.

Parameters

mixed $option_name

Option name.

mixed $option_value

Option value.

Returns

\MainWP\Dashboard\Module\ApiBackups\(boolean) —

False if value was not updated and true if value was updated.

encrypt_api_keys()

encrypt_api_keys(string  $data, integer  $siteid = false, string  $file_key = false, string  $service_name = '') 

Method encrypt_api_keys

Parameters

string $data

data.

integer $siteid

site id.

string $file_key

file key.

string $service_name

service name.

Encrypt data.

decrypt_api_keys()

decrypt_api_keys(mixed  $encrypted_data, string  $def_val = '') 

Method decrypt_api_keys

Parameters

mixed $encrypted_data

encrypted data.

string $def_val

default data.

get_api_key()

get_api_key(string  $name, string  $def_val = '') 

Method get_compatible_site_api_key

Encrypt data.

Parameters

string $name

name data.

string $def_val

default data.

update_api_key()

update_api_key(string  $name, string  $value) 

Method update_compatible_site_api_key

Encrypt data.

Parameters

string $name

name data.

string $value

value data.

get_child_api_key()

get_child_api_key(integer  $website_id, string  $name, string  $def_val = '') 

Method get child site key.

Encrypt data.

Parameters

integer $website_id

name data.

string $name

name data.

string $def_val

default data.

update_child_api_key()

update_child_api_key(integer  $website_id, string  $name, string  $value) 

Method update child api key.

Encrypt data.

Parameters

integer $website_id

name data.

string $name

name data.

string $value

value data.