From 37ebdb8fa1bb3a850d2a1277d25043422ad6b7da Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 27 Jun 2023 08:04:20 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@56056 git-svn-id: http://core.svn.wordpress.org/trunk@55568 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-debug-data.php | 15 +++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 692fd0b559..0bcc06954a 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e34e983be..5fd58917bd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-56055'; +$wp_version = '6.3-alpha-56056'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.