WC_Helper_Updater::is_temporary_failure
Whether a failed update check may succeed if retried. Only a rejected connection is not: a 401 or 403, or a WP_Error for missing local credentials.
Method of the class: WC_Helper_Updater{}
No Hooks.
Returns
bool.
Usage
$result = WC_Helper_Updater::is_temporary_failure( $request, $response_code ): bool;
- $request(array|WP_Error) (required)
- The update-check response.
- $response_code(int) (required)
- The HTTP status code, 0 when there is none.
WC_Helper_Updater::is_temporary_failure() WC Helper Updater::is temporary failure code WC 11.3.0
private static function is_temporary_failure( $request, int $response_code ): bool {
if ( is_wp_error( $request ) ) {
return 'authentication' !== $request->get_error_code();
}
return ! in_array( $response_code, array( 401, 403 ), true );
}