public static function instance()
 {
     if (!isset(self::$instance)) {
         $class_name = __CLASS__;
         self::$instance = new $class_name();
     }
     return self::$instance;
 }
 /**
  * Private constructor (singleton)
  */
 private function __construct()
 {
     self::$plugin_url = plugins_url('', __FILE__);
     self::$plugin_path = dirname(__FILE__);
     // init settings
     self::$settings = Gecka_Terms_Thumbnails_Settings::instance();
     // add default thumbnails sizes
     self::add_image_size('admin-thumbnail', 50, 50, true);
     self::add_image_size('thumbnail', self::$settings->term_thumbnail_size_w, self::$settings->term_thumbnail_size_h, self::$settings->term_thumbnail_crop);
     self::add_image_size('medium', self::$settings->term_medium_size_w, self::$settings->term_medium_size_h, self::$settings->term_medium_crop);
     register_activation_hook(__FILE__, array($this, 'activation_hook'));
     add_action('plugins_loaded', array($this, 'plugins_loaded'), 5);
     add_action('after_setup_theme', array($this, 'after_setup_theme'), 5);
     add_action('init', array($this, 'metadata_wpdbfix'));
     add_action('switch_blog', array($this, 'metadata_wpdbfix'));
     add_filter('widget_categories_args', array($this, 'widget_categories_args'));
     add_action('admin_init', array($this, 'admin_init'));
 }