mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 07:04:34 +00:00
Site Health: Add server time debug data.
This changeset adds "Current time, "Current UTC time" and "Current Server time" under the "Server" section of Site Health debug infos. This provides the current time, the server time, and allow for comparison if there's some time-related issues. Props sebastienserre, Clorith, audrasjb, kebbet, robinwpdeveloper, hrrarya, mukesh27, hareesh-pillai, costdev. Fixes #56378. git-svn-id: https://develop.svn.wordpress.org/trunk@56056 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -839,6 +839,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.
|
||||
|
||||
Reference in New Issue
Block a user