Gravatar Signup Encouragement

Gravatar Signup Encouragement (download) is a plugin that will encourage users without avatar on Gravatar to make one. It checks e-mail address that unregistered users enter in forms or stored e-mail address of registered users on gravatar.com to see if there is avatar associated to that e-mail address. If there is no avatar, it will display message which will inform user that they don’t have an avatar on Gravatar and give them a link to sign-up page of Gravatar which would be pre-filled with their e-mail address.

Checks on gravatar.com for user’s e-mail address are done via simple and fast AJAX.

Message can be shown to:

  • unregistered commenters when they leave text input field for e-mail address
  • registered commenters to whom their registered e-mail address is checked
  • unregistered commenters after they post a comment in a dialog, to whom their entered e-mail address is checked
  • registered commenters after they post a comment in a dialog, to whom their registered e-mail address is checked
  • registered users in administration notices, to whom their registered e-mail address is checked
  • registered users in admin bar, to whom their registered e-mail address is checked
  • registered users on their profile page, to whom their registered e-mail address is checked
  • users who fill registration form when they leave text input field for e-mail address

There is no need for editing of theme’s files in order to show message, everything is done via JavaScript.

Both AJAX and display of messages are done with use of jQuery library. This plugin will load jQuery file to head of your page if it wasn’t already loaded by theme or other plugin(s). You can speed up your web site and save on bandwidth and server resources with use of plugin Use Google Libraries which will load jQuery file from Google AJAX Libraries. See here how will this help you.

You can select in what of eight (plus one on multisite or in bbPress) cases to show message, plus you can choose for each case where on page to show message. There are several elements already available to choose for all cases and you can alternatively add custom element by providing it’s id. Since this plugin uses jQuery selectors to find element, you can add even more advanced filters for selecting. Also be aware that display of message may not look good with your theme.

Customization of styles of messages is also possible. You can customize messages by defining CSS style of it. Whole message is wrapped with div with ID depending on case:

  • gse_comments_message for comment form
  • gseaftercommenting for modal
  • gse_admin_notice for administration notice
  • gse_profile_message for profile page
  • gse_registration_message for registration page
  • gse_ms_signup_message for signup page on multisite
  • gse_bbpress_message for bbPress

Text of a message is also customizable, you can write any message you want, even use HTML tags you want. Note that you should leave link with URL placeholder if you want to show link to Gravatar’s signup page pre-filled with user’s e-mail address, and that you should not use double quotes (") since it will break code. Instead, use curly quotes ( and ) for text, and single quotes (') for HTML tags. Also note that same message is shown for all cases, unless you use WordPress filters to change it per case.

There will be no mess in database made by this plugin, since it adds only one field in database which is deleted if you uninstall plugin using WordPress’ built-in feature for deletion of plugins.

This plugin is fully internationalized, you can translate all text and link to locale version of Gravatar’s site. You can find .pot file in translations folder where you should place your translation. Please send me your translation by contacting me so that I can include it in next releases.

Editing of settings is done on page Discussion Settings in administration area of WordPress, in section Avatars. Here is a screenshot of how settings should look with all cases checked.

Settings form with all expanded options

Here are screenshots of displays of message in all cases with default settings.

Message shown to unregistered commenter on default theme with default settings
Message shown to registered commenter on default theme with default settings
Message shown in a dialog to unregistered commenter on default theme with default settings after posted comment
Message shown in a dialog to registered commenter on default theme with default settings after posted comment
Message shown in admin bar
Message shown in administration notices
Message shown on a profile page with option to show below “Profile” header
Message shown on a registration page with default settings
Message shown on a registration page (multisite) with default theme and default settings
Message shown in a bbPress reply form of a Twenty Eleven theme in line with avatar

And here is video tutorial (don’t forget to turn on captions (subtitles) since this is where you’ll get text):

Gravatar Signup Encouragement is released under the terms of GNU General Public License. It is completely free so if you find it useful you can give something back to author. Your help could be done by giving donation, translating plugin to your language, sending bugs and suggestions, promoting plugin in blogs, forums social networks, and other websites.

Support for this plugin could be get in comment section of this page or (preferably) through WordPress support forum. Note that I don’t guarantee that I’ll respond to your entries nor that I’ll do it in short period of time. Before posting, please read documentation on this page or on plugin’s page in WordPress plugin directory. I’ll may delete questions for which answers are provided.

60 thoughts on “Gravatar Signup Encouragement


  1. What a great plugin!

    One minor problem, though… when I installed and tested it, it did correctly show the message when I entered an email address with no Gravatar. However, when I changed the email address to one which does have a Gravatar, the message did not disappear. This could mislead some folk.


    1. I checked your website and the problem is with some nonstandard code in comment form. On my server I installed Carrington theme but it didn’t use that code as on your pages.

      What version of this theme you are using and did you make any modifications to it’s files or in it’s settings? If you didn’t, do you use any other plugin related to comments?


      1. I again checked Carrington 2.2 and I can confirm that problem is with it (I don’t know how I saw different thing when I first time tried it). Unfortunately, in order to use this plugin with this theme, you’ll need to manually edit plugin’s file.

        In plugin’s file, find two occurrences of jQuery("#email") and replace it with jQuery("input[name='email']"). Then go to plugin’s settings and in section “Comment form (unregistered users)” check “Custom ID” and fill in text filed next to it comments. After that, this plugin should work without problem.

        Note that if this plugin get updated and you use built in function for automatic upgrade or you manually replace files, your edits of code will be lost so you’ll need to repeat them. Also, if you change theme, there will be no more need for this changes so you should reinstall plugin to use it with that theme.

        Sorry, only noticed now that you had replied.

        You can check “Notify me of followup comments via e-mail” to receive e-mail notification when new comment is posted.


  2. Sorry, only noticed now that you had replied.

    I’ve checked and cannot see any active, comment-related plugins. I had changed a few items in the theme but I don’t recall fiddling with the comment form, although I still have to get familiar with Carrington’s weirdish structure.

    I’m using the latest version (Carrington Blog 2.2), by the way.


  3. The more I try these things the more depressed I get for being such an obvious dunce. I have tried to do everything step-by-step and I don’t see the suggestion anywhere on my site. Can someone take a look and give me a clue where I made the mistake? I’m at the point where I’d share the ID &PW with you to find the problem.


    1. First thing, on page “Discussion Settings” in administration of your blog, you probably checked “Users must be registered and logged in to comment”. With this enabled, users must register first on your blog and then they could post a comment, and not like you posted comment here (by providing name, URL and e-mail address). You can try this when you log-out of your blog.

      Maybe you did this intentionally but I need to warn you.

      Second thing, on bottom of page “Discussion Settings” there is a section called “Gravatar Signup Encouragement” where you can setup options for this plugin. If you don’t know what is what, read this blog post above and FAQ.


  4. First of all, thanks for creating a awesome plugin. However, I’m having one problem with it and I think that it might be related to the Mystique theme that I’m using.

    The problem is this: When a first time visitor that doesn’t have a gravatar account visits my website and wants to leave a comment, they are not presented with the encouragement to sign up for an Gravatar account. The comment is suppose to pop up under the Comment box and above the submit button but it doesn’t. My guess is that the comments.php is causing the problem as the encouragement message shows when you create a new account or when a login in user doesn’t have a gravatar.

    A screenshot of the setting page can be viewed at this link: http://screencast.com/t/NzQ2MTQx

    I would appreciate any help that you can provide.


    1. Sorry for late reply. On settings page, enter field-email in field “Custom ID” in sections “Comment Form” and then try again.

      After that, tell me results.


      1. Hi Milan,
        Thank you for your reply, unfortunately it didn’t work. I can confirm that it is theme related as it works with the “WordPress Classic 1.5 by Dave Shea” theme that comes with WP.

        I also installed the Gigya plugin and that one doesn’t work correctly with comments as well.

        Any advise?


        1. Hi Milan,

          I solved the problem, I changed some code in your plugin to get it to work. I dont know if its a bug in your code or just an incompatibility with my theme. This is what I changed:

          In file gravatar-signup-encouragment.php
          On line 395 and 402 replace <jQuery("#email") with jQuery("#<?php echo $gse_options['below_comments_unreg']; ?>")

          Please confirm that is a correct fix.


          1. Ok, its me again… Changing the <jQuery("#email") as i described above works but I am only able to have the notification message appear below the email field with this fix.

            I want the notification message to appear below the comment box instead, so I decided to go back to the file gravatar-signup-encouragment.php and change the two <jQuery("xxxx") entrees on line 395 and 402 to <jQuery("#field-email"). Now i’m able to use the plugins settings page in the backend administrator to select where in the form that I want my notification to appear.

            This will probably only works for the Mystique theme.
            Is there a better way to solve this? please let me know if i’m making things more complicated than they need to be.


          2. I’m really sorry I didn’t respond to you earlier.

            I can confirm that this are issues with Mystique theme. It is using field-email instead of standard email as ID of a email input fields.

            For now, I won’t change code at my plugin but if more themes have problems like this, I’ll consider making option to enter custom ID of email input field.


  5. I think I found a bug. At the comment area, if an e-mail (without Gravatar) is input, the message pops up. That’s good. And if you replace the email address (without Gravatar) to another email address (with Gravatar), the message automatically disappears. That’s even better! The problem is that this message does not disappears on its own at the register page. Once the message pops up, it remains there (until you navigate away, of course). Could you please solve this problem? I am not sure if this problem is present on the profile page, though.

    It’s a great plug-in. It does exactly what I want as if you can read my mind! Keep up the good job!!


  6. Howdy! Really like the simplicity of this plug-in, but I have two problems: first it says I don’t have a Gravatar (which I do), and second when the browser auto-populates forms the routine never runs (you have to manually go to the email box and type something to refresh it). I have no idea why there is a problem looking up the existence of my Gravatar, but the second issue could be solved by a jQuery after load event that checks to see if the box is already filled out, right?


    1. I’m really sorry I didn’t respond to you earlier.

      first it says I don’t have a Gravatar (which I do)

      This shouldn’t happen. If you still have this problem, please give me a link to a page where this occurs.

      second when the browser auto-populates forms the routine never runs (you have to manually go to the email box and type something to refresh it).

      Are you talking about a case where you post comment for a first time (and get a prompt that you don’t have gravatar) and next time you want to comment form is already filled with your data (but you don’t get a prompt that you don’t have gravatar). If so, I’m already aware of this issue and I’m planning to fix it.


    1. I’m really sorry I didn’t respond to you earlier.

      I don’t know did you solved this problem by yourself, but I just tried to use it on your comment form and it works.

      nor can I get it to show on the dashboard for users who are not registered with gravatar

      I don’t understand on what dashboard in doesn’t work?


  7. This plugin is just what I’ve been looking for, but I haven’t been able to make it work on my site. Here are my settings:

    http://dl.dropbox.com/u/3619118/gravatar.png

    As you can see, I’m trying to use the message everywhere — registration, comments, and profile. Unfortunately, I don’t see it appearing in any of those places.

    I have not required registration for comments. I’m using a custom StudioPress theme and do not have any other comment-related plugins. Any idea what I might be doing wrong, or how to fix the problem if it’s an incompatibility with the theme?

    Thanks for your time!


    1. I’m really sorry I didn’t respond to you earlier.

      I think I have a solution for you. Edit you message and replace " with ' (this is at text field at settings page).

      Please tell me if this solved your problem.


  8. Thanks for the reply, Milan.

    I assume you’re referring to the double quotes (“) in the Gravatar URL. I replaced them with single quotes (‘), and the problem persists. The message still does not appear on the registration, comments, or profile pages.

    Any other ideas?


        1. Lance, you didn’t read documentation. Third paragraph on this page says:

          users who fill registration form when they leave text input field for e-mail address

          Also check last screenshot above.


          1. You’re right, Milan. I hadn’t re-read the documentation since the original installation in April. Thanks for helping to solve the problem.


            1. Thank you for pointing me to discovering that I don’t have a notice that users should use double quotes in message. Since they aren’t in plugin’s code, why you changed single quotes to them?


  9. Great plugin! For some reason, though, it shows the message even when I type an e-mail that already has a gravatar… I feel kinda dumb but I can’t figure out why it’s doing this. 🙁


    1. I’m sorry because of this. From what I can see, I beleive that this problem is caused by something on your server.

      If you are interested, we can try this to see if will work. Go to Plugins > Editor. On the right, from “Select plugin to edit”, choose Gravatar Signup Encouragement and press “Select”. Now choose third file from a new list, gravatar-signup-encouragement/gravatar-check.php.

      In text editor, find a line if (!preg_match("|200|", $AgetHeaders[0])) {. Replace it with if (preg_match("|404|", $AgetHeaders[0])) { (! sign is removed and 200 is replaced with 404) and press “Update file”. Does it work now?


      1. Sorry about the very late reply.

        It didn’t work. I have no idea why. What can I do about it? What do I need to ask my web host to do? I have been looking for a plugin like this for the longest time and would really like to make it work. 🙁

        Thanks a lot for trying to help. 🙂


        1. You can ask your host if PHP function get_headers is enabled and does it work. They can see here how this plugin is using it.

          I could also make a code to test this by yourself and eventually find a workaround but if they can reply that would be great since I think that this problem is related to your server.


          1. My site also notifies me as the site admin for WP that I am not signed up with Gravatar, even though it shows my Gravatar avatar.
            Tried the code modification, but it did not change anything, so I took your advice and asked the host if the get_headers function is active/running.
            I did not try it with any other email addresses, but perhaps it is unique to the admin as user?
            When my host gives an answer, I will post it here. Thank you for the plug-in,
            Michael


            1. I couldn’t test in your comment section since it is available only to registered users so I can’t confirm if this is related to just your email address. It’s possible that there are issues with your server as was with other commenters so I’ll create a test plugin to see what is going on.


  10. Hi, thanks for the useful plugin! Works all as it should, but when I reply to a comment while I’m logged in as admin (with a non-standard username, if this makes a difference) it just takes me to an empty page /wp-comments-post.php – and that’s all. The comment is properly submitted, but I think it should redirect me back to the post. If I disable your plugin the redirection works. Any idea?


    1. Hey, Christoph, sorry for this. I discovered cause of this problem and I’ll release a new version that will fix this. Any other problems or suggestions that I might include?

      It is interesting that although I did a number of tests before public release of a new version, this problem never occurred.


  11. I’m having a problem with the message: “Notice: The latest version of the Gravatar Signup Encouragement plugin has new options….”

    I click on: Yes (edit Gravatar Signup Encouragement settings); make the changes and save them the warning/notice message disappears. However when I go back to the Dashboard the message re-appears. The plugin seems to be working fine otherwise. Am I doing something wrong or is there a flaw in the plugin?

    Thanks in advance for your time and attention!


    1. Sorry for this issue. You need to either click on ‘No (use pre-configured default settings)’ on any administration page, or on ‘Do not show this notice again’ on Options > Discussion (where plugin’s settings are).

      This is the problem I plan to fix in next version since you are not first who complained. My mistake was that I assumed that people will understand who to remove it.


      1. Hi, I had the same issue with the notice. I was too scared to click on “No” because it says “use pre-configured default settings”, since I have made some custom changes and would not like them to be reset to the pre-configured state. Thank you for your hint, I clicked on “No” and my custom changes are still there. 🙂


  12. Milan — Thanks for your quick reply. I hate to be such a dork but I’m not finding where I need to go to find Options > Discussion. I’ve tried looking in all the obvious and not so obvious spots and can’t seem to find it.


  13. I’m having the same problem as Nina, where all emails give the gravatar encouragement modal, whether they have a gravatar registered already or not.

    I have get_headers enabled and I’ve tried changing the 200 to 404 line.


    1. Reason for this is that your theme uses different code for comment form. That’s why I enabled option to show message below custom element.

      In your case, I think that you should add label[for='url'] as custom element.


  14. Thanks for checking — I think I deactivated the plug-in before you got there though, because it showed up at every place for a comment. I have re-activated it until I hear back from you so you can see it. I set up a temporary fake account for you to try it out.
    Thanks!


    1. Sorry for huge delay on this. I thought that I’ll be faster at creating this test plugin but I didn’t.

      I logged in with username you gave me and I got message that that email address doesn’t have a gravatar associated to it. When I tried Gravatar’s checking service, it also said that there wasn’t gravatar for that email address. Are you sure that you have gravatar with that email address?

      Anyway, I created a test plugin and you can download it from here. You can do test by going to Tools > GSE Test, where you will get results that you should send me. After you perform test, you can uninstall test plugin since you’ll not need it anymore.

Leave a Reply to Michael Harris Cancel reply

Comment Guidelines:
  • Your email address will not be published
  • Fields marked with * are required
  • If you want your picture next to comment, open an account at Gravatar
  • If you want to know if someone replied to your comment, check “Notify me of followup comments via e-mail”
  • You can use these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>