Added handling of WP_Error to remote_request