PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.9.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.9.2
4.9.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 / views / navigation / web-template.php
wp-staging / views / navigation Last commit date
mobile-template.php 1 month ago web-template.php 1 day ago
web-template.php
151 lines
1 <?php
2
3 /**
4 * @see views/_main/main-navigation.php
5 * @see views/clone/index.php
6 * @var bool $isBackupPage
7 * @var bool $isStagingPage
8 * @var object $backupNotice
9 * @var object $license
10 * @var bool $isCalledFromIndex
11 */
12
13 use WPStaging\Core\WPStaging;
14 use WPStaging\Framework\Language\Language;
15 use WPStaging\Framework\Newsfeed\NewsfeedProvider;
16
17 $wpstgAdminUrl = get_admin_url() . 'admin.php?page=';
18
19 // Get newsfeed data for header notification badge (JS handles seen state via localStorage)
20 $newsfeedProvider = WPStaging::make(NewsfeedProvider::class);
21 $newsfeedData = $newsfeedProvider->getNewsfeedData();
22 $showNewsfeedBadge = !empty($newsfeedData);
23 $menu = [
24 'tab-staging' => [
25 'tab' => esc_html__('Staging', 'wp-staging'),
26 'id' => 'wpstg--tab--toggle--staging',
27 'targetId' => '',
28 'targetUrl' => $wpstgAdminUrl . 'wpstg_clone',
29 'page' => 'wpstg_clone',
30 'isActive' => !empty($isStagingPage),
31 ],
32 'tab-backup' => [
33 'tab' => esc_html__('Backup & Migration', 'wp-staging'),
34 'id' => 'wpstg--tab--toggle--backup',
35 'targetId' => '',
36 'targetUrl' => $wpstgAdminUrl . 'wpstg_backup',
37 'page' => 'wpstg_backup',
38 'isActive' => !empty($isBackupPage),
39 ],
40 'tab-settings' => [
41 'tab' => esc_html__('Settings', 'wp-staging'),
42 'id' => 'wpstg--tab--toggle--settigs',
43 'targetId' => '',
44 'targetUrl' => esc_url($wpstgAdminUrl) . 'wpstg-settings',
45 'page' => 'wpstg-settings',
46 'isActive' => !empty($isActiveSettingsPage),
47 ],
48 'tab-system-info' => [
49 'tab' => esc_html__('System Info', 'wp-staging'),
50 'id' => 'wpstg--tab--toggle--systeminfo',
51 'targetId' => '',
52 'targetUrl' => esc_url($wpstgAdminUrl) . 'wpstg-tools',
53 'page' => 'wpstg-tools',
54 'isActive' => !empty($isActiveSystemInfoPage),
55 ],
56 'tab-license' => [
57 'tab' => esc_html__('Upgrade to Pro', 'wp-staging'),
58 'id' => 'wpstg--tab--toggle--license',
59 'targetId' => '',
60 'targetUrl' => Language::getUpgradeUrl('main_menu'),
61 'page' => 'wpstg-license',
62 'isActive' => !empty($isActiveLicensePage),
63 ],
64 ];
65
66 if ($isCalledFromIndex) {
67 $menu['tab-staging']['targetId'] = '#wpstg--tab--staging';
68 $menu['tab-backup']['targetId'] = '#wpstg--tab--backup';
69 $menu['tab-staging']['targetUrl'] = 'javascript:void(0)';
70 $menu['tab-backup']['targetUrl'] = 'javascript:void(0)';
71 }
72
73 if (defined('WPSTGPRO_VERSION')) {
74 $menu['tab-license']['tab'] = __('License', 'wp-staging');
75 $menu['tab-license']['targetUrl'] = esc_url($wpstgAdminUrl) . 'wpstg-license';
76 }
77
78 $licenseMessage = '';
79 if (defined('WPSTGPRO_VERSION') && (empty($license->license) || $license->license === 'invalid')) {
80 $licenseMessage = __('(Unregistered)', 'wp-staging');
81 }
82
83 if (defined('WPSTGPRO_VERSION') && (!empty($license->error) && $license->error === 'disabled')) {
84 $licenseMessage = __('(Disabled)', 'wp-staging');
85 }
86
87 if (defined('WPSTGPRO_VERSION') && ((!empty($license->license) && $license->license === 'expired') || (!empty($license->error) && $license->error === 'expired'))) {
88 $licenseMessage = __('(Expired)', 'wp-staging');
89 }
90 ?>
91 <div class="wpstg--tab--header wpstg-border-t wpstg-border-solid wpstg-border-gray-200 dark:wpstg-border-slate-800">
92 <ul class="wpstg-navigation-menu">
93 <li class="wpstg-tab-navigation wpstg_admin">
94 <?php require_once(WPSTG_VIEWS_DIR . 'navigation/mobile-template.php'); ?>
95 </li>
96 <?php foreach ($menu as $tabKey => $tab) :?>
97 <li>
98 <a href="<?php echo esc_attr($tab['targetUrl']) ?>" class="wpstg--tab--content <?php echo ($tab['isActive']) ? 'wpstg--tab--active' : '' ?> wpstg-button" data-target="<?php echo esc_attr($tab['targetId']) ?>" id="<?php echo esc_attr($tab['id']) ?>">
99 <?php
100 if ($tabKey !== 'tab-license') {
101 echo esc_html($tab['tab']);
102 }
103
104 if ($tabKey === 'tab-license' && defined('WPSTGPRO_VERSION')) :
105 echo esc_html($tab['tab']);
106 ?>
107 <span class="wpstg--red-warning"><?php echo esc_html($licenseMessage); ?></span>
108 <?php endif;
109
110 if ($tabKey === 'tab-license' && !defined('WPSTGPRO_VERSION')) : ?>
111 <span class="wpstg--red-warning"><?php echo esc_html($tab['tab']); ?> </span>
112 <?php endif; ?>
113 </a>
114 <?php
115 if ($tabKey === 'tab-backup') {
116 $backupNotice->maybeShowBackupNotice();
117 }
118 ?>
119 </li>
120 <?php endforeach; ?>
121 <?php if ($showNewsfeedBadge) : ?>
122 <li class="wpstg-tab-item--vert-center">
123 <a href="#wpstg-newsfeed-container"
124 class="wpstg-newsfeed-notification"
125 id="wpstg-newsfeed-header-link"
126 style="display: none;">
127 <span class="wpstg-newsfeed-notification-badge">
128 <?php esc_html_e('NEW', 'wp-staging'); ?>
129 </span>
130 </a>
131 </li>
132 <?php endif; ?>
133 <li class="wpstg-tab-item--vert-center wpstg-tab-header-loader">
134 <span class="wpstg-loader"></span>
135 </li>
136 <li class="wpstg-contact-us-wrapper">
137 <?php
138 require_once(WPSTG_VIEWS_DIR . '_main/contact-us.php');
139 ?>
140 </li>
141 <li class="wpstg-tab-item--vert-center">
142 <?php require_once(WPSTG_VIEWS_DIR . '_main/darkmode-toggle-button.php'); ?>
143 </li>
144 </ul>
145 </div>
146 <?php
147 if (empty($wpstgDeferCompatNotice)) {
148 WPStaging::make(\WPStaging\Framework\Notices\WpVersionCompatNotice::class)->maybeShow();
149 }
150 ?>
151