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'] ); ?>
AABCore Web Security Setup Wizard - Prevent Malware & Virus Scan
Step of total_steps ); ?>
'Website', 2 => 'Firewall', 3 => 'Prevent Malware', 4 => 'Virus Scan', 5 => 'Review', ); foreach ( $step_titles as $number => $title ) { $class = ''; if ( $number === $step ) { $class = 'active'; } elseif ( $number < $step ) { $class = 'completed'; } ?>
render_completed(); ?>
step_one(); break; case 2: $this->step_two(); break; case 3: $this->step_three(); break; case 4: $this->step_four(); break; case 5: $this->step_five(); break; } ?>
option_namec); $aabcore_seo_site_namea = ! empty($sitename['aabcore_seo_site_name']) ? $sitename['aabcore_seo_site_name'] : ''; $value =$aabcore_seo_site_namea; $this->heading( 'Welcome to AABCore Web Security', 'Active Firewall, Prevent Malware & Virus Scan.' ); ?>

Enter the name of your website or business.

navigation( false, true, false ); } /** * Step 2. */ private function step_two() { $title = get_option( 'aabcore_firewall_on', '' ); $description = get_option( 'aabcore_seo_description', '' ); $this->heading( 'Active Firewall Settings', 'Firewall Settings – Active Protection Against All Types of Threats.' ); ?>
checked > checked value="1">
navigation( true, true, false ); } /** * Step 3. */ private function step_three() { $twitter = get_option( 'aabcore_malware_ono', '' ); $facebook = get_option( 'aabcore_seo_facebook_urlo', '' ); $this->heading( 'Prevent Malware', 'Prevent & Malware Scanner – Scans Files, Folders, and Other Threats.' ); ?>
checked > checked >
navigation( true, true, false ); } /** * Step 4. */ private function step_four() { $robots = get_option( 'aabcore_virus_on', 'index,follow' ); $this->heading( 'Prevent Viruses & Other Threats', 'Protect & Scan for Viruses and Other Threats.' ); ?>
navigation( true, true, false ); } /** * Step 5. */ private function step_five() { $sitename = get_option($this->option_namec); $aabcore_seo_site_nameb = ! empty($sitename['aabcore_seo_site_name']) ? $sitename['aabcore_seo_site_name'] : ''; $site_name =$aabcore_seo_site_nameb; $title = get_option( 'aabcore_firewall_on', '' ); $description = get_option( 'aabcore_seo_description', '' ); $twitter= get_option( 'aabcore_malware_ono', '' ); $facebook= get_option( 'aabcore_seo_facebook_urlo', '' ); $robots= get_option( 'aabcore_virus_on', '' ); $this->heading( 'Review Your Settings', 'Everything looks good? Finish the setup below.' ); ?>
Website
Firewall
Firewall Protect
Malware Protection
Malware Scanner
Scan Viruses & Threats.
navigation( true, false, true ); } /** * Heading. */ private function heading( $title, $description ) { ?>
✓

✓

Setup Complete!

AABCore Web Security has been configured successfully.

Go to Security Dashboard