PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.11.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.11.0
4.11.0 4.10.0 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 / onboarding / next-step.php
wp-staging / views / onboarding Last commit date
backup-next.php 1 week ago capability-icon.php 1 day ago first-run.php 1 day ago next-step.php 1 day ago open-staging-site.php 1 week ago pre-consent.php 1 day ago progress.php 1 day ago update-protection.php 1 day ago
next-step.php
193 lines
1 <?php
2
3 /**
4 * The state that follows a successful capability: what just happened, where it
5 * put it, the one capability worth doing next, and a way out.
6 *
7 * Replaces WP STAGING's normal success modal for the duration of the first run,
8 * so it carries the new staging site's address and leaves out the review ask,
9 * which would land on the exact moment the first run is trying to use. Rendered
10 * hidden while the job still runs, so success lands on a screen rather than a gap.
11 *
12 * @see \WPStaging\Framework\Onboarding\OnboardingJourney
13 *
14 * @var string $completedCapability The capability whose success this announces.
15 * @var string $nextCapability The capability being offered.
16 * @var bool $isNextStepOffered False once the next capability is already under way.
17 * @var bool $isBackupInBackground The offered backup is the one parked behind the staging site.
18 * @var string $stagingSiteUrl Empty unless a staging site exists.
19 * @var array $backupDetails `name` and `size` of the backup this run created, if any.
20 * @var string $adminUrl
21 * @var bool $isNextCapabilityAvailable False when the offered capability cannot run on this site.
22 */
23
24 use WPStaging\Framework\Onboarding\OnboardingJourney;
25
26 $confirmations = [
27 OnboardingJourney::CAPABILITY_BACKUP => [
28 'title' => __('Your backup is ready', 'wp-staging'),
29 'text' => __('A complete backup of your website has been created successfully.', 'wp-staging'),
30 ],
31 OnboardingJourney::CAPABILITY_STAGING => [
32 'title' => __('Your staging site is ready', 'wp-staging'),
33 'text' => __('Test updates and changes safely without affecting your live website.', 'wp-staging'),
34 ],
35 ];
36
37 $offers = [
38 OnboardingJourney::CAPABILITY_STAGING => [
39 'title' => __('Test changes safely next', 'wp-staging'),
40 'text' => __('Create a staging copy of this site where you can test updates and changes without touching your live website.', 'wp-staging'),
41 'cta' => __('Create a Staging Site', 'wp-staging'),
42 'busy' => __('Starting…', 'wp-staging'),
43 'underway' => __('Creating your staging site', 'wp-staging'),
44 'note' => __('It is being built now. You can keep working while it finishes.', 'wp-staging'),
45 ],
46 OnboardingJourney::CAPABILITY_BACKUP => [
47 'title' => __('Protect your live site too', 'wp-staging'),
48 'text' => __('Create a complete backup of this website. It runs on the server, so you can keep working.', 'wp-staging'),
49 'cta' => __('Create Backup Now', 'wp-staging'),
50 'busy' => __('Starting backup…', 'wp-staging'),
51 'underway' => __('Creating your backup', 'wp-staging'),
52 'note' => __('It runs on the server, so you can start testing your staging site.', 'wp-staging'),
53 ],
54 ];
55
56 if (!isset($confirmations[$completedCapability])) {
57 return;
58 }
59
60
61
62
63 $isFinale = $nextCapability === '';
64 $offer = $isFinale ? [] : $offers[$nextCapability];
65
66 $confirmation = $confirmations[$completedCapability];
67 $hasStagingSite = $completedCapability === OnboardingJourney::CAPABILITY_STAGING;
68
69
70
71 $isBackgroundBackup = !$isNextStepOffered && $isBackupInBackground;
72 $backupDone = $confirmations[OnboardingJourney::CAPABILITY_BACKUP];
73 $background = [
74 'title' => __('Your backup has started', 'wp-staging'),
75 'text' => __('It will continue in the background. You can open your staging site or return to WP STAGING now — there’s no need to wait here.', 'wp-staging'),
76
77
78
79 'waiting' => __('Waiting for the server to pick it up…', 'wp-staging'),
80 ];
81
82
83
84
85 $offerButtonClass = $hasStagingSite ? 'wpstg-btn-outline' : 'wpstg-btn-primary';
86 ?>
87 <div
88 class="wpstg-onboarding-next"
89 data-wpstg-onboarding
90 data-completed-capability="<?php echo esc_attr($completedCapability); ?>"
91 data-staging-url="<?php echo esc_url($adminUrl . 'wpstg_clone'); ?>"
92 data-backup-url="<?php echo esc_url($adminUrl . 'wpstg_backup'); ?>"
93 >
94 <div class="wpstg-onboarding-next__done">
95 <svg class="wpstg-onboarding-next__check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
96 <path d="M20 6 9 17l-5-5"></path>
97 </svg>
98 </div>
99
100 <?php if ($isFinale) : ?>
101 <h2 class="wpstg-onboarding-next__title"><?php esc_html_e('You\'re all set', 'wp-staging'); ?></h2>
102 <p class="wpstg-onboarding-next__text"><?php esc_html_e('Your website is backed up and you have a staging copy ready for safe testing.', 'wp-staging'); ?></p>
103 <?php else : ?>
104 <h2 class="wpstg-onboarding-next__title"><?php echo esc_html($confirmation['title']); ?></h2>
105 <p class="wpstg-onboarding-next__text"><?php echo esc_html($confirmation['text']); ?></p>
106 <?php endif; ?>
107
108 <?php if (!$hasStagingSite && !empty($backupDetails['name'])) : ?>
109 <p class="wpstg-onboarding-next__where">
110 <span class="wpstg-onboarding-next__where-label"><?php esc_html_e('Saved as', 'wp-staging'); ?></span>
111 <span class="wpstg-onboarding-next__file"><?php echo esc_html($backupDetails['name']); ?></span>
112 <?php if (!empty($backupDetails['size'])) : ?>
113 <span class="wpstg-onboarding-next__size"><?php echo esc_html(size_format($backupDetails['size'], 1)); ?></span>
114 <?php endif; ?>
115 </p>
116 <?php endif; ?>
117
118 <?php if ($hasStagingSite || $isFinale) : ?>
119 <p class="wpstg-onboarding-next__where">
120 <span class="wpstg-onboarding-next__where-label"><?php esc_html_e('Installed at', 'wp-staging'); ?></span>
121 <a
122 class="wpstg-onboarding-next__url"
123 data-wpstg-onboarding-site-url
124 data-wpstg-onboarding-site-url-text
125 target="_blank"
126 rel="noopener noreferrer"
127 <?php echo $stagingSiteUrl === '' ? 'hidden' : 'href="' . esc_url($stagingSiteUrl) . '"'; ?>
128 ><?php echo esc_html($stagingSiteUrl); ?></a>
129 </p>
130
131 <?php include WPSTG_VIEWS_DIR . 'onboarding/open-staging-site.php'; ?>
132 <?php endif; ?>
133
134 <?php if (!$isFinale && $isNextCapabilityAvailable) : ?>
135 <div
136 class="wpstg-onboarding-next__offer"
137 <?php if ($isBackgroundBackup) : ?>
138 data-wpstg-onboarding-backup="started"
139 data-ready-title="<?php echo esc_attr($backupDone['title']); ?>"
140 data-ready-text="<?php echo esc_attr($backupDone['text']); ?>"
141 role="status"
142 aria-live="polite"
143 <?php endif; ?>
144 >
145 <?php if ($isBackgroundBackup) : ?>
146 <h3 class="wpstg-onboarding-next__offer-title wpstg-onboarding-next__running">
147 <span class="wpstg-onboarding-next__running-mark" aria-hidden="true">
148 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" focusable="false">
149 <path d="M20 6 9 17l-5-5"></path>
150 </svg>
151 </span>
152 <span data-wpstg-onboarding-backup-title><?php echo esc_html($background['title']); ?></span>
153 </h3>
154 <p class="wpstg-onboarding-next__offer-text" data-wpstg-onboarding-backup-text><?php echo esc_html($background['text']); ?></p>
155
156 <?php
157
158
159
160
161 ?>
162 <span class="wpstg-onboarding-progress__bar wpstg-onboarding-next__waiting" data-wpstg-onboarding-backup-bar aria-hidden="true"></span>
163 <p class="wpstg-onboarding-next__waiting-note" data-wpstg-onboarding-backup-waiting hidden><?php echo esc_html($background['waiting']); ?></p>
164
165 <?php
166
167
168 require WPSTG_VIEWS_DIR . 'job/locked.php';
169 ?>
170 <?php elseif (!$isNextStepOffered) : ?>
171 <h3 class="wpstg-onboarding-next__offer-title"><?php echo esc_html($offer['underway']); ?></h3>
172 <p class="wpstg-onboarding-next__offer-text"><?php echo esc_html($offer['note']); ?></p>
173 <?php else : ?>
174 <h3 class="wpstg-onboarding-next__offer-title"><?php echo esc_html($offer['title']); ?></h3>
175 <p class="wpstg-onboarding-next__offer-text"><?php echo esc_html($offer['text']); ?></p>
176
177 <button
178 type="button"
179 class="wpstg-btn wpstg-btn-lg <?php echo esc_attr($offerButtonClass); ?> wpstg-onboarding-next__cta"
180 data-wpstg-onboarding-action="<?php echo esc_attr($nextCapability); ?>"
181 data-busy-label="<?php echo esc_attr($offer['busy']); ?>"
182 >
183 <?php echo esc_html($offer['cta']); ?>
184 </button>
185 <?php endif; ?>
186 </div>
187 <?php endif; ?>
188
189 <button type="button" class="wpstg-onboarding-next__finish" data-wpstg-onboarding-finish>
190 <?php esc_html_e('Continue to WP STAGING', 'wp-staging'); ?>
191 </button>
192 </div>
193