And here’s a diff which also works:
123c123
< if ( $_POST['lwp-submit'] ) {
---
> if ( isset($_POST['lwp-submit']) && $_POST['lwp-submit'] ) {
130c130
< $title = attribute_escape( $options['title'] );
---
> $title = esc_attr( $options['title'] );
133c133
< <?php _e('Title:') ?> <input type="text" style="width:250px" id="lwp-title" name="lwp-title" value="<?php echo $title ?>" /></label>
---
> <?php _e('Title:') ?> <input type="text" class="widefat" id="lwp-title" name="lwp-title" value="<?php echo $title ?>" /></label>
140c140
< if ( !function_exists('register_sidebar_widget') )
---
> if ( !function_exists('wp_register_sidebar_widget') )
142,143c142,144
< register_sidebar_widget('Last Viewed Posts','zg_lwp_widget');
< register_widget_control('Last Viewed Posts','zg_lwp_widget_control', 250, 100);
---
>
> wp_register_sidebar_widget( 'zg_lwp_widget', 'Last Viewed Posts', 'zg_lwp_widget' );
> wp_register_widget_control( 'zg_lwp_widget', 'Last Viewed Posts', 'zg_lwp_widget_control', array('width' => 250, 'height' => 100) );
146c147
< add_action('get_header','zg_lwp_header');
---
> add_action('wp','zg_lwp_header'); // We use <code>wp</code> because: no output has been sent, and is_single() et al. is available
148c149
< ?>
\ No newline at end of file
---
> ?>