includes/class-freemius.php
private function override_plugin_menu_with_activation() {
            $this->_logger->entrance();

            $hook = false;

            if ( ! $this->has_settings_menu() ) {
                // Add the opt-in page without a menu item.
                $hook = FS_Admin_Menu_Manager::add_subpage(
                    null,
                    $this->get_plugin_name(),
                    $this->get_plugin_name(),
                    'manage_options',
                    $this->_slug,
                    array( &$this, '_connect_page_render' )
                );
            } else if ( $this->_menu->is_top_level() ) {
                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) );

                if ( false === $hook ) {
                    // Create new menu item just for the opt-in.
                    $hook = FS_Admin_Menu_Manager::add_page(
                        $this->get_plugin_name(),
                        $this->get_plugin_name(),
                        'manage_options',
                        $this->_menu->get_slug(),
                        array( &$this, '_connect_page_render' )
                    );
                }
            } else {
                $menus = array( $this->_menu->get_parent_slug() );

                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                foreach ( $menus as $parent_slug ) {
                    $hook = $this->_menu->override_submenu_action(
                        $parent_slug,
                        $this->_menu->get_raw_slug(),
                        array( &$this, '_connect_page_render' )
                    );

                    if ( false !== $hook ) {
                        // Found plugin's submenu item.
                        break;
                    }
                }
            }

            if ( $this->is_activation_page() ) {
                // Clean admin page from distracting content.
                self::_clean_admin_content_section();
            }

            if ( false !== $hook ) {
                if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
                    $this->_install_with_current_user();
                } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) {
                    $this->_install_with_new_user();
                }
            }
        }
private function override_plugin_menu_with_activation() {
            $this->_logger->entrance();

            $hook = false;

            if ( ! $this->has_settings_menu() ) {
                // Add the opt-in page without a menu item.
                $hook = FS_Admin_Menu_Manager::add_subpage(
                    null,
                    $this->get_plugin_name(),
                    $this->get_plugin_name(),
                    'manage_options',
                    $this->_slug,
                    array( &$this, '_connect_page_render' )
                );
            } else if ( $this->_menu->is_top_level() ) {
                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) );

                if ( false === $hook ) {
                    // Create new menu item just for the opt-in.
                    $hook = FS_Admin_Menu_Manager::add_page(
                        $this->get_plugin_name(),
                        $this->get_plugin_name(),
                        'manage_options',
                        $this->_menu->get_slug(),
                        array( &$this, '_connect_page_render' )
                    );
                }
            } else {
                $menus = array( $this->_menu->get_parent_slug() );

                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                foreach ( $menus as $parent_slug ) {
                    $hook = $this->_menu->override_submenu_action(
                        $parent_slug,
                        $this->_menu->get_raw_slug(),
                        array( &$this, '_connect_page_render' )
                    );

                    if ( false !== $hook ) {
                        // Found plugin's submenu item.
                        break;
                    }
                }
            }

            if ( $this->is_activation_page() ) {
                // Clean admin page from distracting content.
                self::_clean_admin_content_section();
            }

            if ( false !== $hook ) {
                if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
                    $this->_install_with_current_user();
                } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) {
                    $this->_install_with_new_user();
                }
            }
        }
private function override_plugin_menu_with_activation ( ) { $ this -> _logger -> entrance ( ) ; $ hook = false ; if ( ! $ this -> has_settings_menu ( ) ) { // Add the opt-in page without a menu item.
 $ hook = FS_Admin_Menu_Manager :: add_subpage ( null , $ this -> get_plugin_name ( ) , $ this -> get_plugin_name ( ) , 'manage_options' , $ this -> _slug , array ( & $ this , '_connect_page_render' ) ) ; } else if ( $ this -> _menu -> is_top_level ( ) ) { if ( $ this -> _menu -> is_override_exact ( ) ) { // Make sure the current page is matching the activation page.
 if ( ! $ this -> is_matching_url ( $ this -> get_activation_url ( ) ) ) { return ; } } $ hook = $ this -> _menu -> override_menu_item ( array ( & $ this , '_connect_page_render' ) ) ; if ( false === $ hook ) { // Create new menu item just for the opt-in.
 $ hook = FS_Admin_Menu_Manager :: add_page ( $ this -> get_plugin_name ( ) , $ this -> get_plugin_name ( ) , 'manage_options' , $ this -> _menu -> get_slug ( ) , array ( & $ this , '_connect_page_render' ) ) ; } } else { $ menus = array ( $ this -> _menu -> get_parent_slug ( ) ) ; if ( $ this -> _menu -> is_override_exact ( ) ) { // Make sure the current page is matching the activation page.
 if ( ! $ this -> is_matching_url ( $ this -> get_activation_url ( ) ) ) { return ; } } foreach ( $ menus as $ parent_slug ) { $ hook = $ this -> _menu -> override_submenu_action ( $ parent_slug , $ this -> _menu -> get_raw_slug ( ) , array ( & $ this , '_connect_page_render' ) ) ; if ( false !== $ hook ) { // Found plugin's submenu item.
 break ; } } } if ( $ this -> is_activation_page ( ) ) { // Clean admin page from distracting content.
 self :: _clean_admin_content_section ( ) ; } if ( false !== $ hook ) { if ( fs_request_is_action ( $ this -> get_unique_affix ( ) . '_activate_existing' ) ) { $ this -> _install_with_current_user ( ) ; } else if ( fs_request_is_action ( $ this -> get_unique_affix ( ) . '_activate_new' ) ) { $ this -> _install_with_new_user ( ) ; } } }
Remove plugin's all admin menu items & pages, and replace with activation page.

@author Vova Feldman (@svovaf)
@since  1.0.1
Remove plugin s all admin menu items & pages and replace with activation page .