diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index 42f9a788f7..476bf55d59 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -647,19 +647,32 @@ class WP_Debug_Data { 'label' => __( 'PHP time limit' ), 'value' => ini_get( 'max_execution_time' ), ); - $info['wp-server']['fields']['memory_limit'] = array( - 'label' => __( 'PHP memory limit' ), - 'value' => ini_get( 'memory_limit' ), - ); - $info['wp-server']['fields']['max_input_time'] = array( + + if ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) { + $info['wp-server']['fields']['memory_limit'] = array( + 'label' => __( 'PHP memory limit' ), + 'value' => WP_Site_Health::get_instance()->php_memory_limit, + ); + $info['wp-server']['fields']['admin_memory_limit'] = array( + 'label' => __( 'PHP memory limit (only for admin screens)' ), + 'value' => ini_get( 'memory_limit' ), + ); + } else { + $info['wp-server']['fields']['memory_limit'] = array( + 'label' => __( 'PHP memory limit' ), + 'value' => ini_get( 'memory_limit' ), + ); + } + + $info['wp-server']['fields']['max_input_time'] = array( 'label' => __( 'Max input time' ), 'value' => ini_get( 'max_input_time' ), ); - $info['wp-server']['fields']['upload_max_size'] = array( + $info['wp-server']['fields']['upload_max_size'] = array( 'label' => __( 'Upload max filesize' ), 'value' => ini_get( 'upload_max_filesize' ), ); - $info['wp-server']['fields']['php_post_max_size'] = array( + $info['wp-server']['fields']['php_post_max_size'] = array( 'label' => __( 'PHP post max size' ), 'value' => ini_get( 'post_max_size' ), ); diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 41aecf1a24..82ff8e7edb 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -18,6 +18,8 @@ class WP_Site_Health { private $health_check_mysql_required_version = '5.5'; private $health_check_mysql_rec_version = ''; + public $php_memory_limit; + public $schedules; public $crons; public $last_missed_cron = null; @@ -33,6 +35,9 @@ class WP_Site_Health { public function __construct() { $this->maybe_create_scheduled_event(); + // Save memory limit before it's affected by wp_raise_memory_limit( 'admin' ). + $this->php_memory_limit = ini_get( 'memory_limit' ); + $this->timeout_late_cron = 0; $this->timeout_missed_cron = - 5 * MINUTE_IN_SECONDS;