src/Validators/StatusCodes.php
protected function getMessage(string $url): ?string
    {
        $response = wp_remote_get($url);
        $responseCode = wp_remote_retrieve_response_code($response);

        if (! is_int($responseCode)) {
            return 'Unable to reach ' . $url;
        }

        return ($this->expectedStatusCode === $responseCode)
            ? null
            : $url . ' returns ' . $responseCode;
    }
protected function getMessage(string $url): ?string
    {
        $response = wp_remote_get($url);
        $responseCode = wp_remote_retrieve_response_code($response);

        if (! is_int($responseCode)) {
            return 'Unable to reach ' . $url;
        }

        return ($this->expectedStatusCode === $responseCode)
            ? null
            : $url . ' returns ' . $responseCode;
    }
protected function getMessage ( string $ url ) : ? string { $ response = wp_remote_get ( $ url ) ; $ responseCode = wp_remote_retrieve_response_code ( $ response ) ; if ( ! is_int ( $ responseCode ) ) { return 'Unable to reach ' . $ url ; } return ( $ this -> expectedStatusCode === $ responseCode ) ? null : $ url . ' returns ' . $ responseCode ; }
Check the URL's status code.

@param string $url The URL to be checked.

@return null|string Returns null if status codes is expected.
Check the URL s status code .