Project

General

Profile

Bug #3541

Posts "Missed Schedule"

Added by Marilynn Johnson about 7 years ago. Updated almost 6 years ago.

Status:
Duplicate
Priority name:
Normal
Assignee:
Category name:
WordPress (misc)
Target version:
-
Start date:
2014-10-09
Due date:
% Done:

0%

Estimated time:

Description

Hi Redminers,

I had some scheduled posts to the Philosophy Commons recently that say "missed schedule" in the dashboard and never went up (see screenshot image attached). Do you have any idea what this means or how to stop it from happening?

Thanks for any insight!

~Marilynn

schedule.png (33.8 KB) schedule.png screenshot of missed post Marilynn Johnson, 2014-10-09 12:35 PM

Related issues

Related to CUNY Academic Commons - Bug #4430: Scheduled Posts Not WorkingResolved2015-08-12

History

#1 Updated by Matt Gold about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Giglio

Dom, can you please take a look at this? Thank you.

#2 Updated by Boone Gorges over 6 years ago

  • Category name set to WordPress (misc)
  • Assignee changed from Dominic Giglio to Daniel Jones
  • Target version set to 1.7.18

Marilynn, sorry for the delay on this one. Dan, would you mind taking a look at this? I'm not certain how the "Missed Schedule" thing comes up in WP.

#3 Updated by Daniel Jones over 6 years ago

It looks like this is usually a problem with how the server interacts with the default WP Cron. One quick fix is this plugin: https://wordpress.org/plugins/wp-missed-schedule/

I'd make sure to read the 1-star review of it though and see if you still want to install it - the author of plugin has it output some extra HTML that lets him track his user base, and it adds some other weird output, too. It seems like it works though, and most people haven't had any trouble with it.

The other option would be for us to try and figure out where the issue is between the server and WP Cron (something at least kind of like this: http://www.trickspanda.com/2014/03/fix-missed-schedule-posts-wordpress/), but I don't think I can do that on my local setup.

#4 Updated by Boone Gorges over 6 years ago

Dan, thanks for researching this a bit. The technique used by the plugin looks OK to me. The obfuscated code mentioned by one of the 1-star reviews appears to have been removed, but it's true that it still leaves a calling card in the form of an HTML comment. Looking over the changeset history of the code, I'm not really comfortable installing the plugin (and being subject to future updates) but I think we could probably just tear out the parts that we want. Could I ask you to build an mu-plugin that does that? Basically, I'd say do the following: set up an hourly scheduled task that runs a query similar to what happens in the plugin's `wpmu_init()`. This will be a good chance for you to experience the joy that is WP's pseudo-cron system :-D

#5 Updated by Daniel Jones over 6 years ago

Here's my first crack at this: https://github.com/cuny-academic-commons/cac/commit/ed510fdc9eec8442599ada0d7a5dcc246f485203

I think it's fairly straightforward, although I wasn't able to test very carefully since it seems like a lot of the issues are around particular server setups.

I took the method of finding overdue posts from the file in Wordpress core (wp-admin/includes/class-wp-posts-list-table.php) that outputs the "Missed schedule" line. I was at least able to test that the query works and that I am in fact scheduling an event, although something weird was happening where wp_next_scheduled() was returning a timestamp that was less than what time() was returning, suggesting that the next time it was supposed to be run was actually in the past. That was a little disconcerting, not sure if it's something weird with timezones?

Let me know what you think!

#6 Updated by Boone Gorges over 6 years ago

  • Target version changed from 1.7.18 to 1.7.19

Thanks, Dan. I'll take a look and we'll see what we can do about getting this into 1.7.19.

#7 Updated by Boone Gorges over 6 years ago

  • Target version changed from 1.7.19 to 1.7.20

#8 Updated by Boone Gorges over 6 years ago

  • Target version changed from 1.7.20 to 1.7.21

#9 Updated by Boone Gorges over 6 years ago

  • Target version changed from 1.7.21 to 1.8.1

#10 Updated by Daniel Jones over 6 years ago

Just wanted to check and make sure there weren't any other steps I need to take with this right now.

#11 Updated by Daniel Jones over 6 years ago

Just wanted to check and make sure there weren't any other steps I need to take with this right now.

#12 Updated by Boone Gorges over 6 years ago

  • Assignee changed from Daniel Jones to Boone Gorges

Reassigning to myself for review. If you can do anything additional to test the timestamp issue you discussed above, you could probably save me some time :)

#13 Updated by Boone Gorges over 6 years ago

  • Status changed from Assigned to Resolved

Thanks for your patience here. I think that Dan's plugin should fix this issue. The fix will roll out sorta slowly (it depends on a site's getting traffic) but it should be fully complete within a day or so. Tentatively marking as resolved. https://github.com/cuny-academic-commons/cac/commit/98f7c7b53ba5ab31184e6f496abef33b9f0b687b

#14 Updated by Marilynn Johnson over 6 years ago

Okay, great thanks! I will update here if I see it does it again at any point.

#15 Updated by Boone Gorges over 6 years ago

  • Status changed from Resolved to Assigned
  • Assignee changed from Boone Gorges to Daniel Jones
  • Target version changed from 1.8.1 to Future release

After this fix was deployed, it caused CPU utilization to jump, almost bringing down the server. I'm not sure why - the changeset looks OK to me at a glance - but for now I have disabled it. https://github.com/cuny-academic-commons/cac/commit/dbe63309a46e58ca20adf7c2ffedfdc9d61dc4bd

Dan, can I ask you to take another dive into what's going on here? If there's a way that it can be addressed in WP, that might be better still. Probably related: https://core.trac.wordpress.org/ticket/29581

#16 Updated by Boone Gorges almost 6 years ago

  • Status changed from Assigned to Duplicate
  • Target version deleted (Future release)

Closing in favor of #4430.

Also available in: Atom PDF