Make WordPress Core


Ignore:
Timestamp:
09/09/2022 08:14:43 AM (13 months ago)
Author:
audrasjb
Message:

Coding Standards: Clarify time units for various timeout or expiration values.

This changeset implements a clearer and more consistent timeout/duration/expiration format. It updates time durations used in various files, as per WordPress coding standards:

  • If the value can be represented as an integer (not a fractional) number of minutes (hours, etc.), use the appropriate constant (e.g.: MINUTE_IN_SECONDS) multiplied by that number.
  • Otherwise, keep the value as is and add a comment with the units for clarity.

Follow-up to [11823], [13177], [21996], [37747], [53714].

Props hztyfoon, audrasjb, arrasel403, krupalpanchal, GaryJ, SergeyBiryukov, peterwilsoncc, rudlinkon, costdev, robinwpdeveloper.
Fixes #56293.
See #55647.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r54069 r54113  
    20302030
    20312031        $cookies = wp_unslash( $_COOKIE );
    2032         $timeout = 10;
     2032        $timeout = 10; // 10 seconds.
    20332033        $headers = array(
    20342034            'Cache-Control' => 'no-cache',
     
    28862886        $body    = array( 'site-health' => 'loopback-test' );
    28872887        $cookies = wp_unslash( $_COOKIE );
    2888         $timeout = 10;
     2888        $timeout = 10; // 10 seconds.
    28892889        $headers = array(
    28902890            'Cache-Control' => 'no-cache',
Note: See TracChangeset for help on using the changeset viewer.