is_wizard_page() ) { return; } /* ?> is_wizard_page() ) { return; } wp_enqueue_style( 'aabcore-aabcore-wizard-p', AABCORE_FIREWALL_MALWARE_URL. 'aabcore-wizard-p.css', array(), filemtime(AABCORE_FIREWALL_MALWARE_DIR. 'aabcore-wizard-p.css' ) ); wp_enqueue_style( 'aabcore-firewall-malware-u', AABCORE_FIREWALL_MALWARE_URL. 'aabcore-wizard.css', array(), '109.0.5' ); } /** * Process wizard. */ public function process_wizard() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( 'You do not have permission to access this page.' ); } check_admin_referer( 'aabcore_seo_wizard', 'aabcore_seo_wizard_nonce' ); $step = 1; if ( isset( $_POST['wizard_step'] ) ) { $step = absint( $_POST['wizard_step'] ); } if ( $step < 1 ) { $step = 1; } if ( $step > $this->total_steps ) { $step = $this->total_steps; } $action = ''; if ( isset( $_POST['wizard_action'] ) ) { $action = sanitize_key( wp_unslash( $_POST['wizard_action'] ) ); } $this->save_step( $step ); if ( 'back' === $action ) { $this->redirect_to_step( max( 1, $step - 1 ) ); } if ( 'next' === $action ) { $this->redirect_to_step( min( $this->total_steps, $step + 1 ) ); } if ( 'finish' === $action ) { update_option( 'aabcore_seo_wizard_completed', 1 ); wp_safe_redirect( add_query_arg( array( 'page' => 'aabcore-firewall-malware-u', 'completed' => 1, ), admin_url( 'admin.php' ) ) ); exit; } $this->redirect_to_step( $step ); } /** * Save step data. */ private function save_step( $step ) { switch ( $step ) { case 1: $value = ''; if ( isset( $_GET['site_name'] ) && $_GET['site_name'] === 'aabcore-seo-wizard' && isset( $_POST['aabcore_seo_wizard_nonce'] ) ) { check_admin_referer( 'aabcore_seo_wizard', 'aabcore_seo_wizard_nonce' ); // Process form } if ( isset( $_POST['site_name'] ) ) { $value = sanitize_text_field( wp_unslash( $_POST['site_name'] ) ); } update_option($this->option_namec, [ 'aabcore_seo_site_name' => $value, 'email' => 'test', ]); /* update_option( 'aabcore_seo_site_name', $value ); */ break; case 2: $title = '0'; $description = '0'; if ( isset( $_POST['seo_title'] ) ) { $title = sanitize_text_field( wp_unslash( $_POST['seo_title'] ) ); } if ( isset( $_POST['seo_description'] ) ) { $description = sanitize_textarea_field( wp_unslash( $_POST['seo_description'] ) ); } update_option( 'aabcore_firewall_on', $title ); update_option( 'aabcore_seo_description', $description ); break; case 3: //$twitter = '0'; //$facebook = '0'; $twitter = isset( $_POST['twitterurl'] ) ? sanitize_text_field( wp_unslash( $_POST['twitterurl'] ) ) : '0'; $facebook = isset( $_POST['facebook_url'] ) ? sanitize_text_field( wp_unslash( $_POST['facebook_url'] ) ) : '0'; /* if ( isset( $_POST['twitterurl'] ) ) { $twitter = esc_html( esc_html(wp_unslash( $_POST['twitterurl']) ) ); } if ( isset( $_POST['facebook_url'] ) ) { $facebook = esc_html(wp_unslash( $_POST['facebook_url'])); }*/ update_option( 'aabcore_malware_on', $twitter ); update_option( 'aabcore_seo_facebook_url', $facebook ); break; case 4: $robots = '0'; if ( isset( $_POST['robots'] ) ) {$robots = sanitize_text_field(wp_unslash( $_POST['robots'] )); } $allowed_robots = array( '0', '1', ); if ( ! in_array( $robots, $allowed_robots, true ) ) { $robots = '1'; } update_option( 'aabcore_virus_on', $robots ); break; case 5: break; } } /** * Redirect to wizard step. */ private function redirect_to_step( $step ) { $url = add_query_arg( array( 'page' => 'aabcore-firewall-malware-u', 'step' => absint( $step ), ), admin_url( 'admin.php' ) ); wp_safe_redirect( $url ); exit; } /** * Render wizard. */ public function render_page() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( 'Permission denied.' ); } $step = 1; if ( isset( $_GET['step'] ) && $_GET['step'] === 'aabcore-seo-wizard' && isset( $_POST['aabcore_seo_wizard_nonce'] ) ) { check_admin_referer( 'aabcore_seo_wizard', 'aabcore_seo_wizard_nonce' ); // Process form } if ( isset( $_GET['step'] ) ) { $step = absint( $_GET['step'] ); } if ( $step < 1 ) { $step = 1; } if ( $step > $this->total_steps ) { $step = $this->total_steps; } $completed = isset( $_GET['completed'] ); ?>
Enter the name of your website or business.