rebase on oct-10-2023
This commit is contained in:
@@ -323,6 +323,11 @@ class WP_Debug_Data {
|
||||
'value' => $wp_environment_type,
|
||||
'debug' => $wp_environment_type,
|
||||
),
|
||||
'WP_DEVELOPMENT_MODE' => array(
|
||||
'label' => 'WP_DEVELOPMENT_MODE',
|
||||
'value' => WP_DEVELOPMENT_MODE ? WP_DEVELOPMENT_MODE : __( 'Disabled' ),
|
||||
'debug' => WP_DEVELOPMENT_MODE,
|
||||
),
|
||||
'DB_CHARSET' => array(
|
||||
'label' => 'DB_CHARSET',
|
||||
'value' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : __( 'Undefined' ) ),
|
||||
@@ -839,6 +844,21 @@ class WP_Debug_Data {
|
||||
);
|
||||
}
|
||||
|
||||
// Server time.
|
||||
$date = new DateTime( 'now', new DateTimeZone( 'UTC' ) );
|
||||
$info['wp-server']['fields']['current'] = array(
|
||||
'label' => __( 'Current time' ),
|
||||
'value' => $date->format( DateTime::ATOM ),
|
||||
);
|
||||
$info['wp-server']['fields']['utc-time'] = array(
|
||||
'label' => __( 'Current UTC time' ),
|
||||
'value' => $date->format( DateTime::RFC850 ),
|
||||
);
|
||||
$info['wp-server']['fields']['server-time'] = array(
|
||||
'label' => __( 'Current Server time' ),
|
||||
'value' => wp_date( 'c', $_SERVER['REQUEST_TIME'] ),
|
||||
);
|
||||
|
||||
// Populate the database debug fields.
|
||||
if ( is_resource( $wpdb->dbh ) ) {
|
||||
// Old mysql extension.
|
||||
@@ -1599,20 +1619,26 @@ class WP_Debug_Data {
|
||||
$max_execution_time = ini_get( 'max_execution_time' );
|
||||
}
|
||||
|
||||
// The max_execution_time defaults to 0 when PHP runs from cli.
|
||||
// We still want to limit it below.
|
||||
/*
|
||||
* The max_execution_time defaults to 0 when PHP runs from cli.
|
||||
* We still want to limit it below.
|
||||
*/
|
||||
if ( empty( $max_execution_time ) ) {
|
||||
$max_execution_time = 30; // 30 seconds.
|
||||
}
|
||||
|
||||
if ( $max_execution_time > 20 ) {
|
||||
// If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent
|
||||
// edge-case timeouts that may happen after the size loop has finished running.
|
||||
/*
|
||||
* If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent
|
||||
* edge-case timeouts that may happen after the size loop has finished running.
|
||||
*/
|
||||
$max_execution_time -= 2;
|
||||
}
|
||||
|
||||
// Go through the various installation directories and calculate their sizes.
|
||||
// No trailing slashes.
|
||||
/*
|
||||
* Go through the various installation directories and calculate their sizes.
|
||||
* No trailing slashes.
|
||||
*/
|
||||
$paths = array(
|
||||
'wordpress_size' => untrailingslashit( ABSPATH ),
|
||||
'themes_size' => get_theme_root(),
|
||||
|
||||
Reference in New Issue
Block a user