Do I really need to write a WordPress API wrapper to check the status of “missed schedule” posts?
Posted by jpluimers on 2020/01/29
After years with “missed schedule” posts on (paid!) wordpress.com based sites, WordPress has documented that the scheduler officially does not support more than 100 posts:
[WayBack] Warning: Please do not schedule more than 100 posts. Any posts scheduled beyond that amount will not be published.
In practice this is not fully true, so lets explain that a little.
Background
Imagine the list of scheduled posts as a list of posts to be posted anywhere from the near future (lets call that tail
) until far in the future (for now head
).
As long as you schedule posts in head
to tail
order, then there is no problem. You can schedule 100s of posts (usually I’ve between 700 and 1200 posts scheduled that way).
The problems appear when:
- the list is long (in my experience: much larger than 100 posts, closer to 600-800, but that might depend on your blog)
- you schedule *new* posts towards the
tail
(i.e. near future)
These new posts then will be marked “missed schedule” shortly after their scheduled time like for instance in Source: In case you are still curious on “It’s a German thing, you wouldn’t understand. ‘Dinner for one’ on New Year’s eve.”.
Despite taking discussions on this out of the public, not much changes: [WayBack] The “Missed Schedule” is back on WordPress.com. Now please go fix it for good. « WordPress.com Forums
Plugin-solutions
When you run your own site, or you pay WordPress.com much more and you dare to install plugins (which might be retired just[WayBack] like themes within a few years), that solve problems WordPress introduced in the first place, then you have a few choices
- [WayBack] WP Missed Schedule (Plugin for WordPress) | sLaNGjIs Team – slangjis.org
- Source code: [WayBack] GitHub – sLaNGjI/wp-missed-schedule
- [WayBack] WP Missed Schedule Posts — WordPress Plugins
If I read the core PHP source code of them, I’m not really impressed by the large amount of code for a problem that seems so simple: scheduling posts.
If you still want to try plugins, then read these links:
Other solutions
Some posts indicate this might have to do with the WP-CRON job not running often enough or not at all. It looks like these URLs are related to it:
- https://wiert.wordpress.com/wp-cron.php?doing_wp_cron
- https://wiert.me/wp-cron.php?doing_wp_cron
- https://wordpress.com/wp-cron.php?doing_wp_cron
The plan for them was this:
Put one-minuted uptimerobot monitors on them, to see if they have any effect.
If these do not consistently work, I need to write my own API wrapper that posts ones marked missed-schedule.
They sort of worked:
- scheduled posts were indeed posted after being on the “Missed Schedule” list for some time
- the actual time of posting (which usually is NOT the “scheduled time”, or the “pubData” in the RSS on https://wiert.me/feed/) is when a non-“Missed Schedule” post is being posted
Next step I need to research is if there is a way to use the API to force posting.
Some notes on writing an API
For my link archive:
- https://developer.wordpress.com/docs/api/console/ which
- is open source at [WayBack] GitHub – Automattic/rest-api-console2: WordPress.com REST API Developer Console – superceded by https://github.com/Automattic/wp-api-console
- knows about the regular REST http methods (GET, POST, PUT, DELETE, PATCH; see how HTTP methods are typically used in a RESTful API) with:
- WP.COM API
v1.1
v1
- WP REST API
wp/v2
at https://public-api.wordpress.com/wp/v2
/wpcom/v2
at https://public-api.wordpress.com/wpcom/v2
/
- WP.COM API
- has documentation:
- [WayBack] WordPress REST API on WordPress.com | Developer Resources
- [WayBack] WP REST API v2 Documentation Documentation for version 2.0 of the WP REST API.
- [WayBack] WordPress REST API (Version 2) — WordPress Plugins
- [WayBack] REST API Resources | Developer Resources (v1.1)
- [WayBack] REST API Version 1 (Deprecated) | Developer Resources (v1)
- [WayBack] REST API Handbook | WordPress Developer Resources
- [WayBack] WordPress APIs « WordPress Codex
- All require authentication; I suspect is is the same for every permutation: [WayBack] OAuth2 Authentication | Developer Resources
- [WayBack] Consuming a RESTful Web Service with Angular 4 – Oliver & Friends step by step tutorial to consume the various WordPress REST API using Angular CLI with a single-page Angular 4 application.
- Search: api wordpress.com for scheduled posts checker
- [WayBack] php – How to retrieve Scheduled Post in WordPress REST API – Stack Overflow
Note that these fail (so I need to really dig into this more deeply on how to get started):
This however sort of works: https://public-api.wordpress.com/rest/v1.1/sites/wiert.me/posts/
–jeroen
This entry was posted on 2020/01/29 at 12:00 and is filed under *nix, Development, Missed Schedule, Monitoring, Power User, SocialMedia, Software Development, Uptimerobot, Web Development, WordPress, WordPress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Leave a Reply