How to Create a Simple Widget on WordPress
WordPress widgets are classes, which makes them easy to duplicate, even if you’ve never worked with object-oriented programming before. A class provides a blueprint for objects that will be reused in various ways. Creating a new widget is a matter of copying the basic widget class, then adjusting the enclosed functions to output the content you have in mind. The widget class contains four functions: one that registers the widget, one that prints the widget output, one that updates the widget options, and one that displays the options form..
To create a widget, you only need to extend the standard WP_Widget class and some of its functions.
That base class also contains information about the functions that must be extended to get a working widget.

