\MainWP\ChildMainWP_Child_Server_Information

Class MainWP_Child_Server_Information

MainWP Child server information handler.

Summary

Methods
Properties
Constants
get_class_name()
get_curl_support()
get_curl_version()
curlssl_compare()
get_curl_ssl_version()
get_file_system_method()
get_openssl_working_status()
get_my_sql_version()
get_php_memory_limit()
get_db_size()
init()
dismiss_warnings()
render_warnings()
is_mainwp_pages()
render_page()
render_warning_text()
render_error_log()
render_connection_details()
No public properties found
WARNING
ERROR
get_warnings()
check_mainwp_directory()
check()
filesize_compare()
get_curl_timeout()
mainwp_required_functions()
get_loaded_php_extensions()
get_current_version()
get_mainwp_version()
get_zip_archive_enabled()
get_gzip_enabled()
get_bzip_enabled()
get_wordpress_version()
get_wordpress_memory_limit()
check_if_multisite()
get_ssl_support()
get_ssl_warning()
get_php_version()
get_max_execution_time()
get_upload_max_filesize()
get_post_max_size()
get_max_input_time()
get_os()
get_architecture()
memory_usage()
get_output_buffer_size()
get_php_safe_mode()
get_sql_mode()
get_php_allow_url_fopen()
get_php_exif()
get_php_ip_tc()
get_php_xml()
get_server_getaway_interface()
get_server_ip()
get_server_name()
get_server_software()
get_server_protocol()
get_server_request_time()
get_server_http_accept()
get_server_accept_charset()
get_http_host()
get_complete_url()
get_user_agent()
get_https()
server_self_connect()
get_remote_address()
get_remote_host()
get_remote_port()
get_script_file_name()
get_server_port()
get_current_page_uri()
get_wp_root()
time_compare()
render_file_system_method_check()
render_mainwp_version_check()
render_mainwp_directory()
render_directory_row()
render_row()
render_row_sec()
render_last_lines()
No protected properties found
N/A
render_page_js()
render_server_infor()
render_system_infor_rows()
render_php_settings_rows()
render_mysql_infor_rows()
render_plugins_infor_rows()
render_php_infor_rows()
render_server_infor_rows()
render_cron()
render_error_page()
No private properties found
N/A

Constants

WARNING

WARNING = 1

ERROR

ERROR = 2

Methods

get_class_name()

get_class_name() : string

Method get_class_name()

Get class name.

Returns

string —

CLASS Class name.

get_curl_support()

get_curl_support() : boolean

Check if PHP class curl_version() is enabled.

Returns

boolean —

If 'curl_version' function exists, return true, if not, return false.

get_curl_version()

get_curl_version() : string

Get current cURL Version.

Returns

string —

Current cURL Version.

curlssl_compare()

curlssl_compare(string  $version, string  $operator) : boolean|integer

Compare current cURL & SSL versions to required values.

Parameters

string $version

Required values to compare to.

string $operator

Comparison operator.

Returns

boolean|integer —

When using the optional operator argument, the function will return TRUE if the relationship is the one specified by the operator, FALSE otherwise. Returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.

get_curl_ssl_version()

get_curl_ssl_version() : string

Get curl ssl version.

Returns

string —

SSL version.

get_file_system_method()

get_file_system_method() : string

Get file system method.

Returns

string —

$fs The returned file system method.

get_openssl_working_status()

get_openssl_working_status() : boolean

To verify openssl working.

Returns

boolean —

Working status.

get_my_sql_version()

get_my_sql_version() : string

Get current MySQL version.

Returns

string —

Return the current MySQL version.

get_php_memory_limit()

get_php_memory_limit() : string

Get current PHP memory limit.

Returns

string —

Return current PHP memory limit.

get_db_size()

get_db_size() : string

Get db size.

Returns

string —

Return current db size.

init()

init() 

Add hooks after WordPress has finished loading but before any headers are sent.

dismiss_warnings()

dismiss_warnings() 

Dismiss warnings.

render_warnings()

render_warnings() 

Render warnings.

is_mainwp_pages()

is_mainwp_pages() : boolean

Method is_mainwp_pages()

Get the current page and check it for "mainwp_".

Returns

boolean —

ture|false.

render_page()

render_page() 

Render the Server Information page.

render_warning_text()

render_warning_text(string  $errorType = self::WARNING) : string

Render warning text.

Parameters

string $errorType

Error type.

Returns

string —

Warning message HTML.

render_error_log()

render_error_log() 

Render the error log content.

render_connection_details()

render_connection_details() 

Render the connection details page content.

get_warnings()

get_warnings() : integer

Initiate check on important System Variables and compare them to required defaults.

Returns

integer —

$i Number of detected issues.

check_mainwp_directory()

check_mainwp_directory(string  $message = '', string  $path = '') : boolean

Check if MainWP Directory is writeable.

Parameters

string $message

Return message - Directory not found, Directory not writable, writeable.

string $path

MainWP directory path.

Returns

boolean —

TRUE if exists & writeable, FALSE if not.

check()

check(string  $pCompare, string  $pVersion, string  $pGetter, string  $pExtraCompare = null, string  $pExtraVersion = null, boolean  $sizeCompare = false) : boolean|integer

Check Child Site system variables for any issues.

Parameters

string $pCompare

Comparison operator.

string $pVersion

Version to compare to.

string $pGetter

The method to grab the data with.

string $pExtraCompare

Extra comparison operator.

string $pExtraVersion

Extra version to compare to.

boolean $sizeCompare

Size to compare to.

Returns

boolean|integer —

When using the optional operator argument, the function will return TRUE if the relationship is the one specified by the operator, FALSE otherwise. Returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.

filesize_compare()

filesize_compare(string  $value1, string  $value2, string  $operator = null) : boolean|integer

Compare filesizes.

Parameters

string $value1

First value to compare.

string $value2

Second value to compare.

string $operator

Comparison operator.

Returns

boolean|integer —

When using the optional operator argument, the function will return TRUE if the relationship is the one specified by the operator, FALSE otherwise. Returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.

get_curl_timeout()

get_curl_timeout() : integer

Get current cURL Timeout.

Returns

integer —

Current cURL timeout value.

mainwp_required_functions()

mainwp_required_functions() 

Check for disabled PHP functions.

get_loaded_php_extensions()

get_loaded_php_extensions() 

Get loaded PHP extensions.

get_current_version()

get_current_version() : string

Get the current MainWP Child plugin version.

Returns

string —

$currentVersion The MainWP Child plugin current version.

get_mainwp_version()

get_mainwp_version() : string|boolean

Get the current MainWP Child plugin version.

Returns

string|boolean —

Most recent MainWP Child version or FALSE.

get_zip_archive_enabled()

get_zip_archive_enabled() : boolean

Check if PHP class \ZipArchive is enabled.

Returns

boolean —

If '\ZipArchive' class exists, return true, if not, return false.

get_gzip_enabled()

get_gzip_enabled() : boolean

Check if PHP function gzopen is enabled.

Returns

boolean —

If 'gzopen' function exists, return true, if not, return false.

get_bzip_enabled()

get_bzip_enabled() : boolean

Check if PHP function bzopen is enabled.

Returns

boolean —

If 'bzopen' function exists, return true, if not, return false.

get_wordpress_version()

get_wordpress_version() : string

Get current WordPress version.

Returns

string —

$wp_version Current WordPress version.

get_wordpress_memory_limit()

get_wordpress_memory_limit() : string

Get current WordPress memory limit.

Returns

string —

Current WordPress memory limit.

check_if_multisite()

check_if_multisite() : boolean

Check if in multisite WordPress environment.

Returns

boolean —

If multisite detected, return false, if not, return true.

get_ssl_support()

get_ssl_support() : boolean

Check if PHP extension OpenSSL is enabled.

Returns

boolean —

If 'openssl' extension is loaded, return true, if not, return false.

get_ssl_warning()

get_ssl_warning() : false|string

Get any SSL warnings.

Returns

false|string —

Return error message if there are warnings, FALSE otherwise.

get_php_version()

get_php_version() : string

Get current PHP version.

Returns

string —

Current PHP version.

get_max_execution_time()

get_max_execution_time() : string

Get max execution time.

Returns

string —

Return the PHP max execution time.

get_upload_max_filesize()

get_upload_max_filesize() : string

Get the max uplaod filesize.

Returns

string —

Return the maximum upload filesize.

get_post_max_size()

get_post_max_size() : string

Get the max post size.

Returns

string —

Return the post maximum filesize.

get_max_input_time()

get_max_input_time() : string

Get max input time.

Returns

string —

Return current maximum input time.

get_os()

get_os() 

Get operating system.

get_architecture()

get_architecture() 

Get System architecture.

memory_usage()

memory_usage() 

Get the current Memory usage.

get_output_buffer_size()

get_output_buffer_size() : string

Get the current output buffer size.

Returns

string —

Return the current back track limit.

get_php_safe_mode()

get_php_safe_mode() 

Check if PHP is in Safe Mode.

get_sql_mode()

get_sql_mode() 

Get current SQL mode.

get_php_allow_url_fopen()

get_php_allow_url_fopen() 

Check if PHP Allow URL fopen is enabled.

get_php_exif()

get_php_exif() 

Check if PHP exif is enabled.

get_php_ip_tc()

get_php_ip_tc() 

Check if PHP IP TC is enabled.

get_php_xml()

get_php_xml() 

Check if PHP XML is enabled.

get_server_getaway_interface()

get_server_getaway_interface() 

Get current server gateway interface.

get_server_ip()

get_server_ip() 

Get server IP.

get_server_name()

get_server_name() 

Get server name.

get_server_software()

get_server_software() 

Get server software.

get_server_protocol()

get_server_protocol() 

Get server protocol.

get_server_request_time()

get_server_request_time() 

Get server request time.

get_server_http_accept()

get_server_http_accept() 

Get server HTTP accept.

get_server_accept_charset()

get_server_accept_charset() 

Get server accepted charset.

get_http_host()

get_http_host() 

Get server HTTP host.

get_complete_url()

get_complete_url() 

Get server complete URL.

get_user_agent()

get_user_agent() 

Get server user agent.

get_https()

get_https() 

Check if HTTPS is on.

server_self_connect()

server_self_connect() 

Server self-connection test.

get_remote_address()

get_remote_address() 

Get server remote address.

get_remote_host()

get_remote_host() 

Get server remote host.

get_remote_port()

get_remote_port() 

Get server remote port.

get_script_file_name()

get_script_file_name() 

Get server script filename.

get_server_port()

get_server_port() 

Get server port.

get_current_page_uri()

get_current_page_uri() 

Get current page URL.

get_wp_root()

get_wp_root() 

Get WordPress root directory.

time_compare()

time_compare(string  $a, string  $b) : integer

Time comparison.

Parameters

string $a

Time 1.

string $b

Time 2.

Returns

integer —

Return 0 if $a is equal to $b, -1 if $a > $b or 1 if $a < $b.

render_file_system_method_check()

render_file_system_method_check() 

Render the file system method check.

render_mainwp_version_check()

render_mainwp_version_check() 

Render the MainWP version check.

render_mainwp_directory()

render_mainwp_directory() 

Render the MainWP directory check.

render_directory_row()

render_directory_row(string  $name, string  $directory, string  $check, string  $result, string  $passed) 

Render the directroy check row.

Parameters

string $name

Check name.

string $directory

Directory to check.

string $check

Check condition.

string $result

Check result.

string $passed

Show correct label depending on passed status.

render_row()

render_row(string  $config, string  $compare, string  $version, string  $getter, string  $extra_text = '', string  $extra_compare = null, string  $extra_version = null, boolean  $size_compare = false) 

Render the server information check row.

Parameters

string $config

Check name.

string $compare

Comparison operator.

string $version

Version for comparison.

string $getter

Function to call to handle comparison.

string $extra_text

Extra text to display in the row.

string $extra_compare

Additional comparison operator.

string $extra_version

Additional version to compare.

boolean $size_compare

Determies if size should be compared.

render_row_sec()

render_row_sec(string  $config, string  $compare, string  $version, string  $getter, string  $extra_text = '', string  $extra_compare = null, string  $extra_version = null, string  $toolTip = null, string  $whatType = null, string  $errorType = self::WARNING) 

Render the server information check secondary row.

Parameters

string $config

Check name.

string $compare

Comparison operator.

string $version

Version for comparison.

string $getter

Function to call to handle comparison.

string $extra_text

Extra text to display in the row.

string $extra_compare

Additional comparison operator.

string $extra_version

Additional version to compare.

string $toolTip

Tooltip to show.

string $whatType

What type.

string $errorType

Error type.

render_last_lines()

render_last_lines(string  $path, integer  $line_count, integer  $block_size = 512) : array

Render the error log last lines.

Parameters

string $path

Error log path.

integer $line_count

Line count.

integer $block_size

Block size.

Returns

array —

Selected number of error log records to show.

render_page_js()

render_page_js() 

Render JavaScrip code for the Server Information page.

render_server_infor()

render_server_infor() 

Render server information content.

render_system_infor_rows()

render_system_infor_rows(string  $branding_title) 

Render system information rows.

Parameters

string $branding_title

Custom branding plgin title.

render_php_settings_rows()

render_php_settings_rows() 

Render PHP settings information rows.

render_mysql_infor_rows()

render_mysql_infor_rows() 

Render MySQL settings information rows.

render_plugins_infor_rows()

render_plugins_infor_rows(string  $branding_title) 

Render plugins information rows.

Parameters

string $branding_title

Custom branding plugin title.

render_php_infor_rows()

render_php_infor_rows() 

Render PHP information rows.

render_error_page()

render_error_page() 

Render the Error log page.