There are a lot of Twitter widgets for WordPress but in my experience none of those utilize the powerful SimplePie PHP class that is in the WordPress core. SimplePie is a powerful RSS reader class that has very nice built-in caching system since as we all know the Twitter API is limited to only 150 requests per hour creating problems with high traffic websites.
You can download the plug-in here.
Step 1: Getting the plug-in ready

Create a folder and name it bs_twitter. In that folder, create a PHP file and name it the same as the folder i.e. bs_twitter. Also, in the bs_twitter folder create a folder and name it cache. This will be the main plug-in file. Now, include the SimplePie class and add the activation/deactivation hooks for the plug-in.

register_activation_hook(__FILE__, 'bs_twitter_activate');register_deactivation_hook( __FILE__, 'bs_twitter_deactivate');if ( file_exists(ABSPATH . WPINC . '/class-feed.php') ) { @require_once (ABSPATH . WPINC . '/class-feed.php');}function bs_twitter_activate () {}function bs_twitter_deactivate () {}Step 2: Have the widget code prepared

Starting from WordPress 2.8, creating a widget has become easier with the widget API. This code needs to be pasted to the widgets.php file:
• BS_Twitter is both the name of the class, as well as the name of the first function (the constructor). The constructor contains the code needed to setup the widget – it’s called Twitter Posts.
• form() generates the form that you see in the widget management page in WordPress.
• update() updates the options you enter in the form when the widget configuration is saved.
• widget() displays the actual output of the widget in the main site.
• The last part of the code hooks into WordPress’ widget initialization and instructs it to register your widget

class BS_Twitter extends WP_Widget { function BS_Twitter() { $widget_ops = array( 'classname' => 'twitter_widget', 'description' => 'Show your latest Tweets' ); $this->WP_Widget( 'twitter_widget', 'Twitter Posts', $widget_ops); } function form($instance) { } function update($new_instance, $old_instance) { } function widget($args, $instance) { }}add_action( 'widgets_init', 'bs_load_widgets' );function bs_load_widgets() { register_widget('BS_Twitter');}Step 3: Creating the form

First thing that needs to be done even before you create the form for a widget, you must determine the type of inputs you need. For this specific widget, 3 inputs are needed: title for the widget, Twitter username, and number of tweets to be displayed. If you look at the basic code above, in the form() function you will find a parameter $instance. This basically contains the current values for all inputs in the form (for example, when you save the form with certain values). Therefore, it is needed to pull out the current values of the widgdet and populate the widget input fields with them.

$instance = wp_parse_args( (array) $instance, array('title' => 'Twitter', 'number' => 5, 'twitter_username' => 'abuzz') );$title = esc_attr($instance['title']);$twitter_username = $instance['twitter_username'];$number = absint($instance['number']);?>[*]