Twitter Avatar Reloaded WordPress Plugin

download
9,321 downloads

Twitter avatar reloaded Plugin adds a new field to the comment form to get the user’s Twitter username and stores it together with comments and using it replaces gravatar with twitter avatar when the comment is displayed.

This Plugin works seamlessly and you don’t need to edit your theme files to add the new field to the comment form. It automatically adds it when activated.

Note: Because of the changes in the way Twitter API works, from v2.0 of the plugin you need to create a twitter app and provide the access key and token. Refer to the installation instructions to find out how to do this

Template functions

This Plugin provides 7 template functions which you can use in your theme to customize the way the comment author’s twitter id/profile should be displayed.

  • get_comment_author_twitter_id($comment_id) – Get the Twitter id of the comment author
  • comment_author_twitter_id($comment_id) – Print the Twitter id of the comment author
  • get_comment_author_twitter_url($comment_id) – Get the Twitter profile url of the comment author
  • comment_author_twitter_url($comment_id) – Print the Twitter url of the comment author
  • get_comment_author_twitter_profile_image($comment_id) – Get the twitter profile image url of the comment author
  • comment_author_twitter_profile_image($comment_id) – Print the twitter profile image url of the comment author
  • get_twitter_profile_image($twitter_username) – Get the twitter profile image of a user using twitter id

Styling using CSS

By default the Plugin uses the class comment-form-twitter for the new twitter field. You can add CSS to that field or you can change the class in the Plugins setting page.

Development

The development of the Plugin happens over at github. If you want to contribute to the Plugin, fork the project at github and send me a pull request.

If you are not familiar with either git or Github then refer to this guide to see how fork and send pull request.

Support

  • If you have found a bug/issue or have a feature request, then post them in github issues
  • If you have a question about usage or need help to troubleshoot, then post in WordPress forums or leave a comment in Plugins’s home page
  • If you like the Plugin, then kindly leave a review/feedback at WordPress repo page.
  • If you find this Plugin useful or and wanted to say thank you, then there are ways to make me happy :) and I would really appreciate if you can do one of those.
  • Checkout other WordPress Plugins that I have released.
  • If anything else, then contact me in twitter.

Credit

This plugin uses wp-twitter-api by @timwhitlock as the underlying backend to make calls to Twitter.

Download

You can download the Plugin as a zip file from the WordPress official Plugin directory.

Screenshots

  1. twitter-avatar-reloaded screenshot 1

    Comment form with the new Twitter Field

Installation

Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.

Once the plugin is installed and enabled you can bind it to a Twitter account as follows:

  • Register a Twitter application at https://dev.twitter.com/apps
  • Note the Consumer key and Consumer secret under OAuth settings
  • Log into WordPress admin and go to Settings > Twitter API
  • Enter the consumer key and secret and click ‘Save settings’
  • Click the ‘Connect to Twitter’ button and follow the prompts.

Translation

  • Hebrew (Thanks Sagive)
  • Dutch (Thanks Rene of WordPress WPwebshop)
  • Brazilian Portuguese (Thanks Marcelo of Criacao de Sites em Ribeirao Preto)
  • German (Thanks Jenny Beelens)
  • Spanish (Thanks Brian Flores of InMotion Hosting)
  • Bulgarian (Thanks Nikolay Nikolov of Health Blog)
  • Lithuanian (Thanks Vincent G)
  • Hindi (Thanks Love Chandel)
  • Serbian (Thanks Diana)
  • Irish (Thanks Vikas Arora)
  • Gujarati (Thanks Puneet)

The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you.

Readme Generator

This Readme file was generated using wp-readme, which generates readme files for WordPress Plugins.

Changelog

v2.0.1 (2014-07-12) (Dev time: 1 hours)

  • Fix: Fixed a critical error introduced in v2.0

v2.0 (2014-07-12) (Dev time: 3 hours)

  • New: Add wp-twitter-api library to use new version of Twitter API

v1.4.4 (2014-01-21) (Dev time: 0.5 hour)

  • Fix: Fix undefined warnings
  • Tweak: Make UI compatible with WordPress 3.8

v1.4.3 (2013-05-15) (Dev time: 0.5 hour)

  • Added translation support for Gujarati

v1.4.2 (2012-11-07) (Dev time: 0.5 hour)

  • Added translation support for Irish

v1.4.1 (2012-10-28) (Dev time: 0.5 hour)

  • Added Serbian translations

v1.4 (2012-06-12) (Dev time: 0.5 hour)

  • Added array_key_exists() function check to remove notices (Johannes Freudendahl)
  • Added Hindi translations (Love Chandel)

v1.3 (2012-04-26) (Dev time: 8 hours)

  • Rewrote the way comment field was handled.
  • Rewrote the way the Twitter profile image was retrieved.
  • Started storing the Twitter profile image url in comment meta
  • Revamped the admin UI
  • Added Lithuanian translations

v1.2 (2012-02-05)

  • Added Bulgarian translations.

v1.1 (2011-11-13)

  • Added French translations.

v1.0 (2011-09-11)

  • Using transient api for storing cache and also improve performance

v0.8 (2011-05-22)

  • Added German translations

v0.7 (2011-05-11)

  • Added template functions to display Comment author twitter id and profile url

v0.6 (2011-02-05)

  • Added Dutch translations
  • Added Brazilian Portuguese translations

v0.5 (2010-08-10)

  • Added support for registered users
  • Ability to configure Twitter field label.

v0.4 (2010-08-09)

  • Removed JavaScript from unnecessary pages.

v0.3 (2010-03-20)

  • Added translation for Hebrew (Thanks Sagive)

v0.2 (2010-03-16)

  • Proper alignment of the Twitter Username field

v0.1 (2010-03-13)

  • first version

85 Comments so far

Follow up comments through RSS Feed | Post a comment

  • David Knapp says:

    It works for me but: It is located in the wrong spot. My twitter info box is showing up underneath my comment box section away from the other fill in boxes. What can I do to put it in the right spot. Thanks for any help you can give me.

  • David Knapp says:

    Never mind because now it seems to be working correctly.

  • sagive says:

    hey, i have added an hebrew translation..
    you can download the file with translation
    from here:
    http://www.sagive.co.il/download/twitter-avatar-reloaded.rar

    i would leave it up for a couple of weeks..

    Cheers, Sagive

  • Really nice Sudar. I’m surprise WP hasn’t added comment support for social sites like Twitter and Facebook yet, hopefully in version 3.0 This plugin is a nice step forward.

  • paul bearne says:

    does this overload the builde in avartor code so that twitter is the default souce instead of gravtar

    Paul

    • Sudar says:

      Yes, this Plugin will overload the build-in avatar code, if the twitter field is present. If it is not present, then it will resolve to the default avatar code.

  • Chette says:

    How can I associate a registered user with their Twitter username?

  • kase says:

    hello… thx for the plugin i serch it for 2 hours

  • Marcel says:

    I can’t use the plugin in WordPress 2.9.2.. Is there any solution for this error right here:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /www/htdocs/w00c80c4/wp-content/plugins/twitter-avatar-reloaded/twitter-avatar-reloaded.php on line 207

  • Exactly the plugin I was searching for but, unfortunately, it’s not working for me. Gravatar works fine but the twitter avatars are not retrieved. Any help?

    What pieces of code should I check to try to understand what’s happening?

    • I’ve already uninstalled and installed again the wp-gravatar and this plugin but it still doesn’t work. This plugin alters the comments.php file? I think I’ve edited it in the past so I don’t know if the problem might be there.

      • Sudar says:

        I think the changes you made to the comments.php file are preventing the Plugin from working properly. Uninstall wp-gravatar Plugin and try this Plugin on a fresh WordPress install. Also let me know in which version of WordPress you are trying it.

  • Matt says:

    Great plugin, thank you! Looking forward to being able to post as a user (Since I’m the admin) vs logout, so thanks for working on that.

    Also, is there a way to change the “Twitter” text? IE, I bet some users will put in http://www.twitter.com/username... I’d like to change my to name “Twitter Username” but can’t see where in the php code to change it.

    Thanks!

    Matt

    • Sudar says:

      Right now the only way to change it is to edit the Plugin file. But I will provide an option to change the text from the admin interface itself, in the next version of the Plugin.

    • Sudar says:

      In have released v0.5 of the Plugin with support to edit Twitter field text. Enjoy :)

  • matthias says:

    Hi

    The Plugin shows the input field under the text box! Can I change this?
    And I want to have the Twitter Name in a Text Version next to the avatar. Can I do this? Or can I link the Avatar to the Twitter Profile?

    Very nice Plugin! Thank you!

    • Sudar says:

      Well, it is possible right now to do it, but you might have to edit the Plugin file to do it. I will add the ability to automatically do it, in the next version of the Plugin.

  • Mekha says:

    Wow, this awesome!

  • Nicolargo says:

    Thx for this great wp plugin !

  • itx says:

    can we specify the avatar size?
    my theme has 60×60 avatar size, the avatar got from twitter is 48×48, so it’s stretched.
    it’s pretty ugly though.

  • kase says:

    why dont show gravatar when dont exist twitter account?

  • kase says:

    or this plugin use the gravatar when dont exist account? (i try it en this comment)

    i wanna see if display my gravatar x]

  • Nikki says:

    For whatever reason, the twitter field was still showing up beneath my text box. (I’m using AutoFocus Pro theme with Thematic as the parent.)

    Unfortunately, it also overwrote/broke all the other indenticon/gravatar images for that already existed for commenters on my site so ultimately I had to disable the plugin. I really like the concept of the plugin and I’d be interested in donating once I can get it to work.

    • Sudar says:

      Nikki,

      It should overwrite the Gravatar, only if it is not present. Let me check if there are issues and will release an update if needed.

  • islasands says:

    Not working for me but I have no idea why not…

  • It would be nice if the admin could edit the field for existing comments. I have the Topsy plugin that adds comments or trackbacks every time someone tweets a post. It would be nice to be able to edit their comment and add the proper Twitter avatar. Even better if it would do it automatically.

  • Aisha says:

    The plug in is working correctly, however it is showing up after my comment box as opposed to before with the other information…how do I fix that?

  • Gordon M says:

    Box is showing below the comment field and below the captcha. Also it is automatically removing all the gravitars even when a twitter name isn’t entered?

    Site is:
    http://www.healthtopics.com/blog

  • The Pop Cop says:

    Can you please explain exactly how you get the Twitter box ABOVE the comment box? It’s not even working on your own page here.

    • Sudar says:

      You don’t have to do anything. It is automatically taken care by the Plugin.

      Previously it was not working in my blog because of another unrelated issues which I have fixed now.

  • zipless says:

    awsome plugin
    let me test …

  • tumbol says:

    Is there any way to just use the “Name” field without the twitter field and if a twitter account is found to replace the gravatar with the twitter avatar?

  • esiteweb says:

    I think that juste to write Twitter it’s not clear if we need to write : http://www.twitter.com/anniebergeron or just anniebergeron

    PS : tumbol you have a great idea

  • Ed says:

    I could not install on my WordPress 3.0. When sending a comment does not change the Avtar. Any tips?

  • Steven Burrows says:

    Hi, What is the get_avatar( $args ) function you call to show the avatar?

  • Nancy says:

    Hi – I just installed your latest plugin – very cool! But the fact that it displaying below the comment box is just so odd. Looks like you were planning to update the plugin — is that coming soon? I hate to mess with all the CSS if you are planning to fix. Thanks!

    • Sudar says:

      @Nancy,

      The Plugin actually tries to position the input box before the comment box for normal themes. If it is not working in your theme, then it means that you might have to do it manually by editing the CSS.

  • Lara says:

    Hi,

    I’ve just updated the plugin to the latest version and now get an error message:

    Warning: Missing argument 5 for TwitterAvatarReloaded::change_avatar()

    Can you help me to fix this problem?

  • I’m using this on my fan site. I played around and used some of the functions to make it so that the Twitter icons load for the post/page authors, too.

    If you could add an option to display the Twitter name with the commenter that would be awesome!

    If you want to see my re-write of the functions to be able to display the avatar on post/pages, just drop me a follow-up comment.

    • Sudar says:

      It’s been in my todo list for quite sometime now. If you have already implement then send me the code and I will update the Plugin.

  • loved it very much – thanks :-)

  • ghandhend says:

    Maturrr suwun Nice Plug in :D

  • Papo says:

    Is there a way to show the Twitter user name in the comment itself sort of like a signature using the template functions you provided. If so can you help walk me thru it. Right now the avatars work on my site but I would like to see the persons twitter name. Thanks

  • JBR says:

    Hi, is there any way to have the plug-in try to pull the Twitter avatar (if available) from just the commenter’s email address?

    That’s what the “Twittar” plug-in does – or did – it was written a couple years ago and not sure if it still works.

  • Hi Sudar,

    I installed Avatar reloaded as you suggested.

    Avatars of those leaving comments appear fine, but my own avatar when I reply doesn’t. Also, I cant see the plug-in in my list of installed WP plug-ins, but when I tried adding it, it tells me it’s already installed.

    Any ideas on that.

    Thanks

  • Hi again,

    Sorry, forgot to say I’m using version 3.3.1 of WP.

    Thanks.

  • Alessandra says:

    Hi Sudar,

    first of all I would like to thank you for this awesome plugin. It worked great and I never had any problems with it. But now suddenly my own twitter pic isn’t displayed anymore. If I take a look on the graphic info the link is wrong. The pic adress is the adress of the single post and not the one of my twitter pic as it should be. Only I have this problem. If anyone of my twitter followers post a comment, the twitter pic of the single commenter is displayed without any problems. Do you know the reason? How can I solve this problem? In the beginning everything worked fine.

    Thanks

  • sergio says:

    Hi, Thanks for this plug in i love it!!

    Just a question..

    Can you make the same but instead of graving twitter avatar, could you make it work for tumblr??

    That would be really helpful, i want my commentators to put their tumblr avatar, as their gravatar..

    How can i do this?? could you help me?
    I’d really aprecciate if you could make a plug in like this one..

    Greeting!

    • Sudar says:

      You have to rewrite the plugin to support tumblr. If you are interested in sponsoring the development, then I can give it a shot.

      • sergio says:

        Yeah, i’m making a new website about gaining more followers on tumblr, it would be really helpful to have that plug in.

        i could do it, if you could only tell me what would i need to change :)
        cuz i see it’s a lot of coding.

        • Sudar says:

          The Plugin has to be fundamentally changed. Not sure, if I can just point places in the code that you might have to change.

          If you are not a good programmer, I would suggest you hire someone to do it.

      • sergio says:

        Or how much would it cost?

  • mike says:

    Hi
    this is a great plugin, thanks,
    may I ask, how exactly do I use the 7 theme functions?

    Like the one below, for example,
    where do I place it?

    get_comment_author_twitter_id($comment_id)

  • Tom says:

    Does this code look OK? It is working fine for me but maybe I missed something… I want to add “(@twittername)” after the commenters name, linking to the Twitter profile. So I added this to my comments.php file:

    <?php
    if (function_exists('get_comment_author_twitter_id')) {
    $twittername = get_comment_author_twitter_id($comment_id);
    if ( $twittername ) {
    echo '
    comment_author_twitter_url($comment_id);
    echo '">(';
    comment_author_twitter_id($comment_id);
    echo ');
    }
    }
    ?>

  • Tom says:

    The plugin works fine but I noticed something peculiar. Somebody gave his Twitter handle with a comment and as expected his Twitter avatar shows beside his comment. But when logged in I also see that persons avatar beside MY name on that page in the upper right corner (the “Howdy, User – Edit My Profile – Log Out” drop-down menu). Not a big problem I suppose, though a bit creepy (my first thought was that something malicious changed my avatar!). I think it is a bug in Twitter Avatar Reloaded v. 1.4.2, I am on WP 3.5.

  • Alessandra says:

    Hi Sudar,

    I updated my wordpress blog to 3.3.2. but now the field for filling in the twitter username doesn’t appear on new comments. The consequence is that the gravatar isn’t replaced by the twitter avatar on new comments. What can I do?

    I would be very happy to solve this problem as soon as possible because I like your plugin very much!

  • Sudar says:

    Have you changed your theme? The Plugin is compatible with 3.3.2 and it should display the field.

4 Tweetbacks so far

32 Trackbacks/Pingbacks so far

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>