splash screen on activation
$('.updraftplus-welcome .close').on('click', function(e) {
$(this).closest('.updraftplus-welcome').remove();
// if Shepherd is undefined, exit.
if (!window.Shepherd) return;
var button_classes = 'button button-primary';
var plugins_page_tour = window.updraft_plugins_page_tour = new Shepherd.Tour();
var main_tour = window.updraft_main_tour = new Shepherd.Tour();
// Set up the defaults for each step
main_tour.options.defaults = plugins_page_tour.options.defaults = {
classes: 'shepherd-theme-arrows-plain-buttons shepherd-main-tour',
plugins_page_tour.addStep('intro', {
title: updraftplus_tour_i18n.plugins_page.title,
text: updraftplus_tour_i18n.plugins_page.text,
attachTo: '.js-updraftplus-settings top',
text: updraftplus_tour_i18n.plugins_page.button.text,
window.location = updraftplus_tour_i18n.plugins_page.button.url;
$('body').addClass('highlight-udp');
// var target = $(this.tether.target);
$('body, html').animate({
scrollTop: popup.offset().top - 50
window.scrollTo(0, popup.offset().top - 50);
$('body').removeClass('highlight-udp');
main_tour.addStep('backup_now', {
title: updraftplus_tour_i18n.backup_now.title,
text: updraftplus_tour_i18n.backup_now.text,
attachTo: '#updraft-backupnow-button bottom',
text: updraftplus_tour_i18n.end_tour,
text: updraftplus_tour_i18n.next,
$('#updraft-navtab-settings').trigger('click');
main_tour.addStep('backup_options', {
title: updraftplus_tour_i18n.backup_options.title,
text: updraftplus_tour_i18n.backup_options.text,
classes: 'shepherd-theme-arrows-plain-buttons shepherd-main-tour super-index',
attachTo: '#backupnow_includedb left',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
$('#updraft-backupnow-modal').dialog('close');
text: updraftplus_tour_i18n.next,
main_tour.addStep('backup_now_btn', {
title: updraftplus_tour_i18n.backup_now_btn.title,
text: updraftplus_tour_i18n.backup_now_btn.text,
classes: 'shepherd-theme-arrows-plain-buttons shepherd-main-tour super-index',
attachTo: '.js-tour-backup-now-button top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
text: updraftplus_tour_i18n.backup_now_btn.btn_text,
$('#updraft-backupnow-modal').dialog('close');
$('#updraft-navtab-settings').trigger('click');
// Congratulations - Shows when a user clicks "backup now" in the modal
main_tour.addStep('backup_now_btn_success', {
title: updraftplus_tour_i18n.backup_now_btn_success.title,
text: updraftplus_tour_i18n.backup_now_btn_success.text,
attachTo: '#updraft_activejobs_table top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
$('#updraft-backupnow-button').trigger('click');
main_tour.show('backup_now_btn');
text: updraftplus_tour_i18n.backup_now_btn_success.btn_text,
$('#updraft-navtab-settings').trigger('click');
$(window).trigger('scroll');
main_tour.addStep('settings_timing', {
title: updraftplus_tour_i18n.settings_timing.title,
text: updraftplus_tour_i18n.settings_timing.text,
attachTo: '.retain-files right',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
$('#updraft-navtab-backups').trigger('click');
text: updraftplus_tour_i18n.next,
tetherOptions: $.extend({}, main_tour.options.defaults.tetherOptions, {
// Settings - Remote storage + vault
main_tour.addStep('settings_remote_storage', {
title: updraftplus_tour_i18n.settings_remote_storage.title,
text: updraftplus_tour_i18n.settings_remote_storage.text,
element: 'label[for=updraft_servicecheckbox_updraftvault]',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
text: updraftplus_tour_i18n.next,
if ($('#updraft_servicecheckbox_updraftvault').is(':checked')) {
main_tour.show('vault_selected')
$('label[for=updraft_servicecheckbox_updraftvault]').addClass('emphasize');
$('label[for=updraft_servicecheckbox_updraftvault]').removeClass('emphasize');
// Settings - more + updraftcentral
main_tour.addStep('settings_more', {
title: updraftplus_tour_i18n.settings_more.title,
text: updraftplus_tour_i18n.settings_more.text,
attachTo: '.js-tour-settings-more top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
text: updraftplus_tour_i18n.next,
main_tour.addStep('settings_save', {
title: updraftplus_tour_i18n.settings_save.title,
text: updraftplus_tour_i18n.settings_save.text,
attachTo: '#updraftplus-settings-save top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
text: updraftplus_tour_i18n.next,
if ($('#updraftcentral_cloud_connect_container').length) {
main_tour.show('updraft_central');
$('#updraft-navtab-addons').trigger('click');
main_tour.addStep('updraft_central', {
title: updraftplus_tour_i18n.updraft_central.title,
text: updraftplus_tour_i18n.updraft_central.text,
attachTo: '#updraftcentral_cloud_connect_container top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
text: updraftplus_tour_i18n.next,
$('#updraft-navtab-addons').trigger('click');
main_tour.addStep('premium', {
title: updraftplus_tour_i18n.premium.title,
text: updraftplus_tour_i18n.premium.text,
attachTo: updraftplus_tour_i18n.premium.attach_to,
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
main_tour.going_somewhere = true;
$('#updraft-navtab-settings').trigger('click');
if ($('#updraftcentral_cloud_connect_container').length) {
main_tour.show('updraft_central');
main_tour.show('settings_save');
text: updraftplus_tour_i18n.premium.button,
main_tour.addStep('vault_selected', {
title: updraftplus_tour_i18n.vault_selected.title,
text: updraftplus_tour_i18n.vault_selected.text,
attachTo: '#updraftvault_settings_cell top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
main_tour.show('settings_remote_storage');
text: updraftplus_tour_i18n.next,
main_tour.show('settings_more');
main_tour.addStep('settings_saved', {
title: updraftplus_tour_i18n.settings_saved.title,
text: updraftplus_tour_i18n.settings_saved.text,
attachTo: '#updraftplus-settings-save top',
classes: 'udp-tour-back',
text: updraftplus_tour_i18n.back,
main_tour.show('settings_more');
text: updraftplus_tour_i18n.next,
if ($('#updraftcentral_cloud_connect_container').length) {
main_tour.show('updraft_central');
$('#updraft-navtab-addons').trigger('click');
main_tour.steps.forEach(function(step) {
step.once('show', function() {
// Adds a Close label near the (x)
var close_btn = $(this.el).find('header .shepherd-cancel-link');
close_btn.attr('data-btntext', updraftplus_tour_i18n.close);
// opens the settings tab
$(this.el).find('.js--go-to-settings').on('click', function(e) {
$('#updraft-navtab-settings').trigger('click');
main_tour.on('cancel', cancel_tour);
plugins_page_tour.on('cancel', cancel_tour);
// The tour is either finished or [x] was clicked
main_tour.canceled = true;
current_step: this.getCurrentStep().id
if ('function' === typeof updraft_send_command) {
console.log('Successfully deactivated tour');
{ alert_on_error: false }
subaction: 'set_tour_status',
nonce: updraftplus_tour_i18n.nonce,
current_step: this.getCurrentStep().id