New checkbox in custom widget isn’t saving data

It seems the problem lies within redefining a widget: a widget with the ID “recent-posts” already exists, and that’s causing some strange behaviour when saving the widget. This is possibly due the callback on saving the widget being on the original widget class WP_Widget_Recent_Posts).

It’s not really a good idea anyway to redefine a widget; the widgets API is not intended to be used that way. Your problem can be fixed by using a unique widget ID; replace ‘recent-posts’ by another ID in

parent::__construct('recent-posts', __('Recent Posts'), $widget_ops);

And while you’re at it, rename the widget to avoid having duplicate widget titles:

parent::__construct( 'myplugin-recent-posts', __( 'My plugin: Recent Posts', 'myplugin_textdomain' ), $widget_ops );