Properties

$enabled_wp_seo

$enabled_wp_seo : boolean

Yoast SEO is enabled return true else return null.

Type

boolean — If Yoast SEO is enabled return true else return null.

$last_deactivated_alerts

$last_deactivated_alerts : mixed

Private static variable.

Type

mixed — Default null

$disabled_functions

$disabled_functions : string

Store the disabled php functions.

Type

string — disabled php functions.

$instance

$instance : mixed

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

Type

mixed — Default null

Methods

get_class_name()

get_class_name() : object

Method get_class_name()

Get Class Name.

Returns

object —

CLASS

starts_with()

starts_with(mixed  $haystack, mixed  $needle) : mixed

Method starts_with()

Start of Stack Trace.

Parameters

mixed $haystack

The full stack.

mixed $needle

The function that is throwing the error.

Returns

mixed —

Needle in the Haystack.

ends_with()

ends_with(mixed  $haystack, mixed  $needle) : boolean

Method ends_with()

End of Stack Trace.

Parameters

mixed $haystack

Haystack parameter.

mixed $needle

Needle parameter.

Returns

boolean

get_nice_url()

get_nice_url(string  $pUrl, boolean  $showHttp = false) : string

Method get_nice_url()

Grab url.

Parameters

string $pUrl

Website URL.

boolean $showHttp

Show HTTP.

Returns

string —

$url.

is_domain_valid()

is_domain_valid(mixed  $url) : boolean

Method is_domain_valid()

Check $url against FILTER_VALIDATE_URL.

Parameters

mixed $url

Domain to check.

Returns

boolean —

True|False.

ctype_digit()

ctype_digit(mixed  $str) : boolean

Method ctype_digit()

Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.

Parameters

mixed $str

String to check.

Returns

boolean —

Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.

sortmulti()

sortmulti(mixed  $arr, mixed  $index, mixed  $order, boolean  $natsort = false, boolean  $case_sensitive = false) : array

Method sortmulti()

Sort the given array, Acending, Decending or by Natural Order.

Parameters

mixed $arr

Array to sort.

mixed $index

Index of array.

mixed $order

Acending or Decending order.

boolean $natsort

Sort an array using a "natural order" algorithm. Default: false.

boolean $case_sensitive

If case sensitive return true else return false. Default: false.

Returns

array —

$sorted Return the sorted array.

get_sub_array_having()

get_sub_array_having(mixed  $arr, mixed  $index, mixed  $value) 

Method get_sub_array_having()

Get sub array.

Parameters

mixed $arr

Array to traverse.

mixed $index

Index of array.

mixed $value

Array values.

void array $output Sub array.

trim_slashes()

trim_slashes(mixed  $elem) : string

Method trim_slashes()

Trim stashes from element.

Parameters

mixed $elem

Element to trim.

Returns

string —

Return string with no slashes.

sanitize()

sanitize(mixed  $str) : string

Method sanitize()

Sanitize given string.

Parameters

mixed $str

String to sanitize.

Returns

string —

Sanitized string.

sanitize_attr_slug()

sanitize_attr_slug(mixed  $str) : string

Method sanitize_alphanumeric()

Sanitize given string.

Parameters

mixed $str

String to sanitize.

Returns

string —

Sanitized string.

end_session()

end_session() : void

Method end_session()

End a session.

get_timestamp()

get_timestamp(mixed  $timestamp = false) : string

Method get_timestamp()

Get time stamp in gmt_offset.

Parameters

mixed $timestamp

Time stamp to convert.

Returns

string —

Time stamp in general mountain time offset.

date()

date(mixed  $format) : string

Method date()

Show date in given format.

Parameters

mixed $format

Format to display date in.

Returns

string —

Date.

format_timestamp()

format_timestamp(mixed  $timestamp) : string

Method format_timestamp()

Format the given timestamp.

Parameters

mixed $timestamp

Timestamp to format.

Returns

string —

Formatted timestamp.

format_date()

format_date(mixed  $timestamp) : string

Method format_timestamp()

Format the given timestamp.

Parameters

mixed $timestamp

Timestamp to format.

Returns

string —

Formatted timestamp.

format_duration_time()

format_duration_time(float  $time) : mixed

Format duration time to show.

Parameters

float $time

timestamp.

Returns

mixed —

result.

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.

map_fields()

map_fields(mixed  $data, mixed  $keys, boolean  $object_output = true) : mixed

Method map_fields()

Map Site.

Parameters

mixed $data

data to map.

mixed $keys

Keys to map.

boolean $object_output

Output format array|object.

Returns

mixed —

Mapped data.

map_site()

map_site(mixed  $website, mixed  $keys, boolean  $object_output = true) : mixed

Method map_site()

Map Site.

Parameters

mixed $website

Website to map.

mixed $keys

Keys to map.

boolean $object_output

Output format array|object.

Returns

mixed —

$outputSite Mapped site.

array_merge()

array_merge(mixed  $arr1, mixed  $arr2) : array

Method array_merge()

Merge two given arrays into one.

Parameters

mixed $arr1

First array.

mixed $arr2

Second array.

Returns

array —

Merged Array.

update_option()

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

Method update_option()

Update option.

Parameters

mixed $option_name

Option name.

mixed $option_value

Option value.

Returns

\MainWP\Dashboard\(boolean) —

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

update_user_option()

update_user_option(mixed  $option_name, mixed  $option_value) : \MainWP\Dashboard\(boolean)

Method update_user_option()

Update option.

Parameters

mixed $option_name

Option name.

mixed $option_value

Option value.

Returns

\MainWP\Dashboard\(boolean) —

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

remove_preslash_spaces()

remove_preslash_spaces(string  $text) : string

Method remove_preslash_spaces()

Remove spaces before slashes.

Parameters

string $text

String to strip.

Returns

string —

$text Cleaned string.

remove_http_prefix()

remove_http_prefix(mixed  $pUrl, boolean  $pTrimSlashes = false) : string

Method remove_http_prefix()

Remove http prefixes from given url.

Parameters

mixed $pUrl

Given URL.

boolean $pTrimSlashes

Whether or not to trim slashes. Default is false.

Returns

string —

Trimmed URL.

remove_http_www_prefix()

remove_http_www_prefix(mixed  $pUrl) : string

Method remove_http_www_prefix()

Remove 'www.' from given URL.

Parameters

mixed $pUrl

Given URL.

Returns

string —

Cleaned URL.

sanitize_file_name()

sanitize_file_name(mixed  $filename) : string

Method sanitize_file_name()

Sanitize file names.

Parameters

mixed $filename

File name to sanitize.

Returns

string —

Sanitized filename.

normalize_filename()

normalize_filename(mixed  $s) : string

Method normalize_filename()

Normalize filename.

Parameters

mixed $s

Filename to normalize.

Returns

string —

$s Normalised filename.

esc_content()

esc_content(mixed  $content, string  $type = 'note', mixed  $more_allowed = array()) : string

Method esc_content()

Escape content, allowed content (a,href,title,br,em,strong,p,hr,ul,ol,li,h1,h2 ... ).

Parameters

mixed $content

Content to escape.

string $type

Type of content. Default = note.

mixed $more_allowed

input allowed tags - options.

Returns

string —

Filtered content containing only the allowed HTML.

esc_mixed_content()

esc_mixed_content(mixed  $data, string  $depth, mixed  $more_allowed = array()) : string

Method esc_mixed_content()

Escape mixed content, allowed content (a,href,title,br,em,strong,p,hr,ul,ol,li,h1,h2 ... ).

Parameters

mixed $data

data to escape.

string $depth

Maximum depth to walk through $data. Must be greater than 0.

mixed $more_allowed

input allowed tags - options.

Throws

\Exception

Excetpion message.

Returns

string —

Filtered content containing only the allowed HTML.

show_mainwp_message()

show_mainwp_message(mixed  $type, mixed  $notice_id) : boolean

Method show_mainwp_message()

Check whenther or not to show the MainWP Message.

Parameters

mixed $type

Type of message.

mixed $notice_id

Notice ID.

Returns

boolean —

true|false.

get_hide_notice_status()

get_hide_notice_status(mixed  $notice_id) : mixed

Method get_hide_notice_status()

Check whenther or not to show the MainWP Message.

Parameters

mixed $notice_id

Notice ID.

Returns

mixed —

true|false|time.

get_flash_message()

get_flash_message(mixed  $message_id, boolean  $delete = true) : boolean

Method get_flash_message()

Get saved flash Message.

Parameters

mixed $message_id

Notice ID.

boolean $delete

True to delete the message after get it.

Returns

boolean —

true|false.

update_flash_message()

update_flash_message(mixed  $message_id, mixed  $content) : boolean

Method update_flash_message()

Check whenther or not to show the MainWP Message.

Parameters

mixed $message_id

Notice ID.

mixed $content

Content of message.

Returns

boolean —

true|false.

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.

array_sort_existed_keys()

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

Method array_sort_existed_keys()

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.

array_numeric_filter()

array_numeric_filter(array  $arr_ints) : array

Method array_numeric_filter()

Filter given numeric array.

Parameters

array $arr_ints

Array to filter.

Returns

array —

$arr_ints Array filtered.

enabled_wp_seo()

enabled_wp_seo() : boolean

Method enabled_wp_seo()

Check if Yoast SEO is enabled.

Returns

boolean —

true|false.

value_to_string()

value_to_string(mixed  $var_value) : string

Method value_to_string()

Value to string.

Parameters

mixed $var_value

Value to convert to string.

Returns

string —

Value that has been converted into a string.

get_site_health()

get_site_health(mixed  $issue_counts) : array

Get Health Site value.

Parameters

mixed $issue_counts

Health site issues.

Returns

array —

Health status value.

get_http_codes()

get_http_codes(integer  $code = false) : array

Get HTTP code.

Parameters

integer $code

HTTP code.

Returns

array —

$http_codes HTTP code.

valid_input_emails()

valid_input_emails(string  $emails) : string

Method valid_input_emails().

Parameters

string $emails

Input emails string.

Returns

string —

$valid_emails Valid emails string.

check_image_file_name()

check_image_file_name(string  $filename) : true|false

Method check_image_file_name()

Check if the file image.

Parameters

string $filename

Contains image (file) name.

Returns

true|false —

valid name or not.

check_abandoned()

check_abandoned(mixed  $siteId = null, string  $which = '') : array

Method check_abandoned()

Get site's icon.

Parameters

mixed $siteId

site's id.

string $which

to check plugin/theme.

Throws

\Exception

Error message.

Returns

array —

result error or success

get_dir_slug()

get_dir_slug(string  $slug) : string

Get directory or slug of plugin.

Parameters

string $slug

Plugin slug.

Returns

string —

$value directory or slug of plugin.

get_siteview_mode()

get_siteview_mode() : string

Metho get_siteview_mode().

Get site view mode.

Returns

string —

$viewmode Site view mode.

delete_file()

delete_file(string  $file_path) : boolean

Metho delete_file().

Delete file.

Parameters

string $file_path

File path.

Returns

boolean —

true|false.

get_disable_functions()

get_disable_functions() : string

Method get_disable_functions()

Get disable functions.

Returns

string

is_disabled_functions()

is_disabled_functions(string  $func) : string

Method is_disable_functions()

Check if it is disabled functions.

Parameters

string $func

Function name to check.

Returns

string

hook_verify_ping_nonce()

hook_verify_ping_nonce(boolean  $input_value, string  $nonce = '', mixed  $siteid = false) : mixed

Method hook_verify_ping_nonce()

Verify nonce without session and user id.

Parameters

boolean $input_value

Boolean value, it should always be FALSE.

string $nonce

Nonce to verify.

mixed $siteid

Site ID.

Returns

mixed —

If verified return 1 or 2, if not return false.

create_site_nonce()

create_site_nonce(mixed  $action = -1, mixed  $siteid = false) : string

Method create_site_nonce()

Create action nonce for site.

Parameters

mixed $action

Action to perform.

mixed $siteid

Site ID.

Returns

string —

Custom nonce.

verify_site_nonce()

verify_site_nonce(string  $nonce, mixed  $action = -1, mixed  $siteid) : mixed

Method verify_site_nonce()

Verify nonce without session and user id.

Parameters

string $nonce

Nonce to verify.

mixed $action

Action to perform.

mixed $siteid

Site ID.

Returns

mixed —

If verified return 1 or 2, if not return false.

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.

right_array_merge()

right_array_merge(array  $left_array, array  $right_array) : array

Merge values from right array to left array.

Parameters

array $left_array

left array.

array $right_array

right array.

Returns

array —

$result result array.

get_set_deactivated_licenses_alerted()

get_set_deactivated_licenses_alerted(string  $slug, boolean  $time_value = false, string  $act = 'get') : array

Method get_set_deactivated_licenses_alerted().

Parameters

string $slug

Extension slug.

boolean $time_value

Time value.

string $act

get/set value.

Returns

array —

$result result array.