[wp-trac] [WordPress Trac] #56293: Use 'MINUTE_IN_SECONDS' for consistency in 'update.php' file
WordPress Trac
noreply at wordpress.org
Sun Jul 31 14:03:59 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 hztyfoon):
Thanks a lot @costdev 👍👍👍
Great point. Didn't get it earlier, got it now.
If I understand correctly, one of the point @costdev made is (written in
my own english 👇):
>If `MINUTE_IN_SECONDS / 2` is implemented then there can be a
point/logic/explanation for using both `30 * MINUTE_IN_SECONDS` **and**
`HOUR_IN_SECONDS / 2`.
>And that wouldn't be helpful towards consistency.
This can also make the case for possibly replace `MINUTE_IN_SECONDS / 2`
with `0.5 * MINUTE_IN_SECONDS` as suggested by @peterwilsoncc in the PR
review.
So, I think the following proposed change by @SergeyBiryukov is better.
> For the four instances of `MINUTE_IN_SECONDS / 2` in [53714], that could
be a comment instead of the constant:
> {{{
> define( 'FS_TIMEOUT', 30 ); // 30 seconds.
> }}}
Also,
just came to mind about following
Replying to [comment:24 SergeyBiryukov]:
> Replying to [comment:21 costdev]:
> > Instead, for known values, I'd suggest that we only make use of
`MINUTE_IN_SECONDS` when the value exceeds `59` seconds.
in the case of `90`, wouldn't "plain `90` with an added comment beside it"
be better than `1.5 * MINUTE_IN_SECONDS`? [note: `90` exceeds `59`]
Any thought?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56293#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list