Scheduled Posts Issue Fixer
Scheduled Posts Issue Fixer
Description
WordPress relies on WP-Cron to publish scheduled posts. On low-traffic sites, or when WP-Cron is delayed by caching, a post can be left showing the “missed schedule” error and never goes live.
Scheduled Posts Issue Fixer solves this. It registers a cron job that runs every minute, finds posts whose scheduled time has passed but which are still stuck in the future status, and publishes them using WordPress’s own publishing functions.
Why it is safe for performance
- Processes at most 20 posts per run, so it never loads your whole post table.
- Uses an indexed query against
post_date_gmtandpost_status. - Returns immediately when there is nothing to publish.
- Removes its cron job when the plugin is deactivated or uninstalled.
Features
- Publishes overdue posts, pages and custom post types automatically
- No settings screen, works as soon as it is activated
- Uses
wp_publish_post(), so normal publishing hooks still fire for caching, SEO and notification plugins - Filterable batch size and post types
- Cleans up its cron event on deactivation and uninstall
Installation
INSTALL “Scheduled Posts Issue Fixer” FROM WITHIN WORDPRESS
- Visit the plugins page within your dashboard and select ‘Add New’;
- Search for ‘Scheduled Posts Issue Fixer’;
- Activate Scheduled Posts Issue Fixer from your Plugins page;
- You are done.
INSTALL “Scheduled Posts Issue Fixer” MANUALLY
- Upload the ‘scheduled-posts-issue-fixer’ folder to the /wp-content/plugins/ directory;
- Activate the Scheduled Posts Issue Fixer through the ‘Plugins’ menu in WordPress;
- You are done.
Faq
Scheduled Posts Issue Fixer is a “set and forget” plugin. There are no settings. Your scheduled posts are checked automatically once the plugin is active.
Yes. By default every post type is checked. You can limit it to specific types with the scheduled_posts_issue_fixer_post_types filter:
add_filter( 'scheduled_posts_issue_fixer_post_types', function ( $types ) {
return array( 'post', 'page', 'product' );
} );
20 per run by default. Change it with the scheduled_posts_issue_fixer_batch_size filter (maximum 500).
Yes. The plugin schedules a standard WP-Cron event, so it works with both WP-Cron and a system cron that calls wp-cron.php.
Yes, use the scheduled_posts_issue_fixer_should_publish filter:
add_filter( 'scheduled_posts_issue_fixer_should_publish', function ( $should_publish, $post ) {
if ( 123 === $post->ID ) {
return false;
}
return $should_publish;
}, 10, 2 );
Yes, on deactivation and on uninstall.
Reviews
Changelog
2.0.0
Fixed
- Fixed a fatal error on deactivation:
deRegisterCron()calledwp_clear_scheduled_hook( CRON_NAME )with an undefined bare constant instead ofself::CRON_NAME. On PHP 8 this threwError: Undefined constant "CRON_NAME"and left the cron job behind permanently. - Fixed the cron job never actually running on a schedule. The plugin registered the interval name
every_minute, which is not a valid WordPress cron schedule, so no working event was created. A real every-minute schedule is now registered. - Fixed the cron job not being created when the plugin was updated rather than freshly activated, because activation hooks do not run on update.
- Fixed the timezone handling. The query now compares against
post_date_gmtin GMT instead of applyinggmt_offsettwice.
Changed
- Rewritten as a namespaced, PSR-4 autoloaded plugin (
OptimistHub\ScheduledPostsIssueFixer). - Posts are now published through
wp_publish_post()with a fresh post object, and each post’s status is re-checked before publishing, so posts edited between the query and the update are not published by mistake. - Added an
uninstall.phpthat removes the cron event and the legacy cron event name. - Added filters:
scheduled_posts_issue_fixer_batch_size,scheduled_posts_issue_fixer_post_typesandscheduled_posts_issue_fixer_should_publish. - Requires WordPress 6.0 and PHP 7.4 or newer.
1.0.10
- gmt_offset issue fixed.
1.0.9 – 1.0.5
- Github automatization completed.
1.0.4
- Github readme file update and assets added.
1.0.3
- Github action.
1.0.2
- Plugin creator alias issue.
1.0.1
- Manual installation and activation details added to readme setup
1.0.0
- Stable version released