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.

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  $array, 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 $array

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  $array, mixed  $index, mixed  $value) 

Method get_sub_array_having()

Get sub array.

Parameters

mixed $array

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.

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.

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.

array_sort()

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

Method array_sort()

Sort given array by given flags.

Parameters

mixed $array

Array to sort.

mixed $key

Array key.

string $sort_flag

Flags to sort by. Default = SORT_STRING.

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) : string

Method value_to_string()

Value to string.

Parameters

mixed $var

Value to convert to string.

Returns

string —

Value that has been converted into a string.

render_mainwp_nonce()

render_mainwp_nonce() 

Method render_mainwp_nonce()

Render MainWP nonce.

get_site_health()

get_site_health(mixed  $issue_counts) : array

Get Health Site value.

Parameters

mixed $issue_counts

Health site issues.

Returns

array —

$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.