private function decode(array $response)
    {
        $decodedBody = json_decode($response['body'], true);

        if (null === $decodedBody) {
            return new WP_Error('decode-error', 'Unable to decode response body', $response);
        }

        if (true !== $decodedBody['success']) {
            return $this->wpErrorFor($decodedBody['errors'], $response);
        }

        return $response;
    }