Simple Twitter Connect

( Hey, if you like STC, why not check out Simple Facebook Connect too? )

Plugin: Simple Twitter Connect
Version: 0.15
Last updated: 100 days ago.
Downloaded: 74,835 times.

Download Now

Overview

Following the same pattern as the Simple Facebook Connect plugin, this is a plugin to make connecting a WordPress blog to Twitter easy.

Unlike Twitter Tools and other systems, this plugin uses Twitter’s latest authentication mechanisms. No putting in Twitter names or passwords. Clicking the Connect with Twitter button will redirect a user to Twitter for approval, then bring them back to where they came from, only now with their Twitter credentials available for use. Sub-plugins can then make any use of this they like.

Note: This is fully compatible with Simple Facebook Connect, and can even run at the same time as it. Naturally. :)

Requirements

Currently, WordPress 2.9 or higher and PHP 5. I don’t write code for older versions of WordPress, or obsolete versions of PHP. Sorry.

Features

  • Easy to install and use.
  • Modular. Only use the pieces you want to use.
  • Integrates easily into any theme.
  • Simple control panel, only has the options you need for the pieces you activate.
  • Secure. Uses the latest WordPress coding techniques to eliminate tricky security problems.

Current sub-modules

  • Login using Twitter Credentials
  • Comment using Twitter credentials
  • Users can auto-tweet their comments
  • Tweet button
  • Tweetmeme button
  • Auto-tweet new posts to an account
  • Manual post tweeting
  • Full @anywhere support
  • Auto-link all twitter names on the site

Future sub-modules

  • Pull tweets back in as posts
  • (whatever you like, send me suggestions!)

Installation Instructions

  1. Upload the files to the `/wp-content/plugins/simple-twitter-connect/` directory.
  2. Activate the base plugin through the ‘Plugins’ menu in WordPress.
  3. Configure Twitter for your site by following the instructions on the Settings screen.
  4. Activate the sub plugins you want to use through the ‘Plugins’ menu in WordPress and configure them appropriately. Some require no configuration at all, some require minor theme changes.

Shortlink note

There’s too darned many shortlink systems out in the world. So, this plugin does not implement shortlinks at all.

Instead, it relies on the new Shortlinks API in WordPress 3.0. Unfortunately, this means that if you’re not running WP 3.0, you won’t see shortlinks appear in your tweets (although Twitter might turn some normal links into bit.ly ones for you).

My advice: Be patient. 3.0 will be released eventually.

Licensing

This plugin is licensed under the GPL Version 2 only.

Method to get support

You can email me directly, however I am also a moderator at the WordPress.org support forums, so you’ll find me there as well.

Download Now

 

738 Comments

  1. titi says:

    Hi, thanks for this cool plugin ;)

    Is that possible to include the %excerpt% of an article in the auto-tweet function?

  2. jean-francois says:

    Hi Otto,

    Thanks for this other plugins :)

    It’s possible to set stc-tweetmeme plugin in the title article (not in content) ?

    thanks

  3. titi says:

    There is a way to put the hovercard in other language as english?

  4. titi says:

    Can we remove the calling javascript “platform.twitter.com”? I don’t see why it’s loading this if we don’t set the hovercard option.

  5. titi says:

    I’m using firebug, It’s pretty accurate. I also have “https://twitter.com/scribe?log=…………” each time and it takes 1sec to load.
    But we can’t do nothing for that… I know

  6. says:

    Hello Otto,

    I am using you plugin in my blog, and activate the widget follower box for show the my twitter follo in my sidebar blog.

    For example, the code in my sidebar is

    and shows the box, which is already configured with the css in my style, but does not display the number of followers or their pictures.

    Only shows de box with head and basic estructure…

    all are activated correctly pluguins… which will be the error.

    Thanks

  7. says:

    I was intrigue by this post. I want to try this one out and see the result if this is satisfying then I would avail one. Will look forward to your future articles.

  8. says:

    Hey Otto. Great app! I’m using both SFC & STC. One weird thing I’ve got going on thou. Facebook is all fine. However, Twitter posts give me the ‘mystery man’ generic avatar on the page the comment was left on but in the dashboard it shows the actual twitter avatar for that comment. Just looking to see if you had any ideas. WP 3.0 running Thesis 1.8b1

  9. says:

    More Info – Found this in my comments.php which is most likely the problem:

    function avatar($comment) {

    $avatar = get_avatar(get_comment_author_email(), $this->meta['avatar']['options']['size'], '');

    $author_url = get_comment_author_url();

    $avatar_output = (empty($author_url) || $author_url == 'http://') ? $avatar : "$avatar";
    return '' . apply_filters('thesis_avatar', $avatar_output) . ''; #filter

    • says:

      Sorry, thought I ‘coded’ that, let me change greater/less thans to brackets:

      function avatar($comment) {
      $avatar = get_avatar(get_comment_author_email(), $this->meta['avatar']['options']['size'], ”);
      $author_url = get_comment_author_url();
      $avatar_output = (empty($author_url) || $author_url == ‘http://’) ? $avatar : “{a href=\”$author_url\” rel=\”nofollow\”]$avatar[/a]“; return ‘[span class="avatar"]‘ . apply_filters(‘thesis_avatar’, $avatar_output) . ‘[/span]‘; #filter

      Thanks!

  10. darkfish says:

    When i try to add a comment on my website using twitter “sign in with Twitter” i get the message below

    Fatal error: Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1 in /wp-content/plugins/simple-twitter-connect/OAuth.php on line 82

    Please any help would be grateful

  11. First let me say I am a novice at websites and computing and coding. I wanted to use the STC widget on my homepage to allow people to click and see our twitter page. But, when you click the follow @walkingfaithful on twitter, the box ask for twitter account sign in. I thought it would link to our twitter page like SFC does. I don’t understand why it asks the user to connect walkingfaithful with its twitter account. Could you explain this? And, is there a widget for connecting the user to our twitter account?

    Great apps. Love their ease of use.

    • says:

      That button/box actually does exactly what it says. The user will *follow* you on twitter. It doesn’t make a link to twitter, it actually makes the user follow you.

      If you just want to make a link to your twitter page, you really don’t need a plugin to do that.

  12. On SFC, can I connect my business page to the follow us on Facebook widget button? As noted, I don’t use code -so is there a simple way to do this?

  13. says:

    Hi otto.

    I want to create a special page only avaliable to twitter users (bascally i created a normal page tagged with private). So i used stc as a login sistem but i always receive this error: ERROR: Twitter user not recognized..

    In wordpress general options i marked “anyone can register”… but WP stills witouth recognizing twitter users…

    what can i do to fix this? (please excuse my english).

  14. says:

    I have had STC – Comments working, but currently when you click on the “Sign in with Twitter” button, after authenticating with Twitter and getting sent back to the post the comment form remains unchanged (ie. the name, email, website fields are still visible). I’ve recently upgraded to WP3 and I’ve replaced the whole comment form with the new function as described here: http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/. I’ve also tried deactivating every other Twitter related plugin to no avail. I’m not sure what to try next… any help appreciated!

  15. Ryan says:

    When I comment it posts to my twitter feed:
    “Just left a comment on”
    but never posts the article name or link.
    just those words.
    do you know of a fix or the cause for/of this?

    • says:

      Ryan, log in to your WordPress. Click on Settings in the left hand side menu. Find the STC Plugin listed there. Click on it. Modify the “Just left a comment on sentence”. If you were looking to make that a link to the comment itself, I’m afraid I had a similar issue and just gave up on trying to have the link sent out. I just added my own website url, so you’d get “Just left a comment at http://www.xyz.com“.

      Not the optimum solution for me.. but you have to keep moving now don’t you?

  16. says:

    Question for OTTO,

    STC and SFC working smoothly on my website running WordPress 3.0. The only problem I seem to be having is that when a comment is submitted when logged in via Facebook Comments… the comment is not posted on the user’s wall as it should. The check mark to: Share this on Facebook is always checked. I edited to the code checked/> so as to keep it checked by default. When I realized the comments were not being posted on my Facebook wall, I decided to remove the checkmarked-by default thinking maybe you’d done something to make sure it was not automatically checked off somewhere. Still, that did not solve my problem.

    As I said your plugins, both of them, have given me no hard time what soever. So easy to install, get up and running, customize, and so on and so forth. BUt this not-posting-to-Facebook wall has got me twirling.

    What would you recommend that I do / check / fix?

    Note: STC is posting just fine to twitter – I was also wondering – yes here’s another question I suppose – if it were possible to have the tweet not only sent to the user sending the account, but to another account that I could perhaps monitor so that I may perhaps forward them to Facebook Page or somewhere else. Regardless of what I do with them ,was wondering if by default I could get the tweets sent to two accounts -1. predefined and 2. the user who used it.

    THANKS A LOT.

    • says:

      The code that does this is actually javascript code on the page. When that checkbox is checked, a cookie gets set on the user’s browser via Javascript. When the page reloads with their comment on it, the cookie gets detected and triggers the FB Share popup box. If there’s some other javascript problem on the page, then the code to detect that cookie might not get run, thus, no share.

      STC works differently and sends the tweet on the back end, not via javascript.

  17. says:

    i’ve using your plugin, running well. thanks 4 great plugin.

  18. PaRRoT says:

    Hi. I installed Simple Twitter/Facebook Connect on this site: http://www.twitmix.it/2010/08/10/twitmix-stars/

    Facebook works, Twitter doesn’t. I followed your instruction and the app is correctly registered in Twitter.com/Apps. What I have to do?

    Thank you.

  19. says:

    Otto – just got your update today that includes the new Tweet button – nice fast work on that!

    After that update though now having a problem with Linkify in IE – getting the following error:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; MS-RTC LM 8)
    Timestamp: Thu, 12 Aug 2010 22:16:41 UTC

    Message: ‘twttr.anywhere’ is null or not an object
    Line: 1
    Char: 2348
    Code: 0
    URI: http://platform.twitter.com/anywhere.js?id=ThNdVdo5QiUawAn4oZCw&v=1&ver=1

    Seems to work in Safari with no problem.

  20. says:

    I’ve upgraded to the new version, but I’m getting this error:
    “Fatal error: Call to undefined function stc_tweetbutton_button() in /home/fbreve/public_html/blog/wp-content/themes/i3theme-1-8-classic/single.php on line 39″

  21. Testing Here…
    I am From Indonesian
    thanks for this plugins

  22. [...] The Deadline For CommentsAtom Default FeedGravatar BoxPHP Code WidgetSimple Facebook ConnectSimple Twitter ConnectUnicornifyNothing to See Here « WordPress PROTIP: Child [...]

  23. xiabolai says:

    Hi Otto, Have a serious problem with STC for comments. Everything was working fine up until yesterday, but all of a sudden it won’t authenticate. When user clicks to sign in to Twitter to make a comment, one of two things happens: either the popup appears to authenticate…but upon clicking to Allow my App it refreshes to a white screen. Or, just a white screen appears upon clicking the “sign in with twitter” button. It’s a mystery…as I said it was working perfectly.

    Does this have something to do with the update you pushed yesterday or the day before?

    Any help would be greatly appreciated. Thanks!

    • xiabolai says:

      Follow up – yes, yes it is a bug in the update you pushed yesterday. Luckily, I saved the previous version of STC. Upon reinstalling the previous version, everything is fine. Just thought you should know.

      • says:

        No, it’s not a bug in the update. It still works for me just fine.

        If you’re getting a white screen after authentication, this is usually a sign that there’s an error happening somewhere in the second phase of authentication. Might as well explain it, I suppose.

        Twitter authentication is a several step process.

        1. The user clicks the button. This sends them to your site with an stc_oath_start parameter, to start the process. The plugin recognizes this and sets some session settings and gives the browser a cookie. Then it redirects the browser to twitter for the authentication.

        2. The user visits Twitter, and twitter does the authentication by whatever means. Sometimes the user is already logged in, and it just doesn’t show them anything. In the end, it redirects the user back to the site with a code.

        3. The site gets the code, talks to Twitter a bit, sets some more session settings, then does whatever the user wanted to do (comments, login, etc).

        The only change I made yesterday was to add a new plugin and to move the authentication from the plugin load into the init action. It’s unsafe to do things at plugin load time, so those needed to be moved to init.

        If you’re getting a white screen, there’s several possible causes. Other incompatible plugins are the most common, especially if you have any other plugin that uses OAuth. By moving to the init action, those other plugins might be loading, whereas before, it was just random chance that the STC Base plugin was loading first and preventing the other plugin from loading. So I’d look at that.

        Regardless, there is no bug in the new plugin. It works fine on a default site.

        • says:

          Same solution applies. You have something else that is conflicting that wasn’t conflicting before.

          Another possible problem: Memory requirements might be higher, as now it’s waiting for WordPress to load before authenticating instead of loading WordPress only halfway. If you have very low memory settings, then you might try bumping them up.

        • says:

          Crap. Never mind, you’re both correct. I see the problem. It’s a weird and unusual one, but it’s possible for a set of conditions to happen that would cause what you’re seeing.

          I’ll push a fix.

  24. xiabolai says:

    Just upgraded, that did the trick. Thanks!

  25. says:

    I use version 0.12.
    I was not able to log out when I updated it.
    Please make measures.

  26. Hi Otto

    I’m trying to set up the auto publishing but when click the ‘Sign in with Twitter’ button to authenticate for auto-publishing I get the following error message from Twitter

    Woah there!
    This page is no longer valid. It looks like someone already used the token information you provided. Please return to the site that sent you to this page and try again … it was probably an honest mistake.

    Any ideas what’s causing this and how I could get it working?

    Thanks

    Dominic

    • dave says:

      Yes this also happened to me. I have double checked my settings and all the Twitter Consumer Key and the Twitter Consumer Secret are entered correctly. Maybe it has to do with new version of wordpress + this plugin? Or maybe it has to do with twitters new sign up for apps as it does not have the 4th step anymore when u register the app on twitter it is missing the “4.Use Twitter for login must be checked (enabled).”.

      Was anyone able to fix this problem? If so what did they do?

      Thanks,
      Dave

  27. says:

    Bug report

    In your feeds you have http://twitter.com/share

    Thanks for the Twitter count API hint, going to have some fun with that during the week to improve my shortlinks

  28. Hi Otto – props for this & the FB app. Is there any way to get an alternative button for the ‘follow souterconsults on Twitter’ as it’s a bit wide for my column on http://souterconsulting.eu…?

    Thanks v much

    Justin

    • says:

      You can edit the CSS styling for the button.
      Either find where the original CSS is being defined (some Javascript file) or just paste the below (as is) in your CSS file and it should work. I already fixed styling dimensions to fit your column.

      .twitter-follow-btn-default button, .twitter-follow-btn-inprog button {
      background:none repeat scroll 0 0 transparent;
      border:0 none;
      color:#FFFFFF;
      font:12px Arial,sans-serif;
      overflow:hidden;
      padding:0 0 0 4px;
      text-shadow:0 -1px 0 #18566A;
      width:136px;

  29. [...] you need to install Simple Twitter Connect. This is a splendid plugin by @OttoDestruct that allows to you integrate with a range of [...]

  30. says:

    Hello,
    There seems to be a problem with the new Tweet button.
    I’ve added it at the top of posts, using the plugin settings.
    It seems it adds the text “Tweet” in front of the main content of my posts which are then posted to Feedburner and Facebook.
    It didn’t do that before I activated the Tweet button.
    Cheer.

  31. i installed on my site and it doesn’t work, many people say this, can you fix it or something ?

    • says:

      Your website is probably running on a server without PHP5. Note that this is a requirement for the plugin. If you do have PHP 5… then you need to explain the problem you are facing exactly and what version of WordPress you are using..

  32. [...] Simple Twitter Connect » Otto on WordPress — 6:44pm via [...]

  33. says:

    I readily admit I don’t know what I’m doing, but here are my 2 problems:
    1) When I sign up for a Twitter application, there is no option to “Use Twitter for login must be checked (enabled)”
    2) The Settings page for the plugin within WP doesn’t have a Save settings?Update button or anything, so there’s no way to save the consumer key, etc
    What am I missing?

  34. I don’t know what I may not have set up right, but the “Send Comments to Twitter” checkbox doesn’t work for me. I have that checked and when I submit my comment, nothing happens.

  35. Hey Otto…thanks for all of the help. Great plugin! Question: My Facebook publisher works fine but my Twitter publisher just spins. It never seems to make it to the twitter page. First step works o-auth but tweet just spins in cyberspace. Would love to auto publish from wordpress instead of cut and paste. Help! Please!

  36. Hello,

    We’re working on a beta site and have installed your plugin — it’s great! — but we’re having trouble with the post excerpt showing “Tweet” in plain text before each excerpt? Any solutions?

  37. Alexis says:

    Hi Otto.

    I have the twitter plugin working, but the %URL% command doesn’t seem to be bringing the shortlink URL through to twitter with the post…

    Any ideas?

    On latest version of WP & Your plugins.

  38. says:

    Otto- try this one on for size.

    I have both SFC/STC emabled, and using for the Comments feature. SFC works fine, but STC jumps to a %domain%/?oauth=xxxxxx blank page and then nothing.

    Based on your advice to others, I remove the WP->Twitter plugin thinking it interferes. Might be so, and besides, now I have STC Publish!

    But still no change. Blank page on the OAuth. But then I noticed that the URL was going to http://www.%domain%. My WP and my Twitter app registration both use my domain name without the “www”. Don’t know where that extra is coming from.

    I removed the “www” and the Twitter authentication kicked in.

    Whaddaya think?

  39. darkfish says:

    Still having the same problem, please can anyone help?

    When i try to add a comment on my website using twitter “sign in with Twitter” i get the message below

    Fatal error: Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1 in /wp-content/plugins/simple-twitter-connect/OAuth.php on line 82

    Please any help would be grateful

  40. says:

    Where can I find the CSS for the “Follow” Sidebar Widget so I can make it fit my column? Also, Is the text on it defined somewhere so I can edit it from “Follow @XXX on Twitter” to just “Follow @XXX”? Thanks

  41. Andy Craven says:

    Hi

    I would really like to create a site that allows people to RSVP to come to an event and it then tweets all of their followers that they are attedning with a link to be able to attend themselves.

    Does the plugin do this at the moment and if not is it something you would consider adding?

    Love the plugins by the way (Facebook too)

    Andy

  42. says:

    Now I use plugins wp to twitter for update my blog to twitter account automatically , it’s work for me. :-)

  43. Hey, this plugin works but the short URLs just go to my root directory. (http://vegan.fm)

  44. [...] Simple Twitter Connect » Otto on WordPress. Filed under: WP Plugins [...]

  45. says:

    I have installed twitter and Facebook Connect on http://www.wisdomtalks.com.
    I am facing errors for both.

    On Twitter Connect:
    After allowing access, it doesn’t come back to exact URL, rather shows a white page and in URL field, following URL is written:
    http://www.wisdomtalks.com/?oauth_token=U75dHmWjnyNcJj4FCGRJp8oSEaX0eGtfwidAuUHfQoQ

    Facebook Connect
    When you click, it shows that Application has some error. Whereas, through normal link, Application runs fine.

  46. What should be Call back URL in Twitter Application Settings?

Leave a Reply

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

Connect with Facebook

*

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>

Need to post PHP code? Wrap it in [php] and [/php] tags.