\

Namespaces

MainWP

Classes

WPRocket_CLI Manage Revisions

Constants

DIRECTORY_SEPARATOR

DIRECTORY_SEPARATOR = '/'

Defines reusable directory separator.

DOING_AJAX

DOING_AJAX = true

Checks whether ajax job is in progress.

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

FILTER_SANITIZE_STRING_COMPATIBLE

FILTER_SANITIZE_STRING_COMPATIBLE = 513

FS_METHOD

FS_METHOD = 'direct'

Define WordPress File system.

FS_METHOD

FS_METHOD = 'direct'

MAINWP_CHILD_DEBUG

MAINWP_CHILD_DEBUG = false

MAINWP_CHILD_FILE

MAINWP_CHILD_FILE = __FILE__

Define MainWP Child Plugin absolute full path and filename of this file.

MAINWP_CHILD_PLUGIN_DIR

MAINWP_CHILD_PLUGIN_DIR = plugin_dir_path(MAINWP_CHILD_FILE)

Define MainWP Child Plugin Directory.

MAINWP_CHILD_URL

MAINWP_CHILD_URL = plugin_dir_url(MAINWP_CHILD_FILE)

Define MainWP Child Plugin URL.

MAINWP_DEMO_MODE

MAINWP_DEMO_MODE = true

MAINWP_MODULE_API_BACKUPS_ENABLED

MAINWP_MODULE_API_BACKUPS_ENABLED = true

MAINWP_MODULE_COST_TRACKER_ENABLED

MAINWP_MODULE_COST_TRACKER_ENABLED = true

MAINWP_MODULE_LOG_ENABLED

MAINWP_MODULE_LOG_ENABLED = true

MAINWP_MODULES_DIR

MAINWP_MODULES_DIR = MAINWP_PLUGIN_DIR . 'modules' . DIRECTORY_SEPARATOR

MAINWP_MODULES_URL

MAINWP_MODULES_URL = MAINWP_PLUGIN_URL . 'modules/'

MAINWP_PLUGIN_DIR

MAINWP_PLUGIN_DIR = plugin_dir_path(MAINWP_PLUGIN_FILE)

Define MainWP Dashboard Plugin Directory.

MAINWP_PLUGIN_FILE

MAINWP_PLUGIN_FILE = __FILE__

Define MainWP Dashboard Plugin absolute full path and filename of this file.

MAINWP_PLUGIN_URL

MAINWP_PLUGIN_URL = plugin_dir_url(MAINWP_PLUGIN_FILE)

Define MainWP Child Dashboard URL.

MAINWP_REST_API

MAINWP_REST_API = true

MAINWP_REST_API_DOING

MAINWP_REST_API_DOING = true

MAINWP_SAVE_FS_METHOD

MAINWP_SAVE_FS_METHOD = get_filesystem_method()

Defines save file system method.

MAINWP_VERSION

MAINWP_VERSION = $this->current_version

Defines MainWP Version.

PCLZIP_TEMPORARY_DIR

PCLZIP_TEMPORARY_DIR = $backupdir

Defines PCLZIP temporary directory.

WP_ADMIN

WP_ADMIN = true

WP_DEBUG

WP_DEBUG = false

Defines if WP is debug mode.

WP_INSTALLING

WP_INSTALLING = true

Defines whether WP is being installed.

Functions

add_screen_option()

add_screen_option(mixed  $option, array  $args = array()) 

Adds the WP Fake Screen option.

Parameters

mixed $option

Options.

array $args

Arguments.

apply_filters_deprecated()

apply_filters_deprecated(string  $hook_name, array  $args, string  $version, string  $replacement = '', string  $message = '') 

Support old WP version 4.0.

Fires functions attached to a deprecated filter hook.

When a filter hook is deprecated, the apply_filters() call is replaced with apply_filters_deprecated(), which triggers a deprecation notice and then fires the original filter hook.

Parameters

string $hook_name

The name of the filter hook.

array $args

Array of additional function arguments to be passed to apply_filters().

string $version

The version of WordPress that deprecated the hook.

string $replacement

Optional. The hook that should have been used. Default empty.

string $message

Optional. A message regarding the change. Default empty.

convert_to_screen()

convert_to_screen() : \MainWP_Fake_Wp_Screen

Convert to screen.

We need this because BackWPup_Page_Jobs extends WP_List_Table. which uses convert_to_screen.

Returns

\MainWP_Fake_Wp_Screen

mainwp_autoload()

mainwp_autoload(string  $class_name) : \require_once

Autoloader for all classes, pages & widgets

Parameters

string $class_name

Folder name class|pages|widgets.

Returns

\require_once —

$autoload_path;

mainwp_child_autoload()

mainwp_child_autoload(string  $class_name) 

MainWP Child Plugin Autoloader to load all other class files.

Parameters

string $class_name

Name of the class to load.

mainwp_child_backwpup_wp_list_table_dependency()

mainwp_child_backwpup_wp_list_table_dependency() 

Method mainwp_child_backwpup_wp_list_table_dependency()

Init backwpupwp list table dependency functions.

mainwp_child_helper()

mainwp_child_helper() : mixed

Method mainwp_child_helper()

Get MainWP Child helper instance.

Returns

mixed —

MainWP\Child\MainWP_Helper

mainwp_current_user_can()

mainwp_current_user_can(string  $cap_type = '', string  $cap = '') : boolean

Check permission level.

To compatible with extensions.

Parameters

string $cap_type

Group or type of capabilities.

string $cap

Capabilities for current user.

Returns

boolean —

true|false

mainwp_do_not_have_permissions()

mainwp_do_not_have_permissions(string  $where = '', boolean  $echo_out = true) : string|boolean

Detect permission level & display message to end user.

Parameters

string $where

User's location.

boolean $echo_out

Defines weather or not to echo error message.

Returns

string|boolean —

$msg|false

mainwp_get_actions_handler_instance()

mainwp_get_actions_handler_instance() : boolean

Function to get mainwp actions handler instance.

Returns

boolean —

true|false

mainwp_module_log_filter_var()

mainwp_module_log_filter_var(string  $var_value, integer  $filter = null, mixed  $options = array()) : \Returns

Filters a variable with a specified filter.

This is a polyfill function intended to be used in place of PHP's filter_var() function, which can occasionally be unreliable.

Parameters

string $var_value

Value to filter.

integer $filter

The ID of the filter to apply.

mixed $options

Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array. For the "callback" filter, callable type should be passed. The callback must accept one argument, the value to be filtered, and return the value after filtering/sanitizing it.

Returns

\Returns —

the filtered data, or FALSE if the filter fails.

mainwp_module_log_get_iso_8601_extended_date()

mainwp_module_log_get_iso_8601_extended_date(integer|boolean  $time = false, integer  $offset) : string

Converts a time into an ISO 8601 extended formatted string.

Parameters

integer|boolean $time

Seconds since unix epoch.

integer $offset

Timezone offset.

Returns

string —

an ISO 8601 extended formatted time

mainwp_modules_is_enabled()

mainwp_modules_is_enabled(string  $module) : boolean

Check if module is enable.

Parameters

string $module

module slug.

Returns

boolean —

true|false

mainwp_send_json_output()

mainwp_send_json_output(array  $output) 

Handle send json output.

Parameters

array $output

Array output.

mainwpdir()

mainwpdir() : string

Grab MainWP Directory

Returns

string

wp_verify_nonce()

wp_verify_nonce(string  $nonce, string|integer  $action = -1) : false|integer

Verify that correct nonce was used with time limit.

The user is given an amount of time to use the token, so therefore, since the UID and $action remain the same, the independent variable is the time.

Parameters

string $nonce

Nonce that was used in the form to verify.

string|integer $action

Should give context to what is taking place and be the same when nonce was created.

Returns

false|integer —

False if the nonce is invalid, 1 if the nonce is valid and generated between 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.