Redirect Gravatar requests

Beschreibung

When displaying a post or comment with avatars enabled, WordPress will always check for the existence of a Gravatar. (Note: even the default avatars ‚mystery person‘ and ‚blank‘ are in fact Gravatars served from gravatar.com.) WordPress does this by sending an MD5 hash of every displayed post or comment author’s email address to gravatar.com. Even with many plugins that introduce locally stored default or user avatars, this check still happens. If for whatever reason you do not wish for Gravatar to receive these requests (which some people have voiced GDPR concerns about), this plugin is for you.

The way it works is every time WordPress attempts to display an avatar, this plugin first checks if the image is about to be retrieved from gravatar.com. If it is, the URL is changed to the locally stored ‚mystery person‘ image (included with this plugin). If the avatar has any other source, this plugin doesn’t interfere.

Gravatars are also removed from the Discussion page in Settings and replaced with the locally stored ‚mystery person‘ image. Again, any non-Gravatar images are left alone.

Upon activation of this plugin, if a Gravatar is selected as the default avatar, that setting is changed to the locally stored ‚mystery person‘ image. If any non-Gravatar avatar is selected, that setting isn’t changed.

Upon deactivation of this plugin, if the locally stored ‚mystery person‘ image is selected as the default avatar, that setting is changed to the Gravatar logo. If any non-Gravatar avatar is selected, that setting isn’t changed.

Screenshots

  • Plugin deactivated, Gravatars are loaded.
  • Plugin activated, Gravatars are redirected to the locally stored image.
  • Plugin deactivated, Gravatars are loaded.
  • Plugin activated, Gravatars are redirected to the locally stored image.

Installation

This plugin can be installed the usual way through WordPress’s interface. If you want to manually install this plugin:

  1. Upload the plugin files to /wp-content/plugins/redirect-gravatar-requests/.
  2. Activate the plugin through the ‚Plugins‘ menu in WordPress.

That’s it. You can (de)activate the plugin as often as you like. You can remove it completely either by deleting it in WordPress or through FTP. This plugin doesn’t modify any files nor does it add anything new to the database, once removed there is no trace of it.

FAQ

Can I change the local image?

Not through the WordPress Dashboard. You would have to replace /wp-content/plugins/redirect-gravatar-requests/mystery.jpg. You would also have to repeat this after each plugin update.

The reason for this choice is simple: if you enable the display of avatars, but use this plugin to block Gravatars, then you most likely are already using another plugin for custom avatars.

How to configure this plugin?

There is nothing to be configured about this plugin. As soon as it’s activated, it will redirect all attempts to load a Gravatar from gravatar.com to the locally stored ‚mystery person‘ image included with this plugin.

You can verify that the plugin is working on a page displaying (Gr)avatars in Chrome by opening the developer console (default hotkey F12), selecting the ‚Network‘ tab at the top, typing ‚gravatar‘ in the console’s search box and then reloading the page (by pressing CTRL+R). With the plugin deactivated, you will see requests going out to gravatar.com. With the plugin activated, you will see those requests going to this plugin’s locally stored image instead.

Is this plugin compatible with plugins that add other avatars?

It should be, since this plugin specifically targets only Gravatars. If you do run into problems, please let me know.

Mitwirkende & Entwickler

„Redirect Gravatar requests“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

Änderungsprotokoll

1.0.6

  • Tested on WordPress version 5.2.
  • Increased required PHP version to 5.6.20 in line with the minimum required version for WP 5.2.

1.0.5

  • Added translation to Dutch (nl_NL).
  • Fixed untranslatable string.
  • Reincluded translation template (/languages/redirect-gravatar-requests.pot).
  • Some minor touch-ups on the readme.txt.

1.0.4

  • Refactored code to conform to WordPress coding standards.
  • Added FAQ link to plugin page.

1.0.3

  • Added support and review links to plugin page.

1.0.2

  • Tested on WordPress version 5.1.
  • Increased required PHP version to 5.6 in line with the minimum required version for WP 5.1.

1.0.1

  • Some corrections to the readme.txt to make it more consistent.
  • Removed translation template (/languages/redirect-gravatar-requests.pot), because it’s ignored and a new one is automatically generatad.

1.0.0

  • Initial release.