= $warnings ) { $warnings = 0; } if ( isset( $dismissWarnings['conflicts'] ) && MainWP_Helper::containsAll( $dismissWarnings['conflicts'], $conflicts ) ) { $conflicts = array(); } if ( 0 === $warnings && 0 === count( $conflicts ) ) { return; } if ( $warnings > 0 ) { $dismissWarnings['warnings'] = 0; } if ( count( $conflicts ) > 0 ) { $dismissWarnings['conflicts'] = array(); } MainWP_Helper::update_option( 'mainwp_child_dismiss_warnings', $dismissWarnings ); $itheme_ext_activated = ( 'Y' === get_option( 'mainwp_ithemes_ext_activated' ) ) ? true : false; if ( $itheme_ext_activated ) { foreach ( $conflicts as $key => $cf ) { if ( 'iThemes Security' === $cf ) { unset( $conflicts[ $key ] ); } } if ( 0 === $warnings && 0 === count( $conflicts ) ) { return; } } ?>
0 ) { $warning .= ''; } if ( count( $conflicts ) > 0 ) { $warning .= ''; } echo $warning; ?>
This site may not connect to your dashboard or may have other issues. Check your MainWP Server Information page to review and check here for more information on possible fixesDismiss
'; if ( 1 === count( $conflicts ) ) { $warning .= '"' . $conflicts[0] . '" is'; } else { $warning .= '"' . join( '", "', $conflicts ) . '" are'; } $warning .= ' installed on this site. This is known to have a potential conflict with MainWP functions. Please click this link for possible solutionsDismiss


=', '3.4', 'getWordpressVersion' ) ) { $i ++; } if ( ! self::check( '>=', '5.2.4', 'getPHPVersion' ) ) { $i ++; } if ( ! self::check( '>=', '5.0', 'getMySQLVersion' ) ) { $i ++; } if ( ! self::check( '>=', '30', 'getMaxExecutionTime', '=', '0' ) ) { $i ++; } if ( ! self::check( '>=', '2M', 'getUploadMaxFilesize' ) ) { $i ++; } if ( ! self::check( '>=', '2M', 'getPostMaxSize' ) ) { $i ++; } if ( ! self::check( '>=', '10000', 'getOutputBufferSize' ) ) { $i ++; } // if (!self::check('=', true, 'getSSLSupport')) $i++; if ( ! self::checkDirectoryMainWPDirectory( false ) ) { $i ++; } return $i; } public static function getConflicts() { global $mainWPChild; $pluginConflicts = array( 'Better WP Security', 'iThemes Security', 'Secure WordPress', 'Wordpress Firewall', 'Bad Behavior', 'SpyderSpanker', ); $conflicts = array(); if ( count( $pluginConflicts ) > 0 ) { $plugins = $mainWPChild->get_all_plugins_int( false ); foreach ( $plugins as $plugin ) { foreach ( $pluginConflicts as $pluginConflict ) { if ( ( 1 === $plugin['active'] ) && ( ( $plugin['name'] === $pluginConflict ) || ( $plugin['slug'] === $pluginConflict ) ) ) { $conflicts[] = $plugin['name']; } } } } return $conflicts; } public static function renderConflicts() { $conflicts = self::getConflicts(); $branding_title = 'MainWP'; if ( MainWP_Child_Branding::is_branding() ) { $branding_title = MainWP_Child_Branding::get_branding(); } if ( count( $conflicts ) > 0 ) { $information['pluginConflicts'] = $conflicts; ?>
plugin conflict 1 ? 's' : '' ); ?> found
is installed on this site. This plugin is known to have a potential conflict with functions. Please click this link for possible solutions
No conflicts found. Dismiss

Pass'; } else { echo ' Warning'; } } public static function render() { $branding_title = 'MainWP Child'; if ( MainWP_Child_Branding::is_branding() ) { $branding_title = MainWP_Child_Branding::get_branding(); } ?>
=', '3.4', 'getWordpressVersion' ); ?> =', '5.3', 'getPHPVersion' ); self::renderRow( 'PHP Max Execution Time', '>=', '30', 'getMaxExecutionTime', 'seconds', '=', '0' ); self::renderRow( 'PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)', null, null, true ); self::renderRow( 'PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)', null, null, true ); self::renderRow( 'PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '(256M+ best for big backups)', null, null, true ); self::renderRow( 'SSL Extension Enabled', '=', true, 'getSSLSupport' ); ?> =', '10000', 'getOutputBufferSize' ); ?> =', '5.0', 'getMySQLVersion' ); ?>
Version

'mainwp-child', 'fields' => array( 'sections' => false ), 'timeout' => 60, ) ); if ( is_object( $api ) && isset( $api->version ) ) { return $api->version; } return false; } protected static function getMainWPVersionCheck() { $current = get_option( 'mainwp_child_plugin_version' ); $latest = self::getMainwpVersion(); if ( $current === $latest ) { echo ' Pass'; } else { echo ' Warning'; } } public static function renderCron() { $cron_array = _get_cron_array(); $schedules = wp_get_schedules(); ?> $cron ) { foreach ( $cron as $hook => $cron_info ) { foreach ( $cron_info as $key => $schedule ) { ?>
getMessage(), false ); } if ( ! is_dir( dirname( $path ) ) ) { if ( $write ) { return self::renderDirectoryRow( $branding_title, $path, 'Writable', 'Directory not found', false ); } else { return false; } } $hasWPFileSystem = MainWP_Helper::getWPFilesystem(); global $wp_filesystem; if ( $hasWPFileSystem && ! empty( $wp_filesystem ) ) { if ( ! $wp_filesystem->is_writable( $path ) ) { if ( $write ) { return self::renderDirectoryRow( $branding_title, $path, 'Writable', 'Directory not writable', false ); } else { return false; } } } else { if ( ! is_writable( $path ) ) { if ( $write ) { return self::renderDirectoryRow( $branding_title, $path, 'Writable', 'Directory not writable', false ); } else { return false; } } } if ( $write ) { return self::renderDirectoryRow( $branding_title, $path, 'Writable', 'Writable', true ); } else { return true; } } protected static function renderDirectoryRow( $pName, $pDirectory, $pCheck, $pResult, $pPassed ) { ?>
Pass' : ' Warning' ); ?> Pass' : ' Warning' ); ?> Pass' : ' Warning' ); ?> get_var( 'SHOW VARIABLES LIKE "version"', 1 ); } protected static function getPHPMemoryLimit() { return ini_get( 'memory_limit' ); } protected static function getOS() { echo esc_html( PHP_OS ); } protected static function getArchitecture() { echo esc_html( PHP_INT_SIZE * 8 ) ?> bit get_results( "SHOW VARIABLES LIKE 'sql_mode'" ); if ( is_array( $mysqlinfo ) ) { $sql_mode = $mysqlinfo[0]->Value; } if ( empty( $sql_mode ) ) { $sql_mode = __( 'NOT SET' ); } echo esc_html( $sql_mode ); } protected static function getPHPAllowUrlFopen() { if ( ini_get( 'allow_url_fopen' ) ) { $allow_url_fopen = __( 'ON' ); } else { $allow_url_fopen = __( 'OFF' ); } echo esc_html( $allow_url_fopen ); } protected static function getPHPExif() { if ( is_callable( 'exif_read_data' ) ) { $exif = __( 'YES' ) . ' ( V' . substr( phpversion( 'exif' ), 0, 4 ) . ')'; } else { $exif = __( 'NO' ); } echo esc_html( $exif ); } protected static function getPHPIPTC() { if ( is_callable( 'iptcparse' ) ) { $iptc = __( 'YES' ); } else { $iptc = __( 'NO' ); } echo esc_html( $iptc ); } protected static function getPHPXML() { if ( is_callable( 'xml_parser_create' ) ) { $xml = __( 'YES' ); } else { $xml = __( 'NO' ); } echo esc_html( $xml ); } // new protected static function getCurrentlyExecutingScript() { echo esc_html( $_SERVER['PHP_SELF'] ); } protected static function getServerGetawayInterface() { echo esc_html( $_SERVER['GATEWAY_INTERFACE'] ); } protected static function getServerIP() { echo esc_html( $_SERVER['SERVER_ADDR'] ); } protected static function getSeverName() { echo esc_html( $_SERVER['SERVER_NAME'] ); } protected static function getServerSoftware() { echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); } protected static function getServerProtocol() { echo esc_html( $_SERVER['SERVER_PROTOCOL'] ); } protected static function getServerRequestMethod() { echo esc_html( $_SERVER['REQUEST_METHOD'] ); } protected static function getServerRequestTime() { echo esc_html( $_SERVER['REQUEST_TIME'] ); } protected static function getServerQueryString() { echo esc_html( $_SERVER['QUERY_STRING'] ); } protected static function getServerHTTPAccept() { echo esc_html( $_SERVER['HTTP_ACCEPT'] ); } protected static function getServerAcceptCharset() { if ( ! isset( $_SERVER['HTTP_ACCEPT_CHARSET'] ) || ( '' === $_SERVER['HTTP_ACCEPT_CHARSET'] ) ) { esc_html_e( 'N/A', 'mainwp' ); } else { echo esc_html( $_SERVER['HTTP_ACCEPT_CHARSET'] ); } } protected static function getHTTPHost() { echo esc_html( $_SERVER['HTTP_HOST'] ); } protected static function getCompleteURL() { echo esc_html( $_SERVER['HTTP_REFERER'] ); } protected static function getUserAgent() { echo esc_html( $_SERVER['HTTP_USER_AGENT'] ); } protected static function getHTTPS() { if ( isset( $_SERVER['HTTPS'] ) && '' !== $_SERVER['HTTPS'] ) { echo esc_html( __( 'ON', 'mainwp' ) . ' - ' . $_SERVER['HTTPS'] ); } else { esc_html_e( 'OFF', 'mainwp' ); } } protected static function getRemoteAddress() { echo esc_html( $_SERVER['REMOTE_ADDR'] ); } protected static function getRemoteHost() { if ( ! isset( $_SERVER['REMOTE_HOST'] ) || ( '' === $_SERVER['REMOTE_HOST'] ) ) { esc_html_e( 'N/A', 'mainwp' ); } else { echo esc_html( $_SERVER['REMOTE_HOST'] ); } } protected static function getRemotePort() { echo esc_html( $_SERVER['REMOTE_PORT'] ); } protected static function getScriptFileName() { echo esc_html( $_SERVER['SCRIPT_FILENAME'] ); } protected static function getServerAdmin() { echo esc_html( $_SERVER['SERVER_ADMIN'] ); } protected static function getServerPort() { echo esc_html( $_SERVER['SERVER_PORT'] ); } protected static function getServerSignature() { echo esc_html( $_SERVER['SERVER_SIGNATURE'] ); } protected static function getServerPathTranslated() { if ( ! isset( $_SERVER['PATH_TRANSLATED'] ) || ( '' === $_SERVER['PATH_TRANSLATED'] ) ) { esc_html_e( 'N/A', 'mainwp' ); } else { echo esc_html( $_SERVER['PATH_TRANSLATED'] ); } } protected static function getScriptName() { echo esc_html( $_SERVER['SCRIPT_NAME'] ); } protected static function getCurrentPageURI() { echo esc_html( $_SERVER['REQUEST_URI'] ); } protected static function getWPRoot() { echo esc_html( ABSPATH ); } function formatSizeUnits( $bytes ) { if ( $bytes >= 1073741824 ) { $bytes = number_format( $bytes / 1073741824, 2 ) . ' GB'; } elseif ( $bytes >= 1048576 ) { $bytes = number_format( $bytes / 1048576, 2 ) . ' MB'; } elseif ( $bytes >= 1024 ) { $bytes = number_format( $bytes / 1024, 2 ) . ' KB'; } elseif ( $bytes > 1 ) { $bytes = $bytes . ' bytes'; } elseif ( 1 === $bytes ) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } /* *Plugin Name: Error Log Dashboard Widget *Plugin URI: http://wordpress.org/extend/plugins/error-log-dashboard-widget/ *Description: Robust zero-configuration and low-memory way to keep an eye on error log. *Author: Andrey "Rarst" Savchenko *Author URI: http://www.rarst.net/ *Version: 1.0.2 *License: GPLv2 or later *Includes last_lines() function by phant0m, licensed under cc-wiki and GPLv2+ */ public static function renderErrorLogPage() { ?>
' . esc_html__( 'Error logging disabled.', 'mainwp' ) . ''; } $error_log = ini_get( 'error_log' ); $logs = apply_filters( 'error_log_mainwp_logs', array( $error_log ) ); $count = apply_filters( 'error_log_mainwp_lines', 10 ); $lines = array(); foreach ( $logs as $log ) { if ( is_readable( $log ) ) { $lines = array_merge( $lines, self::last_lines( $log, $count ) ); } } $lines = array_map( 'trim', $lines ); $lines = array_filter( $lines ); if ( empty( $lines ) ) { echo '' . esc_html__( 'MainWP is unable to find your error logs, please contact your host for server error logs.', 'mainwp' ) . ''; return; } foreach ( $lines as $key => $line ) { if ( false !== strpos( $line, ']' ) ) { list( $time, $error ) = explode( ']', $line, 2 ); } else { list( $time, $error ) = array( '', $line ); } $time = trim( $time, '[]' ); $error = trim( $error ); $lines[ $key ] = compact( 'time', 'error' ); } if ( count( $error_log ) > 1 ) { uasort( $lines, array( __CLASS__, 'time_compare' ) ); $lines = array_slice( $lines, 0, $count ); } foreach ( $lines as $line ) { $error = esc_html( $line['error'] ); $time = esc_html( $line['time'] ); if ( ! empty( $error ) ) { echo wp_kses_post( "{$time}{$error}" ); } } } static function time_compare( $a, $b ) { if ( $a === $b ) { return 0; } return ( strtotime( $a['time'] ) > strtotime( $b['time'] ) ) ? - 1 : 1; } static function last_lines( $path, $line_count, $block_size = 512 ) { $lines = array(); // we will always have a fragment of a non-complete line // keep this in here till we have our next entire line. $leftover = ''; $fh = fopen( $path, 'r' ); // go to the end of the file fseek( $fh, 0, SEEK_END ); do { // need to know whether we can actually go back // $block_size bytes $can_read = $block_size; if ( ftell( $fh ) <= $block_size ) { $can_read = ftell( $fh ); } if ( empty( $can_read ) ) { break; } // go back as many bytes as we can // read them to $data and then move the file pointer // back to where we were. fseek( $fh, - $can_read, SEEK_CUR ); $data = fread( $fh, $can_read ); $data .= $leftover; fseek( $fh, - $can_read, SEEK_CUR ); // split lines by \n. Then reverse them, // now the last line is most likely not a complete // line which is why we do not directly add it, but // append it to the data read the next time. $split_data = array_reverse( explode( "\n", $data ) ); $new_lines = array_slice( $split_data, 0, - 1 ); $lines = array_merge( $lines, $new_lines ); $leftover = $split_data[ count( $split_data ) - 1 ]; } while ( count( $lines ) < $line_count && 0 !== ftell( $fh ) ); if ( 0 === ftell( $fh ) ) { $lines[] = $leftover; } fclose( $fh ); // Usually, we will read too many lines, correct that here. return array_slice( $lines, 0, $line_count ); } public static function renderWPConfig() { ?>

WP-Config.php

.htaccess