public static function isJsonError($response)
    {

        if(is_wp_error($response)) {
            return true; 
        }

        if ($decoded = json_decode($response)) {
            $response = (array) $decoded;
        }

        if (isset($response['error'])) {
            return true;
        }
        
        return false;
    }