Skip to content

Avatars

Ben Gillbanks edited this page Apr 9, 2021 · 5 revisions

Replace Gravatar images with an automatically generated profile image. This image will be consistent across any site that uses this module.

Why replace Gravatar?

There are a number of possible privacy violations that can occur by using a third party service.

In order to generate the avatar you must send a hashed version of a users email address to Gravatar. The hashing involves creating an md5 conversion of the users email address, which could potentially be cracked.

In addition loading content from a third party means that you are leaking data. From this one action you tell the external servers who is visiting your website, in turn allowing them to track users around the internet.

Also relying on a third party can be risky. If the service closes, or breaks, or is hacked, then it could disrupt your website and expose your visitors data.

Finally, every time you load an image it slows down your site a little. Loading an image from a third party website slows it even more. Gravatar is highly optimised, but it's still potential problem. By shifting the avatar generation to the browser the download speed issues are eliminated. Toolbelt avatars are fast!

Shortcode

There is a shortcode for displaying users avatars. There is no block for this, so you will need to use the shortcode block and enter the shortcode itself.

[toolbelt-avatar email="[email protected]"]

This shortcode could be used on an about page, or company page, to show what avatars specific people from the website have.

In Use

You can see the generated avatars in action on my website - Binary Moon.

Local Avatars

If you want local avatars for registered users then you can use the Simple Local Avatars plugin.

Theme Support

Since the avatars are displayed as canvases, themes may need to ensure the code sizes the canvases appropriately. This can generally be done with some custom css.

Clone this wiki locally