PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.2.1
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.2.1
1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 All 173 releases
userswp / admin / class-admin-setup-wizard.php

class-admin-setup-wizard.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.2.1, at admin/class-admin-setup-wizard.php

612 lines 23.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class UsersWP_Admin_Setup_Wizard {
8
9 private $step = '';
10
11 private $steps = array();
12
13 public function __construct() {
14
15 add_action('admin_menu', array($this, 'admin_menus'));
16 add_action('current_screen', array($this, 'setup_wizard'));
17 add_action('uwp_wizard_content_use_userswp', array($this, 'content_use_userswp'));
18 add_action('uwp_wizard_content_menus', array($this, 'content_menus'));
19 add_action('uwp_wizard_content_dummy_users', array($this, 'content_dummy_users'));
20 add_action('admin_notices', array($this, 'setup_wizard_notice'));
21 add_action( 'wp_loaded', array( $this, 'hide_wizard_notices' ) );
22
23 }
24
25 public function setup_wizard_notice() {
26
27 $show_notice = get_option( "uwp_setup_wizard_notice" );
28
29 if( isset($show_notice) && 1 == $show_notice) {
30 ?>
31 <div id="message" class="updated notice-alt uwp-message">
32 <p><?php _e( '<strong>Welcome to UsersWP</strong> &#8211; You&lsquo;re almost ready to start your site. :)', 'userswp' ); ?></p>
33 <p class="submit">
34 <a href="<?php echo esc_url( admin_url( 'admin.php?page=uwp-setup' ) ); ?>" class="button-primary"><?php _e( 'Run the Setup Wizard', 'userswp' ); ?></a>
35 <a class="button-secondary skip" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'uwp-hide-notice', 'install' ), 'uwp_hide_notices_nonce', '_uwp_notice_nonce' ) ); ?>"><?php _e( 'Skip setup', 'userswp' ); ?></a>
36 </p>
37 </div>
38 <?php
39 }
40
41 }
42
43 public function hide_wizard_notices() {
44
45 if ( isset( $_GET['uwp-hide-notice'] ) && isset( $_GET['_uwp_notice_nonce'] ) ) {
46
47 if ( ! wp_verify_nonce( $_GET['_uwp_notice_nonce'], 'uwp_hide_notices_nonce' ) ) {
48 wp_die( __( 'Action failed. Please refresh the page and retry.', 'userswp' ) );
49 }
50
51 if ( ! current_user_can( 'manage_options' ) ) {
52 wp_die( __( 'Cheatin&#8217; huh?', 'userswp' ) );
53 }
54
55 delete_option('uwp_setup_wizard_notice');
56 }
57 }
58
59 public function admin_menus(){
60 add_dashboard_page( '', '', 'manage_options', 'uwp-setup', '' );
61 }
62
63 public function setup_wizard() {
64
65 if ( empty( $_GET['page'] ) || 'uwp-setup' !== $_GET['page'] ) {
66 return;
67 }
68
69 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
70
71 $default_steps = array(
72 'introduction' => array(
73 'name' => __( 'Introduction', 'userswp' ),
74 'view' => array( $this, 'setup_introduction' ),
75 'handler' => '',
76 ),
77 'content' => array(
78 'name' => __( 'Content', 'userswp' ),
79 'view' => array( $this, 'setup_content' ),
80 'handler' => array( $this, 'setup_content_save' ),
81 ),
82 'recommend' => array(
83 'name' => __( 'Recommend', 'userswp' ),
84 'view' => array( $this, 'setup_recommend' ),
85 'handler' => array( $this, 'setup_recommend_save' ),
86 ),
87 'next_steps' => array(
88 'name' => __( 'Ready!', 'userswp' ),
89 'view' => array( $this, 'setup_ready' ),
90 'handler' => '',
91 ),
92 );
93
94 $this->steps = apply_filters( 'uwp_setup_wizard_steps', $default_steps );
95 $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
96
97 wp_enqueue_style('wp-admin' );
98 $obj = WP_Font_Awesome_Settings::instance();
99 $obj->enqueue_style();
100 $obj->enqueue_scripts();
101 wp_enqueue_style( 'uwp-setup-wizard-style', USERSWP_PLUGIN_URL . 'admin/assets/css/setup-wizard' . $suffix . '.css',array( 'dashicons', 'install', 'thickbox'),'','' );
102
103 $required_scripts = array(
104 'jquery',
105 'jquery-ui-tooltip',
106 'thickbox',
107 'jquery-ui-progressbar'
108 );
109
110 wp_register_script( 'uwp-setup', USERSWP_PLUGIN_URL . 'admin/assets/js/setup-wizard' . $suffix . '.js', $required_scripts , USERSWP_VERSION );
111
112 wp_localize_script( 'uwp-setup', 'uwp_wizard_obj', array(
113 'ajaxurl' => admin_url( 'admin-ajax.php' )
114 ));
115
116 if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
117 call_user_func( $this->steps[ $this->step ]['handler'], $this );
118 }
119
120 ob_start();
121
122 $this->setup_wizard_header();
123 $this->setup_wizard_steps();
124 $this->setup_wizard_content();
125 $this->setup_wizard_footer();
126 exit;
127 }
128
129 public function setup_wizard_header() {
130 ?>
131 <!DOCTYPE html>
132 <html <?php language_attributes(); ?>>
133 <head>
134 <meta name="viewport" content="width=device-width"/>
135 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
136 <title><?php esc_html_e( 'Userswp &rsaquo; Setup Wizard', 'userswp' ); ?></title>
137 <?php do_action( 'admin_print_styles' ); ?>
138 <?php wp_print_scripts( 'uwp-setup' ); ?>
139 <?php do_action( 'admin_head' ); ?>
140 </head>
141 <body class="uwp-setup wp-core-ui">
142 <h1 id="uwp-logo">
143 <a href="https://userswp.io/"><span class="dashicons dashicons-groups"></span>
144 <span><span class="text-secondary">Users</span><span class="text-primary">WP</span></span>
145 </a>
146 </h1>
147 <?php
148 }
149
150 public function setup_wizard_steps() {
151
152 $ouput_steps = $this->steps;
153
154 array_shift( $ouput_steps );
155 ?>
156 <ol class="uwp-setup-steps">
157 <?php foreach ( $ouput_steps as $step_key => $step ) : ?>
158 <li class="<?php
159 if ( $step_key === $this->step ) {
160 echo 'active';
161 } elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
162 echo 'done';
163 }
164 ?>">
165 <?php echo esc_html( $step['name'] ); ?>
166 </li>
167 <?php endforeach; ?>
168 </ol>
169 <?php
170 }
171
172 public function setup_wizard_content() {
173 echo '<div class="uwp-setup-content">';
174 call_user_func( $this->steps[ $this->step ]['view'], $this );
175 echo '</div>';
176 }
177
178 public function setup_wizard_footer() {
179
180 if ( 'next_steps' === $this->step ) : ?>
181 <p class="uwp-return-to-dashboard-wrap">
182 <a class="uwp-return-to-dashboard" href="<?php echo esc_url( admin_url() ); ?>">
183 <?php esc_html_e( 'Return to the WordPress Dashboard', 'userswp' ); ?>
184 </a>
185 </p>
186 <?php endif; ?>
187 </body>
188 </html>
189 <?php
190 }
191
192 public function get_next_step_link( $step = '' ) {
193 if ( ! $step ) {
194 $step = $this->step;
195 }
196
197 $keys = array_keys( $this->steps );
198 if ( end( $keys ) === $step ) {
199 return admin_url();
200 }
201
202 $step_index = array_search( $step, $keys );
203 if ( false === $step_index ) {
204 return '';
205 }
206
207 return add_query_arg( 'step', $keys[ $step_index + 1 ] );
208 }
209
210 public function setup_introduction() {
211 ?>
212 <h2><?php esc_html_e( 'Thank you for choosing UsersWP!', 'userswp' ); ?></h2>
213 <p><?php _e('This quick setup wizard will help you configure the basic settings. It\'s completely optional and shouldn\'t take longer than two minutes.','userswp'); ?></p>
214 <p><?php _e('No time right now? If you don\'t want to go through the wizard, you can skip and return to the WordPress dashboard. Come back anytime if you change your mind!','userswp'); ?></p>
215
216 <p class="uwp-setup-actions step">
217 <a href="<?php echo esc_url( admin_url() ); ?>" class="button button-large"><?php esc_html_e( 'Not right now', 'userswp' ); ?></a>
218 <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button-primary button button-large button-next"><?php esc_html_e( "Let's go!", 'userswp' ); ?></a>
219 </p>
220 <?php
221 }
222
223 public function setup_content() {
224
225 $wizard_content = array(
226 'use_userswp' => __( "How will you use UsersWP", "userswp" ),
227 'menus' => __( "Menus", "userswp" ),
228 'dummy_users' => __( "Dummy Users", "userswp" ),
229 );
230
231 $wizard_content = apply_filters( 'uwp_wizard_content', $wizard_content );
232 ?>
233 <div class="uwp-wizard-content-parts">
234 <ul>
235 <?php
236 foreach ( $wizard_content as $slug => $title ) {
237 echo '<li class="uwp-sub-menu-tab"><a href="#' . esc_attr( $slug ) . '">' . esc_attr( $title ) . '</a></li>' . " \n";
238 }
239 ?>
240 </ul>
241 </div>
242 <form method="post">
243 <?php
244 foreach ( $wizard_content as $slug => $title ) {
245 echo '<h2 class="uwp-settings-title "><a id="' . esc_attr( $slug ) . '"></a>' . esc_attr( $title ) . '</h2>' . " \n"; // line break adds a nice spacing
246 do_action( "uwp_wizard_content_{$slug}" );
247 }
248 ?>
249 <p class="uwp-setup-actions step">
250 <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'Skip this step', 'userswp' ); ?></a>
251 <input type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( 'Continue', 'userswp' ); ?>" name="save_step"/>
252 <?php wp_nonce_field( 'uwp-setup' ); ?>
253 </p>
254 </form>
255 <?php
256 }
257
258 public function content_use_userswp() {
259 ?>
260 <table class="form-table uwp-dummy-table">
261 <tbody>
262 <tr>
263 <td>
264 <input type="checkbox" name="login_register_page" class="use-uwp-pages" value="1" checked>
265 <strong><?php _e( "Login/Register", "userswp" ); ?></strong></td>
266 <td></td>
267 </tr>
268 <tr>
269 <td>
270 <input type="checkbox" name="user_profiles_page" class="use-uwp-pages" value="1" checked>
271 <strong><?php _e( "User Profiles", "userswp" ); ?></strong></td>
272 <td></td>
273 </tr>
274 <tr>
275 <td>
276 <input type="checkbox" name="member_directory_page" class="use-uwp-pages" value="1" checked>
277 <strong><?php _e( "Members Directory", "userswp" ); ?></strong></td>
278 <td></td>
279 </tr>
280 </tbody>
281 </table>
282 <?php
283 }
284
285 public function content_menus() {
286 ?>
287 <table class="form-table uwp-dummy-table">
288 <tbody>
289 <tr>
290 <td>
291 <strong><?php _e( "Select the theme main menu", "userswp" ); ?></strong>
292 </td>
293 <td style="width: 20%">
294 <strong><?php _e( "Action", "userswp" ); ?></strong>
295 </td>
296 </tr>
297 <tr>
298 <td>
299 <?php
300 $set_menus = get_nav_menu_locations();
301 $set_menus = array_filter( $set_menus );
302
303 if ( ! empty( $set_menus ) ) {
304
305 echo "<select id='uwp_wizard_menu_id' data-type='add' class='uwp-select' >";
306
307 foreach ( $set_menus as $menu_location => $menu_id ) {
308 $selected = '';
309
310 if ( strpos( strtolower( $menu_location ), 'primary' ) !== false || strpos( strtolower( $menu_location ), 'main' ) !== false ) {
311 $selected = 'selected="selected"';
312 }
313
314 $menu_item = wp_get_nav_menus( $menu_id )[0];
315
316 ?>
317 <option value="<?php echo esc_attr( $menu_id ); ?>" <?php echo $selected; ?>>
318 <?php echo esc_attr( $menu_item->name );
319 if ( $selected ) {
320 echo ' ';
321 _e( '( Auto detected )', 'userswp' );
322 } ?>
323 </option>
324 <?php
325 }
326
327 echo "</select>";
328
329 } else {
330 $menus = get_registered_nav_menus();
331
332 if ( ! empty( $menus ) ) {
333
334 echo "<select id='uwp_wizard_menu_location' data-type='create' class='uwp-select' >";
335
336 foreach ( $menus as $menu_slug => $menu_name ) {
337 $selected = '';
338
339 if ( strpos( strtolower( $menu_slug ), 'primary' ) !== false || strpos( strtolower( $menu_slug ), 'main' ) !== false ) {
340 $selected = 'selected="selected"';
341 }
342 ?>
343 <option value="<?php echo esc_attr( $menu_slug ); ?>" <?php echo $selected; ?>>
344 <?php _e( 'Create new menu in:', 'userswp' );
345 echo ' ' . esc_attr( $menu_name );
346 if ( $selected ) {
347 echo ' ';
348 _e( '( Auto detected )', 'userswp' );
349 } ?>
350 </option>
351 <?php
352 }
353 echo "</select>";
354 }
355 }
356 ?>
357 <div class="notice inline notice-success notice-alt uwp-wizard-menu uwp-wizard-menu-result"></div>
358 </td>
359 <td>
360 <input type="button" value="<?php _e( "Insert menu items", "userswp" ); ?>" class="button-primary uwp_dummy_button" onclick="uwp_wizard_setup_menu('<?php echo wp_create_nonce( "uwp-wizard-setup-menu" ); ?>'); return false;" >
361 </td>
362 </tr>
363 </tbody>
364 </table>
365 <?php
366
367 }
368
369 public function content_dummy_users() {
370
371 $get_dummy_user_passowrd = $this->get_dummy_user_passowrd();
372 $dummy_users = get_users( array( 'meta_key' => 'uwp_dummy_user', 'meta_value' => '1', 'fields' => array( 'ID' ) ) );
373 $total_dummy_users = !empty( $dummy_users ) ? count($dummy_users) : 0;
374 ?>
375 <table class="form-table uwp-dummy-table">
376 <tbody>
377 <tr>
378 <td>
379 <p><?php echo sprintf(__('Dummy Users for Testing. Password for all dummy users: <strong>%s</strong>','userswp'),$get_dummy_user_passowrd); ?></p>
380 </td>
381 <td style="width: 20%">
382 <input style="display: <?php echo ( $total_dummy_users > 0 ) ? 'block' :'none'; ?>" type="button" value="<?php _e('Remove', 'userswp');?>" class="button-primary button uwp_diagnosis_button uwp_dummy_users_button uwp_remove_dummy_users_button" onclick="uwp_wizard_setup_dummy_users('<?php echo wp_create_nonce( "uwp_process_diagnosis" ); ?>','remove_dummy_users'); return false;"/>
383 <input style="display: <?php echo ( $total_dummy_users > 0 ) ? 'none' :'block'; ?>"type="button" value="<?php _e( "Create Users", "userswp" ); ?>" class="button-primary button uwp_diagnosis_button uwp_dummy_users_button uwp_add_dummy_users_button" onclick="uwp_wizard_setup_dummy_users('<?php echo wp_create_nonce( "uwp_process_diagnosis" ); ?>','add_dummy_users'); return false;" >
384 </td>
385 </tr>
386 <tr>
387 <td colspan="2" class="has-pbar">
388 <div id="uwp_diagnose_pb_add_dummy_users" class="uwp-pb-wrapper">
389 <div class="progressBar" style="display: none;"><div></div></div>
390 </div>
391 <div id="uwp_diagnose_add_dummy_users"></div>
392 <div id="uwp_diagnose_pb_remove_dummy_users" class="uwp-pb-wrapper">
393 <div class="progressBar" style="display: none;"><div></div></div>
394 </div>
395 <div id="uwp_diagnose_remove_dummy_users"></div>
396 </td>
397 </tr>
398 </tbody>
399 </table>
400 <?php
401 }
402
403 public function get_dummy_user_passowrd(){
404 return substr(hash( 'SHA256', AUTH_KEY . site_url() ), 0, 15);
405 }
406
407 public function setup_content_save() {
408 check_admin_referer( 'uwp-setup' );
409
410 if( !empty( $_REQUEST['step'] ) && 'content' === $_REQUEST['step'] ) {
411 $this->save_content_step_data();
412 }
413
414 wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
415 exit;
416 }
417
418 public function save_content_step_data() {
419
420 $login_register_page = !empty( $_POST['login_register_page'] ) ? $_POST['login_register_page'] : '';
421 $user_profiles_page = !empty( $_POST['user_profiles_page'] ) ? $_POST['user_profiles_page'] : '';
422 $member_directory_page = !empty( $_POST['member_directory_page'] ) ? $_POST['member_directory_page'] : '';
423
424 $login_page = uwp_get_page_id('login_page');
425 $register_page = uwp_get_page_id('register_page');
426 $change_page = uwp_get_page_id('change_page');
427 $forgot_page = uwp_get_page_id('forgot_page');
428 $reset_page = uwp_get_page_id('reset_page');
429 $profile_page = uwp_get_page_id('profile_page');
430 $account_page = uwp_get_page_id('account_page');
431 $users_page = uwp_get_page_id('users_page');
432 $user_list_item_page = uwp_get_page_id('user_list_item_page');
433
434 $login_pages = array($login_page,$register_page,$change_page,$forgot_page,$reset_page);
435
436 if( !empty($login_pages) && count($login_pages) > 0 ) {
437 $login_page_status = 'draft';
438 foreach ( $login_pages as $login_page_id ) {
439
440 if(!empty($login_register_page)) {
441 $login_page_status = 'publish';
442 }
443
444 wp_update_post( array(
445 'ID' => $login_page_id,
446 'post_status' => $login_page_status
447 ) );
448
449 }
450 }
451
452 $profile_pages = array($profile_page,$account_page);
453
454 if( !empty($profile_pages) && count($profile_pages) > 0 ) {
455 $profile_page_status = 'draft';
456 foreach ( $profile_pages as $profile_page_id ) {
457
458 if(!empty($user_profiles_page)) {
459 $profile_page_status = 'publish';
460 }
461
462 wp_update_post( array(
463 'ID' => $profile_page_id,
464 'post_status' => $profile_page_status
465 ) );
466
467 }
468 }
469
470 $users_pages = array($users_page,$user_list_item_page);
471
472 if( !empty($users_pages) && count($users_pages) > 0 ) {
473 $user_page_status = 'draft';
474 foreach ( $users_pages as $user_page_id ) {
475
476 if(!empty($member_directory_page)) {
477 $user_page_status = 'publish';
478 }
479
480 wp_update_post( array(
481 'ID' => $user_page_id,
482 'post_status' => $user_page_status
483 ) );
484
485 }
486 }
487
488 }
489
490 public function setup_recommend() {
491 ?>
492 <form method="post">
493 <div class="uwp-wizard-recommend">
494 <h2 class="uwp-settings-title "><?php _e( "Recommended Plugins", "userswp" ); ?></h2>
495 <p><?php _e( "Below are a few recommended plugins that will help you with your site.", "userswp" ); ?></p>
496 <?php
497 include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
498
499 $recommend_wp_plugins = self::get_recommend_wp_plugins();
500
501 if ( ! empty( $recommend_wp_plugins ) ) {
502 echo "<ul>";
503
504 $installed_text = '<i class="fas fa-check-circle" aria-hidden="true"></i> '. __( 'Installed', 'userswp' );
505 $installing_text = '<i class="fas fa-sync fa-spin" aria-hidden="true"></i> ' . __( 'Installing', 'userswp' );
506
507 echo "<input type='hidden' id='uwp-installing-text' value='$installing_text' >";
508 echo "<input type='hidden' id='uwp-installed-text' value='$installed_text' >";
509
510 foreach ( $recommend_wp_plugins as $plugin ) {
511 $status = install_plugin_install_status( array( "slug" => $plugin['slug'], "version" => "" ) );
512
513 $plugin_status = isset( $status['status'] ) ? $status['status'] : '';
514 $url = isset( $status['url'] ) ? $status['url'] : '';
515
516 if ( $plugin_status == 'install' ) {
517 $checked = "checked";
518 $disabled = "";
519 $checkbox_class = "class='uwp_install_plugins'";
520 } else {
521 $checked = "checked";
522 $disabled = "disabled";
523 $checkbox_class = "";
524 }
525
526 $uwp_html_tip = '<span class="gd-help-tip dashicons dashicons-editor-help" title="' . $plugin['desc'] . '"></span>';
527 echo "<li class='" . $plugin['slug'] . "'>";
528 echo "<input type='checkbox' id='" . $plugin['slug'] . "' $checked $disabled $checkbox_class />";
529 echo $plugin['name'] . " " . $uwp_html_tip;
530 echo " | <a href='" . admin_url( "plugin-install.php?uwp_wizard_recommend=true&tab=plugin-information&plugin=" . $plugin['slug'] . '&TB_iframe=true&width=772&height=407' ) . "' class='thickbox'>".__('More info', 'userswp')."</a>";
531 if ( $plugin_status == 'install' && $url ) {
532 echo " | <span class='uwp-plugin-status' >( " . __( 'Tick to install', 'userswp' ) . " )</span>";
533 } else {
534 if ( ! empty( $plugin_status ) ) {
535 $plugin_status = $installed_text;
536 }
537 echo " | <span class='uwp-plugin-status'>$plugin_status</span>";
538 }
539 echo "</li>";
540
541 }
542 echo "</ul>";
543 }
544 ?>
545 </div>
546 <p class="uwp-setup-actions step">
547 <?php wp_nonce_field( 'uwp-setup' ); ?>
548 <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'Skip this step', 'userswp' ); ?></a>
549 <input type="submit" class="button-primary button button-large button-next uwp-continue-recommend" value="<?php esc_attr_e( 'Continue', 'userswp' ); ?>" name="save_step"/>
550 <input type="submit" class="button-primary button button-large button-next uwp-install-recommend" value="<?php esc_attr_e( 'Install', 'userswp' ); ?>" name="install_recommend" onclick="uwp_wizard_install_plugins('<?php echo wp_create_nonce( 'updates' ); ?>');return false;"/>
551 </p>
552 </form>
553 <?php
554 }
555
556 public static function get_recommend_wp_plugins(){
557
558 $plugins = array(
559 'userswp-social-login' => array(
560 'url' => 'https://wordpress.org/plugins/userswp-social-login/',
561 'slug' => 'userswp-social-login',
562 'name' => __('UsersWP – Social Login', 'userswp'),
563 'desc' => __('This plugin lets your user to register and login with popular sites like Facebook, Google, Twitter, LinkedIn, Instagram, Yahoo, WordPress, vkontakte etc.','userswp'),
564 ),
565 'userswp-recaptcha' => array(
566 'url' => 'https://wordpress.org/plugins/userswp-recaptcha/',
567 'slug' => 'userswp-recaptcha',
568 'name' => __('UsersWP – ReCaptcha', 'userswp'),
569 'desc' => __('This plugin allows you to implement a super security captcha into forms like registration, login forms etc.','userswp'),
570 ),
571 );
572
573 return $plugins;
574 }
575
576 public function setup_recommend_save() {
577 check_admin_referer( 'uwp-setup' );
578 wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
579 exit;
580 }
581
582 public function setup_ready(){
583 $this->setup_ready_actions();
584 ?>
585 <h2><?php esc_html_e( 'Awesome, you are ready to go!', 'userswp' ); ?></h2>
586 <div class="uwp-message">
587 <p><?php _e('Thank you for using UsersWP :)','userswp'); ?></p>
588 </div>
589 <div class="uwp-setup-next-steps-last">
590 <h2><?php _e( 'Learn more', 'userswp' ); ?></h2>
591 <ul>
592 <li class="uwp-getting-started">
593 <a href="https://userswp.io/docs/?utm_source=setupwizard&utm_medium=product&utm_content=getting-started&utm_campaign=userswpplugin" target="_blank"><?php esc_html_e( 'Getting started guide', 'userswp' ); ?></a>
594 </li>
595 <li class="uwp-newsletter">
596 <a href="https://userswp.io/newsletter-signup/?utm_source=setupwizard&utm_medium=product&utm_content=newsletter&utm_campaign=userswpplugin" target="_blank"><?php esc_html_e( 'Get Userswp advice in your inbox', 'userswp' ); ?></a>
597 </li>
598 <li class="uwp-get-help">
599 <a href="https://userswp.io/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=userswpplugin" target="_blank"><?php esc_html_e( 'Have questions? Get help.', 'userswp' ); ?></a>
600 </li>
601 </ul>
602 </div>
603 <?php
604 }
605
606 private function setup_ready_actions() {
607 delete_option('uwp_setup_wizard_notice');
608 }
609
610 }
611
612 new UsersWP_Admin_Setup_Wizard();