PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.8.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.8.2
4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / Backend / Activation / Welcome.php
wp-staging / Backend / Activation Last commit date
Welcome.php 2 years ago
Welcome.php
78 lines
1 <?php
2
3 namespace WPStaging\Backend\Activation;
4
5 // No Direct Access
6 if (!defined("WPINC")) {
7 die;
8 }
9
10 use WPStaging\Framework\Traits\NoticesTrait;
11 use WPStaging\Framework\Facades\Escape;
12
13 class Welcome
14 {
15 use NoticesTrait;
16
17 public function __construct()
18 {
19 add_action('admin_init', [$this, 'welcome']);
20
21 if (wpstgGetProVersionNumberIfInstalled() && $this->isWPStagingAdminPage()) {
22 add_action('wpstg.admin_notices', [$this, 'wpstgproActivationNotice']);
23 }
24 }
25
26 /**
27 * @return void
28 * @todo make this message permanently hideable when dismissed.
29 */
30 public function wpstgproActivationNotice()
31 {
32 ?>
33 <div class="notice notice-warning is-dismissible">
34 <p>
35 <?php
36 printf(
37 Escape::escapeHtml(__('WP Staging Pro is installed but not activated. Some features may not work until you activate the Pro version. Go to <a href=%s>Installed Plugins</a> and activate WP Staging Pro there.', 'wp-staging')),
38 esc_url(admin_url('plugins.php'))
39 );
40 ?>
41 </p>
42 </div>
43 <?php
44 }
45
46 /**
47 * Sends user to the welcome page on first activation of WPSTG as well as each
48 * time WPSTG is upgraded to a new version
49 *
50 * @access public
51 * @return void
52 * @since 1.0.1
53 */
54 public function welcome()
55 {
56 // Bail if pro is installed
57 if (wpstgGetProVersionNumberIfInstalled()) {
58 return;
59 }
60
61 // Bail if no activation redirect
62 if (get_transient('wpstg_activation_redirect') === false) {
63 return;
64 }
65
66 // Delete the redirect transient
67 delete_transient('wpstg_activation_redirect');
68
69 // Bail if activating from network, or bulk
70 if (is_network_admin() || isset($_GET['activate-multi'])) {
71 return;
72 }
73
74 wp_safe_redirect(admin_url('admin.php?page=wpstg-welcome'));
75 exit;
76 }
77 }
78