WordPressOne of the things I like about WordPress 2.5 is the native support for Gravatars, globally recognized avatars. The idea is pretty simple: register with your e-mail address at the Gravatar site, upload a picture (I used a photo of myself, but that’s not a requirement). Once your account is set up, anytime you leave a comment on a Gravatar-enabled blog, your e-mail address is sent (using the magic of cryptographic hashing) to the Gravatar server. The server then does what servers do best: it serves; specifically, it serves your globally recognized avatar to the requesting blog, which then (typically) displays said avatar next to your comment.

Here’s a sample comment from my WordPress 2.5 upgrade post:

Blog comment with Gravatar.

That [handsome] fellow in the corner of the comment should look familiar, and if P.G. Holyfield had a Gravatar account his comment wouldn’t display the generic “Oh, no, I don’t have a Gravatar!” image 1Or perhaps the “Oh, no, I provided a fake e-mail address in the blog comment form!” image. in the upper left:

A comment from a user who does not have a Gravatar account.

Each Gravatar has a content rating—G, PG, R or X—and WordPress has a “Maximum Rating” option that determines whether Gravatars of a given rating will be displayed. I try to maintain a family-friendly blog for the most part, so I’ve set the Maximum Rating to PG, which won’t prevent people with photos of “Lando and the Ugnauts” as their Gravatar from commenting, but will prevent said photo from displaying next to their comment. Seriously, put that thing away before you get us all killed.

Originally, I was going to use a WordPress plugin to handle Gravatar-wrangling, but when I discovered that one of the features of WP-Gravatars made my blog spew green pea soup (or lose its database connection; I forget which), I started poking around for alternative solutions. As it turns out, I didn’t have far to poke: Sandbox, the WordPress theme that serves as the underlying framework for my custom blog theme, had recently released a new version with Gravatar support. Once I had the latest version of Sandbox installed, it was just a matter of tweaking the CSS to style the new Gravatar-enabled comments the way I liked and voila, one Gravatar-enabled blog.

If you start browsing through old comments on the blog, you’re going to notice something: most of the people who comment here don’t have Gravatars. 2Or perhaps they have naughty Gravatars and I won’t display them. That’s fine; I’m okay with adding a feature just for folks like Jason Penney, Sam Chupp and Cynthia Armistead, especially if knowing that their smiling (or illustrated) faces will show up on my site encourages them to comment more.

Should you use a Gravatar? It’s up to you. If you’re worried about your e-mail address being used for nefarious purposes (like flooding your inbox with ads for Lando-enhancement products), consider this: Gravatar is owned by Automattic, the same folks who make the spam-comment-killing Akismet plugin (the very plugin that has backhanded nearly 110,000 spam comments on this blog and kept it from becoming a nightmare to maintain). You think they’re gonna sell your e-mail address to spammers?

1 Or perhaps the “Oh, no, I provided a fake e-mail address in the blog comment form!” image.
2 Or perhaps they have naughty Gravatars and I won’t display them.

21 responses to “Gravatars”

  1. Jason Penney Avatar

    I’ve been using Gravatars on my site for quite a while, and I really like the idea. Glad to see them brought directly into WordPress (not a surprise, since Automattic Matt and WordPress Matt are the same Matt).

    I managed to get them to fall back to myBlogLog avatars on my site with a little tweak, and if I can clean it up a bit I’ll see about releasing it as a plug-in.

  2. Cynthia Armistead Avatar

    I’ve upgraded some of our sites to 2.5. The only problems I’ve encountered are with Now Reading, which has since been updated, and Cystats, which has not. (Cystats is only going weird on one of the updated blogs, though, so I’m not entirely sure that it’s a conflict with 2.5)

    I still have to tweak my templates, though.

  3. KJToo Avatar

    Jason – WP-Gravatars supports MyBlogLog avatars, as well as a couple others. It also has a widget that will show the gravatars of recent posters in your sidebar. An interesting feature is that it will pull favicons if no gravatar is available. Unfortunately, that absolutely killed my site, so I decided to use the native gravatar support and skip gravatars in the sidebar.

  4. KJToo Avatar

    Cynthia – I stopped using the Now Reading plugin right around the time I set up my account on GoodReads. I did like having my library in a database that I could back up, but I didn’t want to go through the hassle of double-entering everything.

  5. Cynthia Armistead Avatar

    I signed up at GoodReads, but I already had so much entered into NR that it’s frustrating to re-enter it.

    We had actually entered our entire library (books, DVDs, CDs) in a ReaderWare database, using a barcode scanner for easier entry. The whole thing was lost when BOTH of Sam’s hard drives, the drives on our server at home, my laptop, AND my external backup drive died within about a month of each other. Yes, we should have had an off-site backup – but how many people really do, for their home data? And who would expect that many things to crap out all at once, absent a lightning strike or fire? (We have good UPSs everywhere, of course.)

    I started trying to update some themes to use gravatars, but so far I’m getting an error about calling an unknown function OR just the default “no gravatar” image, even for people who DO have them.

  6. Jason Penney Avatar

    KJToo – I’m aware there are a lot of avatar related plugins, but I’m trying to do something that used the new 2.5 hooks so it will just work with all 2.5 supporting themes (although with my level of free time, someone will probably beat me to it). I’ve looked at GoodReads, but I’ve invested a lot of time into Now Reading at this point and I can’t seem to bring myself to make the jump.

  7. KJToo Avatar

    Cynthia – If someone would just do a mashup of Squirl (which handles various media types but has some availability issues), GoodReads (which has some nice social networking features) and Now Reading (which, like the others, uses the Amazon API, but also has the benefit of existing in my own database), I’d be thrilled: a single, exportable database of all my books, movies and games that I could share with friends (and strangers), discuss, etc. It’s my multimedia holy grail.

  8. KJToo Avatar

    Jason – I know what you mean. I had a good start on a Now Reading library, but never took the time to sit down and create a pretty, functional library page for my blog theme. When GoodReads came along, I jumped all over it because it was nice and shiny.

  9. Rob Murdoch Avatar
    Rob Murdoch

    I stand corrected. This is . . . zzzzz. Oh, never mind.

  10. Rob Murdoch Avatar
    Rob Murdoch

    My comment is awaiting moderation? Jebus. Moderate away.

  11. KJToo Avatar

    Rob – Your lack of interest is noted. Also noted: until you commented, everyone in the conversation had a gravatar. Way to break the streak, buddy.

  12. Sam Chupp Avatar

    It isn’t very hard to get me to comment, is it? Thanks for the shout-out KJ. Apparently my spouse is more on the ball than I am!

  13. KJToo Avatar

    Sam – It is our lot in life to be forever playing catch-up to our better halves.

  14. Greg Avatar

    Since I’m too much of a control freak to use WordPress, I coded my own blog from scratch. I should look into Gravatar implementation, but finding the time is tough. Right now, I just look up posters’ URLs and use their favicon if they have one.

  15. KJToo Avatar

    Greg – I loves me some control as much as the next guy; I’ve just never developed the mad programming skillz necessary to write my own blogging software. Nor the mad graphic design skills necessary to create my own spiffy look for the site.

    Oh, and I’m trying to make arrangements for a new favicon for this very site, because the current one is…lame.

  16. blob Avatar

    Lame? I helped you design that favicon. I–

    Oh. 🙁

  17. KJToo Avatar

    blob – The favicon simply hasn’t aged well. I liked it at the time, but the more I look at it the less it pleases me. Nothing at all to do with your input on it.

  18. blob Avatar

    I’m just giving you a hard time. It was quick and dirty, even back then.

  19. KJToo Avatar

    blob – Quick and dirty and proof positive that I am not a graphic designer.

  20. Cynthia Armistead Avatar

    I hadn’t seen Squirl before – interesting.

    ReaderWare has a function to export database reports in HTML, but I never did really get it to look great.

    I like the way I can link entries in Now Reading to blog posts that contain reviews, or put the review in the entry. I do wish visitors could comment on the NR pages–I noticed that someone else has asked the author about that, but he hasn’t replied yet. I could figure out how to include the “leave a comment” part in the templates used for NR’s pages, but I don’t know if WP could handle them, without an associated post or page.

  21. KJToo Avatar

    Cynthia – ReaderWare seems somewhat similar to, which I tried out ages ago. I had the same problem with their Movie Collector product that you do with ReaderWare: I wasn’t able to get their HTML output to look very nice. Of course, that was before I really started using CSS, so perhaps I’d have better luck today.

    If I were more of a WordPress wizard, I’d think about modifying NowReading to do what you suggested, as it does increase the value of the plugin immensely.

Leave a Reply

Your email address will not be published. Required fields are marked *