PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.3.1
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.3.1
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
77 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('admin_notices', [$this, 'wpstgproActivationNotice']);
23 }
24 }
25
26 /**
27 * @return void
28 */
29 public function wpstgproActivationNotice()
30 {
31 ?>
32 <div class="notice notice-warning is-dismissible">
33 <p>
34 <?php
35 printf(
36 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')),
37 esc_url(admin_url('plugins.php'))
38 );
39 ?>
40 </p>
41 </div>
42 <?php
43 }
44
45 /**
46 * Sends user to the welcome page on first activation of WPSTG as well as each
47 * time WPSTG is upgraded to a new version
48 *
49 * @access public
50 * @return void
51 * @since 1.0.1
52 */
53 public function welcome()
54 {
55 // Bail if pro is installed
56 if (wpstgGetProVersionNumberIfInstalled()) {
57 return;
58 }
59
60 // Bail if no activation redirect
61 if (get_transient('wpstg_activation_redirect') === false) {
62 return;
63 }
64
65 // Delete the redirect transient
66 delete_transient('wpstg_activation_redirect');
67
68 // Bail if activating from network, or bulk
69 if (is_network_admin() || isset($_GET['activate-multi'])) {
70 return;
71 }
72
73 wp_safe_redirect(admin_url('admin.php?page=wpstg-welcome'));
74 exit;
75 }
76 }
77