Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Easy Gravatars Plugin

Since so many people seemed to be interested, I went ahead and coded up my new Gravatars plugin: Easy Gravatars. It’s designed to be simple to use — just upload and activate. If you want it to be a little harder, you can visit the plugin’s options page to set the size and rating for the gravatars, and even set the location of a default image, and tweak the CSS a little bit.

Download: easygravatars.zip

I’m going to put it in the WordPress Plugin Repository when I get a chance. Once that’s done, I’ll update this post with the new location.


Update, 2007-11-16: The plugin is now in the repository, and you should now be able to see that version 1.1 is available: Easy Gravatars Plugin

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Plugins, WordPress and tagged , , , , , , , , , , . Bookmark the permalink.

144 Responses to Easy Gravatars Plugin

  1. Pingback: Rocking in Hakata » Blog Archive » Gravatars Are Go

  2. Sarah says:

    Awesome. Playing with it now :)

  3. Thanks for doing this Doug. I just hardcoded it, but I can think of a use for this (friends) so they have it, and have a little control.

  4. Jenny says:

    I still like myAvatars better. But this is a nifty plugin. I hope people enjoy it.

  5. Pingback: Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 10/25

  6. kOoLiNuS says:

    Thanks !
    I’ll use it right now on two blogs I manage externally from WP.com …

  7. ashish says:

    thx buddy for this

  8. shijirou says:

    Hi Doug thanks for posting this but my gravatars wont show in the comments. A little help?

  9. papajoneh says:

    I’ve been looking for this plugin for so long. thanks for bringing it out :)

  10. Pingback: Plugins para Wordpress 25 de Octubre at Corazón de La Mancha

  11. Pingback: BlogBroker » WordPress Plugin Releases for 10/25

  12. worlockt says:

    i also want to add avatar feature on my site..but quite confuse with how to set php settings..anybody suggest me where to add gravator link and how to set default setting .

  13. Eric says:

    What if I want to add the function that calls for the Gravatar in my comments.php? Actually, I tried it but it just gave me an error.

  14. RageX says:

    Was wondering if its possible to do a MyblogLog and Gravatar all in one plugin?

    Like if the email isn’t listed in MyBlogLog it try and display Gravatar.

  15. definately does not work with my theme :)
    I’ll do some research when I’m at home what’s wrong, but atm it looks like it’s incompatible with a Google Analytics plugin I’m running. Switched back to plain simple <img class=”gravatar” src=”” /> :D

  16. lorenzone92 says:

    Thanks for this plugin!!!

  17. fel3232 says:

    It looks like it is compatible with Google Analytics plugin I am using. Very nice plugin, I will be using it as well. Thanks a million.

  18. Dougal says:

    shijirou: Are you saying that the plugin doesn’t work on your site, or that it’s not displaying your gravatar here? The plugin depends on the get_comment_author_link filter hook. If your template is bypassing the functions that call that filter, it can’t insert the gravatar code. However, pretty much any template that displays the comment author’s name should be using the correct call. If you’re talking about not getting your gravatar to show up correctly, it might not be rated correctly? I only display “PG” or “G” rated gravatars here. Login to Gravatar, and hover over your icon to view the rating. Click the rating to change it, if necessary.

    worloct: With the Easy Gravatars Plugin, all you have to do is activate the plugin — it should automatically add the icons to your comments without any other changes needed.

    Eric: If you want to add gravatars to your template manually, then this isn’t the plugin for you. Use the one from the gravatar.com site.

    RageX: I’ll probably look into adding MyBlogLog functionality one day.

    Christoph: Odd that it would conflict with another plugin like that — Easy Gravatars isn’t doing anything particularly unusual. Are you sure that’s what the problem was?

  19. Richard says:

    how to use it? It must be very cool.

  20. Thanks. I installed it and modified it. It’s great.

  21. S.K says:

    Thanks. You did as promised!

    I have to now look for that “comment_author_link” hook!

    S.K

  22. shijirou,
    Some thoughts: Make sure you disable wp-cache if you’re using it. then re-emable after you install and test the gravatar plugin (or any plugin for that matter). Also, double check to make sure the email address you have set up for your wordpress user matches the email address you use for your gravatar account.

  23. Pingback: Friki Orgulloso » Blog Archive » Activa Gravatar en tu blog facilmente

  24. Hey… thanks for a great plugin (we’ve implemented it at WebHelperMagazine.com so y’all come by and comment). Question: While I do have a Gravatar, and it shows up via the WordPress.com comment postings, I do not see my gravatar show up at WebHelperMagazine.com (see specifically: http://webhelpermagazine.com/?p=193). On the page referenced, you will see a commenter’s gravatar shows up fine, while mine does not. Is this because I am an admin. for that site? Where does your plugin pull its gravatar images from?

  25. Hello Dougal & All -
    Hey… I figured it out. Went to Gravatar.com and added a Gravatar for my regular address, AND my admin address at http://www.webhelpermagazine.com. Worked great. So… if you have more than one address, you can set them all up at Gravatar.com. – Scott

  26. Works great. I modified the CSS to display the gravatars properly on my theme. Thanks so much. I particularly like the ability to use different image sizes for those of us who want smaller gravatars. :) Cheers!

  27. Pingback: JalanSutera.com

  28. jalansutera says:

    Thank you for this little nice plugin. I can install it with a breeze. Take a look at my blog.

    One question: how to put the avatar a little higher?

  29. yoxx says:

    how to use it? It must be very cool.

  30. Pingback: I’m Gravatar enabled at Missmosta

  31. Dougal says:

    Ulysses: Great job integrating the CSS into your theme!

    jalansutera: Try changing the Span Style to: float:right; margin-left:10px; display:block; margin-top: -1em;

    The “margin-top: -1em” should move it up by one text line.

  32. Andyk says:

    Good work – works a charm on my site!

  33. Pingback: Wordpress Easy Gravatars Plugin

  34. Jay says:

    Wow that was easy. I spent a lot of time with the heavy official plugin but the results weren’t super great. This lightweight plugin did the job in less than 10 minutes, from download to fully-configured. Thanks for making it available.

  35. Pingback: WP Plugin: Easy Gravatars » Blogging News and Reviews // JaypeeOnline

  36. Pingback: Got Gravatars | WordPress Designpraxis

  37. Dougal,
    One of the mods I made to your plugin for my blog was to link the gravatar to the commenter’s website. I bet others might like that option, too. You might want to add it for the next version :)

  38. Pingback: azmifauzan.net

  39. Mark says:

    Thanks Dougal. I modified it ever so slightly but it works like a charm!

  40. SmockLady says:

    thank you so much for doing this. I used to have gravatars up, but I took them down ages ago because I change my blog according to the seasons and it was too much work to keep up with changing every theme. Now I have my own theme that I just change colors with the seasons and all is good. but adding this plugin made it so much nicer (and quicker) to do.
    I do have one question: my gravatar shows up, my default gravatar shows up for those that don’t have one, but I know I have some commentors that have a gravatar and it is showing my default. do I need to do something different?

  41. aag says:

    Other folks’ gravatars show up but not mine. Hmmmmm…

    WELL! My gravatar shows up here but not on my site. Very odd.

  42. Pingback: David’s Technical Musings » Blog Archive » Easier Gravatars

  43. David Potter says:

    This is a terrific plugin – thanks, Dougal, for doing this. I took the liberty to spruce it up a bit:

    Improved admin page layout, including more verbose descriptions of each of the options.
    Added Reset button to the admin page to delete all the options from the database.
    Added ability to display a border around the gravatar image.
    Display image as a link to the comment author’s web site (thanks to Elaine Vigneault for the idea).

    You can find my changes on my web site at http://dpotter.net/Technical/index.php/2007/10/26/easier-gravatars/.

    What I especially appreciate about this plugin is that I don’t have to change my themes. I still have a little work to do to get the images to display just how I want them, but it’s good enough.

    Thanks Dougal,
    David

  44. Pingback: Gravatar enabled | Bent Corner

  45. AvP says:

    nice plugins,thanks.

  46. Pingback: Wordpress Easy Gravatars Plugin | Webz

  47. n-blue says:

    Thanks for released this. I’m still wieghting whether using or not using Avatar on my sites.

  48. Pingback: n-blue | Gravatars ง่ายนิดเดียว

  49. Pingback: links for 2007-10-30 : 7 seconden

  50. Pingback: Weblog Tools Collection » Blog Archive » WeblogToolsCollection Plugin Housekeeping

  51. Pingback: Basic Thinking Blog | Wordpress-Plugins: Gravatar und InSeries

  52. Shandara says:

    Just installed this plugin, but the gravatars don’t show in my comments… so this is a test to see if it work here ;)

  53. Alex says:

    @RageX (11) there is already a plugin where it looks for Gravatar, Avatar and MyBlogLog http://kamajole.dk/plugins/mbla/

    @Dougal, I activated the plugin, but it’s not showing any pictures on my page :(
    http://afrison.de/endlich-wieder-online-neues-design-und-neuer-inhalt/493/

    Where exactly has to be the get_comment_author_link filter hook to show the gravatars?

    Thanks a lot

    Alex

  54. Pingback: WordPress Plugin GRAVATAR on K2

  55. Thanks for the great plugin. I prefer it to all the other Gravatar plugins because I can use it without editing my theme files. That makes updating the theme much easier. I also like that you can edit the CSS from the options page.

  56. FD says:

    I really appreciate this plugin. I’ve been periodically trying to add gravatars to my blog for at least a year. None of the other methods or plugins I’ve tried worked with my theme out of the box but yours did. There’s still an occasional problem with how it’s displayed but I’m almost certain that has more to do with the theme I use than your plugin. Thanks a lot for sharing it.

  57. Pingback: Gravatar, Links und Werbung: Anpassungen auf blog.yoda.ch » blog.yoda.ch

  58. Pingback: Gravatars at they made me do it

  59. BG! says:

    Hi Dougal

    Here’s a thing…

    I’ve got a gravatar and your plugin on my blog.

    If I browse via Firefox, I can see all of the available gravatars from commenters that have them, including mine.

    But… if I browse via IE, I can see all of the others except mine. I’ve got the correct email addy against all of my comments, my gravatar is rated G and I’ve got the options page configured to show X.

    Here’s my post regarding the matter: http://beardedgit.com/?p=218

    I would appreciate your views regarding this weirdness.

    Cheers,

    BG

  60. BG! says:

    Hi Dougal

    Got me a gravatar (rated G) and installed your plugin, set to display X.
    In Firefox I see all available gravatars from all commenters who have them, including mine.
    In IE, I see all the others but mine refuses to show.

    Any ideas?

    Cheers,

    BG

  61. Pingback: Easy Gravatars Plugin | 我爱水煮鱼

  62. Pingback: Automattic Acquired Gravatar — WP Assist

  63. Pingback: わーどぷれすっ! » Easy Gravatars

  64. Pingback: Fall Back Blog Updates: Favorite Posts and Comment Fun : Elaine Vigneault

  65. Carlotta says:

    Thank you so much for this great plugin. It’s really easy to integrate and works perfect for me and my sites.

  66. Gina says:

    This is great, but having issues with it showing on my blog. As the page loads, it briefly shows the image where it should be, but nothing ever appears. And a few others have shown, but mine never does. :-/

  67. David says:

    We’re experiencing a bug with this plugin. Gravatar is correctly configured and the proper e-mail address is being used (as shown by my gravatar above). Here is the test case, which you’re welcome to try at our site: http://www.newpopehat.dreamhosters.com/?p=89#comments

    Any help would be appreciated!

    NOT LOGGED IN, NO AUTHOR HYPERLINK:
    1. Commenter provides Name and Email, *** no Website ***
    2. Result: Comment appears with Gravatar, “Commenter Says” text appears.

    LOGGED IN, NO AUTHOR HYPERLINK:
    1. Commenter’s profile includes *** no Website ***
    2. Result: Comment appears with Gravatar, “Commenter Says” text appears.

    NOT LOGGED IN, AUTHOR HYPERLINK:
    1. Commenter provides Name, Email, and Website
    2. Result: Comment appears without Gravatar, “Says” link appears without Commenter’s name, and with an invalid URL

    LOGGED IN, AUTHOR HYPERLINK:
    1. Commenter’s profile includes a Website
    2. Result: Comment appears without Gravatar, “Says” link appears without Commenter’s name, and with an invalid URL

    The “Says” link seems to contain formatting and placement info for the non-appearing gravatar; the defect seems to be that

    < a href='

    is missing from the hyperlink, which then distorts the gravatar code.

    Perhaps something about the plugin's use of get_comment_author_link() is interfering with the Comment page's own use of comment_author_link(). The return seems not to be formatting the hyperlink properly.

  68. David says:

    Confirmed that Christoph is right. We’re also running the GoogleAnalytics plugin, and seeing the symptoms described in comment 44 above. Disabling Google Analytics fixes the problem.

    Naturally, it would be preferable to run both, but GA is the priority.

    Where might they be in conflict? Here’s the particular plugin that breaks eg:
    Plugin Name: Google Analytics for WordPress
    Plugin URI: http://www.joostdevalk.nl/wordpress/analytics/

  69. Dougal nice work, when have time i made a integration test.

    Keep Going!

  70. Dougal says:

    Okay, I’ve taken a look at the Google Analytics plugin, and I think I know why it causes problems with Easy Gravatars. That plugin also uses the get_comment_author_link API hook, later than Easy Gravatars does, and uses a greedy regular expression that’s trouncing on the image tag.

    I’ll do some experiments and see if I can some up with a quick fix. I’ve also contacted the author of the Google Analytics plugin and made him aware of the problem and a possible fix.

  71. David says:

    Thanks for looking into it!

  72. artesea says:

    Cheers for this. Even though I knew how to put Gravatars manually on my blog, I just couldn’t be bothered to do it. Thanks.

  73. Aahz says:

    Great plugin! Thanx!

    But it doesn’t seem to be pulling my gravatar. At first it wasn’t doing so because I had actually created my blog and my gravatar under different emails. I’ve since added a gravatar to the admin email address and it is still showing the default gravatar. I used that admin email address here and it is showing the correct one. :(

  74. Jeffro2pt0 says:

    I am having difficulty seeing gravatars in IE but they appear fine in FireFox. Also, this plugin seems to overlap everything in my commenting section. I’d rather have a line of PHP code to place into my comments.php file to really embed the avatar in the commenting area of the site.

  75. Pingback: WordPreciousss 1.4 · WordPreciousss

  76. Pingback: geek ramblings » Easy Gravatars version 1.1

  77. Bardulf says:

    Thanks for this plugin. I like the idea of it, and have installed it on my site, but it isn’t showing my gravatar in my comments — and won’t show anyone else’s as yet because I’m only just setting a blog up. So I thought I’d leave a comment here, to say thanks, and to see if my gravatar showed up here. Cheers!

    Mmm, only the default image here too. Must be a problem with the gravatar end then. Odd. I wonder if it might be because it’s a newly set up gravatar.

  78. Pingback: Sobre WP » Blog Archive » Easy Gravatars 1.1

  79. Dougal says:

    Frozen: No, you do not need anything else for it to work.

  80. Pingback: Blogs Of The Day Lister » WordPress Wednesday News: WordPress 2.3.1 Released, Get Your Upgrade, WordPress Podcast Speaks out, WordCamp Israel a Success, Argentina is Next, and WordPress Wins.

  81. Pingback: » Easy Gravatars Plugin for WordPress BigDadGib

  82. bigdadgib says:

    Thank you. Too Cool! :)

  83. Pingback: scot hacker’s foobar blog » Gravatar

  84. danithew says:

    For some reason my blog is putting up little squares/rectangles but they are empty of gravatar images. I don’t know what is causing the problem. Any ideas?

  85. Pingback: WordPress 2.3 compatiblity Plugins | Dreamer's Blog

  86. try says:

    just trying it out :-)

  87. Pingback: Easy Gravatar - Gravatar Problem gelöst | Teigfladens Alltag

  88. Pingback: Adding Avatars and Gravatars to Your WordPress and WordPress.com Blog « Lorelle on WordPress

  89. Dougal says:

    Get the latest version of the plugin from the Plugin Repository.

  90. Pingback: Plugin Easy Gravatars pada Wordpress | Agung's Blog

  91. Pingback: Установка Gravatar на свой блог | Web разработка, IT новости, технологии, дизайн, блоггинг, SEO, заработок в интернете, практические советы и рекоменÐ

  92. Pingback: WordPress Plugins Database » Plugin Details » Easy Gravatars

  93. chuck says:

    Hi Doug, this is a somewhat banal question, but how do I get the gravatar into the little quote boxes on my site? That’s the only thing that’s keeping this from being utter perfection, and it’s due to my suckage at coding. Thanks for a great plugin.

  94. Dougal says:

    chuck: Try setting your span style in the Easy Gravatar options to this (note the new ‘margin-top’ bit at the end):

    float: right; margin-left: 10px; display: block; width: 40px; margin-top: -0.5em;

  95. Pingback: Blogs for Bands

  96. Zołak says:

    Very good one! Thank You!

  97. Mico says:

    I tried editing the easygravatars.php file (in the WP plug-in editor), as I thought you meant in your comment #25. No success for any values of margin-top, negative or positive. The image seemed glued at its upper left corner.

    However, when I made the change in the EasyGravatar *Options* screen, as you said in comment #62, it worked! Can you tell me why? Also, is there a reason you specified vertical displacement in ems rather than px?

    Thanks for your work and especially for your support by answering all these pleas for help. You’re a champ!

  98. Dougal says:

    …when I made the change in the EasyGravatar *Options* screen, as you said in comment #62, it worked! Can you tell me why? Also, is there a reason you specified vertical displacement in ems rather than px?

    Mico: Changing that value in the plugin code won’t matter, if the plugin is already installed and activated. At that point, the option is already saved in the database, and it will always look at that. So, when you change it via the Options page, you are setting the value that it really wants to use, see?

    As far as why I used em instead of px, it’s because there’s no way for me to know what px size you have chosen on your site. The em measure is always relative to whatever your preferred text size is, so a value like margin-top: -1em; should always (well, in most cases) move the image up by one text line. But if you want to set it in pixels instead of ems, go ahead, that’s why the options are there — so you can set it the way you want it.

  99. yorick says:

    Wonderful, Thanks :)

  100. Pingback: geek ramblings » WordPress 2.5 Beta

  101. Jorge says:

    Something happened to the plugin, I think today: when a Gravatar is not found, the default image is not read, a blank square from Gravatar is shown instead. Any idea why?

  102. Pingback: geek ramblings

  103. mark says:

    hi

    brilliant plugin, this is the only gravatar plugin that has actually worked for me. I have noticed a few people who have left comments are moaning that it does not allow them to do certain things like styling etc. I have made some ammendments to the plugin to allow this. I won’t be offering it as a download but for those who are interested you can email me and I will help you out (all of this with the plugin authors permission of course.)

    here are a few things I have done:

    I took out the image tags to better control styling within the templates
    i added a blank target so author urls will open in a new page (very handy for myself)
    i added a few more option to the drop down box on the admin page so you can link the image to other comment_author tags, this helps with styling and gives more control.

    I have yet to upload to my live site (will be shortly) so if anyone wants more info just drop me a line.

    Dougal:
    I hope these amendments are ok, and if you would like to drop me line please feel free.

    Mark…

  104. Pingback: random threads » Blog Archive » lookee at the fo’s over there on the right!

  105. Shane says:

    Awesome plugin! Going to be installing it very very soon. Thanks!

  106. Pingback: [i:rrhoblog] » links for 2008-04-25

  107. krisel says:

    I been waiting for this plugin.. thank you so much..

  108. Martijn says:

    Doesn’t seem to work

  109. Shane says:

    Thanks for the great plugin! Is there an easy way to use the Gravatar’s Identicons w/ this plugin? Thanks!

  110. Dougal says:

    Shane: yes — just type ‘identicon’, ‘monsterid’, or ‘wavatar’ as the Default image url in the Easy Gravatars settings. I’ve been meaning to post about this, but just haven’t had time yet.

  111. sara says:

    how do you make the gravatar icon not link to the person’s site?

  112. kazounet says:

    Thank you for this nice plugin :)

  113. Pingback: Leonaut.com

  114. David says:

    Hi there–

    I’m 127% sure this is the stupidest question you’ll receive today, but…

    How can I force each comment to appear on a new line, rather than stacking up horizontally when an earlier comment isn’t long enough to scroll past the gravatar image? (In the screenshot at http://threetwelve.net/images/misc/egscreenshot.jpg, for instance, the text “David posted the following…” should line up with “Amie posted the following…” above it, rather than appearing to the right of Amie’s gravatar.)

    Thanks for whatever wisdom you can provide!

    : )
    David

  115. Testing says:

    Just testing

  116. David says:

    I got it–I had two plugins competing for comment style. :-p

  117. klaas says:

    Ye i whas wondering wich plugin i need for this.Becuas it is a great thing.
    Going to download it now and will try it out.\/\/

  118. Pingback: 15 plugins essenciais para o WordPress | criandowebsites.com.br

  119. Pingback: Zach Kollegger » Blog » Changes, Changes, Changes

  120. vladm says:

    ?? ??… ??? ??? ? ?????????: ? ??? ?????? ????????? ? ??????.:)

  121. Goran Web says:

    This is a cool plugin, thanks Doug.

  122. Thai SEO says:

    Thanks for this plugin!!!

  123. dikma says:

    why, this plugins no active in blog ..
    it not displayed pict

  124. rambochai says:

    i still dont know how to use it — after i have install still can’t appear —

    will try again —

  125. abbie says:

    Nice plugin!
    Thanks for giving it free.. :)

  126. Sohail says:

    Hi there
    Great plug mate. I am just having one problem with it and that is “i can’t remove the border of avatar”. Please tell me how can i do that

  127. Sohail says:

    I can not remove the border of avatar image how to do that?

  128. Really good plug in.But i wonder something about this plug in.If someone created easy gravatar from another site and commented in my site does gravatar seems?Or must he create one gravatar from my blog?

  129. d4v says:

    I am not getting random wavatars, just the same one no matter who is the author

  130. David says:

    I just found your site, I need to get a gravatar – thanks for the plugin, off to d/l now

  131. Genry says:

    I really like, thanks!

  132. nick aviles says:

    thanks a lot for the plugin :)

  133. e?itim seti says:

    But it doesn’t seem to be pulling my gravatar. At first it wasn’t doing so because I had actually created my blog and my gravatar under different emails. I’ve since added a gravatar to the admin email address and it is still showing the default gravatar. I used that admin email address here and it is showing the correct one. :(

  134. Baron says:

    Hi.

    It seems to display the pic to the right of the comment, almost all comments but not in the little gravitar box on the left. Any ideas?
    Set to : G & Comment Author Link
    Does it need to be uploaded elsewhere as well? I would think so, to show up on other blogs…or is this that kinda gravitar?

    Thanks,
    Baron

  135. Baron says:

    Sorry bad email the first time.
    I can’t seem to get it to show up in the little gravitar box on the left only to the right side of the comment.
    Do I need to upload this pic somewhere else as well to show up on other blogs? I would think so.
    Thanks
    Baron

  136. Pingback: Como criar um blog no WordPress. « PEDAGOGIA DO AMOR.

Leave a Reply

%d bloggers like this: