wp-cli / doctor-command

Diagnose problems within WordPress by running a series of checks for symptoms
MIT License
146 stars 22 forks source link

Duplicate-cron complains about WP core functionality (publish_future_post) #154

Open jespervnielsen opened 4 years ago

jespervnielsen commented 4 years ago

Bug Report

Describe the current, buggy behavior

wp doctor check --all --spotlight Complains about duplicate cron-jobs.

The duplicate cronjobs is "publish_future_post" Which is WP Core generating those "single-events" to publish post in the future.

If a site is using this functionality, and have more than 10 post set to the future, WP Doctor command will give an error. Even through its expected behavior.

it could be argued that WP Core, should have the post_id as part of the single-cronjob naming, but thats not the case.

Example of WP Core registrering cronjobs using a non-unique key https://github.com/WordPress/WordPress/blob/87cdca8cd61887cd6685c0e11a06e913415524a7/wp-includes/post.php#L4514

maybe a simple solution could be to check if the saved parameter, is the same on multiple jobs.

danielbachhuber commented 1 year ago

Thanks for the report, @jespervnielsen !

We could include an exclusion for this particular scenario.

Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices.