/**
  * Creates a new instance of this class if one hasn't already been made
  * and then returns the single instance of this class.
  *
  * @return RegenerateThumbnails
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new RegenerateThumbnails();
         self::$instance->setup();
     }
     return self::$instance;
 }
 function options_tab($tab)
 {
     echo '<form method="post" action="options.php" >';
     wp_nonce_field('options.php');
     echo '<div style="float:left;width:330px;">';
     $this->show_thumb_sizes();
     echo '</div>';
     echo '<div style="float:left;margin-top:50px;">';
     settings_fields($tab);
     do_settings_sections($tab);
     submit_button('Add Image Size');
     echo '</div>';
     echo '</form>';
     echo '<div class="clear"></div>';
     if (class_exists('RegenerateThumbnails')) {
         $regen = new RegenerateThumbnails();
         $regen->regenerate_interface();
     } else {
         _e('<h3>Regenerate Thumbnails</h3>');
         printf(__('<p>Install Regenerate Thumbnails to crop all images that you have uploaded to your blog. This is useful if you\'ve changed any of the thumbnail dimensions above or on the <a href="%s">media settings page</a></p>'), admin_url('options-media.php'));
         $url = current_user_can('install_plugins') ? wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=regenerate-thumbnails'), 'install-plugin_regenerate-thumbnails') : 'http://wordpress.org/extend/plugins/regenerate-thumbnails/';
         _e('<a href="' . esc_url($url) . '" class="button-secondary">Install Regenerate Thumbnails</a>');
     }
 }