Properties

$instance

$instance : mixed

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

Type

mixed — Default null

$maxHistory

$maxHistory : integer

Private variable to hold the max history value.

Type

integer — Max history.

Methods

get_class_name()

get_class_name() : string

Method get_class_name()

Get class name.

Returns

string —

CLASS Class name.

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

parse_init_auth()

parse_init_auth(boolean  $auth = false) : boolean

Method parse_init_auth()

Parse inistial authentication.

Parameters

boolean $auth

True is authenticated, false if not.

Returns

boolean —

ture|false.

auth()

auth(string  $signature, string  $func, string  $nonce) : integer|boolean

Method auth()

Connection authentication handler. Verifies that the signature is correct for the specified data using the public key associated with pub_key_id. This must be the public key corresponding to the private key used for signing.

Parameters

string $signature

MainWP Dashboard signature.

string $func

Function to run.

string $nonce

Security nonce.

Returns

integer|boolean —

$auth Returns 1 if authenticated, false if authentication fails.

connect_verify()

connect_verify(string  $data, string  $signature, string  $pubkey, mixed  $alg) : boolean

Method connect_verify()

Verify connect.

Parameters

string $data

Data sign.

string $signature

signature.

string $pubkey

Public key.

mixed $alg

signature algorithm.

Returns

boolean —

Connect valid or not.

get_connect_sign_algorithm()

get_connect_sign_algorithm(mixed  $alg) : mixed

Method get_connect_sign_algorithm().

Get supported sign algorithms.

Parameters

mixed $alg

Input value.

Returns

mixed —

$alg Valid algorithm value.

is_valid_supported_sign_alg()

is_valid_supported_sign_alg(mixed  $alg) : mixed

Method is_valid_supported_sign_alg().

Check if valid supported Sign Algo value.

Parameters

mixed $alg

Input value.

Returns

mixed —

$valid Valid algorithm value.

check_to_requires_reconnect_for_sha1_safe()

check_to_requires_reconnect_for_sha1_safe(integer  $alg_new) 

Method check_to_requires_reconnect_for_sha1_safe()

Check if need to deactive/active child plugin.

Parameters

integer $alg_new

Algo value.

Throws

\MainWP\Child\Exception|\Exception

Error exception.

maybe_update_child_sign_algo()

maybe_update_child_sign_algo(integer  $alg_new) 

Method maybe_update_child_sign_algo()

Check if need to update child sign algo settings.

Parameters

integer $alg_new

Algo value.

parse_login_required()

parse_login_required() : boolean

Method parse_login_required()

Check if the login process is required.

Throws

\MainWP\Child\Exception|\Exception

Error exception.

Returns

boolean —

Return true on success, false on failure.

parse_query()

parse_query(string  $val) : array

Method parse_query()

Parse query

Parameters

string $val

Contains the parameter to prase.

Returns

array —

$arr Array containing parsed arguments.

validate_pre_download_file()

validate_pre_download_file(string  $file, string  $dir) : boolean

Method validate_pre_download_file()

Parameters

string $file

File param request.

string $dir

Directory param request.

Returns

boolean —

Valid or not valid to download file.

check_login()

check_login() : boolean

Method check_login()

Auto-login user to the child site when the Open WP Admin feature from the MainWP Dashboard is used.

Throws

\MainWP\Child\Exception|\Exception

Error exception.

Returns

boolean —

Return false if $_POST['mainwpsignature'] is not set.

check_login_as()

check_login_as(string  $alter_login) : boolean

Method check_login_as()

Auto-login alternative user to the child site when the Open WP Admin feature from the MainWP Dashboard is used.

Parameters

string $alter_login

Alternative user account to log into.

Returns

boolean —

Return false will log in as default admin user. Return true will try to login as alternative user.

login()

login(string  $username, boolean  $doAction = false) : boolean

Method login()

The login process handler.

Parameters

string $username

Contains the account username.

boolean $doAction

If true, run 'wp_login' action aftr the login.

Returns

boolean —

true|false

check_other_auth()

check_other_auth() 

Method check_other_auth()

Check other authentication methods.

is_valid_auth()

is_valid_auth(string  $key) : boolean

Method is_valid_auth()

Check if authentication is valid.

Parameters

string $key

Contains the authentication key to check.

Returns

boolean —

true|false If valid authentication, return true, if not, return false.

get_max_history()

get_max_history() : integer

Method get_max_history()

Returns

integer —

The max history value.

check_compatible_connect_info()

check_compatible_connect_info() 

Method check_compatible_connect_info()

Check check compatible connected info.

get_request_files()

get_request_files() : resource

Method get_request_files()

Parse HTTP request to get files.

Returns

resource —

Requested file.

check_redirects()

check_redirects() : boolean

Method check_redirects()

Handle redirects.

Returns

boolean —

Returns false if $_REQUEST['fdl'] is set.

open_location_redirect()

open_location_redirect(string  $open_location) 

Method open_location_redirect()

Jump to the wanted location (child site WP Admin page).

Parameters

string $open_location

Desired location relative path.

where_authed_redirect()

where_authed_redirect() 

Method where_authed_redirect()

Safe redirect to wanted location.