public static function getGravatarUrl($email, $size = 32, $defaultImage = 'identicon')
    {
        if (empty($email) || self::isValid($email) === false) {
            return null;
        }

        $hash = md5(strtolower(trim($email)));

        $parts = ['scheme' => 'http', 'host' => 'www.gravatar.com'];
        if (Url::isHttps()) {
            $parts = ['scheme' => 'https', 'host' => 'secure.gravatar.com'];
        }

        // Get size
        $size = Vars::limit(Filter::int($size), 32, 2048);

        // Prepare default images
        $defaultImage = trim($defaultImage);
        if (preg_match('/^(http|https)./', $defaultImage)) {
            $defaultImage = urldecode($defaultImage);
        } else {
            $defaultImage = strtolower($defaultImage);
            if (!Arr::in((string)$defaultImage, self::getGravatarBuiltInImages())) {
                $defaultImage = self::getGravatarBuiltInDefaultImage();
            }
        }

        // Build full url
        $parts['path'] = '/avatar/' . $hash . '/';
        $parts['query'] = [
            's' => $size,
            'd' => $defaultImage,
        ];

        return Url::create($parts);
    }