A Simple Twitter Tweets display widget, using Twitter OAth and API v1.1 and backup up so it always displays your Tweets.
Our clients, especially on shared hosting were having issues with the Twitter API not displaying their tweets, too many connections from the same source (host). We solved that issue, then lo and behold Twitter changed their API so displaying your own Tweets required OAuth authentication and finally we buckled and decided to roll our own so it would be simple for them, for us and for you.
Twitter changed their API again. Removing version 1.0 of the API altogether and by forcing version 1.1 of the API and use of the OAuth authentication requirement. We wrote this plugin so everyone could have it at a click of a button.
There are a few Twitter plugins out their, but we couldn’t find one simple enough, or that worked (to be honest) and so the Simple Twitter Tweets plugin was born.
Twitter users who want to display their Tweets on their website (or within an application) have to create a Twitter Application to get access to the required “Keys” and “Tokens” Twitter provides for Authentication. The instructions for this are provided below so you can be up and running with Tweets on your site in less time than it takes to make a cup of Tea.
- Simple setup
- Twitter API v1.1 compliant (OAuth Ready)
- No passwords required or used
- Works even when Twitters down, over capacity or not connecting
- Tweets stored in the database with each call, so if your call to the Twitter API fails for whatever reason there won’t be a blank space or Oops message on your site, you’ll just see the last set of Tweets the system stored – sweet huh.
- Tweeted when? – In Human Time using minutes, hours and days (i.e. 5 hours ago) or using Twitter time display (i.e. 5h)
- Twitter intents – increase social interaction with users ability to Reply, Retweet and Favourite your tweets right from you page
- Twitter intents using bespoke (only three characters) icon font (tiny) and colour the icons right in the widget
- Did we say it was simple and works…
Installation is as simple as 1,2,3 or maybe 4 because of Twitter 🙂
- Upload ‘simple-twitter-tweets’ to the ‘/wp-content/plugins/’ directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Add the Widget to your page (e.g. Sidebar) and update the required details
- Click Save
- Note: You will need to create a Twitter Application – See below. Oh, it’s really easy.
Creating a Twitter Application
The Twitter Widget will never ask for your password, as it gets all your required data from the Open Authentication keys and secrets you will get by creating your application at Twitter. It also means that if you change your password, you won’t need to update any of the details of your Widget.
To find these details, go to https://apps.twitter.com/ and sign in.
Center of the screen click “Create a New Application.”
Enter a unique name (anything you want), a description (again this is just for you), and your site’s URL. You can leave the Callback URL empty as it is not used for this implementation.
Yay, success – OK! You will be taken to a new screen, there’s one more step then you can copy all the details into correct fields of the Widget and be on your way.
OK, click the “Create my Access Token” button. This is a shortcut to authenticate your own account with your application (so you never need use your password).
Good. Now click the Details Tab as all the information you need is presented hereso you can just copy the required information into the exact corresponding inputs fields of the Widget.
Full details and screenshots of this process can seen on the Simple Twitter Tweets page
The Widget Options
Fill in your details, copy and past the Twitter Application details (as described below).
- You can select the Title of the Widget as you like.
- Enter your Twitter username (without the @) just the name.
- How many Tweets to display
- The time in minutes between updates (per the API requirement) this should be 5 but if the API changes you can alter it here.
- Consumer Key: Under the OAuth settings heading
- Consumer Secret: Under the OAuth settings heading
- Access Token: Under the Your access token heading
- Access Token Secret: Under the Your access token heading
- Choose if you want the @replies included or not
- Avatar: Your image or logo as displayed on Twitter – show on/off
- Avatar: Round the corners to your image (5px on modern browsers)
- Avatar: Set the size – defaults to the Twitter default of 48px
- Time Display: Default is WP human time (i.e. 5 hours ago)
- Time Display: New option – if set, Twitter time (i.e. 5h)
- Time Display: Choose to display the ‘ago’ or not
- Twitter Intents: Show Twitter intents for ‘Reply’, ‘Retweet’ and ‘Favourite’
- Twitter Intents: Option to hide the Text and just use icons
- Twitter Intents: Colourise the icons to your display
- Twitter Follow: Choose to Show the Twitter Follow button
- Twitter Follow: Choose to show your Twitter name
- Twitter Follow: Choose to show your follower count
- Twitter Follow: Enforce your language (defaults to en [English])
- Click Save
- Can I change the look and feel of the Tweets
Of course you can. It’s really simple too.
The Tweets are in a widget as with all widgets, and are a simple unordered list.
- To make styling easier the <ul> has a class of Tweets – <ul class=”tweets”>
- Each Tweet is a list item <li>
- Each Time reference is an emphasised link <em><a>
- Inside the <li> we now have (if you choose to diplay it) the avatar image
- Inside the <li> we also have (if you choose to diplay them) the Twitter intents. These are are in a DIV with a class of ‘intent-meta’ – in case you want to control its placement or spacing further. Each Intent is a link containing a ‘span’ for icon (using icon fonts for speed and styling flexibility) and another span for the text
- Where can I get help
If you’re really stuck use the WordPress Support Forum or check out the support portal
- More FAQs
We’ve tested it and as far as we know it works great! Phew, but if you have an issue or you want to propose some functionality then submit you ideas at the support portal and we’ll update these FAQs and get onto it when we can.
The oh-so-fancy pull down fields to set API and other settings won’t even stay open to edit. Also struggle to understand how these setting cannot be set outside of the widget itself in order to reuse the feed in different places on the website. Not impressed.
Don’t actually exclude replies
Strange, because it doesn’t seem to want to exclude mentions within the feed despite requesting so. Strange also because it looks like a pile of something produced out of the rear end of a dog (in Customizr, at least). Not simple due to the four step process, and the instructions are a little out of date.
Please fix the exclude button.
I have been using Really Simple Twitter Feed for years but that seems to have disappeared and I discovered this plugin having tried and failed to get two others working.
I had this up and running in a couple of minutes, styled in a few more.
Very happy, I wish more plugins worked so well with so little fuss.
Contributors & Developers
“Simple Twitter Tweets” is open source software. The following people have contributed to this plugin.Contributors
- [Fixed] Cleanup – variable definition errors
- [Fixed] Cleanup – oAuth port definition error
- [Fixed] i18n localisation couple missing textdomain references (props: alysko)
- [Added] Load Plugin Text Domain. Now loads the language files.
- [Updated] Made the permalink on the list item (Cheers Brian)
- [Updated] Fixed Typo
- [Updated] All 4.1 updates and version number updated
- [Added] Div for follow button alignment control – Props Brian Henry
- [Added] Permalink screen name, prevent issues with spaces – thx to Brian
- [Added] Link widget title to Twitter account.Widget admin option added for control – thx to Brian
- [Added] Span to mimic line break and emphasis using CSS, cleaner – thx again Brian
- [Added] Multiple Widget ready – you can now use multiple versions in widget ready areas as requested
- [Added] Internationalisation (i18n) – Ready for impending WP [theme and plugin] Language packs. All interface text marked up ready for translations
- [Fixed] Redeclared Function Error Fixed
- [Fixed] PHP deprecated functions (notice) added PHP 5 construction references
- [Added] SSL reference for avatar (profile pic) images for secure pages
- [Added] Check for data retrieval, handles foreach warning (bullet proof old bug)
- [Added] Defined ‘ago’ so when not used handles warning
- [Added] Clean inputs no whitespace issue
- [Updated] URL for Twitter apps creation updated (as it was moved)
- [Fixed] Serialization error fixed – changed base_64 fix for 4-byte emoji strip
- [Fixed] Class conflict error – check for use before including
- [Fixed] Emoji error (presented as for each error) 4-byte emoji issue
- [Fixed] Word break (letter break on certain browsers) – moved so break on links only to ensure long URLs don’t break display
- [Updated] Intents was on by default before selected (but not saved) – now off on initialisation and user selection to turn on required
- [Fixed] Show Avatar was maintaining indent of tweets when turned off after having been set. Now checks for Avatar on flag not just size change.
- [Added] Twitter Avatar, display, controls, presentation, styling and more
- [Added] Time display formating and options
- [Added] Twitter Intents, plus display styling and options
- [Updated] Time reference i18n (localisation) compliance
- [Updated] Widget UI, cleaner and more compartmentalized
- [Fixed] Twitter API Copy/Paste (copy and past can introduce whitespace error – fixed)
- [Fixed] URLs no longer truncated in retweets!
- [Added] cURL error notification: this is a required PHP extension for connection to the Twitter API
- Fixed Exclude Replies variable notice and tweet calculation
- Added @ symbol for Twitter name links in Tweets
- Hash Tag linking and ReTweet @names linking
- Name reference added to hover state attribute for date link Screen Names – better than username reference
- Updated depricated functions to ensure future compatibility
- Rewrote link creation for URLs in tweets
- Fixed screen name reference for Twitter date links
- Added Twitter name reference enabling database backup for multiple account use
- Added Twitter Follow Button and configuration options
- Updated screenshots and instructions for new functionality and option settings
- Readme, descriptions and screenshot updates
- Initial release