function ultra_panel_settings()
{
    global $ultraadmin;
    //print_r($ultraadmin);
    ultra_add_option("ultraadmin_plugin_access", "manage_options");
    ultra_add_option("ultraadmin_plugin_page", "show");
    ultra_add_option("ultraadmin_plugin_userid", "");
    ultra_add_option("ultraadmin_menumng_page", "enable");
    ultra_add_option("ultraadmin_admin_menumng_page", "enable");
    ultra_add_option("ultraadmin_admintheme_page", "enable");
    ultra_add_option("ultraadmin_logintheme_page", "enable");
    ultra_add_option("ultraadmin_master_theme", "0");
    $get_menumng_page = ultra_get_option("ultraadmin_menumng_page", "enable");
    $get_admin_menumng_page = ultra_get_option("ultraadmin_admin_menumng_page", "enable");
    $get_admintheme_page = ultra_get_option("ultraadmin_admintheme_page", "enable");
    $get_logintheme_page = ultra_get_option("ultraadmin_logintheme_page", "enable");
    $get_mastertheme_page = ultra_get_option("ultraadmin_master_theme", "0");
    // manageoptions and super admin
    $ultraadmin_permissions = ultra_get_option("ultraadmin_plugin_access", "manage_options");
    if ($ultraadmin_permissions == "super_admin" && is_super_admin()) {
        $ultraadmin_permissions = 'manage_options';
    }
    // specific user
    $ultraadmin_userid = ultra_get_option("ultraadmin_plugin_userid", "");
    if ($ultraadmin_permissions == "specific_user" && $ultraadmin_userid == get_current_user_id()) {
        $ultraadmin_permissions = 'read';
    }
    $showtabs = true;
    if (is_multisite() && ultra_network_active()) {
        if (!is_main_site()) {
            $showtabs = false;
        }
    }
    if ($showtabs) {
        add_menu_page('Ultra Admin Addon', __('Admin Add on', 'ultra_framework'), $ultraadmin_permissions, 'ultra_permission_settings', 'ultra_permission_settings_page');
        add_submenu_page('ultra_permission_settings', 'Plugin Settings', __('Plugin Settings', 'ultra_framework'), $ultraadmin_permissions, 'ultra_permission_settings', 'ultra_permission_settings_page');
        if ($get_menumng_page != "disable") {
            add_submenu_page('ultra_permission_settings', 'Menu Management', __('Menu Management', 'ultra_framework'), $ultraadmin_permissions, 'ultra_menumng_settings', 'ultra_menumng_settings_page');
        }
    }
}
function ultra_core()
{
    global $ultra_css_ver;
    global $ultraadmin;
    $ultraadmin = ultraadmin_network($ultraadmin);
    $globalmsg = "";
    $login_screen = "custom";
    if (isset($ultraadmin['enable-login']) && $ultraadmin['enable-login'] != "1" && $ultraadmin['enable-login'] == "0" && !$ultraadmin['enable-login']) {
        $login_screen = "default";
    }
    /*----------- Check Permissions - Start ---------------*/
    $get_admintheme_page = ultra_get_option("ultraadmin_admintheme_page", "enable");
    $get_logintheme_page = ultra_get_option("ultraadmin_logintheme_page", "enable");
    $adminside = true;
    if (isset($get_admintheme_page) && $get_admintheme_page == "disable") {
        $adminside = false;
    }
    $loginside = true;
    if (isset($get_logintheme_page) && $get_logintheme_page == "disable") {
        $loginside = false;
    }
    //echo $adminside; echo $loginside;
    /*----------- Check Permissions - End---------------*/
    if ($ultra_css_ver != "") {
        /* Add Options*/
        ultra_add_option("ultraadmin_menuorder", "");
        ultra_add_option("ultraadmin_submenuorder", "");
        ultra_add_option("ultraadmin_menurename", "");
        ultra_add_option("ultraadmin_submenurename", "");
        ultra_add_option("ultraadmin_menudisable", "");
        ultra_add_option("ultraadmin_submenudisable", "");
        add_action('admin_enqueue_scripts', 'ultra_disable_menu', 1);
        if ($adminside) {
            add_action('admin_enqueue_scripts', 'ultra_scripts', 1);
        }
        add_action('admin_enqueue_scripts', 'ultra_logo', 99);
        add_action('admin_enqueue_scripts', 'ultra_logo_url', 99);
        add_action('admin_enqueue_scripts', 'ultra_admintopbar', 1);
        add_action('admin_enqueue_scripts', 'ultra_admintopbar_links', 1);
        add_action('wp_enqueue_scripts', 'ultra_admintopbar_links', 1);
        add_action('wp_enqueue_scripts', 'ultra_wptopbar', 1);
        add_action('wp_before_admin_bar_render', 'ultra_topbar_logout_link');
        add_action('wp_before_admin_bar_render', 'ultra_topbar_menuids');
        add_action('admin_bar_menu', 'ultra_topbar_account_menu', 11);
        if ($adminside) {
            add_action('admin_enqueue_scripts', 'ultra_page_loader', 1);
            add_action('admin_enqueue_scripts', 'ultra_fonts', 99);
            add_action('admin_enqueue_scripts', 'ultra_admin_css', 99);
        }
        add_action('admin_enqueue_scripts', 'ultra_favicon', 99);
        add_action('admin_enqueue_scripts', 'ultra_custom_css', 99);
        add_action('admin_enqueue_scripts', 'ultra_extra_css', 99);
        /*add_action('admin_enqueue_scripts', 'ultraadmin_access', 99);*/
        add_filter('admin_footer_text', 'ultra_footer_admin');
        if ($adminside) {
            remove_action("admin_color_scheme_picker", "admin_color_scheme_picker");
        }
        if ($login_screen == "custom" && $loginside) {
            add_action('login_enqueue_scripts', 'ultra_custom_login', 99);
            add_filter('login_headerurl', 'ultra_custom_loginlogo_url');
            add_action('login_enqueue_scripts', 'ultra_login_options', 99);
        }
        if ($adminside) {
            ultra_dynamic_css_settings();
        }
    } else {
        echo "<script type='text/javascript'>console.log('Ultra WP Admin: WordPress Version Not Supported Yet!');</script>";
    }
}