Gravatars2

Gravatars2 WordPress Plugin Works with the “new” gravatar.com 2.0 Service
(the gravatar.com service only works sporadically, however)

The “new” service still uses the same query format, so there was nothing to change for that. Note the images are now self-rated, defaulting to “X”, so you may want to change the “Default Rating” in the plugin management page to “X” to get the images for people that forgot to rate their gravatar.

Unfortunately, the REST API was nixed in the “new” 2.0 system, meaning there is no way to check if an image is available without just downloading the image. And now since a nice blue “G” is returned if there is no image (or if the max rating is not met), a kludgey test has to be made to make sure a good image was returned. This makes the plugin caching system slower, unfortunately, but still not nearly as slow as not caching the images, and having your site visitors have to wait for the gravatar.com server to return an image (probably a blue “G”).

Gravatars2 is a WordPress plugin, modified from Skippy’s Gravatars with the following enhancements:

  • Caches “No Images” and Errors (in addtion to images, of course)
    • Separate cache times for all 3 cache types
    • Greatly speeds up page loads which are slowed down by having to check the gravatar.com server (and removes a LOT of load from the gravatar.com server)
    • NEW: Uses “fsockopen” so that ‘allow_url_fopen’ is not required to be On. Speeds up caching times by allowing a socket timeout of 10 seconds (configurable).
  • Cron supported
    • Unix-type “system cron” job can be used to have all cache refreshes performed by the server, without user interference
    • Skippy’s “WP-Cron” can be used if a true system cron is not available (Gravatars2-WPCron updated for clean integration)
  • “Local” and “Global” gravatars are cached in separate directories
  • Cache management (refresh/delete) split out to “Management” tab
  • Various other things which may or may not be noticeable to you, but are good :)

UPDATE v2.7.0: Local Gravatar Images no longer overwritten when someone submits a bad local image URL. Thanks to George Caswell for identifying the problem & solution.

UPDATE v2.6.2: Gravatar Cache Manage admin panel now links the md5 to the full gravatar.com query (including rating, size, & default gravatar). This should help people troubleshoot problems they may be having with their gravatar images.

UPDATE v2.6.1: Kludged a “fix” for the gravatar.com REST API not working. Default is to NOT use the REST API, but once it starts working, recommended to set it back to “Yes” in the options.

UPDATE v2.6.0: Cached images are never expired until a new valid image is received from gravatar.com. A “Load Saved Cache” option reloads images from the local filesystem into the cache (as long as they have not been deleted). This should help deal with gravatar.com server suckage.

DOWNLOAD

Download the plugin here (available in both Unix gzip-tar & Windows zip packages):

gravatars2.tar.gz

gravatars2.zip

Current Version:
Last Updated:

View bottom of gravatars2.README for Change Log

INSTALLATION INSTRUCTIONS

Please read the Installation Instructions page to see how to set up Gravatars2 on your site.

For reference, you can view the comments.php and style.css file that this site is using. Gravatar styles at the very bottom.

QUESTIONS / FEEDBACK

If you have any questions, or want to give feedback, go to the Discussion & Support page.