'; } $ampforwp_install_config = array( 'installer_dir' => 'install', 'plugin_title' => ucfirst( 'AMPforWP Installer' ), 'start_steps' => 1, 'total_steps' => 6, 'installerpage' => 'ampforwptourinstaller', 'dev_mode' => false, 'steps' => array( 1=>array( 'title'=> esc_html__('Welcome','accelerated-mobile-pages'), 'fields'=>'', 'description'=>esc_html__('Welcome','This wizard will set up AMP on your website, install plugin, and import content. It is optional & should take only a few minutes.','accelerated-mobile-pages'), ), 2=>array( 'title'=>esc_html__('Upload Logo','accelerated-mobile-pages'), 'description'=>esc_html__('Recommend logo size is: 190x36','accelerated-mobile-pages'), 'fields'=>'
  • '.$ampLogo.'
  • ' ), 3=>array( 'title'=>esc_html__('Select Pages','accelerated-mobile-pages'), 'description'=>esc_html__('Where you would like to enable AMP.','accelerated-mobile-pages'), 'fields'=>'
  • ', ), 4=>array( 'title'=>esc_html__('Setup Analytics','accelerated-mobile-pages'), 'description'=>esc_html__('Enter your Google Analytics Tracking code','accelerated-mobile-pages'), 'fields'=>'
  • ', ), 5=>array( 'title'=>esc_html__('Select Design','accelerated-mobile-pages'), 'description'=>'', 'fields'=>'
  • ', ), 6=>array( 'title'=>esc_html__('Enjoy','accelerated-mobile-pages'), 'description'=>esc_html__('Navigate to ','accelerated-mobile-pages'), 'fields'=>'', ), ), 'current_step'=>array( 'title'=>'', 'step_id'=>1 ) ); add_action( 'admin_menu', 'ampforwp_add_admin_menu' ); add_action( 'admin_init', 'ampforwp_installer_init'); add_action( 'admin_footer', 'ampforwp_svg_sprite'); add_action( 'wp_ajax_ampforwp_save_installer', 'ampforwp_save_steps_data', 10, 0 ); function ampforwp_add_admin_menu(){ global $ampforwp_install_config; ampforwp_installer_init(); } function ampforwp_installer_init(){ // Exit if the user does not have proper permissions if(! current_user_can( 'manage_options' ) ) { return ; } global $ampforwp_install_config; ampforwp_instller_admin_init(); } function ampforwp_instller_admin_init(){ if(isset($_GET['ampforwp_install'], $_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], '_wpnonce') && $_GET['ampforwp_install']=='1' && is_admin()){ ampforwp_steps_call(); } } function ampforwp_steps_call(){ global $ampforwp_install_config; if ( !wp_verify_nonce($_GET['_wpnonce'], '_wpnonce') || empty( $_GET['page'] ) || $ampforwp_install_config['installerpage'] !== $_GET['page'] ) { return; } if ( ob_get_length() ) { ob_end_clean(); } $step = isset( $_GET['step'] ) ? sanitize_text_field( wp_unslash(sanitize_key( $_GET['step'] ) ) ) : $ampforwp_install_config['start_steps'] ; $title = $ampforwp_install_config['steps'][$step]['title']; $ampforwp_install_config['current_step']['step_id'] = $step; // Use minified libraries if dev mode is turned on. $suffix = ''; // Enqueue styles. wp_enqueue_style( 'ampforwp_install', esc_url(AMPFORWP_PLUGIN_DIR_URI. $ampforwp_install_config['installer_dir']. '/assets/css/merlin' . $suffix . '.css') , array( 'wp-admin' ), '0.1'); // Enqueue javascript. wp_enqueue_script( 'ampforwp_install', esc_url(AMPFORWP_PLUGIN_DIR_URI. $ampforwp_install_config['installer_dir']. '/assets/js/merlin' . $suffix . '.js') , array( 'jquery-core' ), '0.1' ); wp_localize_script( 'ampforwp_install', 'ampforwp_install_params', array( 'ajaxurl' => esc_url(admin_url( 'admin-ajax.php' )), 'wpnonce' => wp_create_nonce( 'ampforwp_install_nonce' ), 'pluginurl' => esc_url(AMPFORWP_PLUGIN_DIR_URI), ) ); ob_start(); ampforwp_install_header(); ?>
    %s', esc_url( admin_url( 'admin.php?page=amp_options' ) ), esc_html__( 'Return to dashboard','accelerated-mobile-pages' ) ); ?>

    300,"message"=>'Request not valid')); die; } // Exit if the user does not have proper permissions if(! current_user_can( 'manage_options' ) ) { return ; } $redux_builder_amp = get_option('redux_builder_amp'); if($redux_builder_amp!=''){ foreach($_POST as $postKey=>$postValue){ if($postKey=='opt-media' && $postValue!=""){ $postValue = json_decode(stripcslashes($postValue),true); $redux_builder_amp[$postKey] = $postValue; }elseif(isset($redux_builder_amp[$postKey]) && $postValue!=""){ $redux_builder_amp[$postKey] = sanitize_text_field($postValue); } } } update_option('redux_builder_amp',$redux_builder_amp); wp_send_json( array( 'done' => 1, 'message' => "Stored Successfully", ) ); } function ampforwp_skip_button(){ ?> array( 'href' => array(), 'title' => array(), 'target' => array(), ), ); update_option( 'ampforwp_installer_completed', time() ); ?>

    > <?php echo ucwords($current_step); ?> '', 'title' => '', 'desc' => '', 'aria_hidden' => true, // Hide from screen readers. 'fallback' => false, ); // Parse args. $args = wp_parse_args( $args, $defaults ); // Set aria hidden. $aria_hidden = ''; if ( true === $args['aria_hidden'] ) { $aria_hidden = ' aria-hidden="true"'; } // Set ARIA. $aria_labelledby = ''; if ( $args['title'] && $args['desc'] ) { $aria_labelledby = ' aria-labelledby="title desc"'; } // Begin SVG markup. $svg = ''; // If there is a title, display it. if ( $args['title'] ) { $svg .= '' . esc_html( $args['title'] ) . ''; } // If there is a description, display it. if ( $args['desc'] ) { $svg .= '' . esc_html( $args['desc'] ) . ''; } $svg .= ''; // Add some markup to use as a fallback for browsers that do not support SVGs. if ( $args['fallback'] ) { $svg .= ''; } $svg .= ''; return $svg; } /** * Adds data attributes to the body, based on Customizer entries. */ function ampforwp_svg_allowed_html() { $array = array( 'svg' => array( 'class' => array(), 'aria-hidden' => array(), 'role' => array(), ), 'use' => array( 'xlink:href' => array(), ), ); return $array; } function step_output_bottom_dots(){ global $ampforwp_install_config; ?>
      $i) { $class_attr = 'done'; $show_link = true; } ?>