WP: Gravatar Signup

March 11, 2005
12:15 am
Posted in: Tech, WordPress

This plugin has been moved to my code section, here.

164 Responses to “WP: Gravatar Signup”

  1. Marc says:

    When your plugin is activated it returns the following code in the comments template:

    Warning: Missing argument 1 for show_gravatar_signup() in /home/cranial/public_html/wordpress/wp-content/plugins/gravatar-signup/gravatar-signup.php on line 32

    The plugin was uploaded as per instructions 1e entire folder resides in the wp-content/plugin folder.

    I checked and both files as loaded are not corrupted in any way.

    Any ideas in how to solve the problem?

  2. Mark says:

    Yes I do… I’ll have a new version up in a minute or two!

  3. Mark says:

    Okay, try that.

    I assume you’re inserting the code into your comments file yourself, right?

  4. JoeBruin88 says:

    Pretty nifty plugin.

  5. [...]

    « UnCommon Web Tutorial

    Gravatar Signup

    WP: Gravatar Signup [ Tempus Fugit | TxFx.net ] ist ein kleines Plugin das die Anmeldung fur eine [...]

  6. JoeBruin88 says:

    You should also release your custom blogroll on your sidebar!

  7. Robert says:

    Hey Mark - is it possible to manually place the call on WP 1.5? I have customized my comments template so the tab order is off. It also shows the checkbox for people that already have gravatars so I would like to wrap it in a statement to detect that and only show if the user has no gravatar.

  8. Robert says:

    Don’t sweat it Mark. You wrote the thing so beautifully, it was a breeze to modify it for the custom comments template!

  9. JoeBruin88 says:

    Rob, were you able to successfully modify your comments template so that the Sign up checkbox does not appear if they already have a Gravatar?

    If so, can you pass along the info?

  10. Jeff Swanson says:

    Just testing to see if mine works…Nice site by the way

  11. Jeff Swanson says:

    super cool! it does

  12. Jeff Swanson says:

    I can’t get it to work on my site though…I’ve placed the gravater sign up folder into my plugin folder and activated the plugin. I’m using wordpress 1.5, What could be the problem…? My site address is: http://www.jeffswanson.com
    If someone could give me a hand that would be great…

  13. Robert says:

    JoeBruin: Nope. I was thinking there might be some variable in the Gravatar plugin itself that would let me perform a check against it, but no dice.

  14. Marc says:

    I have the same problem as Jeff. When I was on WP 1.2 Mingus the gravatar worked fine. In fact looking at past threads (pre upgrade) it still does even though I am now useing WP 1.5.

    Yet now, any comment I leave on my own site doesn’t show the gravatar.

    Any clue as to why?

  15. Mark says:

    Marc, you’ll need the plugin you used in WP 1.2 in order to display Gravatars. This plugin does NOT display Gravatars. All it does is easily allow your users to sign up for one. You’d still need to use a plugin to show Gravatars.

  16. Robert says:

    NIce version update Mark. Thanks!

  17. Robert says:

    Mark - FYI, I got an error thrown on line 93 of the plugin file. It looks like the include was missing the left parenthesis in this latest version.

  18. Ian says:

    Mark, excellent work on this plugin. Thanks for you hard work on it…I’m sure it’ll increase the number of commenter’s on our sites having gravatars!

  19. Tony says:

    I too get the error that Robert is talking about. How do I fix this?

  20. [...] X-Valid Attempts to create valid XHTML from arbitrary source. (Uninstalled since post) Gravatar Signup Allows commenters to sign up for a gravatar by clicking a checkbox [...]

  21. Ajay says:

    Just a question. How do I actually implement the gravatar on my blog like you have done?

  22. Ajay says:

    Problem solved. Added the manual code. Sorry for the double post :)

    Thanks once again for your plugin :D

  23. [...] why not on weblogs? Integration of Gravatar on my blog was simple. I first installed the Gravatar Signup Plugin. It generates code with a checkbox when you comment giving [...]

  24. c. s. says:

    Just a tip: as far as I can tell, performing get_headers() (PHP5 core function, see man page comments for a pre-PHP5 version) will return Last-Modified information if it is NOT a 1×1 image (ie. that user has an existing Gravatar).

    It’s a noble effort, but I’m not convinced this plugin is in the user’s best interests. How can I be sure someone hasn’t bastardized the plugin to save my selected password?

  25. Mark says:

    Robert, fixed the line 93 error.

    C.S., thanks for the tip. I’m already working on building a simple local cache of e-mail hashes that have gravatars so that an outgoing connection isn’t needed once we find out that a certain address has a gravatar, but get_headers() should speed it up for the first time.

    About your security concerns… I considered that, but as long as you own the e-mail address, it isn’t a problem. A user can always go to http://gravatar.com/forgot_password.php and have their password reset.

  26. Robert says:

    Great work Mark!

  27. Frederik says:

    Hi Mark. Very nice plugin. However, it only seems to work for users who are not logged in. I have a 1.5-compatible template that omits the name and eMail-fields if a user is logged in.

  28. Mark says:

    Frederik,
    I have a big update coming in the next 30 minutes that will include a fix for that issue, as well as a massive speed improvement using both a local cache and C.S.’s suggestion.

  29. Frederik says:

    whohoo, looking forward to that!

  30. Mark says:

    Okay, big update!

    For version 1.4 there is an additional step. You have to make the /plugins/gravatar-signup/gravatar-cache.txt file (which is new) writable. This will be used to cache the hashes of e-mail addresses that have Gravatars. This will make it much faster to determine if someone has a Gravatar.

    The new method for initially determining if a person has a Gravatar is much faster, thanks to C.S.’s comment. All in all, I think you’ll find this version to be about 4 or 5 times faster in most circumstances.

    Also, it works with logged in WordPress users who don’t specify an e-mail address, and uses the e-mail address from their profile, should they have one.

    Test away!

  31. c. s. says:

    Why write your own when one already exists?

    http://www.cimmanon.org/avatars/viewsource.php

  32. Mark says:

    C.S. I’m not caching the images, just the hashes. I don’t actually need the Gravatar… just need to know if one exists.

  33. JoeBruin88 says:

    I CHMODed the txt file at 766. Is that good enough, or does it need to be 777?

  34. Frederik says:

    actually 666 is sufficient. See here: Understanding file permissions on Unix

  35. Mark says:

    Joe,
    It depends on your server. 666 is the standard as Frederik noted, but some servers will be 755, some 777.

    Go view your comment form with a cookie with a valid Gravatar e-mail set. If the file can’t be written, it will give you an error telling you so.

  36. Marc says:

    Marc, you’ll need the plugin you used in WP 1.2…

    I understand that I had previously updated it along with the WP 1.5 install. I think I’ll download your newest version, delete and reinstall the gravatar code from them.

    See if that cure the problem.

  37. [...] on. If you wish to allow your users to also sign up for an account when leaving a comment, download this plugin as well.

    Untitled Document function Wrb [...]

  38. [...] So if you have a Gravatar.com account, you get an icon next to your comments here. You can sign up when posting a comment if you like. All icons have to be rated by human beings as to their [...]

  39. [...] i dine kommentarer. Hvis du selv have det pa din WordPress weblog, kan du smutte forbi Tempus Fugit og hente det plugin der skal bruges. Det ma et eller andet sted være temlig popul [...]

  40. [...] osts in one day, I’m a fucking freak! Anyway, I just saw this great plugin by Mark called wp-gravatar-signup and I knew I just had to have it. Install and set up was a breeze, so if you do [...]

  41. Frederik says:

    please update the version on wp-plugins.net

  42. Mark says:

    Frederik,
    Done, thanks.

  43. Frederik says:

    Wow, that was fast. Thanks. Could you please consider an internationalisation-option for future updates or any other way I can change the displayed text besides editing the source?

  44. Mark says:

    Absolutely. I’ll internationalize the next version.

  45. Frederik says:

    you da man!

  46. Mr Piggy says:

    Wondering if it’ll work.

    Thank you in advance!

  47. Henrikf says:

    where in my 1.5 defualt wp comment.php will this line go ??

    I have tried but the checkbox will not show up.
    Funny

  48. Mark says:

    Henrikf,

    Andwhere within the <form> </form> tags should work.

  49. Henrikf says:

    hmm ..still no go
    eeeh wait i have only one “” tag, no “” inside my /wp-content/themes/default/comments.php

  50. Henrikf says:

    i only have the

    no

    inside my /wp-content/themes/default/comments.php

  51. Henrikf says:

    aaargh … i only have the closing form tag (in comments.php)
    not the opening form tag ….

  52. henna says:

    Finally got a gravatar for me as well… Great site u got here!

  53. Henrikf says:

    Ok ! narrowed it down …

    The check button is showing upp in IE win , Safari mac ,Firefox win

    but not in Firefox on mac …. funny
    Is this a javascript thing ?
    BTw.. java and script is enabled i Firefox ..

  54. Mark says:

    Henrifk,

    The check button isn’t JavaScript dependant. How it works is that when you click the check button, an additional section opens up below, and that uses JavaScript… but JS support shouldn’t affect the checkbox itself. Only think I can think of is some weird CSS issue. Unfortunately I don’t have a Mac to test on for you…

  55. [...] †ã®ã‚¢ãƒã‚¿ãƒ¼ã‚‚表示されないようで、これを解決するプラグインや、Gravatarの登録リンクを表示するプラグインも出ています。 [...]

  56. Makki says:

    I have a problem here please help. I got it setup properly i believe except my gravatar doesnt not show in any of the comments i have made on my site. please help.
    http://makkigui.ambitiouslemon.com/

  57. Mark says:

    Makki,
    In order to have Gravatars show up, you’ll need a separate Gravatar plugin. I didn’t want to reinvent the wheel, as there are many great plugins to do that already. This one looks particularly nice.

  58. Makki says:

    i get this messege
    Fatal Error: Remote file opening disabled on this install of PHP: this plugin cannot properly function.

  59. Mark says:

    Makki,
    Eek, tell your web host that you’d like “URL fopen()” ability. You can also try this plugin that doesn’t require it.

  60. Makki says:

    Ok i got that one installed but i dont see anywhere in the documentation about where to put the syntax

  61. Makki says:

    where do i put the syntax so the gravatars show up?
    i am using the wp gravatar plugin

  62. Makki says:

    Hey anyone can help me out here please?

  63. Mark says:

    Makki, it should be placed in your comments. In WP 1.5, this is /themes/your-theme/comments.php

    I’d place it right before the comment content.

  64. Makki says:

    Thanks for your help man :)

  65. Makki says:

    is this what i insert?

    because i get an error

  66. Makki says:

    err i mean is this the code?

    ?php gravatar({rating{, size{, default{, border}}}}) ?

  67. Mark says:

    Makki,
    There are examples. That is the general syntax. Specific examples are provided. The easiest is just this:

    <?php gravatar(); ?>

  68. [...] tore: Simple way to backup and restore a WordPress MySql database and wordpress folder. Gravatar: Allows commenters to sign up for a gravatar by clicking a checkbox and filling in a des [...]

  69. cap says:

    cool

  70. Scottish says:

    This plugin rocks! Thanks so much :D

  71. Ben says:

    I just want a gravatar.

  72. Makki says:

    If you would just like to have your own gravatar signup at gravatar.com :)

  73. Ben says:

    Right, but is there a way to test this script feature (getting a Gravatar) on your page without actually leaving a message? Perhaps create a demo site that automatically deletes the comments after a day or two? My earlier comment was just rubbish — I was testing! ;)

  74. Google Ads Theme Switcher Gila Literal Barrage Uncertain WordPress Classic WordPress Default Plugins Used BAStats Deep Thoughts Paged Comment Editing Gravatar Signup Gravatars Identify External Links Link Library Live Comment Preview Referrer Bouncer Official Comments Plugins Used Recent Comments RSS Inclusion RunPHP Scripturizer

  75. Mark says:

    I don’t mind if you leave a generic “this looks cool!” comment in order to test it out, as long as it is done on this entry. :-)

  76. Siggie says:

    how come the checkbox dont show on my latest firefox 1.02 on my webpage??
    but it shows on ie6 sp2
    (win xp)

  77. Mark says:

    Siggie, probably because you have a comment cookie saved in Firefox but not in IE.

  78. Siggie says:

    oh man u r a genius! i cleared my cache n it worked!!!! great job ;-)

  79. Father Luke says:

    Well, I downloaded it.
    Uploaded it to my plug ins folder.
    Put in the

    /* — —-*/

    (slashes and spaces added to avoid problems in these here comments )

    And I see nothing when I use it on my site:

    F a t h e r L u k e .com

    I am using the manji theme
    with wordpress 1.5-beta-1 2005-01-25
    and I’m using skippy’s gravatar plug in.

    Any love here?

    I’d love to use this, but hey - wanting and being
    dissapointed because I can’t have something are two
    different things.

    Hope someone might be able to help.
    I’ve seen this little plug in and uit rocks the WP world.

    Okay,
    Father Luke

  80. Mark says:

    I downloaded Manji, and took a look at its comments file. It is incompatible with WordPress 1.5, so you will need to place the &lt?php show_subscription_checkbox(); ?> function call manually. It can go anywhere in between your opening <form> and closing </form> within your comments.php file.

  81. Father Luke says:

    You da’ man.

    I love you,
    Father Luke

  82. Father Luke says:

    Whoa!
    Shows up in IE but not in Firefox.

    Am I loopey?

    Father Luke

  83. Mark says:

    Luke,
    Doesn’t show up if you already have a Gravatar and have a comment cookie with that e-mail address. You must have a comment cookie saved in Firefox. Try clearing your cookies.

  84. Father Luke says:

    Doesn’t show up if you already have a Gravatar and have a comment cookie with that e-mail address. You must have a comment cookie saved in Firefox. Try clearing your cookies.

    B I N G O.

    Feel the love. . .

  85. luis says:

    testing

  86. gone-zhar says:

    good work dude !

  87. Doesn’t show up if you already have a Gravatar and have a comment cookie with that e-mail address. You must have a comment cookie saved in Firefox. Try clearing your cookies.

    All well and good, I guess, but if you’re requiring user-login to post comments, there’s no way for your existing users to get their gravatar via this plugin. Perhaps it would make sense to add a Dashboard page for already-registered users so that the signup form could be presented to them there…?

  88. GFMorris.com says:

    Site Version 1.1

    I’m calling the present state of GFMorris.com’s layout Version 1.1. Added since you last viewed the site:

    Gravatars in comments. This isn’t a requirement; if you don’t have one, a silhouette shows up beside your posts. Since I require user…

  89. Mark says:

    Geof, well, it’s supposed to hide the checkbox if you have a comment cookie saved and that e-mail address does not have a Gravatar but it appears that the Gravatar server changed things around, so the method I’m using to determine if a user has a Gravatar isn’t working. That’s why you’re only seeing the checkbox if you clear the cookie… because the code that determines Gravatar status is returning a false positive. I’m in the process of changing that code to use a method that won’t be broken the next time they shuffle stuff around over there.

  90. Aha. Fair enough, Mark … always fun when someone shifts an API on you. :(

  91. And just for your debugging purposes: I implemented this on a spanking-new Weblog [that has no comments], and I’m being asked the first time if I want to sign up even though that user has one [it's the same email I'm using here]. Though, that’s probably just because of the cache not having data in it. If so, I’m posting this comment as instructional for those who are in this unique situation, wondering if they’ve buggered something up.

    Thanks for the spiffy plugin. :)

  92. Mark says:

    Alright, people. Please upgrade to version 1.5! Thanks to Geof for bringing to my attention that something wasn’t working. Gravatar changed something on their servers, so the method I was using to see if the current commenter already has a Gravatar was failing. Now, it’s using a method that shouldn’t break in the future, since it’s the new method that the people at Gravatar have recommended! Also, fixes for sites with user registration as well as compatibility with the latest WP 1.5.1 builds. You should flush out (empty the contents of) your gravatar-cache.txt file, because it’s likely filled up with hashes of people who don’t have Gravatars, due to the fact that the code was creating false positives.

  93. Bless you, Mark. Have a great night. :)

  94. Makki says:

    Hi i am returned here :) i have a disability ok and umm sometimes i just dont understand stuff and so i must apologize i guess cuz i need someone to explain step by step to me about adding to the comments.php please someone can help me out cuz i have done all can do and avs dont show up.

    thank you

  95. Mark says:

    Makki, this plugin does not handle that. You’ll have to install this one, or this one, and follow their directions for implementation.

  96. Rahul Sinha says:

    I wonder if WP will soon have some of the more popular plug-ins bundled in. This is especially important where the plug-ins advance a “platform” technology, such as Gravatar, Del.icio.us, etc.

    WP seems to have the marketshare to create standards simply by adopting a protocol or platform in its default configurations (wrt blog related technologies). This is a power that they might as well use, no?

    -RS

  97. I wonder if WP will soon have some of the more popular plug-ins bundled in.

    At this point, Rahul, WordPress is still solidifying its codebase and coming to a maturity point. The plugins released with the default install are primarily those written by the maintainers of the codebase; third-party developers shan’t expect such freedoms.

    Where WordPress could definitely stand to improve is in having a centralized plugin database. That effort is starting quite fitfully, at least to my eyes…

  98. Shadow says:

    Not sure what is going on here…

    1. Copied folder to plugins folder
    2. Activated plugin
    3. Made cache.txt writeable
    4. Dropped into comments.php

    Nothing showing up anywhere. I tried moving the call to different places in comments.php and still not showing.

    Any ideas? Thanks :)

  99. JoeBruin88 says:

    I upgraded and now it’s not working. I have the same problem as Geof above (#97).