Bug Report
Describe the current, buggy behavior
There is no valid reason for the HTTP API request to wp-cron.php to return anything other than a 200 response code. There is no condition in WordPress core under which a non-200 code is returned for successful spawning of cron.
Therefore, if the cron spawning request performed in the wp cron test command receives anything other than a 200 it should be treated as an error, but currently it's treated as a warning and an exit code of 0 is still returned.
Some examples of a non-200 status code being returned from a request to wp-cron.php which the user needs to be concerned about because it means their cron spawner is not functioning as expected:
wp-cron.php gets deleted - 404
- Fatal error occurs during cron spwaning -
500
- Redirects occurring when they shouldn't -
301/302
- Server misconfiguration - basically anything
Describe how other contributors can replicate this bug
- Delete
wp-cron.php
- Run
wp cron test
- Observe that a warning is presented, but the exit code remains as
0
Describe what you would expect as the correct outcome
An error message and an exit code of 1 should be returned whenever the cron spawning request returns anything other than a 200.
Bug Report
Describe the current, buggy behavior
There is no valid reason for the HTTP API request to
wp-cron.phpto return anything other than a200response code. There is no condition in WordPress core under which a non-200code is returned for successful spawning of cron.Therefore, if the cron spawning request performed in the
wp cron testcommand receives anything other than a200it should be treated as an error, but currently it's treated as a warning and an exit code of0is still returned.Some examples of a non-200 status code being returned from a request to
wp-cron.phpwhich the user needs to be concerned about because it means their cron spawner is not functioning as expected:wp-cron.phpgets deleted -404500301/302Describe how other contributors can replicate this bug
wp-cron.phpwp cron test0Describe what you would expect as the correct outcome
An error message and an exit code of
1should be returned whenever the cron spawning request returns anything other than a200.