[wp-trac] [WordPress Trac] #44597: Scheduling posts adds wrong seconds as post_date
WordPress Trac
noreply at wordpress.org
Tue Aug 25 22:06:53 UTC 2020
#44597: Scheduling posts adds wrong seconds as post_date
--------------------------+------------------------------
Reporter: katsar0v | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version: 4.9.7
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by markparnell):
Replying to [comment:2 lukasbesch]:
> @markparnell You mentioned the value for the seconds should be random.
> If I understand it correctly, the reason is that if you are using
regular `WP_CRON`, the load impact of publishing a large number of
scheduled posts would be distributed on multiple requests rather than only
the first after second zero.
I was just responding to the OP's comment regarding the seconds appearing
to be random - clarifying that while I haven't specifically tested it, I
suspect that the seconds are automatically picked up from the current time
rather than actually being randomly generated. Your point about publishing
a large number of posts effectively simultaneously is a fair one though.
I'm not sure how much of an impact that would really have, but it's
certainly something to keep in mind.
> If this is the case, we could check if `WP_CRON` is enabled before
setting it to the current time (or even a random value), else set it to
zero.
My immediate concern with that approach is that it would be based on
whether `WP_CRON` is enabled at the time of scheduling the posts, but that
could change before they are actually published. Admittedly that's not
likely to change often on a production site, so it's a fairly edge case.
> From an editors perspective, I think the seconds input would make more
sense as it allows finer control of time-critical content.
Agreed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44597#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list