Make WordPress Core

Ticket #48692: 48692.patch

File 48692.patch, 2.2 KB (added by Clorith, 4 years ago)
  • src/wp-admin/includes/class-wp-site-health.php

     
    13521352                return $result;
    13531353        }
    13541354
     1355        /**
     1356         * Test if the site is using timezones relative to their location, or by using an offset value.
     1357         *
     1358         * Daylight Savings Time (DST) may affect the times used and shown by your site, and using an UTC offset,
     1359         * instead of a localized timezone, means that the site does not get automatic DST updates.
     1360         *
     1361         * This check looks for default or UTC values and recommends changing to a fixed location.
     1362         *
     1363         * @since 5.3.1
     1364         *
     1365         * @return array The test results.
     1366         */
     1367        public function get_test_timezone_not_utc() {
     1368                $result = array(
     1369                        'label'       => __( 'Your site uses localized timezones' ),
     1370                        'status'      => 'good',
     1371                        'badge'       => array(
     1372                                'label' => __( 'Performance' ),
     1373                                'color' => 'blue',
     1374                        ),
     1375                        'description' => sprintf(
     1376                                '<p>%s</p>',
     1377                                __( 'Daylight Savings Time (DST) may affect the times used and shown by your site, and using an UTC offset, instead of a localized timezone, means that the site does not get automatic DST updates.' )
     1378                        ),
     1379                        'actions'     => '',
     1380                        'test'        => 'timezone_not_utc',
     1381                );
     1382
     1383                $timezone = get_option( 'timezone_string', null );
     1384
     1385                if ( empty( $timezone ) || 'UTC' === substr( $timezone, 0, 3 ) ) {
     1386                        $result['status'] = 'recommended';
     1387                        $result['label']  = __( 'Your site is not using localized timezones' );
     1388                        $result['actions'] .= sprintf(
     1389                                '<p><a href="%s">%s</a></p>',
     1390                                esc_url( admin_url( 'options-general.php' ) ),
     1391                                __( 'Update your site timezone' )
     1392                        );
     1393                }
     1394
     1395                return $result;
     1396        }
     1397
    13551398        /**
    13561399         * Test if your site is serving content over HTTPS.
    13571400         *
     
    18901933                                        'label' => __( 'Debugging enabled' ),
    18911934                                        'test'  => 'is_in_debug_mode',
    18921935                                ),
     1936                                'timezones'         => array(
     1937                                        'label' => __( 'Timezone' ),
     1938                                        'test'  => 'timezone_not_utc',
     1939                                ),
    18931940                        ),
    18941941                        'async'  => array(
    18951942                                'dotorg_communication' => array(