Welcome to UsersWP – You‘re almost ready to start your site. :)', 'userswp' ); ?>

array( 'name' => __( 'Introduction', 'userswp' ), 'view' => array( $this, 'setup_introduction' ), 'handler' => '', ), 'content' => array( 'name' => __( 'Content', 'userswp' ), 'view' => array( $this, 'setup_content' ), 'handler' => array( $this, 'setup_content_save' ), ), 'recommend' => array( 'name' => __( 'Recommend', 'userswp' ), 'view' => array( $this, 'setup_recommend' ), 'handler' => array( $this, 'setup_recommend_save' ), ), 'next_steps' => array( 'name' => __( 'Ready!', 'userswp' ), 'view' => array( $this, 'setup_ready' ), 'handler' => '', ), ); $this->steps = apply_filters( 'uwp_setup_wizard_steps', $default_steps ); $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); wp_enqueue_style( 'wp-admin' ); $obj = WP_Font_Awesome_Settings::instance(); $obj->enqueue_style(); $obj->enqueue_scripts(); wp_enqueue_style( 'uwp-setup-wizard-style', USERSWP_PLUGIN_URL . 'admin/assets/css/setup-wizard' . $suffix . '.css', array( 'dashicons', 'install', 'thickbox' ), '', '' ); $required_scripts = array( 'jquery', 'jquery-ui-tooltip', 'thickbox', 'jquery-ui-progressbar' ); wp_register_script( 'uwp-setup', USERSWP_PLUGIN_URL . 'admin/assets/js/setup-wizard' . $suffix . '.js', $required_scripts, USERSWP_VERSION ); wp_localize_script( 'uwp-setup', 'uwp_wizard_obj', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { call_user_func( $this->steps[ $this->step ]['handler'], $this ); } ob_start(); $this->setup_wizard_header(); $this->setup_wizard_steps(); $this->setup_wizard_content(); $this->setup_wizard_footer(); exit; } public function setup_wizard_header() { ?> > <?php esc_html_e( 'Userswp › Setup Wizard', 'userswp' ); ?>

UsersWP

steps; array_shift( $ouput_steps ); ?>
    $step ) : ?>
'; call_user_func( $this->steps[ $this->step ]['view'], $this ); echo ''; } public function setup_wizard_footer() { if ( 'next_steps' === $this->step ) : ?>

step; } $keys = array_keys( $this->steps ); if ( end( $keys ) === $step ) { return admin_url(); } $step_index = array_search( $step, $keys ); if ( false === $step_index ) { return ''; } return add_query_arg( 'step', $keys[ $step_index + 1 ] ); } public function setup_content() { $wizard_content = array(); if ( is_multisite() ) { $reg = get_site_option( 'registration' ); if ( $reg == 'none' ) { $wizard_content['general_settings'] = __( "General Settings", "userswp" ); } } else { if ( ! get_option( 'users_can_register' ) ) { $wizard_content['general_settings'] = __( "General Settings", "userswp" ); } } $wizard_content['use_userswp'] = __( "How will you use UsersWP", "userswp" ); $wizard_content['menus'] = __( "Menus", "userswp" ); $wizard_content['dummy_users'] = __( "Dummy Users", "userswp" ); $wizard_content = apply_filters( 'uwp_wizard_content', $wizard_content ); ?>
$title ) { echo '

' . esc_attr( $title ) . '

' . " \n"; // line break adds a nice spacing do_action( "uwp_wizard_content_{$slug}" ); } ?>




"; foreach ( $set_menus as $menu_location => $menu_id ) { $selected = false; if ( strpos( strtolower( $menu_location ), 'primary' ) !== false || strpos( strtolower( $menu_location ), 'main' ) !== false ) { $selected = true; } $menu_item = wp_get_nav_menus( $menu_id )[0]; ?> "; } else { $menus = get_registered_nav_menus(); if ( ! empty( $menus ) ) { echo " " class="button-primary uwp_dummy_button" onclick="uwp_wizard_setup_menu(''); return false;">
get_dummy_user_passowrd(); $dummy_users = get_users( array( 'meta_key' => 'uwp_dummy_user', 'meta_value' => '1', 'fields' => array( 'ID' ) ) ); $total_dummy_users = ! empty( $dummy_users ) ? count( $dummy_users ) : 0; ?>

%s', 'userswp' ), $get_dummy_user_passowrd ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

','remove_dummy_users'); return false;"/> " class="button-primary button uwp_diagnosis_button uwp_dummy_users_button uwp_add_dummy_users_button" onclick="uwp_wizard_setup_dummy_users('','add_dummy_users'); return false;">
save_content_step_data(); } wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } public function save_content_step_data() { $login_register_page = ! empty( $_POST['login_register_page'] ) ? absint( $_POST['login_register_page'] ) : ''; $user_profiles_page = ! empty( $_POST['user_profiles_page'] ) ? absint( $_POST['user_profiles_page'] ) : ''; $member_directory_page = ! empty( $_POST['member_directory_page'] ) ? absint( $_POST['member_directory_page'] ) : ''; if ( is_multisite() ) { if ( isset( $_POST['registration'] ) && ! empty( $_POST['registration'] ) ) { update_site_option( 'registration', esc_attr( $_POST['registration'] ) ); } } else { if ( isset( $_POST['users_can_register'] ) && 1 == absint( $_POST['users_can_register'] ) ) { update_option( 'users_can_register', 1 ); } } $login_page = uwp_get_page_id( 'login_page' ); $register_page = uwp_get_page_id( 'register_page' ); $change_page = uwp_get_page_id( 'change_page' ); $forgot_page = uwp_get_page_id( 'forgot_page' ); $reset_page = uwp_get_page_id( 'reset_page' ); $profile_page = uwp_get_page_id( 'profile_page' ); $account_page = uwp_get_page_id( 'account_page' ); $users_page = uwp_get_page_id( 'users_page' ); $user_list_item_page = uwp_get_page_id( 'user_list_item_page' ); $login_pages = array( $login_page, $register_page, $change_page, $forgot_page, $reset_page ); if ( ! empty( $login_pages ) && count( $login_pages ) > 0 ) { $login_page_status = 'draft'; foreach ( $login_pages as $login_page_id ) { if ( ! empty( $login_register_page ) ) { $login_page_status = 'publish'; } wp_update_post( array( 'ID' => $login_page_id, 'post_status' => $login_page_status ) ); } } $profile_pages = array( $profile_page, $account_page ); if ( ! empty( $profile_pages ) && count( $profile_pages ) > 0 ) { $profile_page_status = 'draft'; foreach ( $profile_pages as $profile_page_id ) { if ( ! empty( $user_profiles_page ) ) { $profile_page_status = 'publish'; } wp_update_post( array( 'ID' => $profile_page_id, 'post_status' => $profile_page_status ) ); } } $users_pages = array( $users_page, $user_list_item_page ); if ( ! empty( $users_pages ) && count( $users_pages ) > 0 ) { $user_page_status = 'draft'; foreach ( $users_pages as $user_page_id ) { if ( ! empty( $member_directory_page ) ) { $user_page_status = 'publish'; } wp_update_post( array( 'ID' => $user_page_id, 'post_status' => $user_page_status ) ); } } } public function setup_recommend() { ?>

"; $installed_text = ' ' . esc_html__( 'Installed', 'userswp' ); $installing_text = ' ' . esc_html__( 'Installing', 'userswp' ); echo ""; echo ""; foreach ( $recommend_wp_plugins as $plugin ) { $status = install_plugin_install_status( array( "slug" => $plugin['slug'], "version" => "" ) ); $plugin_status = isset( $status['status'] ) ? $status['status'] : ''; $url = isset( $status['url'] ) ? $status['url'] : ''; if ( $plugin_status == 'install' ) { $checked = "checked"; $disabled = ""; $checkbox_class = "class='uwp_install_plugins'"; } else { $checked = "checked"; $disabled = "disabled"; $checkbox_class = ""; } $uwp_html_tip = ''; echo "
  • "; echo "" . $plugin['name'] . " " . $uwp_html_tip; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo " | " . esc_html__( 'More info', 'userswp' ) . ""; if ( $plugin_status == 'install' && $url ) { echo " | ( " . esc_html__( 'Tick to install', 'userswp' ) . " )"; } else { if ( ! empty( $plugin_status ) ) { $plugin_status = $installed_text; } echo " | " . $plugin_status . ""; } echo "
  • "; } echo ""; } ?>

    array( 'url' => 'https://wordpress.org/plugins/ayecode-connect/', 'slug' => 'ayecode-connect', 'name' => 'AyeCode Connect', 'desc' => __( 'Allows you to install any purchased AyeCode Ltd product add-ons without a zip file. It also installs and activates licences automatically, so there is no need to copy/paste licenses.', 'userswp' ), ), 'userswp-social-login' => array( 'url' => 'https://wordpress.org/plugins/userswp-social-login/', 'slug' => 'userswp-social-login', 'name' => __( 'UsersWP – Social Login', 'userswp' ), 'desc' => __( 'This plugin lets your user to register and login with popular sites like Facebook, Google, Twitter, LinkedIn, Instagram, Yahoo, WordPress, vkontakte etc.', 'userswp' ), ), 'userswp-recaptcha' => array( 'url' => 'https://wordpress.org/plugins/userswp-recaptcha/', 'slug' => 'userswp-recaptcha', 'name' => __( 'UsersWP – ReCaptcha', 'userswp' ), 'desc' => __( 'This plugin allows you to implement a super security captcha into forms like registration, login forms etc.', 'userswp' ), ), ); return $plugins; } public function setup_recommend_save() { check_admin_referer( 'uwp-setup' ); wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } public function setup_ready() { $this->setup_ready_actions(); ?>