Ejemplo n.º 1
0
 public function __construct($plugin_file)
 {
     $this->update();
     $this->filterFunction = create_function('$a', 'if ($a == null) { return false; } return $a;');
     $this->plugin_dir = dirname($plugin_file);
     $this->plugin_slug = plugin_basename($plugin_file);
     list($t1, $t2) = explode('/', $this->plugin_slug);
     $this->slug = str_replace('.php', '', $t2);
     $this->posts_where_suffix = '';
     $this->comments_and_clauses = '';
     add_action('template_redirect', array($this, 'template_redirect'));
     add_action('init', array(&$this, 'parse_init'));
     add_action('admin_menu', array(&$this, 'admin_menu'));
     add_action('admin_init', array(&$this, 'admin_init'));
     add_action('init', array(&$this, 'localization'));
     if (is_admin()) {
         MainWP_Helper::update_option('mainwp_child_plugin_version', self::$version, 'yes');
     }
     $this->checkOtherAuth();
     if (is_admin()) {
         MainWP_Clone::init();
     }
     MainWP_Child_Server_Information::init();
     MainWP_Client_Report::init();
     MainWP_Child_Plugins_Check::Instance();
     MainWP_Child_Themes_Check::Instance();
     $this->run_saved_snippets();
     if (!get_option('mainwp_child_pubkey')) {
         MainWP_Helper::update_option('mainwp_child_branding_disconnected', 'yes', 'yes');
     }
     $branding_robust = true;
     $cancelled_branding = get_option('mainwp_child_branding_disconnected') === 'yes' && !get_option('mainwp_branding_preserve_branding');
     if ($branding_robust && !$cancelled_branding) {
         $branding_header = get_option('mainwp_branding_plugin_header');
         if (is_array($branding_header) && isset($branding_header['name']) && !empty($branding_header['name'])) {
             $this->branding_robust = stripslashes($branding_header['name']);
         }
     }
     add_action('admin_notices', array(&$this, 'admin_notice'));
     add_filter('plugin_row_meta', array(&$this, 'plugin_row_meta'), 10, 2);
 }