> Info subpages. */ private static function get_subpages() { if ( isset( static::$subPages ) && is_array( static::$subPages ) ) { return static::$subPages; } /** * Filter mainwp_getsubpages_server * * Filters subpages for the Info page. * * @since Unknown */ $sub_pages = apply_filters_deprecated( 'mainwp-getsubpages-server', array( array() ), '4.0.7.2', 'mainwp_getsubpages_server' ); // NOSONAR - not IP. static::$subPages = apply_filters( 'mainwp_getsubpages_server', $sub_pages ); return is_array( static::$subPages ) ? static::$subPages : array(); } /** * Get the built-in Info pages used across menu registration and navigation rendering. * * @return array> Info page definitions. */ private static function get_core_pages() { $pages = array( array( 'slug' => 'ServerInformation', 'page_title' => __( 'Info', 'mainwp' ), 'menu_title' => ' ' . esc_html__( 'Info', 'mainwp' ) . '', 'nav_title' => esc_html__( 'Server', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render' ), 'active_keys' => array( '', 'ServerInformation' ), 'show_in_header_nav' => true, 'show_in_subpages_menu' => true, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ) ), ), array( 'slug' => 'ServerInformationCron', 'page_title' => __( 'Cron Schedules', 'mainwp' ), 'menu_title' => '
' . esc_html__( 'Cron Schedules', 'mainwp' ) . '
', 'nav_title' => esc_html__( 'Cron Schedules', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_cron' ), 'active_keys' => array( 'ServerInformationCron' ), 'show_in_header_nav' => true, 'show_in_subpages_menu' => true, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), esc_html__( 'Cron Schedules', 'mainwp' ) ), ), array( 'slug' => 'ErrorLog', 'page_title' => __( 'Error Log', 'mainwp' ), 'menu_title' => '
' . esc_html__( 'Error Log', 'mainwp' ) . '
', 'nav_title' => esc_html__( 'Error Log', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_error_log_page' ), 'active_keys' => array( 'ErrorLog' ), 'show_in_header_nav' => true, 'show_in_subpages_menu' => true, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), esc_html__( 'Error Log', 'mainwp' ) ), ), array( 'slug' => 'WPConfig', 'page_title' => __( 'WP-Config File', 'mainwp' ), 'menu_title' => '
' . esc_html__( 'WP-Config File', 'mainwp' ) . '
', 'nav_title' => esc_html__( 'WP-Config File', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_wp_config' ), 'active_keys' => array( 'WPConfig' ), 'show_in_header_nav' => false, 'show_in_subpages_menu' => true, 'show_in_left_menu' => false, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), esc_html__( 'WP-Config File', 'mainwp' ) ), ), array( 'slug' => '.htaccess', 'page_title' => __( '.htaccess File', 'mainwp' ), 'menu_title' => '
' . esc_html__( '.htaccess File', 'mainwp' ) . '
', 'nav_title' => esc_html__( '.htaccess File', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_htaccess' ), 'active_keys' => array( '.htaccess' ), 'show_in_header_nav' => false, 'show_in_subpages_menu' => true, 'show_in_left_menu' => false, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), esc_html__( '.htaccess File', 'mainwp' ) ), 'condition' => static function() { return MainWP_Server_Information_Handler::is_apache_server_software(); }, ), array( 'slug' => 'ActionLogs', 'page_title' => __( 'Custom Event Monitor', 'mainwp' ), 'menu_title' => '
' . esc_html__( 'Custom Event Monitor', 'mainwp' ) . '
', 'nav_title' => esc_html__( 'Custom Event Monitor', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_action_logs' ), 'active_keys' => array( 'ActionLogs' ), 'show_in_header_nav' => true, 'show_in_subpages_menu' => false, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), esc_html__( 'Custom Event Monitor', 'mainwp' ) ), ), array( 'slug' => 'PluginPrivacy', 'page_title' => __( 'Plugin Privacy', 'mainwp' ), 'menu_title' => '
' . esc_html__( 'Plugin Privacy', 'mainwp' ) . '
', 'nav_title' => esc_html__( 'Plugin Privacy', 'mainwp' ), 'callback' => array( static::get_class_name(), 'render_plugin_privacy_page' ), 'active_keys' => array( 'PluginPrivacy' ), 'show_in_header_nav' => false, 'show_in_subpages_menu' => false, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => 'mainwp_tab', 'palette_titles' => array( esc_html__( 'Privacy Policy', 'mainwp' ) ), ), ); $visible_pages = array(); foreach ( $pages as $page ) { if ( 'ServerInformation' !== $page['slug'] && MainWP_Menu::is_disable_menu_item( 3, $page['slug'] ) ) { continue; } if ( isset( $page['condition'] ) && is_callable( $page['condition'] ) && ! call_user_func( $page['condition'] ) ) { continue; } $visible_pages[] = $page; } return $visible_pages; } /** * Convert a navigation href into a usable URL. * * @param string $href Navigation href. * * @return string Navigation URL. */ private static function get_navigation_item_url( $href ) { $href = trim( wp_specialchars_decode( (string) $href, ENT_QUOTES ) ); if ( empty( $href ) ) { return ''; } if ( preg_match( '/^https?:\/\//i', $href ) ) { return $href; } return admin_url( ltrim( $href, '/' ) ); } /** * Get dynamic Info subpage items using the legacy left-menu normalization path. * * @return array> Info navigation items. */ private static function get_filtered_subpage_navigation_items() { $menu_items = array(); $core_slugs = array(); foreach ( static::get_navigation_items( 'left_menu_core' ) as $item ) { if ( empty( $item['show_in_left_menu'] ) ) { continue; } $core_slugs[ $item['slug'] ] = true; $menu_items[] = array( 'title' => $item['title'], 'parent_key' => $item['left_menu_parent'], 'href' => $item['href'], 'slug' => $item['slug'], 'right' => '', ); } MainWP_Menu::init_subpages_left_menu( static::get_subpages(), $menu_items, 'ServerInformation', 'Server' ); $items = array(); foreach ( $menu_items as $menu_item ) { if ( empty( $menu_item['slug'] ) || empty( $menu_item['title'] ) || empty( $menu_item['href'] ) ) { continue; } if ( isset( $core_slugs[ $menu_item['slug'] ] ) ) { continue; } if ( isset( $menu_item['item_slug'] ) ) { if ( MainWP_Menu::is_disable_menu_item( 3, $menu_item['item_slug'] ) ) { continue; } } elseif ( MainWP_Menu::is_disable_menu_item( 3, $menu_item['slug'] ) ) { continue; } $active_slug = 0 === strpos( $menu_item['slug'], 'Server' ) ? substr( $menu_item['slug'], strlen( 'Server' ) ) : $menu_item['slug']; $item = array( 'slug' => $menu_item['slug'], 'title' => $menu_item['title'], 'href' => $menu_item['href'], 'active_keys' => array( $active_slug, $menu_item['slug'] ), 'show_in_header_nav' => false, 'show_in_subpages_menu' => true, 'show_in_left_menu' => true, 'show_in_palette' => true, 'left_menu_parent' => isset( $menu_item['parent_key'] ) ? $menu_item['parent_key'] : 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), $menu_item['title'] ), 'menu_hidden' => false, ); if ( isset( $menu_item['item_slug'] ) ) { $item['item_slug'] = $menu_item['item_slug']; } if ( ! empty( $menu_item['before_title'] ) ) { $item['before_title'] = $menu_item['before_title']; $item['palette_titles'][1] = trim( wp_strip_all_tags( $menu_item['before_title'] ) . ' ' . $menu_item['title'] ); } $items[] = $item; } return $items; } /** * Get the Info navigation items. * * @return array> Info navigation items. */ public static function get_navigation_items( $context = 'default' ) { $items = array(); foreach ( static::get_core_pages() as $page ) { $items[] = array( 'slug' => $page['slug'], 'title' => $page['nav_title'], 'href' => 'admin.php?page=' . $page['slug'], 'active_keys' => $page['active_keys'], 'show_in_header_nav' => $page['show_in_header_nav'], 'show_in_subpages_menu' => $page['show_in_subpages_menu'], 'show_in_left_menu' => $page['show_in_left_menu'], 'show_in_palette' => $page['show_in_palette'], 'left_menu_parent' => $page['left_menu_parent'], 'palette_titles' => $page['palette_titles'], 'menu_hidden' => false, ); } if ( 'left_menu_core' === $context ) { return $items; } if ( 'command_palette' === $context ) { return array_merge( $items, static::get_filtered_subpage_navigation_items() ); } foreach ( static::get_subpages() as $subPage ) { if ( empty( $subPage['slug'] ) || MainWP_Menu::is_disable_menu_item( 3, 'Server' . $subPage['slug'] ) ) { continue; } $item = array( 'slug' => 'Server' . $subPage['slug'], 'title' => $subPage['title'], 'href' => ! empty( $subPage['href'] ) ? $subPage['href'] : 'admin.php?page=Server' . $subPage['slug'], 'active_keys' => array( $subPage['slug'], 'Server' . $subPage['slug'] ), 'show_in_header_nav' => false, 'show_in_subpages_menu' => empty( $subPage['menu_hidden'] ), 'show_in_left_menu' => empty( $subPage['menu_hidden'] ), 'show_in_palette' => empty( $subPage['menu_hidden'] ), 'left_menu_parent' => 'ServerInformation', 'palette_titles' => array( esc_html__( 'System Info', 'mainwp' ), $subPage['title'] ), 'menu_hidden' => ! empty( $subPage['menu_hidden'] ), ); if ( isset( $subPage['item_slug'] ) ) { $item['item_slug'] = $subPage['item_slug']; } $items[] = $item; } return $items; } /** * Get the Info command palette items. * * @return array> Command palette item definitions. */ public static function get_command_palette_items() { $items = array(); foreach ( static::get_navigation_items( 'command_palette' ) as $item ) { if ( empty( $item['show_in_palette'] ) ) { continue; } $items[] = array( 'slug' => $item['slug'], 'href' => $item['href'], 'path_titles' => $item['palette_titles'], ); } return $items; } /** * Method init_menu() * * Initiate Info subPage menu. * * @uses \MainWP\Dashboard\MainWP_Menu::is_disable_menu_item() * @uses \MainWP\Dashboard\MainWP_Server_Information_Handler::is_apache_server_software() */ public static function init_menu() { // phpcs:ignore -- NOSONAR - complex. add_action( 'mainwp_pageheader_infor', array( static::get_class_name(), 'render_header' ) ); add_action( 'mainwp_pagefooter_infor', array( static::get_class_name(), 'render_footer' ) ); foreach ( static::get_core_pages() as $page ) { add_submenu_page( 'mainwp_tab', $page['page_title'], $page['menu_title'], 'read', $page['slug'], $page['callback'] ); } foreach ( static::get_subpages() as $subPage ) { if ( empty( $subPage['slug'] ) || MainWP_Menu::is_disable_menu_item( 3, 'Server' . $subPage['slug'] ) ) { continue; } add_submenu_page( 'mainwp_tab', $subPage['title'], '
' . $subPage['title'] . '
', 'read', 'Server' . $subPage['slug'], $subPage['callback'] ); } } /** * Renders Sub Pages Menu. * * @uses \MainWP\Dashboard\MainWP_Menu::is_disable_menu_item() * @uses \MainWP\Dashboard\MainWP_Server_Information_Handler::is_apache_server_software() */ public static function init_subpages_menu() { // phpcs:ignore -- NOSONAR - complex. ?> esc_html__( 'Info', 'mainwp' ), 'parent_key' => 'mainwp_tab', 'slug' => 'ServerInformation', 'href' => 'admin.php?page=ServerInformation', 'icon' => '', ), 0 ); $init_sub_subleftmenu = array(); foreach ( static::get_navigation_items( 'left_menu_core' ) as $item ) { if ( empty( $item['show_in_left_menu'] ) ) { continue; } $init_sub_subleftmenu[] = array( 'title' => $item['title'], 'parent_key' => $item['left_menu_parent'], 'href' => $item['href'], 'slug' => $item['slug'], 'right' => '', ); } if ( empty( $subPages ) ) { $subPages = static::get_subpages(); } MainWP_Menu::init_subpages_left_menu( $subPages, $init_sub_subleftmenu, 'ServerInformation', 'Server' ); foreach ( $init_sub_subleftmenu as $item ) { if ( isset( $item['item_slug'] ) ) { if ( MainWP_Menu::is_disable_menu_item( 3, $item['item_slug'] ) ) { continue; } } elseif ( MainWP_Menu::is_disable_menu_item( 3, $item['slug'] ) ) { continue; } MainWP_Menu::add_left_menu( $item, 2 ); } } /** * Renders Info header. * * @param string $shownPage Current page. * * @uses \MainWP\Dashboard\MainWP_Menu::is_disable_menu_item() * @uses \MainWP\Dashboard\MainWP_UI::render_top_header() * @uses \MainWP\Dashboard\MainWP_UI::render_page_navigation() * @uses \MainWP\Dashboard\MainWP_Server_Information_Handler::is_apache_server_software() */ public static function render_header( $shownPage = '' ) { $params = array( 'title' => esc_html__( 'Info', 'mainwp' ), ); MainWP_UI::render_top_header( $params ); $renderItems = array(); foreach ( static::get_navigation_items() as $item ) { if ( empty( $item['show_in_header_nav'] ) ) { continue; } $renderItems[] = array( 'title' => $item['title'], 'href' => $item['href'], 'active' => in_array( $shownPage, $item['active_keys'], true ), ); } if ( isset( $_GET['page'] ) && 'PluginPrivacy' !== $_GET['page'] ) { //phpcs:ignore -- monce safe. MainWP_UI::render_page_navigation( $renderItems ); } static::render_actions_bar(); echo '
'; } /** * Renders Server Information footer. */ public static function render_footer() { echo '
'; } /** * Renders Server Information action bar element. */ public static function render_actions_bar() { if ( isset( $_GET['page'] ) && 'ServerInformation' === $_GET['page'] ) : // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ?>
=' ) ) { /* translators: 1: line break tag, 2: opening anchor tag, 3: closing anchor tag */ echo "
" . sprintf( esc_html__( 'Your host needs to update OpenSSL to at least version 1.1.0 which is already over 4 years old and contains patches for over 60 vulnerabilities.%1$sThese range from Denial of Service to Remote Code Execution. %2$sClick here for more information.%3$s', 'mainwp' ), '
', '', '' ) . '
'; } // Detect issues before rendering. $datatable_rows = MainWP_Server_Information_Handler::get_database_report_rows(); static::render_detected_issues_summary(); ?>
> > >
> > >
> > >
> >
> > >
> >
=', '6.2', 'get_wordpress_version', '', '', null, null, static::ERROR ); static::render_row( 'WordPress Memory Limit', '>=', '64M', 'get_wordpress_memory_limit', '', '', null ); static::render_row( 'MultiSite Disabled', '=', true, 'check_if_multisite', '', '', null ); ?> > =', '7.4', 'get_php_version', '', '', null, null, static::ERROR ); static::render_row( 'PHP Max Execution Time', '>=', '30', 'get_max_execution_time', 'seconds', '=', '0' ); static::render_row( 'PHP Max Input Time', '>=', '30', 'get_max_input_time', 'seconds', '=', '0' ); static::render_row( 'PHP Memory Limit', '>=', '256M', 'get_php_memory_limit', '', '', null, 'filesize' ); static::render_row( 'PCRE Backtracking Limit', '>=', '10000', 'get_output_buffer_size', '', '', null ); static::render_row( 'PHP Upload Max Filesize', '>=', '2M', 'get_upload_max_filesize', '', '', null, 'filesize' ); static::render_row( 'PHP Post Max Size', '>=', '2M', 'get_post_max_size', '', '', null, 'filesize' ); static::render_row( 'SSL Extension Enabled', '=', true, 'get_ssl_support', '', '', null ); static::render_row( 'SSL Warnings', '=', '', 'get_ssl_warning', 'empty', '', null ); static::render_row( 'cURL Extension Enabled', '=', true, 'get_curl_support', '', '', null, null, static::ERROR ); static::render_row( 'cURL Timeout', '>=', '300', 'get_curl_timeout', 'seconds', '=', '0' ); if ( function_exists( 'curl_version' ) ) { $reuire_curl = '7.18.1'; if ( version_compare( MainWP_Server_Information_Handler::get_php_version(), '8.0.0' ) >= 0 ) { $reuire_curl = '7.29.0'; } static::render_row( 'cURL Version', '>=', $reuire_curl, 'get_curl_version', '', '', null ); $openssl_version = 'OpenSSL/1.1.0'; static::render_row( 'OpenSSL Version', '>=', $openssl_version, 'get_curl_ssl_version', '', '', null, 'curlssl' ); $wk = MainWP_Server_Information_Handler::get_openssl_working_status(); ?> OpenSSL Working Status Yes > > > > > > > > =', '5.0', 'get_mysql_version', '', '', null, null, static::ERROR ); ?> > > > > > > > > > > > > > > > > > > > > > > > | $plugin ) { if ( isset( $all_extensions[ dirname( $slug ) ] ) ) { continue; } ?> =', '7.4', 'get_php_version', '', '', null ); static::render_row_with_description( esc_html__( 'SSL Extension Enabled', 'mainwp' ), '=', true, 'get_ssl_support', '', '', null ); static::render_row_with_description( esc_html__( 'cURL Extension Enabled', 'mainwp' ), '=', true, 'get_curl_support', '', '', null ); $ssl_version = MainWP_Server_Information_Handler::get_curl_ssl_version(); $openssl_version = 'OpenSSL/1.1.0'; if ( false !== strpos( $ssl_version, 'LibreSSL' ) ) { $openssl_version = 'LibreSSL/2.5.0'; } static::render_row_with_description( 'cURL SSL Version', '>=', $openssl_version, 'get_curl_ssl_version', '', '', null, 'curlssl' ); if ( ! MainWP_Server_Information_Handler::curlssl_compare( $openssl_version, '>=' ) ) { ?> =', '5.0', 'get_mysql_version', '', '', null ); ?>
', '', '' ); } else { /* translators: 1: line break tag, 2: opening anchor tag, 3: closing anchor tag */ printf( esc_html__( 'Your host needs to update OpenSSL to at least version 1.1.0 which is already over 4 years old and contains patches for over 60 vulnerabilities.%1$sThese range from Denial of Service to Remote Code Execution. %2$sClick here for more information.%3$s', 'mainwp' ), '
', '', '' ); } ?>
array( 'mainwp_updatescheck_start_last_timestamp', 'mainwp_cronupdatescheck_action', $auto_update_text ), 'Check for reconnect sites' => array( 'mainwp_cron_last_stats', 'mainwp_cronreconnect_action', esc_html__( 'Once hourly', 'mainwp' ), 'hourly' ), 'Ping childs sites' => array( 'mainwp_cron_last_ping', 'mainwp_cronpingchilds_action', esc_html__( 'Once daily', 'mainwp' ), 'daily' ), ); $cron_jobs['Child site uptime monitoring'] = array( 'mainwp_uptime_lasttime_check', 'mainwp_cronuptimemonitoringcheck_action', esc_html__( 'Once every minute', 'mainwp' ), 'minutely' ); $disableHealthChecking = get_option( 'mainwp_disableSitesHealthMonitoring', 1 ); // disabled by default. if ( ! $disableHealthChecking ) { $cron_jobs['Site Health monitoring'] = array( 'mainwp_cron_checksiteshealth_last_timestamp', 'mainwp_cronsitehealthcheck_action', esc_html__( 'Once hourly', 'mainwp' ), 'hourly' ); } if ( get_option( 'mainwp_enableLegacyBackupFeature' ) ) { $cron_jobs['Start backups (Legacy)'] = array( 'mainwp_cron_last_backups', 'mainwp_cronbackups_action', esc_html__( 'Once hourly', 'mainwp' ), 'hourly' ); $cron_jobs['Continue backups (Legacy)'] = array( 'mainwp_cron_last_backups_continue', 'mainwp_cronbackups_continue_action', esc_html__( 'Once every five minutes', 'mainwp' ), '5minutely' ); } $cron_jobs = apply_filters( 'mainwp_info_schedules_cron_listing', $cron_jobs ); /** * Action: mainwp_before_cron_jobs_table * * Renders on the top of the Cron Jobs page, before the Schedules table. * * @since 4.0 */ do_action( 'mainwp_before_cron_jobs_table' ); ?>
', ' ' ); ?>
$hook ) { if ( is_array( $hook ) && isset( $hook['title'] ) && isset( $hook['action'] ) ) { $job_title = $hook['title']; $job_action = $hook['action']; $job_freq = isset( $hook['frequency'] ) ? $hook['frequency'] : ''; $job_last_run = isset( $hook['last_run'] ) ? $hook['last_run'] : ''; $job_next_run = isset( $hook['next_run'] ) ? $hook['next_run'] : ''; } else { $is_auto_update_job = false; $lasttime_run = 0; $next_run = 0; if ( 'mainwp_updatescheck_start_last_timestamp' === $hook[0] ) { $update_time = MainWP_Settings::get_websites_automatic_update_time(); $last_run = $update_time['last']; $next_run = $update_time['next']; $is_auto_update_job = true; } elseif ( false === get_option( $hook[0] ) ) { $last_run = esc_html__( 'Never', 'mainwp' ); } else { $lasttime_run = get_option( $hook[0] ); if ( $lasttime_run ) { if ( 'mainwp_uptime_lasttime_check' === $hook[0] ) { $last_run = MainWP_Utility::format_timestamp( $lasttime_run ); } else { $last_run = MainWP_Utility::format_timestamp( MainWP_Utility::get_timestamp( $lasttime_run ) ); } } else { $last_run = esc_html__( 'Never', 'mainwp' ); } } if ( $useWPCron && 'mainwp_updatescheck_start_last_timestamp' !== $hook[0] ) { $next_run = wp_next_scheduled( $hook[1] ); if ( ! empty( $next_run ) ) { $next_run = MainWP_Utility::format_timestamp( MainWP_Utility::get_timestamp( $next_run ) ); } } if ( empty( $next_run ) || ( ! $useWPCron && ! $is_auto_update_job && isset( $hook[3] ) ) ) { $nexttime_run = static::get_schedule_next_time_to_show( $hook[3], $lasttime_run, $local_timestamp ); if ( $nexttime_run < $local_timestamp + 3 * MINUTE_IN_SECONDS ) { $next_run = esc_html__( 'Any minute', 'mainwp' ); } else { $next_run = MainWP_Utility::format_timestamp( MainWP_Utility::get_timestamp( $nexttime_run ) ); } } $job_title = $cron_job; $job_action = $hook[1]; $job_freq = $hook[2]; $job_last_run = $last_run; $job_next_run = $next_run; } // phpcs:disable WordPress.Security.EscapeOutput ?>
'true', 'paging' => 'false', 'info' => 'false', 'responsive' => 'true', ); /** * Filter: mainwp_cron_jobs_table_features * * Filters the Cron Schedules table features. * * @since 4.1 */ $table_features = apply_filters( 'mainwp_cron_jobs_table_features', $table_features ); ?>
MainWP Upload Directory' . $mess . ''; } /** * Renders the directory check row. * * @param string $name check name. * @param string $check desired result. * @param string $result detected result. * @param bool $passed true|false check result. * * @return bool true. */ public static function render_directory_row( $name, $check, $result, $passed ) { // phpcs:disable WordPress.Security.EscapeOutput ?>
' . 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 ( 1 < count( $lines ) ) { // phpcs:ignore -- ok. //uasort( $lines, array( MainWP_Server_Information_Handler::get_class_name(), 'time_compare' ) ); $lines = array_slice( $lines, 0, $count ); } // phpcs:disable WordPress.Security.EscapeOutput foreach ( $lines as $line ) { $error = esc_html( $line['error'] ); $time = esc_html( $line['time'] ); if ( ! empty( $error ) ) { echo '' . $time . '' . $error . ''; } } // phpcs:enable } /** * Renders the WP Config page. * * @return void */ public static function render_wp_config() { if ( ! \mainwp_current_user_can( 'dashboard', 'see_server_information' ) ) { \mainwp_do_not_have_permissions( 'WP-Config.php', 'mainwp' ); return; } static::render_header( 'WPConfig' ); /** * Action: mainwp_before_wp_config_section * * Fires before the WP Config section. * * @since 4.1 */ do_action( 'mainwp_before_wp_config_section' ); ?>
'; esc_html_e( 'It appears that the show_source() PHP function has been disabled on the servre.', 'mainwp' ); echo '
'; esc_html_e( 'Please, contact your host support and have them enable the show_source() function for the proper functioning of this feature.', 'mainwp' ); } elseif ( file_exists( ABSPATH . 'wp-config.php' ) ) { show_source( ABSPATH . 'wp-config.php' ); } else { $files = get_included_files(); $configFound = false; if ( is_array( $files ) ) { foreach ( $files as $file ) { if ( stristr( $file, 'wp-config.php' ) ) { $configFound = true; show_source( $file ); break; } } } if ( ! $configFound ) { esc_html_e( 'wp-config.php not found', 'mainwp' ); } } ?>
log_action( 'Action logs set to: ' . MainWP_Logger::instance()->get_log_text( $act_log ), ( $spec_log ? $act_log : MainWP_Logger::LOG ), 2, true ); if ( MainWP_Logger::DISABLED === $act_log ) { MainWP_Logger::instance()->set_log_priority( $act_log, $spec_log ); } MainWP_Utility::update_option( 'mainwp_actionlogs', $act_log ); MainWP_Utility::update_option( 'mainwp_actionlogs_enabled_timestamp', time() ); } if ( isset( $_REQUEST['actionlogs_clear'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $log_to_db = apply_filters( 'mainwp_logger_to_db', true ); if ( $log_to_db ) { MainWP_Logger::instance()->clear_log_db(); } else { MainWP_Logger::instance()->clear_log(); } } $enabled = (int) MainWP_Logger::instance()->get_log_status(); $specific_default = array( MainWP_Logger::UPDATE_CHECK_LOG_PRIORITY => esc_html__( 'Update Checking', 'mainwp' ), MainWP_Logger::UPTIME_CHECK_LOG_PRIORITY => esc_html__( 'Uptime monitoring', 'mainwp' ), MainWP_Logger::UPTIME_NOTICE_LOG_PRIORITY => esc_html__( 'Uptime notification', 'mainwp' ), MainWP_Logger::LOGS_REGULAR_SCHEDULE => esc_html__( 'Regular Schedule', 'mainwp' ), MainWP_Logger::DEBUG_UPDATES_SCHEDULE => esc_html__( 'Debug updates crons', 'mainwp' ), MainWP_Logger::EXECUTION_TIME_LOG_PRIORITY => esc_html__( 'Execution time', 'mainwp' ), MainWP_Logger::EXECUTION_SYNC_LOG_PRIORITY => esc_html__( 'Execution Sync', 'mainwp' ), MainWP_Logger::EXECUTION_SYNC_DETAILS_LOG_PRIORITY => esc_html__( 'Execution Sync Details', 'mainwp' ), MainWP_Logger::LOGS_AUTO_PURGE_LOG_PRIORITY => esc_html__( 'Auto Archive Network Activity', 'mainwp' ), MainWP_Logger::CONNECT_LOG_PRIORITY => esc_html__( 'Dashboard Connect', 'mainwp' ), MainWP_Logger::SITES_CHANGES_LOG_PRIORITY => esc_html__( 'Network Activity', 'mainwp' ), MainWP_Logger::UNHOOKS_LOG_PRIORITY => esc_html__( 'Unhooks Info', 'mainwp' ), MainWP_Logger::CACHE_METRICS_LOG_PRIORITY => esc_html__( 'Cache Metrics', 'mainwp' ), MainWP_Logger::DB_QUERIES_LOG_PRIORITY => esc_html__( 'DB Queries', 'mainwp' ), MainWP_Logger::WARM_CACHE_LOG_PRIORITY => esc_html__( 'Warm Cache', 'mainwp' ), MainWP_Logger::EXTENSION_UPDATES_CHECK_LOG_PRIORITY => esc_html__( 'Extension Updates Check', 'mainwp' ), MainWP_Logger::AUTO_UPDATES_LOG_PRIORITY => esc_html__( 'Auto Updates', 'mainwp' ), ); $specific_logs = apply_filters( 'mainwp_specific_action_logs', $specific_default ); // deprecated since 4.3.1, use 'mainwp_log_specific_actions' instead. $specific_logs = apply_filters( 'mainwp_log_specific_actions', $specific_logs ); ?>

show_log_db(); } else { MainWP_Logger::instance()->show_log_file(); } ?>
enabled_log_priority( MainWP_Logger::SITES_CHANGES_LOG_PRIORITY ) ) { $stats = Log_DB_Helper::instance()->get_logs_db_stats(); MainWP_Logger::instance()->log_events( 'sites-changes', 'DB Info :: ' . print_r( $stats, true ) ); //phpcs:ignore --ok. } } /** * Renders the Plugin Privacy page. * * @return void */ public static function render_plugin_privacy_page() { static::render_header( 'PluginPrivacy' ); /** * Action: mainwp_before_plugin_privacy_section * * Fires before the Plugin Privacy section. * * @since 4.2 */ do_action( 'mainwp_before_plugin_privacy_section' ); ?>

'; esc_html_e( 'It appears that the show_source() PHP function has been disabled on the servre.', 'mainwp' ); echo '
'; esc_html_e( 'Please, contact your host support and have them enable the show_source() function for the proper functioning of this feature.', 'mainwp' ); } else { show_source( ABSPATH . '.htaccess' ); } ?>
' . esc_html__( 'Individual uptime monitoring is running', 'mainwp' ) . ''; } echo '' . $option['label'] . '' . $option['value'] . $addition_info . ''; } // phpcs:enable } /** * Render detected issues summary. * * @return void */ private static function render_detected_issues_summary() { $issues = MainWP_Server_Information_Handler::get_primary_issues(); if ( empty( $issues ) ) { ?>

> >
> > ' . esc_html__( 'Warning', 'mainwp' ) . ''; } else { $msg = '' . esc_html__( 'Fail', 'mainwp' ) . ''; } if ( $ech ) { echo $msg; //phpcs:ignore -- escaped. } else { return $msg; } } /** * Renders PHP Pass HTML. * * @param bool $ech echo or return. * * @return string PHP Pass html. */ private static function get_pass_html( $ech = false ) { $msg = '' . esc_html__( 'Pass', 'mainwp' ) . ''; if ( $ech ) { echo $msg; //phpcs:ignore -- escaped. } else { return $msg; } } }