Skip to content

Non-200 HTTP status code from the spawn test should result in an error #65

@johnbillion

Description

@johnbillion

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

  1. Delete wp-cron.php
  2. Run wp cron test
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions