diff --git a/src/WP_CLI/CommandWithUpgrade.php b/src/WP_CLI/CommandWithUpgrade.php index 578da5e1..7a77258a 100755 --- a/src/WP_CLI/CommandWithUpgrade.php +++ b/src/WP_CLI/CommandWithUpgrade.php @@ -826,9 +826,10 @@ public function get_the_latest_github_version( $repo_slug ) { $body = \wp_remote_retrieve_body( $response ); $decoded_body = json_decode( $body ); - if ( wp_remote_retrieve_response_code( $response ) === \WP_Http::FORBIDDEN ) { + // WP_Http::FORBIDDEN doesn't exist in WordPress 3.7 + if ( 403 === wp_remote_retrieve_response_code( $response ) ) { return new \WP_Error( - \WP_Http::FORBIDDEN, + 403, $this->build_rate_limiting_error_message( $decoded_body ) ); }