Here’s a Wordpress widget base class which reduces the amount of code needed to create a simple widget with fields. Allows overriding a method adding more complex fields. This code should be placed in your theme’s function.php file. You can then subclass Field_Widget whenever you like by following the example given. Thanks to¬† for sharing tips on how to use WP_Widget.