PluginProbe ʕ •ᴥ•ʔ
UpdraftPlus: WP Backup & Migration Plugin / 1.16.23
UpdraftPlus: WP Backup & Migration Plugin v1.16.23
1.26.4 1.26.3 1.9.19 1.9.25 1.9.26 1.9.30 1.9.31 1.9.32 1.9.4 1.9.40 1.9.41 1.9.42 1.9.43 1.9.44 1.9.45 1.9.46 1.9.5 1.9.50 1.9.51 1.9.60 1.9.62 1.9.63 1.9.64 1.11.12 1.4.8 1.11.15 1.4.9 1.11.17 1.5.16 1.11.18 1.5.20 1.11.2 1.5.21 1.11.20 1.5.22 1.11.23 1.5.5 1.11.24 1.5.6 1.11.25 1.5.7 1.11.26 1.5.8 1.11.27 1.5.9 1.11.28 1.6.1 1.11.3 1.6.17 1.11.4 1.6.2 1.11.5 1.6.46 1.11.8 1.7.0 1.11.9 1.7.1 1.12.0 1.7.18 1.12.1 1.7.20 1.12.12 1.7.3 1.12.13 1.7.34 1.12.15 1.7.35 1.12.17 1.7.39 1.12.2 1.7.40 1.12.20 1.7.41 1.12.23 1.8.1 1.12.24 1.8.11 1.12.25 1.8.12 1.12.28 1.8.13 1.12.29 1.8.2 1.12.30 1.8.5 1.12.32 1.8.8 1.12.34 1.9.0 1.12.35 1.9.13 1.12.37 1.9.15 1.12.39 1.9.17 1.12.4 1.12.40 1.12.6 1.13.1 1.13.11 1.13.12 1.13.15 1.13.16 1.13.2 1.13.3 1.13.4 1.13.5 1.13.6 1.13.7 1.13.8 1.13.9 1.14.10 1.14.11 1.14.12 1.14.13 1.14.2 1.14.3 1.14.4 1.14.5 1.14.7 1.14.9 1.15.0 1.15.2 1.15.3 1.15.5 1.15.6 1.15.7 1.16.0 1.16.10 1.16.11 1.16.12 1.16.13 1.16.14 1.16.15 1.16.16 1.16.17 1.16.20 1.16.21 1.16.22 1.16.23 1.16.24 1.16.25 1.16.26 1.16.28 1.16.29 1.16.32 1.16.34 1.16.35 1.16.36 1.16.37 1.16.4 1.16.40 1.16.41 1.16.42 1.16.43 1.16.44 1.16.45 1.16.46 1.16.47 1.16.48 1.16.49 1.16.5 1.16.50 1.16.51 1.16.53 1.16.55 1.16.56 1.16.59 1.16.6 1.16.60 1.16.61 1.16.62 1.16.63 1.16.64 1.16.65 1.16.66 1.16.67 1.16.68 1.16.69 1.16.7 1.16.8 1.16.9 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.14 1.2.15 1.2.16 1.2.17 1.2.19 1.2.2 1.2.20 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.33 1.2.35 1.2.36 1.2.38 1.2.39 1.2.4 1.2.40 1.2.41 1.2.42 1.2.43 1.2.44 1.2.45 1.2.46 1.2.5 1.2.7 1.2.8 1.2.9 1.22.1 1.22.10 1.22.11 1.22.12 1.22.14 1.22.15 1.22.16 1.22.17 1.22.18 1.22.19 1.22.20 1.22.21 1.22.22 1.22.23 1.22.24 1.22.3 1.22.4 1.22.5 1.22.6 1.22.7 1.22.8 1.22.9 1.23.1 1.23.10 1.23.11 1.23.12 1.23.13 1.23.15 1.23.16 1.23.2 1.23.3 1.23.4 1.23.5 1.23.6 1.23.7 1.23.8 1.23.9 1.24.1 1.24.10 1.24.11 1.24.12 1.24.2 trunk 1.24.3 0.7.4 1.24.4 0.7.7 1.24.5 0.8.28 1.24.6 0.8.29 1.24.7 0.8.30 1.24.8 0.8.31 1.24.9 0.8.32 1.25.1 0.8.33 1.25.2 0.8.36 1.25.3 0.8.37 1.25.5 0.8.50 1.25.6 0.8.51 1.25.7 0.9.1 1.25.8 0.9.10 1.25.9 0.9.11 1.26.1 0.9.12 1.26.2 0.9.2 1.3.10 0.9.20 1.3.12 0.9.21 1.3.14 0.9.22 1.3.15 1.0.10 1.3.17 1.0.11 1.3.18 1.0.12 1.3.19 1.0.15 1.3.2 1.0.16 1.3.20 1.0.18 1.3.22 1.0.20 1.3.23 1.0.3 1.3.24 1.0.4 1.3.25 1.0.5 1.3.3 1.0.6 1.3.4 1.0.7 1.3.6 1.0.8 1.3.7 1.0.9 1.3.8 1.1.0 1.3.9 1.1.10 1.4.0 1.1.11 1.4.10 1.1.12 1.4.11 1.1.13 1.4.12 1.1.14 1.4.13 1.1.15 1.4.14 1.1.16 1.4.15 1.1.17 1.4.2 1.1.2 1.4.27 1.1.3 1.4.28 1.1.5 1.4.29 1.1.6 1.4.30 1.1.8 1.4.4 1.1.9 1.4.48 1.10.1 1.4.5 1.10.3 1.4.6 1.11.1 1.4.7
updraftplus / includes / updraftplus-tour.php
updraftplus / includes Last commit date
Dropbox2 6 years ago Google 6 years ago checkout-embed 6 years ago cloudfiles 12 years ago handlebars 6 years ago images 9 years ago jquery.serializeJSON 7 years ago jstree 6 years ago labelauty 6 years ago tether 6 years ago tether-shepherd 7 years ago updraftclone 6 years ago S3.php 6 years ago S3compat.php 6 years ago cacert.pem 6 years ago class-backup-history.php 6 years ago class-commands.php 6 years ago class-database-utility.php 6 years ago class-filesystem-functions.php 6 years ago class-job-scheduler.php 6 years ago class-manipulation-functions.php 7 years ago class-partialfileservlet.php 9 years ago class-remote-send.php 6 years ago class-semaphore.php 6 years ago class-storage-methods-interface.php 6 years ago class-udrpc.php 6 years ago class-updraft-dashboard-news.php 6 years ago class-updraftcentral-updraftplus-commands.php 8 years ago class-updraftplus-encryption.php 6 years ago class-wpadmin-commands.php 6 years ago class-zip.php 6 years ago ftp.class.php 7 years ago get-cpanel-quota-usage.pl 12 years ago google-extensions.php 9 years ago jquery-ui.custom.css 7 years ago jquery-ui.custom.min.css 7 years ago jquery-ui.custom.min.css.map 7 years ago jquery.blockUI.js 8 years ago jquery.blockUI.min.js 8 years ago updraft-admin-common.js 6 years ago updraft-admin-common.min.js 6 years ago updraft-notices.php 6 years ago updraft-restorer-skin-compatibility.php 6 years ago updraft-restorer-skin.php 6 years ago updraftcentral.php 7 years ago updraftplus-clone.php 6 years ago updraftplus-login.php 7 years ago updraftplus-notices.php 6 years ago updraftplus-tour.php 7 years ago updraftvault.php 6 years ago
updraftplus-tour.php
291 lines
1 <?php
2 if (!defined('ABSPATH')) die('No direct access allowed');
3 /**
4 * Class UpdraftPlus_Tour
5 *
6 * Adds the guided tour when activating the plugin for the first time.
7 */
8 class UpdraftPlus_Tour {
9
10 /**
11 * The class instance
12 *
13 * @var object
14 */
15 protected static $instance;
16
17 /**
18 * Get the instance
19 *
20 * @return object
21 */
22 public static function get_instance() {
23 if (!self::$instance) {
24 self::$instance = new self();
25 }
26 return self::$instance;
27 }
28
29 /**
30 * __construct
31 */
32 private function __construct() {
33 }
34
35 /**
36 * Sets up the notices, security and loads assets for the admin page
37 */
38 public function init() {
39 // Add plugin action link
40 add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
41
42 // only init and load assets if the tour hasn't been canceled
43 if (isset($_REQUEST['updraftplus_tour']) && 0 === intval($_REQUEST['updraftplus_tour'])) {
44 $this->set_tour_status(array('current_step' => 'start'));
45 return;
46 }
47
48 // if backups already exist and
49 if ($this->updraftplus_was_already_installed() && !isset($_REQUEST['updraftplus_tour'])) {
50 return;
51 }
52
53 // if 'Take tour' link was used, reset tour
54 if (isset($_REQUEST['updraftplus_tour']) && 1 === intval($_REQUEST['updraftplus_tour'])) {
55 $this->reset_tour_status();
56 }
57
58 if (!UpdraftPlus_Options::get_updraft_option('updraftplus_tour_cancelled_on')) {
59 add_action('admin_enqueue_scripts', array($this, 'load_tour'));
60 }
61 }
62
63 /**
64 * Loads in tour assets
65 *
66 * @param string $hook - current page
67 */
68 public function load_tour($hook) {
69
70 $pages = array('settings_page_updraftplus', 'plugins.php');
71
72 if (!in_array($hook, $pages)) return;
73 if (!UpdraftPlus_Options::user_can_manage()) return;
74
75 global $updraftplus, $updraftplus_addons2, $updraftplus_checkout_embed;
76
77 $checkout_embed_5gb_attribute = '';
78 if ($updraftplus_checkout_embed) {
79 $checkout_embed_5gb_attribute = $updraftplus_checkout_embed->get_product('updraftplus-vault-storage-5-gb') ? 'data-embed-checkout="'.apply_filters('updraftplus_com_link', $updraftplus_checkout_embed->get_product('updraftplus-vault-storage-5-gb', UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings')).'"' : '';
80 }
81
82 $script_suffix = $updraftplus->use_unminified_scripts() ? '' : '.min';
83 wp_enqueue_script('updraftplus-tether-js', trailingslashit(UPDRAFTPLUS_URL).'includes/tether/tether'.$script_suffix.'.js', $updraftplus->version, true);
84 wp_enqueue_script('updraftplus-shepherd-js', trailingslashit(UPDRAFTPLUS_URL).'includes/tether-shepherd/shepherd'.$script_suffix.'.js', array('updraftplus-tether-js'), $updraftplus->version, true);
85 wp_enqueue_style('updraftplus-shepherd-css', trailingslashit(UPDRAFTPLUS_URL).'css/tether-shepherd/shepherd-theme-arrows-plain-buttons'.$script_suffix.'.css', false, $updraftplus->version);
86 wp_enqueue_style('updraftplus-tour-css', trailingslashit(UPDRAFTPLUS_URL).'css/updraftplus-tour'.$script_suffix.'.css', false, $updraftplus->version);
87 wp_register_script('updraftplus-tour-js', trailingslashit(UPDRAFTPLUS_URL).'js/tour.js', array('updraftplus-tether-js'), $updraftplus->version, true);
88
89 $tour_data = array(
90 'nonce' => wp_create_nonce('updraftplus-credentialtest-nonce'),
91 'show_tab_on_load' => '#updraft-navtab-status',
92 'next' => __('Next', 'updraftplus'),
93 'back' => __('Back', 'updraftplus'),
94 'skip' => __('Skip this step', 'updraftplus'),
95 'end_tour' => __('End tour', 'updraftplus'),
96 'close' => __('Close', 'updraftplus'),
97 'plugins_page' => array(
98 'title' => __("UpdraftPlus settings", 'updraftplus'),
99 'text' => '<div class="updraftplus-welcome-logo"><img src="'.trailingslashit(UPDRAFTPLUS_URL).'images/ud-logo.png" alt="" /></div><strong>'.__('Welcome to UpdraftPlus', 'updraftplus').'</strong>, '.__("the world’s most trusted backup plugin!", 'updraftplus'),
100 'button' => array(
101 'url' => UpdraftPlus_Options::admin_page_url().'?page=updraftplus',
102 'text' => __('Press here to start!', 'updraftplus')
103 )
104 ),
105 'backup_now' => array(
106 'title' => __('Your first backup', 'updraftplus'),
107 'text' => sprintf(_x('To make a simple backup to your server, press this button. Or to setup regular backups and remote storage, go to %s settings %s', 'updraftplus'), '<strong><a href="#settings" class="js--go-to-settings">', '</a></strong>')
108 ),
109 'backup_options' => array(
110 'title' => __("Manual backup options", 'updraftplus'),
111 'text' => __('Select what you want to backup', 'updraftplus')
112 ),
113 'backup_now_btn' => array(
114 'title' => __("Creating your first backup", 'updraftplus'),
115 'text' => __("Press here to run a manual backup.", 'updraftplus').'<br>'.sprintf(_x("But to avoid server-wide threats backup regularly to remote cloud storage in %s settings %s", 'Translators: %s is a bold tag.', 'updraftplus'), '<strong><a href="#settings" class="js--go-to-settings">', '</a></strong>'),
116 'btn_text' => __('Go to settings', 'updraftplus')
117 ),
118 'backup_now_btn_success' => array(
119 'title' => __('Creating your first backup', 'updraftplus'),
120 'text' => __('Congratulations! Your first backup is running.', 'updraftplus').'<br>'.sprintf(_x('But to avoid server-wide threats backup regularly to remote cloud storage in %s settings %s', 'Translators: %s is a bold tag.', 'updraftplus'), '<strong>', '</strong>'),
121 'btn_text' => __('Go to settings', 'updraftplus')
122 ),
123 'settings_timing' => array(
124 'title' => __("Choose your backup schedule", 'updraftplus'),
125 'text' => __("Choose the schedule that you want your backups to run on.", 'updraftplus')
126 ),
127 'settings_remote_storage' => array(
128 'title' => __("Remote storage", 'updraftplus'),
129 'text' => __("Now select a remote storage destination to protect against server-wide threats. If not, your backups remain on the same server as your site.", 'updraftplus')
130 .'<div class="ud-notice">'
131 .'<h3>'.__('Try UpdraftVault!').'</h3>'
132 .__("UpdraftVault is our remote storage which works seamlessly with UpdraftPlus.", 'updraftplus')
133 .' <a href="'.apply_filters('updraftplus_com_link', 'https://updraftplus.com/updraftvault/').'" target="_blank">'.__('Find out more here.', 'updraftplus').'</a>'
134 .'<p><a href="'.apply_filters('updraftplus_com_link', $updraftplus->get_url('shop_vault_5')).'" target="_blank" '.$checkout_embed_5gb_attribute.' class="button button-primary">'.__('Try UpdraftVault for 1 month for only $1!', 'updraftplus').'</a></p>'
135 .'</div>'
136 ),
137 'settings_more' => array(
138 'title' => __("More settings", 'updraftplus'),
139 'text' => __("Look through the other settings here, making any changes you’d like.", 'updraftplus')
140 ),
141 'settings_save' => array(
142 'title' => __("Save", 'updraftplus'),
143 'text' => __('Press here to save your settings.', 'updraftplus')
144 ),
145 'settings_saved' => array(
146 'title' => __("Save", 'updraftplus'),
147 'text' => __('Congratulations, your settings have successfully been saved.', 'updraftplus')
148 ),
149 'updraft_central' => array(
150 'title' => __("UpdraftCentral", 'updraftplus'),
151 'text' => '<div class="ud-notice">'
152 .'<h3>'.__('Control all your backups in one place', 'updraftplus').'</h3>'
153 .__('Do you have a few more WordPress sites you want to backup? If yes you can save hours by controlling all your backups in one place from UpdraftCentral.', 'updraftplus')
154 .'</div>'
155 ),
156 'premium' => array(
157 'title' => 'UpdraftPlus Premium',
158 'text' => __('Thank you for taking the tour.', 'updraftplus')
159 .'<div class="ud-notice">'
160 .'<h3>'.__('UpdraftPlus Premium and addons', 'updraftplus').'</h3>'
161 .__('UpdraftPlus Premium has many more exciting features!', 'updraftplus').' <a href="'.apply_filters('updraftplus_com_link', 'https://updraftplus.com/shop/updraftplus-premium/').'" target="_blank">'.__('Find out more here.', 'updraftplus').'</a>'
162 .'</div>',
163 'attach_to' => '#updraft-navtab-addons top',
164 'button' => __('Finish', 'updraftplus')
165 ),
166 'vault_selected' => array(
167 'title' => 'UpdraftVault',
168 'text' => _x('To get started with UpdraftVault, select one of the options below:', 'Translators: UpdraftVault is a product name and should not be translated.', 'updraftplus')
169 )
170 );
171
172 if (isset($_REQUEST['tab'])) {
173 $tour_data['show_tab_on_load'] = '#updraft-navtab-'.esc_attr($_REQUEST['tab']);
174 }
175
176 // Change the data for premium users
177 if ($updraftplus_addons2 && method_exists($updraftplus_addons2, 'connection_status')) {
178
179 $tour_data['settings_remote_storage'] = array(
180 'title' => __("Remote storage", 'updraftplus'),
181 'text' => __("Now select a remote storage destination to protect against server-wide threats. If not, your backups remain on the same server as your site.", 'updraftplus')
182 .'<div class="ud-notice">'
183 .'<h3>'.__('Try UpdraftVault!').'</h3>'
184 .__("UpdraftVault is our remote storage which works seamlessly with UpdraftPlus.", 'updraftplus')
185 .' <a href="'.apply_filters('updraftplus_com_link', 'https://updraftplus.com/updraftvault/').'" target="_blank">'.__('Find out more here.', 'updraftplus').'</a>'
186 .'<br>'
187 .__("If you have a valid Premium license, you get 1GB of storage included.", 'updraftplus')
188 .' <a href="'.apply_filters('updraftplus_com_link', 'https://updraftplus.com/shop/updraftplus-vault-storage-5-gb/').'" target="_blank" '.$checkout_embed_5gb_attribute.'>'.__('Otherwise, you can try UpdraftVault for 1 month for only $1!', 'updraftplus').'</a>'
189 .'</div>'
190 );
191
192 if ($updraftplus_addons2->connection_status() && !is_wp_error($updraftplus_addons2->connection_status())) {
193 $tour_data['premium'] = array(
194 'title' => 'UpdraftPlus Premium',
195 'text' => __('Thank you for taking the tour. You are now all set to use UpdraftPlus!', 'updraftplus'),
196 'attach_to' => '#updraft-navtab-addons top',
197 'button' => __('Finish', 'updraftplus')
198 );
199 } else {
200 $tour_data['premium'] = array(
201 'title' => 'UpdraftPlus Premium',
202 'text' => __('Thank you for taking the tour.', 'updraftplus')
203 .'<div class="ud-notice">'
204 .'<h3>'.__('Connect to updraftplus.com', 'updraftplus').'</h3>'
205 .__('Log in here to enable all the features you have access to.', 'updraftplus')
206 .'</div>',
207 'attach_to' => '#updraftplus-addons_options_email right',
208 'button' => __('Finish', 'updraftplus')
209 );
210 }
211 }
212
213 wp_localize_script('updraftplus-tour-js', 'updraftplus_tour_i18n', $tour_data);
214 wp_enqueue_script('updraftplus-tour-js');
215 }
216
217 /**
218 * Removes the tour status so the tour can be seen again
219 *
220 * @return string|WP_Error not visible by the user
221 */
222 public function reset_tour_status() {
223
224 // If the option isn't set, the tour hasn't been cancelled
225 if (!UpdraftPlus_Options::get_updraft_option('updraftplus_tour_cancelled_on')) {
226 // string not visible by the user
227 return 'The tour is still active. Everything should be ok.';
228 }
229
230 $result = UpdraftPlus_Options::delete_updraft_option('updraftplus_tour_cancelled_on');
231 // strings not visible by the user
232 return $result ? 'The tour status was successfully reset' : new WP_Error('update_failed', 'The attempt to update the tour option failed.', array('status' => 409));
233 }
234
235 /**
236 * Updates the stored value for which step the tour ended on
237 *
238 * @param object $request - the http $_REQUEST obj
239 * @return bool
240 */
241 public function set_tour_status($request) {
242 if (!isset($request['current_step'])) return false;
243 return UpdraftPlus_Options::update_updraft_option('updraftplus_tour_cancelled_on', $request['current_step']);
244 }
245
246 /**
247 * Adds the Tour link under the plugin on the plugin screen.
248 *
249 * @param Array $links Set of links for the plugin, before being filtered
250 * @param String $file File name (relative to the plugin directory)
251 * @return Array filtered results
252 */
253 public function plugin_action_links($links, $file) {
254 if (is_array($links) && 'updraftplus/updraftplus.php' === $file) {
255 $links['updraftplus_tour'] = '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&updraftplus_tour=1" class="js-updraftplus-tour">'.__("Take Tour", "updraftplus").'</a>';
256 }
257 return $links;
258 }
259
260 /**
261 * Checks if UDP was newly installed.
262 *
263 * Checks if there are backups, and if there are more than 1,
264 * checks if the folder is older than 1 day old
265 *
266 * @return bool
267 */
268 public function updraftplus_was_already_installed() {
269 // If backups already exist
270 $backup_history = UpdraftPlus_Backup_History::get_history();
271
272 // No backup history
273 if (!$backup_history) return false;
274 if (is_array($backup_history) && 0 === count($backup_history)) {
275 return false;
276 }
277 // If there is at least 1 backup, we check if the folder is older than 1 day old
278 if (0 < count($backup_history)) {
279 $backups_timestamps = array_keys($backup_history);
280 $last_backlup_age = time() - end($backups_timestamps);
281 if (DAY_IN_SECONDS < $last_backlup_age) {
282 // the oldest backup is older than 1 day old, so it's likely that UDP was already installed, and the backups aren't a product of the user testing while doing the tour.
283 return true;
284 }
285 }
286 return false;
287 }
288 }
289
290 add_action('admin_init', array(UpdraftPlus_Tour::get_instance(), 'init'));
291