admin管理员组

文章数量:1332198

We have moved a to new server and now we can’t publish. At least, we can’t publish instantly.

Maybe can be useful: we are using Plesk & CloudFlare.

When we publish a new post, the post_status value in wp_posts table is, automatically, future instead of publish

We have already taken a look at this post with no lucky: /

What we have already done is:

  • Checked server time
  • Everything OK into site health info
  • Disabled all plugins & changed to default theme
  • Disabled WP Cron and setted custom cron
  • Installed My Missed Schedule and WP Control plugins (thanks to the first one, a cron event that is running each 5 minutes forces to publish missed scheduled post).
  • Installed wp-cli and trying to run with wp cron event run publish_future_post --due-now with no lucky
  • Checked PHP extensions according to this
  • An exact backup in my localhost is working like a charm

Here are some snapshots when trying to publish a post at 12:57pm…

And here the cron thas is created just after trying to publish:

This is how post_date & post_date_gmt looks on the database:

And this is how the time looks in WP:

So, until 2 hours later, the post isn't published...
This is being a nightmare. We can't use, for example, the ACF plugin. We add a new field, and it doesn't appear until 2 hours later...

Any clue?

We have moved a to new server and now we can’t publish. At least, we can’t publish instantly.

Maybe can be useful: we are using Plesk & CloudFlare.

When we publish a new post, the post_status value in wp_posts table is, automatically, future instead of publish

We have already taken a look at this post with no lucky: https://wordpress/support/topic/publish-immediately-missing-and-scheduled-posts-fails/

What we have already done is:

  • Checked server time
  • Everything OK into site health info
  • Disabled all plugins & changed to default theme
  • Disabled WP Cron and setted custom cron
  • Installed My Missed Schedule and WP Control plugins (thanks to the first one, a cron event that is running each 5 minutes forces to publish missed scheduled post).
  • Installed wp-cli and trying to run with wp cron event run publish_future_post --due-now with no lucky
  • Checked PHP extensions according to this
  • An exact backup in my localhost is working like a charm

Here are some snapshots when trying to publish a post at 12:57pm…

And here the cron thas is created just after trying to publish:

This is how post_date & post_date_gmt looks on the database:

And this is how the time looks in WP:

So, until 2 hours later, the post isn't published...
This is being a nightmare. We can't use, for example, the ACF plugin. We add a new field, and it doesn't appear until 2 hours later...

Any clue?

Share Improve this question edited Jul 21, 2020 at 8:37 Anfuca asked Jul 21, 2020 at 8:07 AnfucaAnfuca 1811 silver badge7 bronze badges 5
  • 1 Have you tried to change the time WP uses from UTC to something else? A lot of people see that times and dates are stored as UTC timestamps and try to force them to the local time, not realising the concept of timestamps vs time, and in the process they break a lot of time and date related things like this. E.g. is your local time UTC +2 or -2? – Tom J Nowell Commented Jul 21, 2020 at 8:32
  • My local time is UTC +2 and server time outputs: mar jul 21 10:38:20 CEST 2020 PS: I've updated the post with a new snapshot showing post_date into database. – Anfuca Commented Jul 21, 2020 at 8:38
  • @TomJNowell I've tried to change WP time from UTC +2 to Madrid and same behavior – Anfuca Commented Jul 21, 2020 at 8:51
  • 1 hmm your server thinks that local time and universal time are the same. This implies that it thinks it's in the UTC timezone, but is 2 hours out of sync from actual UTC time. Did you change the time to match local time without changing the timezone? It should show local time as 2 hours ahead of UTC. Have you confirmed no theme or plugin is interfering by disabling them and reproducing the problem on a clean slate? PHP/your server is mistaken as to what time it is in UTC. You should confirm at the server level that the time is correct for the set timezone of your server – Tom J Nowell Commented Jul 21, 2020 at 8:54
  • Good point @TomJNowell Local and universal time are the same in WP, haven't seen that...! timedatectl outputs correct Universal time and correct Local time (+2). No plugin or theme interfering. Same behavior in a clean installation on that server... Now I'm trying how to fix the time shown in Settings. Checking timezones on PHP, Plesk, etc. I'm hoping that fixing there, the issue disappears... I'll let you know – Anfuca Commented Jul 21, 2020 at 10:19
Add a comment  | 

1 Answer 1

Reset to default 2

So the issue in this case was that PHP wasn't displaying correct UTC Time. Thanks to @TomJNowell for pointing me in the right way.

It seems to be a bug/error in some Plesk installation: https://talk.plesk/threads/utc-time-issue-plesk-php-7-3-7-4-on-centos7.356169/

To solve the issue we have replaced the UTC file usr/share/zoneinfo/UTC with another copy from another server.

After that, UTC time and Local time appears perfect and we can be able to publish inmediately.

本文标签: wp cronError trying to publish immediately Post statusfuture (Missed schedule error)