thefrosty / wp-missed-schedule-publisher
Catches scheduled posts that have been missed and publishes them.
Installs: 200
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- php: ^8.1
- composer/installers: ~2.0
- symfony/http-foundation: ~6.4.14 || ^7.1.7
- thefrosty/wp-utilities: ^3.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0.0
- roave/security-advisories: dev-master
- roots/wordpress-no-content: ^6.6
README
Catches scheduled posts that have been missed and publishes them.
Package Installation (via Composer)
$ composer require thefrosty/wp-missed-schedule-publisher:^1.0
Integrations
Supports the following 3rd party plugin(s):
- Simple History -- log missed scheduled events and publications
TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher::ACTION_SCHEDULE_MISSED
TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher::ACTION_SCHEDULE_PUBLISH
- How to use actions
- When a one or more posts have missed their schedule. Example:
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher; add_action(MissedSchedulePublisher::ACTION_SCHEDULE_MISSED, static function(array $post_ids): void { // Do something with the post ID's array. });
- When a post that missed its schedule is published. Example:
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher; add_action(MissedSchedulePublisher::ACTION_SCHEDULE_PUBLISH, static function(int $post_id, false | string $old_status): void { $new_status = get_post_status($post_id); // Maybe there was an issue publishing? if ($old_status === $new_status) { return; } // Do something with the $post_id. });
- When a one or more posts have missed their schedule. Example:
- Filters
TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher::FILTER_BATCH_LIMIT
TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher::FILTER_FREQUENCY
- How to use filters
- Change the allowed batch (query) limit count. Example:
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher; // Lower it to only 10 (defaults to 20) add_filter(MissedSchedulePublisher::FILTER_BATCH_LIMIT, static fn(): int => 10);
- Change the frequency of the check (in seconds). Example:
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher; // Every hour (defaults to 15 minutes) add_filter(MissedSchedulePublisher::FILTER_FREQUENCY, static fn(): int => \HOUR_IN_SECONDS); // Every minute (defaults to 15 minutes) add_filter(MissedSchedulePublisher::FILTER_FREQUENCY, static fn(): int => \MINUTE_IN_SECONDS);
- Change the allowed batch (query) limit count. Example: