Methods

get_class_name()

get_class_name() : object

Method get_class_name()

Get Class Name.

Returns

object —

Class name.

try_visit()

try_visit(string  $url, boolean  $verifyCertificate = null, string  $http_user = null, string  $http_pass = null, integer  $sslVersion, boolean  $forceUseIPv4 = null, boolean  $no_body = false) : array

Method try visit.

Try connecting to Child Site via cURL.

Parameters

string $url

Child Site URL.

boolean $verifyCertificate

Option to check SSL Certificate. Default = null.

string $http_user

HTTPAuth Username. Default = null.

string $http_pass

HTTPAuth Password. Default = null.

integer $sslVersion

Child Site SSL Version.

boolean $forceUseIPv4

Option to fource IP4. Default = null.

boolean $no_body

Option to set CURLOPT_NOBODY option. Default = false.

Returns

array —

$out. 'host IP, Returned HTTP Code, Error Message, http Status error message.

check_ignored_http_code()

check_ignored_http_code(mixed  $value) : \MainWP\Dashboard\bolean

Method check_ignored_http_code()

Check if http error code is being ignored.

Parameters

mixed $value

http error code.

Returns

\MainWP\Dashboard\bolean —

True|False.

check_website_status()

check_website_status(array  $website) : mixed

Method check_website_status()

Check if the Website returns and http errors.

Parameters

array $website

Child Site information.

Returns

mixed —

False|try visit result.

get_post_data_authed()

get_post_data_authed(mixed  $website, mixed  $what, null  $params = null) : mixed

Method get_post_data_authed()

Get authorized $_POST data & build query.

Parameters

mixed $website

Array of Child Site Info.

mixed $what

What we are posting.

null $params

Post parameters.

Returns

mixed —

null|http_build_query()

get_get_data_authed()

get_get_data_authed(mixed  $website, mixed  $paramValue, string  $paramName = 'where', boolean  $asArray = false) : string

Method get_get_data_authed()

Get authorized $_GET data & build query.

Parameters

mixed $website

Child Site data.

mixed $paramValue

OpenSSL parameter.

string $paramName

Parameter name.

boolean $asArray

true|false Default is false.

Returns

string —

$url

get_post_data_not_authed()

get_post_data_not_authed(mixed  $url, mixed  $admin, mixed  $what, null  $params = null) : mixed

Method get_post_data_not_authed()

Get not authorized $_POST data.

Parameters

mixed $url

Child site URL.

mixed $admin

Admin Username.

mixed $what

What function to perform.

null $params

Function parameters.

Returns

mixed —

null|http_build_query()

fetch_urls_authed()

fetch_urls_authed(object  $websites, string  $what, array  $params = null, mixed  $handler, mixed  $output, mixed  $whatPage = null, array  $others = array(), boolean  $is_external_hook = false) : boolean

Method fetch_urls_authed()

Fethech authorized URLs.

Parameters

object $websites

Websites information.

string $what

Action to perorm.

array $params

Request parameters.

mixed $handler

Request handler.

mixed $output

Request output.

mixed $whatPage

Request URL. Default /admin-ajax.php.

array $others

Request additional information.

boolean $is_external_hook

Check if external hook is used.

Returns

boolean —

true|false

get_resource_id()

get_resource_id(mixed  $resource) : \MainWP\Dashboard\$result

Method get_resource_id()

Get resource id.

Parameters

mixed $resource

The given resource.

Returns

\MainWP\Dashboard\$result —

Resource ID only.

get_lock_identifier()

get_lock_identifier(mixed  $pLockName) : mixed

Method get_lock_identifier(

Get lock identifier.

Parameters

mixed $pLockName

Provided Lock Name.

Returns

mixed —

false|sem_get()|@fopen

lock()

lock(mixed  $identifier) : mixed

Method lock()

Use sem_acquire or @flock to lock the $identifier.

Parameters

mixed $identifier

Identifier.

Returns

mixed —

false|sem_acquire()|@flock

release()

release(mixed  $identifier) : mixed

Method release()

Use sem_release or @flock, @fclose to unlock $identifier.

Parameters

mixed $identifier

Identifier.

Returns

mixed —

false|sem_release()|@flock

fetch_url_authed()

fetch_url_authed(object  $website, string  $what, null  $params = null, boolean  $checkConstraints = false, boolean  $pForceFetch = false, boolean  $pRetryFailed = true, null  $rawResponse = null) : mixed

Method fetch_url_authed()

Updates the child site via authenticated request.

Parameters

object $website

Website information.

string $what

Function to perform.

null $params

Function paramerters.

boolean $checkConstraints

Whether or not to check contraints.

boolean $pForceFetch

Whether or not to force the fetch.

boolean $pRetryFailed

Whether or not to retry the fetch process.

null $rawResponse

Raw response.

Returns

mixed —

$information

fetch_url_not_authed()

fetch_url_not_authed(string  $url, string  $admin, string  $what, null  $params = null, boolean  $pForceFetch = false, null  $verifyCertificate = null, null  $http_user = null, null  $http_pass = null, integer  $sslVersion, array  $others = array(), array  $output = array()) : mixed

Method fetch_url_not_authed()

Fetch not authorized URL.

Parameters

string $url

URL to fetch from.

string $admin

Admin name.

string $what

Function to perform.

null $params

Function paramerters.

boolean $pForceFetch

true|false Whether or not to force the fetch.

null $verifyCertificate

Verify the SSL Certificate.

null $http_user

htaccess username.

null $http_pass

htaccess password.

integer $sslVersion

SSL version to check for.

array $others

Other functions to perform.

array $output

Output values.

Returns

mixed —

self::fetch_url() Fetch URL.

fetch_url()

fetch_url(object  $website, string  $url, mixed  $postdata, boolean  $checkConstraints = false, null  $verifyCertificate = null, boolean  $pRetryFailed = true, null  $http_user = null, null  $http_pass = null, integer  $sslVersion, array  $others = array(), array  $output = array()) : mixed

Method fetch_url()

Fetch URL.

Parameters

object $website

Child Site info.

string $url

URL to fetch from.

mixed $postdata

Post data to fetch.

boolean $checkConstraints

true|false Whether or not to check contraints.

null $verifyCertificate

Verify SSL Certificate.

boolean $pRetryFailed

ture|false Whether or not the Retry has failed.

null $http_user

htaccess username.

null $http_pass

htaccess password.

integer $sslVersion

SSL version.

array $others

Other functions to perform.

array $output

Output values.

Throws

\Exception

Exception message.

Returns

mixed —

self::fetch_url_site()

fetch_url_site()

fetch_url_site(object  $website, string  $url, mixed  $postdata, boolean  $checkConstraints = false, null  $verifyCertificate = null, null  $http_user = null, null  $http_pass = null, integer  $sslVersion, array  $others = array(), array  $output = array()) : mixed

Method fetch_url_site()

M Fetch URL.

Parameters

object $website

Child Site info.

string $url

URL to fetch from.

mixed $postdata

Post data to fetch.

boolean $checkConstraints

true|false Whether or not to check contraints.

null $verifyCertificate

Verify SSL Certificate.

null $http_user

htaccess username.

null $http_pass

htaccess password.

integer $sslVersion

SSL version.

array $others

Other functions to perform.

array $output

Output values.

Throws

\MainWP\Dashboard\MainWP_Exception

Exception message.

Returns

mixed —

$data, $information.

download_to_file()

download_to_file(mixed  $url, mixed  $file, boolean  $size = false, null  $http_user = null, null  $http_pass = null) 

Method download_to_file()

Download to file.

Parameters

mixed $url

Download URL.

mixed $file

File to download to.

boolean $size

Size of file.

null $http_user

htaccess username.

null $http_pass

htaccess password.

Throws

\MainWP\Dashboard\MainWP_Exception

Exception message.

init_cookiesdir()

init_cookiesdir(mixed  $cookieDir) : void

Method init_coockiesdir()

Check for cookies directory and crate it if it doesn't already exist, set the file permissions and update htaccess.

Parameters

mixed $cookieDir

Cookies directory.

get_file_content()

get_file_content(mixed  $url) : mixed

Method get_file_content()

Get contents of file.

Parameters

mixed $url

File Location.

Returns

mixed —

false|$data

get_favico_url()

get_favico_url(mixed  $website) : mixed

Method get_favico_url()

Get Child Site favicon URL.

Parameters

mixed $website

Child Site info.

Returns

mixed —

$faviurl Favicon URL.

debug_fetch_urls_authed()

debug_fetch_urls_authed(object  $websites, string  $what, array  $params, mixed  $handler, mixed  $output, mixed  $whatPage, boolean  $json_format, array  $others) 

Method debug_fetch_urls_authed()

To debug fetch authorized URLs.

Parameters

object $websites

Websites information.

string $what

Action to perorm.

array $params

Request parameters.

mixed $handler

Request handler.

mixed $output

Request output.

mixed $whatPage

Request URL. Default /admin-ajax.php.

boolean $json_format

Use JSON format.

array $others

Request additional information.

check_constraints()

check_constraints(mixed  $identifier, mixed  $website) 

Method check_constraints()

Check connection delay constraints.

Parameters

mixed $identifier

Lock identifier.

mixed $website

Object child site.

check_constraints_last_request()

check_constraints_last_request(mixed  $identifier, integer  $minimumDelay, string|null  $ip = null) 

Method check_constraints_last_request().

Check constraints for last requests.

Parameters

mixed $identifier

connect identifier.

integer $minimumDelay

minimum delay.

string|null $ip

ip address.

check_constraints_open_requests()

check_constraints_open_requests(mixed  $identifier, integer  $maximumRequests, string|null  $ip = null) 

Method check_constraints_open_requests().

Check constraints for open requests.

Parameters

mixed $identifier

connect identifier.

integer $maximumRequests

maximum requests.

string|null $ip

ip address.