PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.9.5
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.9.5
4.9.5 4.9.4 4.9.3 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 6 days ago web-template.php 6 days ago
web-template.php
155 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 // Free has no license page, so this tab leaves WordPress for the pricing
57 // table. Pro overrides it to the local license screen further down.
58 'tab-license' => [
59 'tab' => esc_html__('Upgrade to Pro', 'wp-staging'),
60 'id' => 'wpstg--tab--toggle--license',
61 'targetId' => '',
62 'targetUrl' => Language::getUpgradeUrl('main_menu'),
63 'page' => 'wpstg-license',
64 'isActive' => !empty($isActiveLicensePage),
65 'isExternal' => true,
66 ],
67 ];
68
69 if ($isCalledFromIndex) {
70 $menu['tab-staging']['targetId'] = '#wpstg--tab--staging';
71 $menu['tab-backup']['targetId'] = '#wpstg--tab--backup';
72 $menu['tab-staging']['targetUrl'] = 'javascript:void(0)';
73 $menu['tab-backup']['targetUrl'] = 'javascript:void(0)';
74 }
75
76 if (defined('WPSTGPRO_VERSION')) {
77 $menu['tab-license']['tab'] = __('License', 'wp-staging');
78 $menu['tab-license']['targetUrl'] = esc_url($wpstgAdminUrl) . 'wpstg-license';
79 $menu['tab-license']['isExternal'] = false;
80 }
81
82 $licenseMessage = '';
83 if (defined('WPSTGPRO_VERSION') && (empty($license->license) || $license->license === 'invalid')) {
84 $licenseMessage = __('(Unregistered)', 'wp-staging');
85 }
86
87 if (defined('WPSTGPRO_VERSION') && (!empty($license->error) && $license->error === 'disabled')) {
88 $licenseMessage = __('(Disabled)', 'wp-staging');
89 }
90
91 if (defined('WPSTGPRO_VERSION') && ((!empty($license->license) && $license->license === 'expired') || (!empty($license->error) && $license->error === 'expired'))) {
92 $licenseMessage = __('(Expired)', 'wp-staging');
93 }
94 ?>
95 <div class="wpstg--tab--header wpstg-border-t wpstg-border-solid wpstg-border-gray-200 dark:wpstg-border-slate-800">
96 <ul class="wpstg-navigation-menu">
97 <li class="wpstg-tab-navigation wpstg_admin">
98 <?php require_once(WPSTG_VIEWS_DIR . 'navigation/mobile-template.php'); ?>
99 </li>
100 <?php foreach ($menu as $tabKey => $tab) :?>
101 <li>
102 <a href="<?php echo esc_attr($tab['targetUrl']) ?>" <?php echo !empty($tab['isExternal']) ? 'target="_blank" rel="noopener noreferrer"' : ''; ?> 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']) ?>">
103 <?php
104 if ($tabKey !== 'tab-license') {
105 echo esc_html($tab['tab']);
106 }
107
108 if ($tabKey === 'tab-license' && defined('WPSTGPRO_VERSION')) :
109 echo esc_html($tab['tab']);
110 ?>
111 <span class="wpstg--red-warning"><?php echo esc_html($licenseMessage); ?></span>
112 <?php endif;
113
114 if ($tabKey === 'tab-license' && !defined('WPSTGPRO_VERSION')) : ?>
115 <span class="wpstg--red-warning"><?php echo esc_html($tab['tab']); ?> </span>
116 <?php endif; ?>
117 </a>
118 <?php
119 if ($tabKey === 'tab-backup') {
120 $backupNotice->maybeShowBackupNotice();
121 }
122 ?>
123 </li>
124 <?php endforeach; ?>
125 <?php if ($showNewsfeedBadge) : ?>
126 <li class="wpstg-tab-item--vert-center">
127 <a href="#wpstg-newsfeed-container"
128 class="wpstg-newsfeed-notification"
129 id="wpstg-newsfeed-header-link"
130 style="display: none;">
131 <span class="wpstg-newsfeed-notification-badge">
132 <?php esc_html_e('NEW', 'wp-staging'); ?>
133 </span>
134 </a>
135 </li>
136 <?php endif; ?>
137 <li class="wpstg-tab-item--vert-center wpstg-tab-header-loader">
138 <span class="wpstg-loader"></span>
139 </li>
140 <li class="wpstg-contact-us-wrapper">
141 <?php
142 require_once(WPSTG_VIEWS_DIR . '_main/contact-us.php');
143 ?>
144 </li>
145 <li class="wpstg-tab-item--vert-center">
146 <?php require_once(WPSTG_VIEWS_DIR . '_main/darkmode-toggle-button.php'); ?>
147 </li>
148 </ul>
149 </div>
150 <?php
151 if (empty($wpstgDeferCompatNotice)) {
152 WPStaging::make(\WPStaging\Framework\Notices\WpVersionCompatNotice::class)->maybeShow();
153 }
154 ?>
155