id, $array ) ) { return $text; } $author_extend = ''; $link = ''; $debug_url = admin_url( 'admin.php?page=ultimate-debug-settings' ); $license_link = bsf_registration_page_url( "&activation_method=license-key$author_extend", '6892199' ); if( isset( $_GET['author'] ) ){ $author_extend = '&author'; $license_link = add_query_arg( 'author', '', $license_link ); } $link .= 'Ultimate Addons debug settings'; //$link .= ' | Activate license using purchase key'; return $link; } function bsf_admin_scripts_updater($hook){ if(defined('OPN_VERSION')) { echo ""; } echo " "; if($hook == "post.php" || $hook == "post-new.php" || $hook == 'ultimate_page_about-ultimate' || $hook == 'visual-composer_page_vc-roles' || $hook == 'toplevel_page_about-ultimate' || $hook == 'ultimate_page_ultimate-dashboard' || $hook == 'ultimate_page_ultimate-smoothscroll' || $hook == 'ultimate_page_ultimate-scripts-and-styles' || $hook == 'ultimate_page_ultimate-product-license' || $hook == 'admin_page_ultimate-debug-settings' || $hook == 'ultimate_page_bsf-google-maps' || $hook == 'settings_page_ultimate-product-license' ){ $css_ext = '.min.css'; if ( is_rtl() ) { $css_ext = '.min-rtl.css'; } $bsf_dev_mode = bsf_get_option('dev_mode'); wp_register_style("ultimate-admin-style", UAVC_URL."admin/css/style.css"); wp_register_style("ultimate-chosen-style", UAVC_URL.'admin/vc_extend/css/chosen.css'); wp_register_script("ultimate-chosen-script", UAVC_URL."admin/vc_extend/js/chosen.js"); wp_register_script("ultimate-vc-backend-script", UAVC_URL."admin/js/ultimate-vc-backend.min.js",array('jquery'),ULTIMATE_VERSION,true); wp_register_style("ultimate-vc-backend-style", UAVC_URL.'admin/css/ultimate-vc-backend' . $css_ext); if($bsf_dev_mode === 'enable') { wp_enqueue_style('ultimate-admin-style'); } else { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script('ultimate-vc-backend-script'); wp_enqueue_style('ultimate-vc-backend-style'); } } wp_localize_script( 'jquery', 'uavc', array( 'add_zipped_font' => wp_create_nonce( 'smile-add-zipped-fonts-nonce' ), 'remove_zipped_font' => wp_create_nonce( 'smile-remove-zipped-fonts-nonce' ), 'get_font_variants' => wp_create_nonce( 'uavc-get-font-variants-nonce' ), 'ult_get_attachment_url' => wp_create_nonce( 'uavc-get-attachment-url-nonce' ), ) ); }/* end admin_scripts */ function register_brainstorm_menu(){ if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) { return; } else { $role = 'manage_network_options'; } if ( ! current_user_can( 'manage_options' ) ) { return; } else { $role = 'manage_options'; } global $submenu; if(defined('BSF_MENU_POS')) $required_place = BSF_MENU_POS; else $required_place = 200; if(function_exists('bsf_get_free_menu_position')) $place = bsf_get_free_menu_position($required_place,1); else $place = null; $page = add_menu_page( 'Ultimate', 'Ultimate', $role, 'about-ultimate', array($this,'load_about'), '', $place ); add_submenu_page( "about-ultimate", __("Modules","ultimate_vc"), __("Modules","ultimate_vc"), $role, "ultimate-dashboard", array($this,'load_modules') ); add_submenu_page( "about-ultimate", __("Smooth Scroll","ultimate_vc"), __("Smooth Scroll","ultimate_vc"), $role, "ultimate-smoothscroll", array($this,'load_smoothscroll') ); add_submenu_page( "about-ultimate", __("Scripts & Styles","ultimate_vc"), __("Scripts & Styles","ultimate_vc"), $role, "ultimate-scripts-and-styles", array($this,'load_scripts_styles') ); if ( ! is_multisite() ) { add_submenu_page( "about-ultimate", __("Product License","ultimate_vc"), __("Product License","ultimate_vc"), $role, "ultimate-product-license", array($this,'product_license') ); } add_submenu_page( "NOATTACH", __("Debug","ultimate_vc"), __("Debug","ultimate_vc"), $role, "ultimate-debug-settings", array($this,'load_debug_settings') ); // Add sub-menu for OPN if OPN in installed - {One Page Navigator}. if( defined('OPN_VERSION') ){ if(defined('BSF_MENU_POS')) $required_place = BSF_MENU_POS; else $required_place = 200; if(function_exists('bsf_get_free_menu_position')) $place = bsf_get_free_menu_position($required_place,1); else $place = null; $page = add_menu_page( 'OPN', 'OPN', 'administrator', 'opn-settings', array($this,'load_opn'), 'dashicons-admin-generic', $place ); } // section wise menu global $bsf_section_menu; $section_menu = array( 'menu' => 'ultimate-resources', 'is_down_arrow' => true ); $bsf_section_menu[] = $section_menu; $icon_manager_page = add_submenu_page( "about-ultimate", __("Icon Manager","ultimate_vc"), __("Icon Manager","ultimate_vc"), $role, "bsf-font-icon-manager", array($this, 'ultimate_icon_manager_menu') ); $AIO_Icon_Manager = new AIO_Icon_Manager; add_action( 'admin_print_scripts-' . $icon_manager_page, array($AIO_Icon_Manager,'admin_scripts')); $Ultimate_Google_Font_Manager = new Ultimate_Google_Font_Manager; $google_font_manager_page = add_submenu_page( "about-ultimate", __("Google Font Manager","ultimate_vc"), __("Google Fonts","ultimate_vc"), $role, "bsf-google-font-manager", array($Ultimate_Google_Font_Manager,'ultimate_font_manager_dashboard') ); add_action( 'admin_print_scripts-' . $google_font_manager_page, array($Ultimate_Google_Font_Manager,'admin_google_font_scripts')); $google_font_manager_page = add_submenu_page( "about-ultimate", __("Google Maps","ultimate_vc"), __("Google Maps","ultimate_vc"), $role, "bsf-google-maps", array($this,'ultimate_google_maps_dashboard') ); // must be at end of all sub menu $submenu['about-ultimate'][0][0] = __("About","ultimate_vc"); } function load_opn(){ if(class_exists('OPN_Navigator')) { $OPN_Navigator = new OPN_Navigator; $OPN_Navigator->opn_settings(); } } function ultimate_icon_manager_menu(){ $AIO_Icon_Manager = new AIO_Icon_Manager; $AIO_Icon_Manager->icon_manager_dashboard(); } function load_modules(){ require_once(plugin_dir_path(__FILE__).'/modules.php'); } function load_dashboard(){ require_once(plugin_dir_path(__FILE__).'/dashboard.php'); } function load_about() { require_once(plugin_dir_path(__FILE__).'/about.php'); } function load_smoothscroll() { require_once(plugin_dir_path(__FILE__).'/smooth-scroll-setting.php'); } function load_scripts_styles() { require_once(plugin_dir_path(__FILE__).'/script-styles.php'); } function product_license() { require_once(plugin_dir_path(__FILE__).'/product-license.php'); } function load_debug_settings() { require_once(plugin_dir_path(__FILE__).'/debug.php'); } function ultimate_resources() { $connects = false; require_once(plugin_dir_path(__FILE__).'/resources.php'); } function ultimate_google_maps_dashboard() { require_once(plugin_dir_path(__FILE__).'/map-settings.php'); } function update_modules(){ check_ajax_referer( 'ultimate-modules-setting', 'security' ); if(isset($_POST['ultimate_row'])){ $ultimate_row = sanitize_text_field( $_POST['ultimate_row'] ); } else { $ultimate_row = 'disable'; } $result1 = update_option( 'ultimate_row', $ultimate_row ); $ultimate_modules = array(); if(isset($_POST['ultimate_modules'])){ $ultimate_modules = array_map( 'sanitize_text_field', $_POST['ultimate_modules'] ); } $result2 = update_option( 'ultimate_modules', $ultimate_modules ); if($result1 || $result2 ){ echo 'success'; } else { echo 'failed'; } die(); } function can_access_admin() { $bsf_ultimate_roles = bsf_get_option('ultimate_roles'); if($bsf_ultimate_roles == false || empty($bsf_ultimate_roles)) { $bsf_ultimate_roles = array( 'administrator' ); } if(!in_array('administrator', $bsf_ultimate_roles)) array_push($bsf_ultimate_roles, 'administrator'); $user = wp_get_current_user(); $user_role = $user->roles[0]; if(in_array($user_role, $bsf_ultimate_roles)) { return $user_role; } return false; } function update_debug_settings() { check_ajax_referer( 'ultimate-debug-settings', 'security' ); if( isset( $_POST['ultimate_video_fixer'] ) ){ $ultimate_video_fixer = sanitize_text_field( $_POST['ultimate_video_fixer'] ); } else { $ultimate_video_fixer = 'disable'; } $result1 = update_option('ultimate_video_fixer',$ultimate_video_fixer); if(isset($_POST['ultimate_ajax_theme'])){ $ultimate_ajax_theme = sanitize_text_field( $_POST['ultimate_ajax_theme'] ); } else { $ultimate_ajax_theme = 'disable'; } $result2 = update_option('ultimate_ajax_theme',$ultimate_ajax_theme); if(isset($_POST['ultimate_custom_vc_row'])){ $ultimate_custom_vc_row = sanitize_text_field( $_POST['ultimate_custom_vc_row'] ); } else { $ultimate_custom_vc_row = ''; } $result3 = update_option('ultimate_custom_vc_row',$ultimate_custom_vc_row); if(isset($_POST['ultimate_theme_support'])){ $ultimate_theme_support = sanitize_text_field( $_POST['ultimate_theme_support'] ); } else { $ultimate_theme_support = 'disable'; } $result4 = update_option('ultimate_theme_support',$ultimate_theme_support); if(isset($_POST['ultimate_rtl_support'])){ $ultimate_rtl_support = sanitize_text_field( $_POST['ultimate_rtl_support'] ); } else { $ultimate_rtl_support = 'disable'; } $result5 = update_option('ultimate_rtl_support',$ultimate_rtl_support); if(isset($_POST['ultimate_modal_fixer'])){ $ultimate_modal_fixer = sanitize_text_field( $_POST['ultimate_modal_fixer'] ); } else { $ultimate_modal_fixer = 'disable'; } $result6 = update_option( 'ultimate_modal_fixer', $ultimate_modal_fixer ); $result7 = $result8 = false; $bsf_options_array = array( 'dev_mode', 'ultimate_global_scripts', 'ultimate_roles', 'ultimate_modal_menu' ); $check_update_option_7 = $check_update_option_8 = false; if(isset($_POST['bsf_options'])){ $bsf_options_keys = array_keys($_POST['bsf_options']); $bsf_options_array = array_diff($bsf_options_array, $bsf_options_keys); foreach ( $_POST['bsf_options'] as $key => $value ) { $key = sanitize_text_field( $key ); if( is_array($value) ) { $value = array_map( 'sanitize_text_field', $value ); } else { $value = sanitize_text_field( $value ); } $result7 = bsf_update_option( $key, $value ); if( $result7 ) $check_update_option_7 = true; } } foreach ( $bsf_options_array as $key => $key_value ) { $key_value = sanitize_text_field( $key_value ); $result8 = bsf_update_option( $key_value, '' ); if( $result8 ) $check_update_option_8 = true; $result8 = true; } if(isset($_POST['ultimate_smooth_scroll_compatible'])){ $ultimate_smooth_scroll_compatible = sanitize_text_field( $_POST['ultimate_smooth_scroll_compatible'] ); } else { $ultimate_smooth_scroll_compatible = 'disable'; } $result9 = update_option('ultimate_smooth_scroll_compatible',$ultimate_smooth_scroll_compatible); if(isset($_POST['ultimate_animation'])){ $ultimate_animation = sanitize_text_field( $_POST['ultimate_animation'] ); } else { $ultimate_animation = 'disable'; } $result10 = update_option('ultimate_animation',$ultimate_animation); if($result1 || $result2 || $result3 || $result4 || $result5 || $result6 || $result7 || $result8 || $result9 || $result10){ echo 'success'; } else { echo 'failed'; } die(); } function update_settings(){ check_ajax_referer( 'smooth-scroll-setting', 'security' ); if( isset( $_POST['ultimate_smooth_scroll'] ) ) { $ultimate_smooth_scroll = sanitize_text_field( $_POST['ultimate_smooth_scroll'] ); } else { $ultimate_smooth_scroll = 'disable'; } $result1 = update_option('ultimate_smooth_scroll',$ultimate_smooth_scroll); if(isset($_POST['ultimate_smooth_scroll_options'])){ $ultimate_smooth_scroll_options['step'] = ( '' != $_POST['ultimate_smooth_scroll_options']['step'] ) ? ( int ) $_POST['ultimate_smooth_scroll_options']['step'] : ''; $ultimate_smooth_scroll_options['speed'] = ( '' != $_POST['ultimate_smooth_scroll_options']['speed'] ) ? ( int ) $_POST['ultimate_smooth_scroll_options']['speed'] : ''; } else { $ultimate_smooth_scroll_options = ''; } $result2 = update_option('ultimate_smooth_scroll_options',$ultimate_smooth_scroll_options); if($result1 || $result2){ echo 'success'; } else { echo 'failed'; } die(); } function update_css_options(){ check_ajax_referer( 'css-settings-setting', 'security' ); if(isset($_POST['ultimate_css'])){ $ultimate_css = sanitize_text_field( $_POST['ultimate_css'] ); } else { $ultimate_css = 'disable'; } $result1 = update_option('ultimate_css',$ultimate_css); if(isset($_POST['ultimate_js'])){ $ultimate_js = sanitize_text_field( $_POST['ultimate_js'] ); } else { $ultimate_js = 'disable'; } $result2 = update_option('ultimate_js',$ultimate_js); if($result1 || $result2){ echo 'success'; } else { echo 'failed'; } die(); } /* * Display admin notices for plugin activation */ function display_notice(){ global $hook_suffix; $status = "not-activated"; $ultimate_keys = get_option('ultimate_keys'); $username = $ultimate_keys['envato_username']; $api_key = $ultimate_keys['envato_api_key']; $purchase_code = $ultimate_keys['ultimate_purchase_code']; $user_email = (isset($ultimate_keys['ultimate_user_email'])) ? $ultimate_keys['ultimate_user_email'] : ''; $activation_check = get_option('ultimate_license_activation'); if(false === ( get_transient( 'ultimate_license_activation' ) )){ if(!empty($activation_check)){ $get_activation_data = check_license_activation($purchase_code, $username, $user_email); $activation_check_temp = json_decode($get_activation_data); $val = array( 'response' => $activation_check_temp->response, 'status' => $activation_check_temp->status, 'code' => $activation_check_temp->code ); $val = array_map( 'sanitize_text_field', $val ); update_option('ultimate_license_activation', $val); delete_transient( 'ultimate_license_activation' ); set_transient( "ultimate_license_activation", true, 60*60*12); } } $activation_check = get_option('ultimate_license_activation'); $ultimate_constants = get_option('ultimate_constants'); $builtin = get_option('ultimate_updater'); if($activation_check !== ''){ $status = isset($activation_check['status']) ? $activation_check['status'] : "not-activated"; $code = $activation_check['code']; } if($status == "Deactivated" || $status == "not-activated" || $status == "not-verified"){ if ( $hook_suffix == 'plugins.php' ){ if( $builtin === 'disabled' || $ultimate_constants['ULTIMATE_NO_PLUGIN_PAGE_NOTICE'] === true || (is_multisite() == true && is_main_site() == false)) $hide_notice = true; else $hide_notice = false; $reg_link = (is_multisite()) ? network_admin_url('index.php?page=bsf-dashboard') : admin_url('index.php?page=bsf-dashboard'); if(!$hide_notice) : ?>
" alt="">

'.__('activate your copy','ultimate_vc').' '.__('of the Ultimate Addons for WPBakery Page Builder to receive automatic updates & get premium support.','ultimate_vc');?> X