[wp-trac] [WordPress Trac] #56293: Use 'MINUTE_IN_SECONDS' for consistency in 'update.php' file

WordPress Trac noreply at wordpress.org
Sun Jul 31 10:48:18 UTC 2022


#56293: Use 'MINUTE_IN_SECONDS' for consistency in 'update.php' file
----------------------------+-------------------------------
 Reporter:  hztyfoon        |       Owner:  audrasjb
     Type:  defect (bug)    |      Status:  reviewing
 Priority:  low             |   Milestone:  6.1
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by costdev):

 @hztyfoon Yep, `35`, `45`, `55` aren't standard timeouts, they were just
 examples to show how we could just hardcode `< 60` and use
 `MINUTE_IN_SECONDS` for `60+`.

 It's highly unlikely that the reader will interpret `$timeout = 30` as
 referring to milliseconds or minutes, especially since 30 minutes would
 just be written as `30 * MINUTE_IN_SECONDS`.

 I see it as much more helpful towards consistency if we only use the
 constants when it's ''additive'', so that we don't end up with examples
 like `30 * MINUTE_IN_SECONDS` **and** `HOUR_IN_SECONDS / 2` in the
 codebase.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56293#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list