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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54113 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-09-09 08:14:43 +00:00
parent f042981494
commit 912fb7666c
6 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -405,7 +405,7 @@ function wp_update_plugins( $extra_stats = array() ) {
$locales = array_unique( $locales );
if ( $doing_cron ) {
$timeout = 30;
$timeout = 30; // 30 seconds.
} else {
// Three seconds, plus one extra second for every 10 plugins.
$timeout = 3 + (int) ( count( $plugins ) / 10 );
@@ -687,7 +687,7 @@ function wp_update_themes( $extra_stats = array() ) {
$locales = array_unique( $locales );
if ( $doing_cron ) {
$timeout = 30;
$timeout = 30; // 30 seconds.
} else {
// Three seconds, plus one extra second for every 10 themes.
$timeout = 3 + (int) ( count( $themes ) / 10 );