Black Friday Super Sale! 🔥 Enjoy a jaw-dropping discount of up to 50% OFF on all Nextend Social Login plans. Hurry, the offer ends on December 1st!
Buy now

How to prevent GIF avatars from being downloaded?

GIF files can be relatively large, which may increase bandwidth usage. If you want to prevent GIFs from being downloaded or used as avatars, you can disable them as shown below

Code
add_action('nsl_update_avatar', function ($provider, $user_id, $avatarUrl) {
    $path = parse_url($avatarUrl, PHP_URL_PATH);

    if ($path && strtolower(pathinfo($path, PATHINFO_EXTENSION)) === 'gif') {
        remove_action('nsl_update_avatar', array(
            NextendSocialLoginAvatar::getInstance(),
            'updateAvatar'
        ), 10);
    }
}, 1, 3);
Your cookie preferences

We use cookies to improve your experience, analyze traffic, and personalize content. By clicking "Accept all" you agree to storing them on your device. Read our privacy policy.