­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ function updraft_send_command(t,e,r,n){for(var a in default_options={json_parse:!0,alert_on_error:!0,action:"updraft_ajax",nonce:updraft_credentialtest_nonce,nonce_key:"nonce",timeout:null,async:!0,type:"POST"},void 0===n&&(n={}),default_options)n.hasOwnProperty(a)||(n[a]=default_options[a]);var o={action:n.action,subaction:t};if(o[n.nonce_key]=n.nonce,"object"==typeof e)for(var d in e)o[d]=e[d];else o.action_data=e;t={type:n.type,url:ajaxurl,data:o,success:function(e,t){if(n.json_parse){try{var a=ud_parse_json(e)}catch(t){return"function"==typeof n.error_callback?n.error_callback(e,t,502,a):(console.log(t),console.log(e),void(n.alert_on_error&&alert(updraftlion.unexpectedresponse+" "+e)))}if(a.hasOwnProperty("fatal_error"))return"function"==typeof n.error_callback?n.error_callback(e,t,500,a):(console.error(a.fatal_error_message),n.alert_on_error&&alert(a.fatal_error_message),!1);"function"==typeof r&&r(a,t,e)}else"function"==typeof r&&r(e,t)},error:function(t,e,a){"function"==typeof n.error_callback?n.error_callback(t,e,a):(console.log("updraft_send_command: error: "+e+" ("+a+")"),console.log(t))},dataType:"text",async:n.async};null!=n.timeout&&(t.timeout=n.timeout),jQuery.ajax(t)}function updraft_delete(t,e,a){jQuery("#updraft_delete_timestamp").val(t),jQuery("#updraft_delete_nonce").val(e),a?jQuery("#updraft-delete-remote-section, #updraft_delete_remote").prop("disabled",!1).show():jQuery("#updraft-delete-remote-section, #updraft_delete_remote").hide().attr("disabled","disabled"),-1')}function updraft_check_overduecrons(){updraft_send_command("check_overdue_crons",null,function(t){if(t&&t.hasOwnProperty("m")&&Array.isArray(t.m))for(var e in t.m)jQuery("#updraft-insert-admin-warning").append(t.m[e])},{alert_on_error:!1})}function updraft_remote_storage_tabs_setup(){var t,r=0,n=jQuery(".updraft_servicecheckbox:checked"),e=(jQuery(n).each(function(t,e){var a=jQuery(e).val();"updraft_servicecheckbox_none"!=jQuery(e).attr("id")&&r++,jQuery(".remote-tab-"+a).show(),t==jQuery(n).length-1&&updraft_remote_storage_tab_activation(a)}),0?
'+updraftlion.updraftvault_info+"
"),e.append(t))}function updraft_remote_storage_test(t,a,e){var n,e=e?(n=jQuery("#updraft-"+t+"-test-"+e),".updraftplusmethod."+t+"-"+e):(n=jQuery("#updraft-"+t+"-test"),".updraftplusmethod."+t),o=n.data("method_label"),d=(n.html(updraftlion.testing_settings.replace("%s",o)),{method:t});jQuery("#updraft-navtab-settings-content "+e+" input[data-updraft_settings_test], #updraft-navtab-settings-content .expertmode input[data-updraft_settings_test]").each(function(t,e){var a,r=jQuery(e).data("updraft_settings_test"),n=jQuery(e).attr("type");r&&(n||(console.log("UpdraftPlus: settings test input item with no type found"),console.log(e),n="text"),a=null,"checkbox"==n?a=jQuery(e).is(":checked")?1:0:"text"==n||"password"==n||"hidden"==n?a=jQuery(e).val():(console.log("UpdraftPlus: settings test input item with unrecognised type ("+n+") found"),console.log(e)),d[r]=a)}),jQuery("#updraft-navtab-settings-content "+e+" textarea[data-updraft_settings_test], #updraft-navtab-settings-content "+e+" select[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test");d[a]=jQuery(e).val()}),updraft_send_command("test_storage_settings",d,function(t,e){n.html(updraftlion.test_settings.replace("%s",o)),void 0!==(a=void 0!==a&&0!=a?a.call(this,t,e,d):a)&&!1===a&&(alert(updraftlion.settings_test_result.replace("%s",o)+" "+t.output),t.hasOwnProperty("data")&&console.log(t.data))},{error_callback:function(t,e,a,r){n.html(updraftlion.test_settings.replace("%s",o)),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})}function backupnow_whichfiles_checked(a){return jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(t){var e;!jQuery(this).is(":checked")||"updraft_include_"==(e=jQuery(this).attr("name")).substring(0,16)&&(e=e.substring(16),""!=a&&(a+=","),a+=e)}),a}function backupnow_whichtables_checked(t){var e=!1;return jQuery("#backupnow_database_moreoptions .updraft_db_entity").each(function(t){(!jQuery(this).is(":checked")||jQuery(this).is(":checked")&&jQuery(this).data("non_wp_table"))&&(e=!0)}),t=jQuery("input[name^='updraft_include_tables_']").serializeArray(),!e||t}function updraft_deleteallselected(){var a="",r="",n=0;jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").each(function(t){0;var e=jQuery(this).data("nonce"),e=(r&&(r+=","),r+=e,jQuery(this).data("key"));a&&(a+=","),a+=e,jQuery(this).find(".updraftplus-remove").data("hasremote")&&n++}),updraft_delete(a,r,n)}function updraft_open_main_tab(e){updraftlion.main_tabs_keys.forEach(function(t){e==t?(jQuery("#updraft-navtab-"+t+"-content").show(),jQuery("#updraft-navtab-"+t).addClass("nav-tab-active")):(jQuery("#updraft-navtab-"+t+"-content").hide(),jQuery("#updraft-navtab-"+t).removeClass("nav-tab-active")),updraft_console_focussed_tab=e})}function updraft_openrestorepanel(t){updraft_historytimertoggle(t),updraft_open_main_tab("backups")}function updraft_delete_old_dirs(){return!0}function updraft_initiate_restore(t){jQuery('#updraft-navtab-backups-content .updraft_existing_backups button[data-backup_timestamp="'+t+'"]').trigger("click")}function updraft_restore_setoptions(n){jQuery('input[name="updraft_restore[]"]').each(function(t,e){var a=jQuery(e).val(),r=new RegExp(a+"=([0-9,]+)"),r=n.match(r);r?(jQuery(e).prop("disabled",!1).data("howmany",r[1]).parent().show(),"db"==a&&0,jQuery(e).is(":checked")&&jQuery("#updraft_restorer_"+a+"options").show()):jQuery(e).attr("disabled","disabled").parent().hide()});n.match(/dbcrypted=1/)?(jQuery("#updraft_restore_db").data("encrypted",1),jQuery(".updraft_restore_crypteddb").show()):(jQuery("#updraft_restore_db").data("encrypted",0),jQuery(".updraft_restore_crypteddb").hide()),jQuery("#updraft_restore_db").trigger("change");var t=n.match(/meta_foreign=([12])/);t?jQuery("#updraft_restore_meta_foreign").val(t[1]):jQuery("#updraft_restore_meta_foreign").val("0")}function updraft_backup_dialog_open(t){t=void 0===t?"new":t,0==jQuery("#updraftplus_incremental_backup_link").data("incremental")&&"incremental"==t?(jQuery("#updraft-backupnow-modal .incremental-free-only").show(),t="new"):jQuery("#updraft-backupnow-modal .incremental-backups-only, #updraft-backupnow-modal .incremental-free-only").hide(),jQuery("#backupnow_includefiles_moreoptions").hide(),updraft_settings_form_changed&&!window.confirm(updraftlion.unsavedsettingsbackup)||(jQuery("#backupnow_label").val(""),"incremental"==t?(update_file_entities_checkboxes(!0,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!1),jQuery("#backupnow_includefiles").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_incremental_backup),jQuery("#updraft-backupnow-modal .new-backups-only").hide(),jQuery("#updraft-backupnow-modal .incremental-backups-only").show()):(update_file_entities_checkboxes(!1,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_new_backup),jQuery("#updraft-backupnow-modal .new-backups-only").show(),jQuery("#updraft-backupnow-modal .incremental-backups-only").hide()),jQuery("#updraft-backupnow-modal").data("backup-type",t),jQuery("#updraft-backupnow-modal").dialog("open"))}function update_file_entities_checkboxes(t,e){t?jQuery(e).each(function(t,e){jQuery("#backupnow_files_updraft_include_"+e).prop("checked",!1),jQuery("#backupnow_files_updraft_include_"+e).prop("disabled",!0)}):jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(t){var e=jQuery(this).attr("name");"updraft_include_"==e.substring(0,16)&&(e=e.substring(16),jQuery("#backupnow_files_updraft_include_"+e).prop("disabled",!1),jQuery("#updraft_include_"+e).is(":checked")&&jQuery("#backupnow_files_updraft_include_"+e).prop("checked",!0))})}var impossible_increment_entities,updraft_poplog_log_nonce,onlythesefileentities=backupnow_whichfiles_checked(""),updraft_restore_stage=(""==onlythesefileentities?jQuery("#backupnow_includefiles_moreoptions").show():jQuery("#backupnow_includefiles_moreoptions").hide(),1),lastlog_lastmessage="",lastlog_lastdata="",lastlog_jobs="",updraft_activejobs_nextupdate=(new Date).getTime()+1e3,updraft_page_is_visible=1,updraft_console_focussed_tab=updraftlion.tab,php_max_input_vars=0,skipped_db_scan=0,updraft_settings_form_changed=!1;function updraft_check_page_visibility(t){"hidden"==document.visibilityState?updraft_page_is_visible=0:(updraft_page_is_visible=1)!==t&&jQuery("#updraft-navtab-backups-content").length&&updraft_activejobs_update(!0)}window.onbeforeunload=function(t){if(updraft_settings_form_changed)return updraftlion.unsavedsettings},void 0!==document.hidden&&document.addEventListener("visibilitychange",function(){updraft_check_page_visibility(0)},!1),updraft_check_page_visibility(1);var updraft_activejobs_update_timer,temporary_clone_timeout,updraft_poplog_log_pointer=0,updraft_poplog_lastscroll=-1,updraft_last_forced_jobid=-1,updraft_last_forced_resumption=-1,updraft_last_forced_when=-1,updraft_backupnow_nonce="",updraft_activejobslist_backupnownonce_only=0,updraft_inpage_hasbegun=0,updraft_aborted_jobs=[],updraft_clone_jobs=[],updraft_backups_selection={};function setup_migrate_tabs(){jQuery("#updraft_migrate .updraft_migrate_widget_module_content").each(function(t,e){var a=jQuery(e).find("h3").first().html(),r=jQuery(".updraft_migrate_intro");jQuery('"}),setTimeout(jQuery.unblockUI,5e3),jQuery(".blockUI .updraft-close-overlay").on("click",function(){jQuery.unblockUI()})}function updraft_popuplog(t){var e=updraftlion.loading_log_file;t&&(e+=" (log."+t+".txt)"),jQuery("#updraft-poplog").dialog("option","title",e),jQuery("#updraft-poplog-content").html(""+e+" ... "),jQuery("#updraft-poplog").dialog("open"),updraft_send_command("get_log",t,function(t){updraft_poplog_log_pointer=t.pointer,updraft_poplog_log_nonce=t.nonce;var e="?page=updraftplus&action=downloadlog&force_download=1&updraftplus_backup_nonce="+t.nonce,a=(jQuery("#updraft-poplog-content").html(t.log),{});a[updraftlion.downloadlogfile]=function(){window.location.href=e},a[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-poplog").dialog("option","buttons",a),jQuery("#updraft-poplog").dialog("option","title","log."+t.nonce+".txt"),updraft_poplog_lastscroll=-1},{type:"GET",timeout:6e4,error_callback:function(t,e,a,r){void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),jQuery("#updraft-poplog-content").append(r.fatal_error_message)):(r=e==a?a:a+" ("+e+")",jQuery("#updraft-poplog-content").append(r),console.log(t))}})}function updraft_showlastbackup(){updraft_send_command("get_fragment","last_backup_html",function(t){response=t.output,lastbackup_laststatus==response?setTimeout(function(){updraft_showlastbackup()},7e3):jQuery("#updraft_last_backup").html(response),lastbackup_laststatus=response},{type:"GET"})}var updraft_historytimer=0,calculated_diskspace=0,updraft_historytimer_notbefore=0,updraft_history_lastchecksum=!1;function updraft_historytimertoggle(t){updraft_historytimer&&1!=t?(clearTimeout(updraft_historytimer),updraft_historytimer=0):(updraft_updatehistory(0,0),updraft_historytimer=setInterval(function(){updraft_updatehistory(0,0)},3e4),calculated_diskspace||(updraftplus_diskspace(),calculated_diskspace=1))}function updraft_updatehistory(t,e,a,r){if("undefined"==typeof updraft_restore_screen||!updraft_restore_screen){void 0===a&&(a=jQuery("#updraft_debug_mode").is(":checked")?1:0);var n=Math.round((new Date).getTime()/1e3);if(1==t||1==e)updraft_historytimer_notbefore=n+30;else if(n'+updraftlion.rescanningremote+"

")):(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('

'+updraftlion.rescanning+"

"))),updraft_send_command("rescan",{operation:e?"remotescan":!!t&&"rescan",debug:a,backup_count:r},function(t){if(t.hasOwnProperty("logs_exist")&&t.logs_exist&&jQuery("#updraft_lastlogmessagerow .updraft-log-link").show(),t.hasOwnProperty("migrate_tab")&&t.migrate_tab&&(jQuery("#updraft-navtab-migrate").hasClass("nav-tab-active")||(jQuery("#updraft_migrate_tab_alt").html(""),jQuery("#updraft_migrate").replaceWith(jQuery(t.migrate_tab).find("#updraft_migrate")),setup_migrate_tabs())),t.hasOwnProperty("web_server_disk_space")&&(""==t.web_server_disk_space?(console.log("UpdraftPlus: web_server_disk_space is empty"),jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length&&jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").slideUp("slow",function(){jQuery(this).remove()})):jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length?jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").replaceWith(t.web_server_disk_space):jQuery("#updraft-navtab-backups-content .updraft-disk-space-actions").prepend(t.web_server_disk_space)),update_backupnow_modal(t),t.hasOwnProperty("backupnow_file_entities")&&(impossible_increment_entities=t.backupnow_file_entities),null!=t.n&&jQuery("#updraft-existing-backups-heading").html(t.n),null!=t.t){if(null!=t.cksum){if(t.cksum==updraft_history_lastchecksum)return;updraft_history_lastchecksum=t.cksum}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html(t.t),updraft_backups_selection.checkSelectionStatus(),t.data&&console.log(t.data)}})}}function update_backupnow_modal(t){t.hasOwnProperty("modal_afterfileoptions")&&jQuery(".backupnow_modal_afterfileoptions").html(t.modal_afterfileoptions)}function updraft_exclude_entity_update(t){var e=[];jQuery("#updraft_include_"+t+"_exclude_container .updraft_exclude_entity_wrapper .updraft_exclude_entity_field").each(function(){var t=jQuery(this).data("val").toString().trim();""!=t&&e.push(t)}),jQuery("#updraft_include_"+t+"_exclude").val(e.join(","))}function updraft_is_unique_exclude_rule(t,e){return existing_exclude_rules_str=jQuery("#updraft_include_"+e+"_exclude").val(),existing_exclude_rules=existing_exclude_rules_str.split(","),!(-1'+updraftlion.day+" ").after(' '+updraftlion.inthemonth+" ")):(jQuery(".updraft_monthly_extra_words_"+t).remove(),r?(updraft_interval_week_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.mdayselector).before(''+updraftlion.day+" ").after(' '+updraftlion.inthemonth+" "),n=!1===updraft_interval_month_val?1:updraft_interval_month_val,n-=1,jQuery(a+" option").eq(n).prop("selected",!0)):(updraft_interval_month_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.dayselector),e=!1===updraft_interval_week_val?1:updraft_interval_week_val,jQuery(a+" option").eq(e).prop("selected",!0))))}function updraft_check_same_times(){var t=0,e=jQuery("#updraft-navtab-settings-content .updraft_interval").val(),a=("manual"==e?jQuery("#updraft-navtab-settings-content .updraft_files_timings").hide():jQuery("#updraft-navtab-settings-content .updraft_files_timings").show(),"weekly"==e||"fortnightly"==e||"monthly"==e?(updraft_intervals_monthly_or_not("updraft_startday_files",e),jQuery("#updraft-navtab-settings-content #updraft_startday_files").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_files").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_files").hide()),jQuery("#updraft-navtab-settings-content .updraft_interval_database").val());"manual"==a&&(t=1,jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide()),"weekly"==a||"fortnightly"==a||"monthly"==a?(updraft_intervals_monthly_or_not("updraft_startday_db",a),jQuery("#updraft-navtab-settings-content #updraft_startday_db").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_db").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_db").hide()),a==e?(jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide(),0==t?jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").show():jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide()):(jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide(),0==t&&jQuery("#updraft-navtab-settings-content .updraft_db_timings").show())}function updraft_activejobs_delete(a){updraft_aborted_jobs[a]=1,jQuery("#updraft-jobid-"+a).closest(".updraft_row").addClass("deleting"),updraft_send_command("activejobs_delete",a,function(t){var e=jQuery("#updraft-jobid-"+a).closest(".updraft_row");e.addClass("deleting"),"Y"==t.ok?(jQuery("#updraft-jobid-"+a).html(t.m),e.remove(),jQuery("#updraft-backupnow-inpage-modal").dialog("isOpen")&&jQuery("#updraft-backupnow-inpage-modal").dialog("close"),updraft_show_success_modal({message:updraft_active_job_is_clone(a)?updraftlion.clone_backup_aborted:updraftlion.backup_aborted,icon:"no-alt",classes:"warning"})):"N"==t.ok?(e.removeClass("deleting"),alert(t.m)):(e.removeClass("deleting"),alert(updraftlion.unexpectedresponse),console.log(t))})}function updraftplus_diskspace_entity(e){jQuery("#updraft_diskspaceused_"+e).html(""+updraftlion.calculating+""),updraft_send_command("get_fragment",{fragment:"disk_usage",data:e},function(t){jQuery("#updraft_diskspaceused_"+e).html(t.output)},{type:"GET"})}function updraft_active_job_is_clone(e){return updraft_clone_jobs.filter(function(t){return t==e}).length}function updraft_iframe_modal(t,e){jQuery("#updraft-iframe-modal-innards").html(''),jQuery("#updraft-iframe-modal").dialog({title:e,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){jQuery(this).dialog("option","width",780),jQuery(this).dialog("option","minHeight",260),500r?jQuery(this).dialog("option","height",r):jQuery(this).dialog("option","height",jQuery(window).height()-30)}}).dialog("open")}function updraftplus_diskspace(){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(""+updraftlion.calculating+""),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(t.output)},{type:"GET"})}"undefined"!=typeof updraft_siteurl&&setInterval(function(){jQuery.get(updraft_siteurl+"/wp-cron.php")},21e4);lastlog_lastmessage="";function updraftplus_deletefromserver(t,e,a){updraft_send_command("updraft_download_backup",{stage:"delete",timestamp:t,type:e,findex:a=a||0},null,{action:"updraft_download_backup",nonce:updraft_download_nonce,nonce_key:"_wpnonce"})}function updraftplus_downloadstage2(t,e,a){location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"×tamp="+t+"&type="+e+"&stage=2&findex="+a+"&action=updraft_download_backup"}function updraftplus_show_contents(t,e,a){updraft_html_modal('

'+updraftlion.zip_file_contents_info+' -

'+updraftlion.browse_download_link+'
',updraftlion.zip_file_contents,780,500),zip_files_jstree("zipbrowser",t,e,a)}function zip_files_jstree(a,r,n,o){jQuery("#updraft_zip_files_jstree").jstree({core:{multiple:!1,data:function(t,e){updraft_send_command("get_jstree_directory_nodes",{entity:a,node:t,timestamp:r,type:n,findex:o},function(t){t.hasOwnProperty("error")?alert(t.error):e.call(this,t.nodes)},{error_callback:function(t,e,a,r){void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('

'+r.fatal_error_message+"

"),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",jQuery("#updraft_zip_files_jstree").html('

'+r+"

"),console.log(r),alert(r),console.log(t))}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["search","sort"]}),jQuery("#updraft_zip_files_jstree").on("ready.jstree",function(t,e){jQuery("#updraft-iframe-modal").dialog("option","title",updraftlion.zip_file_contents+": "+e.instance.get_node("#").children[0])});var t=!1;jQuery("#zip_files_jstree_search").on("keyup",function(){t&&clearTimeout(t),t=setTimeout(function(){var t=jQuery("#zip_files_jstree_search").val();jQuery("#updraft_zip_files_jstree").jstree(!0).search(t)},250)}),jQuery("#updraft_zip_files_jstree").on("changed.jstree",function(t,e){jQuery("#updraft_zip_path_text").text(e.node.li_attr.path),e.node.li_attr.size?(jQuery("#updraft_zip_size_text").text(e.node.li_attr.size),jQuery("#updraft_zip_download_item").show()):(jQuery("#updraft_zip_size_text").text(""),jQuery("#updraft_zip_download_item").hide())}),jQuery("#updraft_zip_download_item").on("click",function(t){t.preventDefault(),updraft_send_command("get_zipfile_download",{path:jQuery("#updraft_zip_path_text").text(),timestamp:r,type:n,findex:o},function(t){t.hasOwnProperty("error")?alert(t.error):t.hasOwnProperty("path")?location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"×tamp="+r+"&type="+n+"&stage=2&findex="+o+"&filepath="+t.path+"&action=updraft_download_backup":alert(updraftlion.download_timeout)},{error_callback:function(t,e,a,r){void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})})}function remove_updraft_downloader(t,e){jQuery(t).closest(".updraftplus_downloader").fadeOut().remove(),0==jQuery(".updraftplus_downloader_container_"+e+" .updraftplus_downloader").length&&jQuery(".updraftplus_downloader_container_"+e).remove()}function updraft_downloader(t,e,a,p,r,n,o){"string"!=typeof r&&(r=r.toString()),jQuery(".ud_downloadstatus").show();var r=r.split(","),n=n||e,l=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+r[0]).data("wp_nonce").toString();jQuery(".updraftplus_downloader_container_"+a).length||(jQuery(p).append('
'),jQuery(".updraftplus_downloader_container_"+a).append(''+updraftlion.download+" "+a+" ("+n+"):"));for(var d=0;d'+a+s+':
'+updraftlion.begunlooking+'
'),jQuery(i).data("downloaderfor",{base:t,nonce:e,what:a,index:r[d]}),setTimeout(function(){updraft_activejobs_update(!0)},1500)),jQuery(i).data("lasttimebegan",(new Date).getTime())}return updraft_send_command("updraft_download_backup",{type:a,timestamp:e,findex:r},function(t){},{action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:l,timeout:1e4,async:o=!!o}),!1}function ud_parse_json(e,a){if(!(a=void 0!==a))try{return JSON.parse(e)}catch(t){console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse based upon first/last curly brackets"),console.log(e)}var r=e.indexOf("{"),n=e.lastIndexOf("}");if(-1 '+updraftlion.preparing_backup_files),updraft_send_command("restore_alldownloaded",{timestamp:jQuery("#updraft_restore_timestamp").val(),restoreopts:jQuery("#updraft_restore_form").serialize()},function(e,t,a){var r=null;jQuery("#updraft_restorer_restore_options").val(""),jQuery(".updraft-restore--next-step").prop("disabled",!1);try{if(null==e)return void jQuery("#updraft-restore-modal-stage2a").html(updraftlion.emptyresponse);var n=e.m;if(""!=e.w&&(n=n+'

'+updraftlion.warnings+"

"+e.w+"
"),""!=e.e?n=n+'

'+updraftlion.errors+"

"+e.e+"
":updraft_restore_stage=3,e.hasOwnProperty("i")){try{(r=ud_parse_json(e.i)).hasOwnProperty("addui")&&(console.log("Further UI options are being displayed"),n+='
'+r.addui+"
","object"==typeof JSON&&"function"==typeof JSON.stringify&&(delete r.addui,e.i=JSON.stringify(r))),r.hasOwnProperty("php_max_input_vars")&&(php_max_input_vars=parseInt(r.php_max_input_vars)),r.hasOwnProperty("skipped_db_scan")&&(skipped_db_scan=parseInt(r.skipped_db_scan))}catch(t){console.log(t),console.log(e)}jQuery("#updraft_restorer_backup_info").val(e.i)}else jQuery("#updraft_restorer_backup_info").val();jQuery("#updraft-restore-modal-stage2a").html(n),jQuery(".updraft-restore--next-step").text(updraftlion.restore),0'+r.fatal_error_message+"

"),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",jQuery("#updraft-restore-modal-stage2a").html('

'+r+"

"),console.log(r),alert(r),console.log(t))}}))}function updraft_downloader_status(t,e,a,r){}function updraft_downloader_status_update(t,n){var o=0;return jQuery(t).each(function(t,e){var a,r;""!=e.base&&(a="."+(e.base+e.timestamp+"_"+e.what+"_"+e.findex),null!=e.e?(jQuery(a+" .raw").html(""+updraftlion.error+" "+e.e),console.log(e)):null!=e.p?(jQuery(a+"_st .dlfileprogress").width(e.p+"%"),null!=e.a&&0"+updraftlion.downloadtocomputer+' \t\t\t\t",e.hasOwnProperty("can_show_contents")&&e.can_show_contents&&(r+=' "),jQuery(a+" .raw").html(r),jQuery(a+"_st").remove()))):null!=e.m?jQuery(a+" .raw").html(e.m):(jQuery(a+" .raw").html(updraftlion.jsonnotunderstood+" ("+n+")"),o=1))}),o}function updraft_backupnow_go(t,e,a,r,n,o,d,u){var i,t={backupnow_nodb:t,backupnow_nofiles:e,backupnow_nocloud:a,backupnow_label:o,extradata:n};""!=r&&(t.onlythisfileentity=r),""!=d&&(t.onlythesetableentities=d),""!=u&&(t.only_these_cloud_services=u),t.always_keep=void 0!==n.always_keep?n.always_keep:0,delete n.always_keep,t.incremental=void 0!==n.incremental?n.incremental:0,delete n.incremental,t.db_anon_all=void 0!==n.db_anon_all?n.db_anon_all:0,delete n.db_anon_all,t.db_anon_non_staff=void 0!==n.db_anon_non_staff?n.db_anon_non_staff:0,delete n.db_anon_non_staff,jQuery(".updraft_requeststart").length||((i=jQuery('
').html(''+updraftlion.requeststart)).data("remove",!1),setTimeout(function(){i.data("remove",!0)},3e3),setTimeout(function(){i.remove()},75e3),jQuery("#updraft_activejobsrow").before(i)),updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",t,function(t){if(t.hasOwnProperty("error"))return jQuery(".updraft_requeststart").remove(),void alert(t.error);jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),setTimeout(function(){updraft_activejobs_update(!0)},500)})}function updraft_process_status_check(t,e,a){if(t.hasOwnProperty("fatal_error"))return console.error(t.fatal_error_message),void(!0===updraftplus_activejobs_list_fatal_error_alert&&(updraftplus_activejobs_list_fatal_error_alert=!1,alert(this.alert_done+" "+t.fatal_error_message)));try{t.hasOwnProperty("l")&&(t.l?(jQuery("#updraft_lastlogmessagerow").show(),jQuery("#updraft_lastlogcontainer").html(t.l)):(jQuery("#updraft_lastlogmessagerow").hide(),jQuery("#updraft_lastlogcontainer").html("("+updraftlion.nothing_yet_logged+")"))),updraftlion.hasOwnProperty("hosting_restriction")&&updraftlion.hosting_restriction instanceof Array&&(updraftlion.hosting_restriction.length=0,t.hasOwnProperty("hosting_restriction")&&(t.hosting_restriction&&t.hosting_restriction.includes("only_one_backup_per_month")&&updraftlion.hosting_restriction.push("only_one_backup_per_month"),t.hosting_restriction&&t.hosting_restriction.includes("only_one_incremental_per_day")&&updraftlion.hosting_restriction.push("only_one_incremental_per_day"))),jQuery("#updraft-wrap #updraft-navtab-settings-content").is(":hidden")||t.hasOwnProperty("automatic_updates")&&jQuery('input[name="updraft_auto_updates"]').prop("checked",t.automatic_updates);var r,n,o=-1,d=jQuery(".updraft_requeststart"),u=(t.j&&d.length&&d.data("remove")&&d.remove(),jQuery(t.j)),i=(u.find(".updraft_jobtimings").each(function(t,e){var a,e=jQuery(e);e.data("jobid")&&(a=e.data("jobid"),e=e.closest(".updraft_row"),updraft_aborted_jobs[a]&&e.hide())}),jQuery("#updraft_activejobsrow").html(u),u.find('.job-id[data-isclone="1"]'));0updraft_last_forced_when+1e5&&(updraft_last_forced_jobid!=a||e!=updraft_last_forced_resumption)&&(updraft_last_forced_resumption=e,updraft_last_forced_jobid=a,updraft_last_forced_when=timenow,console.log("UpdraftPlus: force resumption: job_id="+a+", resumption="+e),updraft_send_command("forcescheduledresumption",{resumption:e,job_id:a},function(t){console.log(t)},{json_parse:!1,alert_on_error:!1})))}),timenow=(new Date).getTime(),updraft_activejobs_nextupdate=timenow+18e4,1==updraft_page_is_visible&&"backups"==updraft_console_focussed_tab&&(updraft_activejobs_nextupdate=-1"+updraftlion.error+" "+updraftlion.servererrorcode)):0<=a.url.search("subaction=restore_alldownloaded")&&jQuery("#updraft-restore-modal-stage2a").append("
"+updraftlion.error+" "+updraftlion.servererrorcode+": "+r)))}),jQuery(function(m){var e;m(document).on("udp/checkout/done",function(t,e){e.hasOwnProperty("product")&&"updraftpremium"===e.product&&"complete"===e.status&&(m(".premium-upgrade-purchase-success").show(),m(".updraft_feat_table").closest("section").hide(),m(".updraft_premium_cta__action").hide())}),m(".expertmode .advanced_settings_container .advanced_tools_button").on("click",function(){var t;t=m(this).attr("id"),m('.expertmode .advanced_settings_container .advanced_tools:not(".'+t+'")').hide(),m(".expertmode .advanced_settings_container .advanced_tools."+t).fadeIn("slow"),m(".expertmode .advanced_settings_container .advanced_tools_button:not(#"+t+")").removeClass("active"),m(".expertmode .advanced_settings_container .advanced_tools_button#"+t).addClass("active")}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction&&(e=jQuery.ui.dialog.prototype._allowInteraction,jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||e.apply(this,arguments)}),m("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(t){t.preventDefault(),m(this).remove(),m("#updraftcentral_keys_table").slideDown()}),m("#updraftcentral_keycreate_altmethod_moreinfo_get").on("click",function(t){t.preventDefault(),m(this).remove(),m("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),m("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var t,e,r=[],a=(m(".updraft_webdav_settings").each(function(t,e){var a,e=m(e).attr("id");e&&"updraft_webdav_"==e.substring(0,15)&&(e=e.substring(15),e=(id_split=e.split("_"))[0],a=id_split[1],void 0===r[a]&&(r[a]=[]),r[a][e]=this.value)}),"@"),n="/",o=":",d=":";for(e in r)(0<=r[e].host.indexOf("@")||""===r[e].host)&&(a=""),0<=r[e].host.indexOf("/")?m("#updraft_webdav_host_error").show():m("#updraft_webdav_host_error").hide(),0!=r[e].path.indexOf("/")&&""!==r[e].path||(n=""),""!==r[e].user&&""!==r[e].pass||(o=""),""!==r[e].host&&""!==r[e].port||(d=""),t=r[e].webdav+r[e].user+o+r[e].pass+a+encodeURIComponent(r[e].host)+d+r[e].port+n+r[e].path,masked_webdav_url=r[e].webdav+r[e].user+o+r[e].pass.replace(/./gi,"*")+a+encodeURIComponent(r[e].host)+d+r[e].port+n+r[e].path,m("#updraft_webdav_url_"+e).val(t),m("#updraft_webdav_masked_url_"+e).val(masked_webdav_url)}),m("#updraft-navtab-backups-content").on("click",".js--delete-selected-backups",function(t){t.preventDefault(),updraft_deleteallselected()}),m("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .backup-select input",function(t){updraft_backups_selection.toggle(m(this).closest(".updraft_existing_backups_row"))}),m("#updraft-navtab-backups-content").on("click","#cb-select-all",function(t){m(this).is(":checked")?updraft_backups_selection.selectAll():updraft_backups_selection.deselectAll()}),m("#updraft-wrap").on("click","[id^=updraftplus_manual_authorisation_submit_]",function(t){t.preventDefault();var e,t=m(this).data("method"),a=m("#updraftplus_manual_authentication_data_"+t).val();m("#updraftplus_manual_authentication_error_"+t).text(),m("#updraft-wrap #updraftplus_manual_authorisation_template_"+t+" .updraftplus_spinner.spinner").addClass("visible"),m("#updraftplus_manual_authorisation_submit_"+t).prop("disabled",!0),updraft_send_command("manual_remote_storage_authentication",{method:e=t,auth_data:a},function(t){m("#updraft-wrap #updraftplus_manual_authorisation_template_"+e+" .updraftplus_spinner.spinner").removeClass("visible"),t.hasOwnProperty("result")&&"success"===t.result?(m("#updraft-wrap .updraftplus-top-menu").before(t.data),m("#updraft-wrap #updraftplus_manual_authorisation_template_"+e).parent().remove(),m("#updraft-wrap .updraft_authenticate_"+e).remove()):t.hasOwnProperty("result")&&"error"===t.result&&(m("#updraftplus_manual_authentication_error_"+e).text(t.data),m("#updraftplus_manual_authorisation_submit_"+e).prop("disabled",!1))})}),m("#updraft-navtab-backups-content").on("click",".js--select-all-backups",function(t){updraft_backups_selection.selectAll()}),m("#updraft-navtab-backups-content").on("click",".js--deselect-all-backups",function(t){updraft_backups_selection.deselectAll()}),m("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(t){(t.ctrlKey||t.metaKey)&&(t.shiftKey?(void 0===updraft_backups_selection.firstMultipleSelectionIndex?(m(document).on("keyup.MultipleSelection",function(t){updraft_backups_selection.unregister_highlight_mode(),m(document).off(".MultipleSelection")}),updraft_backups_selection.select(this),m(this).addClass("range-selection-start"),updraft_backups_selection.register_highlight_mode()):(updraft_backups_selection.selectAllInBetween(this),jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").removeClass("range-selection")),updraft_backups_selection.firstMultipleSelectionIndex=this.rowIndex-1):updraft_backups_selection.toggle(this))}),updraft_backups_selection.checkSelectionStatus(),m("#updraft-navtab-addons-content .wrap").on("click",".updraftplus_com_login .ud_connectsubmit",function(t){t.preventDefault();var t=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),e=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),a=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,r=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0;n.submit({email:t,password:e,auto_update:a,auto_udc_connect:r})}),m("#updraft-navtab-addons-content .wrap").on("keydown",".updraftplus_com_login input",function(t){var e,a,r;13==t.which&&(t.preventDefault(),t=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),e=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),a=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,r=m("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0,n.submit({email:t,password:e,auto_update:a,auto_udc_connect:r}))}),m("#updraft-navtab-migrate-content").on("click",".updraftclone_show_step_1",function(t){m(".updraftplus-clone").addClass("opened"),m(".updraftclone_show_step_1").hide(),m(".updraft_migrate_widget_temporary_clone_stage1").show(),m(".updraft_migrate_widget_temporary_clone_stage0").hide()}),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_temporary_clone_show_stage0",function(t){t.preventDefault(),m(".updraft_migrate_widget_temporary_clone_stage0").toggle()}),setup_migrate_tabs(),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .close",function(t){m(".updraft_migrate_intro").show(),m(this).closest(".updraft_migrate_widget_module_content").hide()}),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_add_site--trigger",function(t){t.preventDefault(),m(".updraft_migrate_add_site").toggle()}),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_login .ud_connectsubmit",function(t){t.preventDefault();var t=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),e=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),a=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),r=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0;t&&e?o({form_data:{email:t,password:e,two_factor_code:a,consent:r}}):m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html(""+updraftlion.error+" "+updraftlion.username_password_required).show()}),m("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_login input",function(t){var e,a,r;13==t.which&&(t.preventDefault(),t=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),e=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),a=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),r=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0,t&&e?o({form_data:{email:t,password:e,two_factor_code:a,consent:r}}):m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html(""+updraftlion.error+" "+updraftlion.username_password_required).show())}),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_key .ud_key_connectsubmit",function(t){t.preventDefault();var t=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),e=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0;t?a({form_data:{clone_key:t,consent:e}}):m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html(""+updraftlion.error+" "+updraftlion.clone_key_required).show()}),m("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_key input",function(t){var e;13==t.which&&(t.preventDefault(),t=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),e=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0,t?a({form_data:{clone_key:t,consent:e}}):m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html(""+updraftlion.error+" "+updraftlion.clone_key_required).show())}),m("#updraft-navtab-migrate-content").on("change",".updraft_migrate_widget_module_content #updraftplus_clone_php_options",function(){var t=m(this).data("php_version");m(this).val() option").each(function(){var t=m(this).val();"starter"==t&&m('#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options option[value="'+t+'"]').prop("selected",!0),m('#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options option[value="'+t+'"]').prop("disabled",!1)});var a,t=m(this).find("option:selected");"current"!=m(t).data("nonce")&&"wp_only"!=m(t).data("nonce")&&(a=m(t).data("size"),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options > option").each(function(){var t=m(this).data("size"),e=m(this).val();if(!(t<=a))return m('#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options option[value="'+e+'"]').prop("selected",!0),!1;m('#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options option[value="'+e+'"]').prop("disabled",!0)}))}),m("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content #updraft_migrate_createclone",function(t){t.preventDefault(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!0),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(""),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").addClass("visible");var t=m(this).data("clone_id"),e=m(this).data("secret_token"),a=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_php_options").val(),p=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_wp_options").val(),l=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_region_options").val(),_=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_package_options").val(),r=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftclone_branch").val(),n=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftplus_branch").val(),c=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_admin_login_options").is(":checked"),o=m("#updraftplus_clone_use_queue").is(":checked")?1:0,f=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_backupnow_db_anon_all").is(":checked")?1:0,g=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_backupnow_db_anon_non_staff").is(":checked")?1:0,d="current",u="current",i=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_backup_options").length,s=m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_backup_options").find("option:selected"),i=(0!==i&&void 0!==s&&(d=s.data("nonce"),u=s.data("timestamp")),{form_data:{clone_id:t,secret_token:e,install_info:{php_version:a,wp_version:p,region:l,package:_,admin_only:c,updraftclone_branch:void 0===r?"":r,updraftplus_branch:void 0===n?"":n,use_queue:void 0===o?1:o}}}),s={db_anon_all:f,db_anon_non_staff:g};"wp_only"===d&&(i.form_data.install_info.wp_only=1),function t(r,n,o,d){var u="";"current"!=n&&updraft_send_command("whichdownloadsneeded",{updraftplus_clone:!0,timestamp:n},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),u=t.downloads,console.log(u)),0!=u.length)for(var e=0;e'+r.fatal_error_message+"

")):(r="updraft_send_command: error: "+e+" ("+a+")",m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html('

'+r+"

"),console.log(r),console.log(t))}});setTimeout(function(){var e,a;0==u.length?(e=r.form_data.clone_id,a=r.form_data.secret_token,updraft_send_command("process_updraftplus_clone_create",r,function(t){try{if(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").removeClass("visible"),t.hasOwnProperty("status")&&"error"==t.status)return void m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.error+" "+t.message).show();"success"===t.status&&(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").html(t.html),temporary_clone_timeout&&clearTimeout(temporary_clone_timeout),t.hasOwnProperty("secret_token")&&(a=t.secret_token),"wp_only"===o?(jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").addClass("visible"),b(e,a)):(jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").addClass("visible"),h(e,a,t.url,t.key,o,n,d)))}catch(t){m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),console.log("Error when processing the response of process_updraftplus_clone_create (as follows)"),console.log(t)}})):t(r,n,o,d)},5e3)}(i,u,d,s)});var n={};function o(t){m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",t,function(t){try{if(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").removeClass("visible"),t.hasOwnProperty("status")&&"error"==t.status)return m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html(t.message).show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),void m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val("");t.hasOwnProperty("tfa_enabled")&&1==t.tfa_enabled&&(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").trigger("focus")),"authenticated"===t.status&&(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").val(""),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(t.html),t.hasOwnProperty("clone_info")&&t.clone_info.hasOwnProperty("expires_after")&&r(t.clone_info.expires_after))}catch(t){console.log(t)}})}function a(t){m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",t,function(t){try{if(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").removeClass("visible"),t.hasOwnProperty("status")&&"error"==t.status)return void m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html(t.message).show();"authenticated"===t.status&&(m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(t.html),t.hasOwnProperty("clone_info")&&t.clone_info.hasOwnProperty("expires_after")&&r(t.clone_info.expires_after))}catch(t){console.log(t)}})}function r(t){temporary_clone_timeout=setTimeout(function(){m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").hide(),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(""),m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").show()},1e3*t)}function h(t,e,a,r,n,o,d){t={updraftplus_clone_backup:1,backupnow_nodb:0,backupnow_nofiles:0,backupnow_nocloud:0,backupnow_label:"UpdraftPlus Clone",extradata:"",onlythisfileentity:"plugins,themes,uploads,others",clone_id:t,secret_token:e,clone_url:a,key:r,backup_nonce:n,backup_timestamp:o,db_anon_all:d.db_anon_all,db_anon_non_staff:d.db_anon_non_staff};updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",t,function(t){jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").removeClass("visible"),jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,updraft_clone_jobs.push(updraft_backupnow_nonce),updraft_inpage_success_callback=function(){jQuery("#updraft_clone_activejobsrow").hide(),updraft_aborted_jobs[updraft_backupnow_nonce]?jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_aborted):jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_complete)},console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),updraft_activejobs_update(!0)})}function b(e,a){var t={clone_id:e,secret_token:a};setTimeout(function(){updraft_send_command("process_updraftplus_clone_poll",t,function(t){if(t.hasOwnProperty("status")){if("error"==t.status)return void m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.error+" "+t.message).show();if("success"===t.status&&t.hasOwnProperty("data")&&t.data.hasOwnProperty("wordpress_credentials"))return m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").removeClass("visible"),void m("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_clone_progress").append("
WordPress "+updraftlion.credentials+":
"+updraftlion.username+": "+t.data.wordpress_credentials.username+"
"+updraftlion.password+": "+t.data.wordpress_credentials.password)}else console.log(t);b(e,a)})},6e4)}function s(t){var e=Handlebars.compile(updraftlion.remote_storage_templates[t]),a=updraftlion.remote_storage_options[t].default,r=updraftlion.remote_storage_methods[t],r=(a.instance_id="s-"+function(t){for(var e="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r").prop("href",a).prop("hostname"):e)||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(e),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}n.set_status=function(t){m("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").text(t)},n.show_loader=function(){m("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").addClass("visible"),m("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").prop("disabled","disabled")},n.hide_loader=function(){m("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").removeClass("visible").text(updraftlion.processing),m("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").prop("disabled",!1)},n.submit=function(e){if(m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),this.stage)switch(this.stage){case"connect_udc":case"connect_udc_TFA":var t=m("#updraftplus-addons_options_email").val(),a=m("#updraftplus-addons_options_password").val();this.login_data.email=t,this.login_data.password=a,this.connect_udc();break;case"create_key":this.create_key();break;default:this.stage=null,n.submit()}else this.set_status(updraftlion.connecting),this.show_loader(),updraft_send_command("updraftplus_com_login_submit",{data:e},function(t){t.hasOwnProperty("success")?m("#updraftplus-addons_options_auto_udc_connect").is(":checked")?(this.login_data={email:e.email,password:e.password,i_consent:1,two_factor_code:""},n.create_key()):(n.hide_loader(),m("#updraft-navtab-addons-content .wrap .updraftplus_com_login").trigger("submit")):t.hasOwnProperty("error")&&(n.hide_loader(),m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(t.message).show())}.bind(this))},n.create_key=function(){this.stage="create_key",this.set_status(updraftlion.udc_cloud_connected),this.show_loader();updraft_send_command("updraftcentral_create_key",{where_send:"__updraftpluscom",key_description:"",key_size:null,mothership_firewalled:0},function(t){try{var e=ud_parse_json(t);if(e.hasOwnProperty("error"))return void console.log(e);e.hasOwnProperty("bundle")?(console.log("bundle",e.bundle),this.login_data.key=e.bundle,this.stage="connect_udc",n.connect_udc()):(e.hasOwnProperty("r")?(m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),alert(e.r)):(m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),console.log(e)),n.hide_loader())}catch(t){console.log(t),n.hide_loader()}}.bind(this),{json_parse:!1})},n.connect_udc=function(){var a=m("#updraft-navtab-addons-content .wrap"),t=(n.set_status(updraftlion.udc_cloud_key_created),n.show_loader(),"connect_udc_TFA"==this.stage&&(this.login_data.two_factor_code=a.find("input#updraftplus-addons_options_two_factor_code").val(),n.set_status(updraftlion.checking_tfa_code)),{form_data:this.login_data});t.form_data.addons_options_connect=1,updraft_send_command("process_updraftcentral_login",t,function(t){try{var e=ud_parse_json(t);if(e.hasOwnProperty("error")){if("incorrect_password"===e.code&&(a.find(".tfa_fields").hide(),a.find(".non_tfa_fields").show(),a.find("input#updraftplus-addons_options_two_factor_code").val(""),a.find("input#updraftplus-addons_options_password").val("").trigger("focus")),"no_key_found"===e.code&&(this.stage="create_key"),"no_licences_available"!==e.code)return m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(e.message).show(),m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").find("a").attr("target","_blank"),console.log(e),void n.hide_loader();m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.login_udc_no_licences_short).show(),e.status="authenticated",a.find('input[name="_wp_http_referer"]').val(function(t,e){return e+"&udc_connect=0"})}e.hasOwnProperty("tfa_enabled")&&1==e.tfa_enabled&&(m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),a.find(".non_tfa_fields").hide(),a.find(".tfa_fields").show(),a.find("input#updraftplus-addons_options_two_factor_code").trigger("focus"),this.stage="connect_udc_TFA"),"authenticated"===e.status&&(a.find(".non_tfa_fields").hide(),a.find(".tfa_fields").hide(),a.find(".updraft-after-form-table").hide(),this.stage=null,m("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.login_successful_short).show().addClass("success"),setTimeout(function(){m("#updraft-navtab-addons-content .wrap form.updraftplus_com_login").trigger("submit")},1e3))}catch(t){console.log(t)}n.hide_loader()}.bind(this),{json_parse:!1})},m("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_add_instance",function(t){t.preventDefault(),updraft_settings_form_changed=!0,s(m(this).data("method"))}),m("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_delete_instance",function(t){t.preventDefault(),updraft_settings_form_changed=!0;var t=m(this).data("method"),e=m(this).data("instance_id");1===m("."+t+"_updraft_remote_storage_border").length&&s(t),m("."+t+"-"+e).hide("slow",function(){m(this).remove()})}),m("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod .updraft_edit_label_instance",function(t){m(this).find("span").hide(),m(this).attr("contentEditable",!0).trigger("focus")}),m("#updraft-navtab-settings-content #remote-storage-holder").on("keyup",".updraftplusmethod .updraft_edit_label_instance",function(t){var e=jQuery(this).data("method"),a=jQuery(this).data("instance_id"),r=jQuery(this).text();m("#updraft_"+e+"_instance_label_"+a).val(r)}),m("#updraft-navtab-settings-content #remote-storage-holder").on("blur",".updraftplusmethod .updraft_edit_label_instance",function(t){m(this).attr("contentEditable",!1),m(this).find("span").show()}),m("#updraft-navtab-settings-content #remote-storage-holder").on("keypress",".updraftplusmethod .updraft_edit_label_instance",function(t){13===t.which&&(m(this).attr("contentEditable",!1),m(this).find("span").show(),m(this).trigger("blur"))}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("change","input[class='updraft_instance_toggle']",function(){updraft_settings_form_changed=!0,jQuery(this).is(":checked")?jQuery(this).siblings("label").html(updraftlion.instance_enabled):jQuery(this).siblings("label").html(updraftlion.instance_disabled)}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("change","select[class='logic_type']",function(){updraft_settings_form_changed=!0,""!==this.value?(jQuery("div.logic",jQuery(this).parents("tr.updraftplusmethod")).show(),jQuery(this).parents("tr.updraftplusmethod").find("div.logic ul.rules > li").each(function(){jQuery(this).find("select").each(function(){jQuery(this).prop("disabled",!1)})})):(jQuery(this).parents("tr.updraftplusmethod").find("div.logic ul.rules > li").each(function(){jQuery(this).find("select").each(function(){jQuery(this).prop("disabled",!0)})}),jQuery(this).parents("tr.updraftplusmethod").find("div.logic").hide())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("change","select[class='conditional_logic_operand']",function(){if(updraft_settings_form_changed=!0,jQuery(this).parent().find("select:nth(2)").empty(),"day_of_the_week"===jQuery(this).val())for(var t=0;t').text(updraftlion.conditional_logic.day_of_the_week_options[t].value));else if("day_of_the_month"===jQuery(this).val())for(t=1;t<=31;t++)jQuery(this).parent().find("select:nth(2)").append(jQuery('').text(t))}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click","div.conditional_remote_backup ul.rules li span",function(){updraft_settings_form_changed=!0;var t=jQuery(this).parents("ul.rules");jQuery(this).hasClass("remove-rule")&&jQuery(this).parent().slideUp(function(){jQuery(this).remove(),jQuery(t).find("> li").length<2&&jQuery("li:nth(0) span.remove-rule",t).remove()})}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click","div.conditional_remote_backup input.add-new-rule",function(){var t=jQuery(this).parent().find("ul.rules");jQuery(t).find("> li").length<2&&jQuery(t).find("li:nth(0)").append(''),$cloned_item=jQuery(t).find("> li").last().clone(),jQuery($cloned_item).find("> select").each(function(){jQuery(this).prop("name",jQuery(this).prop("name").replace(/\[instance_conditional_logic\]\[rules\]\[[0-9]+\]/gi,"[instance_conditional_logic][rules]["+jQuery(t).data("rules")+"]"))}),jQuery(t).append($cloned_item),jQuery(t).data("rules",parseInt(jQuery(t).data("rules"))+1),jQuery($cloned_item).find('select[name*="[operand]"]').trigger("change")}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var r=jQuery(this).data("method"),n=jQuery(this).data("instance_id");updraft_remote_storage_test(r,function(t,e,a){return"sftp"==r&&(a.hasOwnProperty("scp")&&a.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+t.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+t.output),t.hasOwnProperty("data")&&t.data&&t.data.hasOwnProperty("valid_md5_fingerprint")&&t.data.valid_md5_fingerprint&&m("#updraft_sftp_fingerprint_"+n).val(t.data.valid_md5_fingerprint),!0)},n)}),m("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").on("change",function(){updraft_check_same_times()}),m("#backupnow_includefiles_showmoreoptions").on("click",function(t){t.preventDefault(),m("#backupnow_includefiles_moreoptions").toggle()}),m("#backupnow_database_showmoreoptions").on("click",function(t){t.preventDefault(),m("#backupnow_database_moreoptions").toggle()}),m("#backupnow_db_anon_all").on("click",function(t){m("#backupnow_db_anon_non_staff").prop("checked")&&m("#backupnow_db_anon_non_staff").prop("checked",!1)}),m("#backupnow_db_anon_non_staff").on("click",function(t){m("#backupnow_db_anon_all").prop("checked")&&m("#backupnow_db_anon_all").prop("checked",!1)}),m("#updraft-navtab-migrate-content").on("click","#updraftplus_clone_backupnow_db_anon_all",function(){m("#updraftplus_clone_backupnow_db_anon_non_staff").prop("checked")&&m("#updraftplus_clone_backupnow_db_anon_non_staff").prop("checked",!1)}),m("#updraft-navtab-migrate-content").on("click","#updraftplus_clone_backupnow_db_anon_non_staff",function(){m("#updraftplus_clone_backupnow_db_anon_all").prop("checked")&&m("#updraftplus_clone_backupnow_db_anon_all").prop("checked",!1)}),m("#updraft-backupnow-modal").on("click","#backupnow_includecloud_showmoreoptions",function(t){t.preventDefault(),m("#backupnow_includecloud_moreoptions").toggle()}),m("#updraft-navtab-backups-content").on("click","a.updraft_diskspaceused_update",function(t){t.preventDefault(),updraftplus_diskspace()}),m(".advanced_settings_content a.updraft_diskspaceused_update").on("click",function(t){t.preventDefault(),jQuery(".advanced_settings_content .updraft_diskspaceused").html(""+updraftlion.calculating+""),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery(".advanced_settings_content .updraft_diskspaceused").html(t.output)},{type:"GET"})}),m("#updraft-navtab-backups-content a.updraft_uploader_toggle").on("click",function(t){t.preventDefault(),m("#updraft-plupload-modal").slideToggle()}),m("#updraft-navtab-backups-content a.updraft_rescan_local").on("click",function(t){t.preventDefault(),updraft_updatehistory(1,0)}),m("#updraft-navtab-backups-content a.updraft_rescan_remote").on("click",function(t){t.preventDefault(),confirm(updraftlion.remote_scan_warning)&&updraft_updatehistory(1,1)}),m("#updraftplus-remote-rescan-debug").on("click",function(t){t.preventDefault(),updraft_updatehistory(1,1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){p(!1)}),p(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'

'+updraftlion.fetching+"
"});try{updraft_send_command("updraftcentral_get_log",null,function(t){jQuery("#updraftcentral_view_log_container").unblock(),t.hasOwnProperty("log_contents")?jQuery("#updraftcentral_view_log_contents").html('
'+t.log_contents+"
"):console.response(resp)},{error_callback:function(t,e,a,r){jQuery("#updraftcentral_view_log_container").unblock(),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})}catch(t){jQuery("#updraft_central_key").html(),console.log(t)}}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_wizard_go",function(t){jQuery("#updraftcentral_wizard_go").hide(),jQuery(".updraftcentral_wizard_success").remove(),jQuery(".create_key_container").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage1_go",function(t){t.preventDefault(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery(".updraftcentral_wizard_stage1").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage2_go",function(t){t.preventDefault(),l()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var t=!!jQuery("#updraftcentral_mothership_other").is(":checked"),e=jQuery("#updraftcentral_keycreate_description").val(),a=jQuery("#updraftcentral_keycreate_keysize").val(),r="__updraftpluscom";if(data={key_description:e,key_size:a},t&&"http"!=(r=jQuery("#updraftcentral_keycreate_mothership").val()).substring(0,4))alert(updraftlion.enter_mothership_url);else{data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=r,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'

'+updraftlion.creating_please_allow+"
"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(t.hasOwnProperty("error"))return alert(t.error),void console.log(t);alert(t.r),t.hasOwnProperty("bundle")&&t.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(t.keys_guide),jQuery("#updraftcentral_keys_content").append('
'+t.r+'
")):console.log(t),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(t.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(t){alert(updraftlion.unexpectedresponse+" "+response),console.log(t)}},{error_callback:function(t,e,a,r){jQuery("#updraftcentral_keys").unblock(),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})}catch(t){jQuery("#updraft_central_key").html(),console.log(t)}}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();t=jQuery(this).data("key_id");void 0!==t?(jQuery("#updraftcentral_keys").block({message:'

'+updraftlion.deleting+"
"}),updraft_send_command("updraftcentral_delete_key",{key_id:t},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)},{error_callback:function(t,e,a,r){jQuery("#updraftcentral_keys").unblock(),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})):console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found")}),jQuery("#updraft_reset_sid").on("click",function(t){t.preventDefault(),updraft_send_command("reset_site_id",null,function(t){jQuery("#updraft_show_sid").html(t)},{json_parse:!1})}),jQuery("#updraft-navtab-settings-content form input:not('.udignorechange'), #updraft-navtab-settings-content form select").on("change",function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").on("click",function(t){updraft_settings_form_changed=!1});var d=180,t=(jQuery(".updraft-bigbutton").each(function(t,e){e=jQuery(e).width();d'+t.count_backups+"");for(a=0;a '+updraftlion.maybe_downloading_entities),updraft_send_command("whichdownloadsneeded",{downloads:d,timestamp:c},function(t){if(m(".updraft-restore--next-step").prop("disabled",!1),t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),a=t.downloads,console.log(a)),0==a.length)updraft_restorer_checkstage2(0);else for(var e=0;e'+r.fatal_error_message+"

")):(r="updraft_send_command: error: "+e+" ("+a+")",m("#updraft-restore-modal-stage2a").html('

'+r+"

"),console.log(r),console.log(t))}})}catch(t){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(t),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var u=1;if(jQuery(".updraft-restore--next-step, .updraft-restore--cancel").prop("disabled",!0),m("#updraft_restoreoptions_ui input.required").each(function(t){var e,a;0!=u&&(""==(e=m(this).val())?(alert(updraftlion.pleasefillinrequired),u=0):""!=m(this).attr("pattern")&&(a=m(this).attr("pattern"),new RegExp(a,"g").test(e)||(alert(m(this).data("invalidpattern")),u=0)))}),1==o&&(r=0,jQuery('input[name="updraft_restore_table_options[]"').each(function(t,e){jQuery(e).is(":checked")&&!jQuery(e).is(":disabled")&&(r=1)}),0==r&&!skipped_db_scan))return alert(updraftlion.youdidnotselectany),void jQuery(".updraft-restore--next-step, .updraft-restore--cancel").prop("disabled",!1);if(1==n&&(r=0,jQuery('input[name="updraft_include_more_index[]"').each(function(t,e){jQuery(e).is(":checked")&&!jQuery(e).is(":disabled")&&(r=1,""==jQuery("#updraft_include_more_path_restore"+t).val()&&alert(updraftlion.emptyrestorepath))}),0==r))return alert(updraftlion.youdidnotselectany),void jQuery(".updraft-restore--next-step, .updraft-restore--cancel").prop("disabled",!1);if(u){var i=m("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();if(jQuery.each(jQuery('input[name="updraft_restore_table_options[]').filter(function(t){return!1===jQuery(this).prop("checked")}),function(t,e){i+="&"+jQuery(e).attr("name")+"=udp-skip-table-"+jQuery(e).val()}),console.log("Restore options: "+i),void 0!==php_max_input_vars){var t,e=i.split("&").length,s='

'+updraftlion.warnings+'

    ';if(!php_max_input_vars&&1e3<=e)console.log("Restore options: "+e+" PHP max input vars not detected; using default: 1000");else if(php_max_input_vars&&php_max_input_vars<=e)return t="
  • "+updraftlion.php_max_input_vars_detected_warning+"
  • ",1!=jQuery("#updraft-restore-modal-stage2a .notice-warning").length?(s=s+t+"
",jQuery("#updraft_restoreoptions_ui").prepend(s)):jQuery("#updraft-restore-modal-stage2a #updraft_restore_warnings").append(t),console.log("Restore options: "+e+" PHP max input vars: "+php_max_input_vars),jQuery(".updraft-restore--next-step, .updraft-restore--cancel").prop("disabled",!1),void(php_max_input_vars=void 0)}m("#updraft_restorer_restore_options").val(i),m("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),m("#updraft_restore_form").trigger("submit"),updraft_restore_stage=4}}}else alert(updraftlion.youdidnotselectany)}},c=m(".updraft_restore_main--activity").width(),t=(jQuery("#activity-full-log").on("click",function(){var t="1460px"==m(".updraft_restore_main").css("max-width")?"860px":"1460px",e=m(".updraft_restore_main--activity").width()==c?"100%":c+"px",a="600px"==m(".updraft_restore_main--activity").css("min-height")?"0px":"600px",r=m("#activity-full-log").attr("title")==updraftlion.restoreactivitylogscreenexit?updraftlion.restoreactivitylogfullscreen:updraftlion.restoreactivitylogscreenexit;m("#activity-full-log").toggleClass("dashicons-fullscreen-exit-alt"),m("#activity-full-log").attr("title",r),m(".updraft_restore_main--components").toggle("fast"),m(".updraft_restore_main--header").toggle("fast"),m(".updraft_restore_main--activity").animate({minHeight:a,width:e}),m(".updraft_restore_main").animate({maxWidth:t})}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,modal:!0,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){m(this).dialog("option","width",580),m(this).dialog("option","minHeight",261),m(this).dialog("option","height",380)}}),{});t[updraftlion.backupnow]=function(){var t=jQuery("#backupnow_includedb").is(":checked")?0:1,e=jQuery("#backupnow_includefiles").is(":checked")?0:1,a=jQuery("#backupnow_includecloud").is(":checked")?0:1,r=jQuery("#backupnow_db_anon_all").is(":checked")?1:0,n=jQuery("#backupnow_db_anon_non_staff").is(":checked")?1:0,o=backupnow_whichtables_checked(""),d=jQuery("#always_keep").is(":checked")?1:0,u="incremental"==jQuery("#updraft-backupnow-modal").data("backup-type")?1:0;if(!updraftlion.hosting_restriction.includes("only_one_backup_per_month")||u){if(!updraftlion.hosting_restriction.includes("only_one_incremental_per_day")||!u){if(""==o&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_database_moreoptions").show();"boolean"==typeof o&&(o=null);var i,s=backupnow_whichfiles_checked("");return""==s&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):""==(i=jQuery("input[name^='updraft_include_remote_service_']").serializeArray())&&0==a?(alert(updraftlion.nocloudserviceschosen),void jQuery("#backupnow_includecloud_moreoptions").show()):("boolean"==typeof i&&(i=null),void(t&&e?alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),updraft_backupnow_go(t,e,a,s,{always_keep:d,incremental:u,db_anon_all:r,db_anon_non_staff:n},jQuery("#backupnow_label").val(),o,i))))}alert(updraftlion.hosting_restriction_one_incremental_perday)}else alert(updraftlion.hosting_restriction_one_backup_permonth)},t[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){m(this).dialog("option","width",610),m(this).dialog("option","minHeight",300),m(this).dialog("option","height",472)},modal:!0,buttons:t,create:function(){m(this).closest(".ui-dialog").find(".ui-dialog-buttonpane .ui-button").first().addClass("js-tour-backup-now-button")}}),jQuery("#updraft-poplog").dialog({autoOpen:!1,modal:!0,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){m(this).dialog("option","width",860),m(this).dialog("option","minHeight",260),600'+r.fatal_error_message+"

"),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",jQuery("#updraft_zip_files_jstree").html('

'+r+"

"),console.log(r),alert(r),console.log(t))}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["sort"]}):"contain-clause"==t&&jQuery("#updraft_exclude_files_folders_wildcards_jstree").jstree({core:{multiple:!1,data:function(t,e){updraft_send_command("get_jstree_directory_nodes",{entity:"filebrowser",directories_only:1,node:t,path:jQuery("#updraft_exclude_modal_path").val(),findex:0,skip_root_node:0},function(t){t.hasOwnProperty("error")?alert(t.error):e.call(this,t.nodes)},{error_callback:function(t,e,a,r){void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('

'+r.fatal_error_message+"

"),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",jQuery("#updraft_zip_files_jstree").html('

'+r+"

"),console.log(r),alert(r),console.log(t))}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["sort"]}),jQuery("#updraft_exclude_modal_main").slideUp(),jQuery(".updraft-exclude-panel").hide(),jQuery(".updraft-exclude-panel[data-panel="+t+"]").slideDown()}),jQuery(".updraft-exclude-modal-reset").on("click",function(t){t.preventDefault(),jQuery("#updraft_exclude_files_folders_jstree").jstree("destroy"),jQuery("#updraft_exclude_files_folders_wildcards_jstree").jstree("destroy"),jQuery("#updraft_exclude_extension_field").val(""),jQuery("#updraft_exclude_prefix_field").val(""),jQuery(".updraft-exclude-panel").slideUp(),jQuery("#updraft_exclude_modal_main").slideDown()}),jQuery(".updraft-exclude-submit").on("click",function(){var t,e="";switch(jQuery(this).data("panel")){case"file-dir":if(0==(t=jQuery("#updraft_exclude_files_folders_jstree").jstree("get_selected")).length)return void alert(updraftlion.exclude_select_file_or_folder_msg);var a=t[0],r=jQuery("#updraft_exclude_modal_path").val(),e=a="/"==(a="/"==(a=a.substr(0,r.length)==r?a.substr(r.length,a.length):a).charAt(0)?a.substr(1):a).charAt(a.length-1)?a.substr(0,a.length-1):a;break;case"extension":var n=jQuery("#updraft_exclude_extension_field").val();if(""==n)return void alert(updraftlion.exclude_type_ext_msg);if(!n.match(/^[0-9a-zA-Z]+$/))return void alert(updraftlion.exclude_ext_error_msg);e="ext:"+n;break;case"begin-with":n=jQuery("#updraft_exclude_prefix_field").val();if(""==n)return void alert(updraftlion.exclude_type_prefix_msg);if(!n.match(/^\s*[a-z-_\d,\s]+\s*$/i))return void alert(updraftlion.exclude_prefix_error_msg);e="prefix:"+n;break;case"contain-clause":if(0==(t=jQuery("#updraft_exclude_files_folders_wildcards_jstree").jstree("get_selected")).length)return void alert(updraftlion.exclude_select_folder_wildcards_msg);var n=jQuery(this).parents("div.updraft-exclude-panel").find("div.clause-input-container input").val(),o=(jQuery(this).parents("div.updraft-exclude-panel").find("div.clause-input-container input").val(""),jQuery(this).parents("div.updraft-exclude-panel").find("div.clause-input-container select").val());if(""==n)return void alert(updraftlion.exclude_contain_error_msg);jQuery(this).parents("div.updraft-exclude-panel").find("div.clause-input-container select option").eq(0).prop("selected",!0);a=t[0],r=jQuery("#updraft_exclude_modal_path").val();""!==(e=a="/"==(a="/"==(a=a.substr(0,r.length)==r?a.substr(r.length,a.length):a).charAt(0)?a.substr(1):a).charAt(a.length-1)?a.substr(0,a.length-1):a)&&(e+="/"),n=n.replace(/\*/g,"\\*"),"beginning"===o?e+=n+"*":"middle"===o?e+="*"+n+"*":"end"===o&&(e+="*"+n);break;default:return}var d,u=jQuery("#updraft_exclude_modal_for").val();updraft_is_unique_exclude_rule(e,u)&&(d='
',jQuery('.updraft_exclude_entity_container[data-include-backup-file="'+u+'"]').append(d),updraft_exclude_entity_update(u),jQuery("#updraft_exclude_modal").dialog("close"))}),jQuery("#updraft-navtab-settings-content .updraft-service").on("change",function(){var t=jQuery(this).val();jQuery("#updraft-navtab-settings-content .updraftplusmethod").hide(),jQuery("#updraft-navtab-settings-content ."+t).show()}),jQuery("#updraft-navtab-settings-content a.updraft_show_decryption_widget").on("click",function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").on("click",function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").on("click",function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").on("click",function(t){t.preventDefault(),updraft_open_main_tab("status"),updraft_page_is_visible=1,updraft_console_focussed_tab="status",updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").on("click",function(t){t.preventDefault(),updraft_open_main_tab("expert"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").on("click",function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),updraft_open_main_tab("settings"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-addons").on("click",function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),updraft_open_main_tab("addons"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-backups").on("click",function(t){t.preventDefault(),updraft_console_focussed_tab="backups",updraft_historytimertoggle(1),updraft_open_main_tab("backups")}),jQuery("#updraft-navtab-migrate").on("click",function(t){t.preventDefault(),jQuery("#updraft_migrate_tab_alt").html("").hide(),updraft_open_main_tab("migrate"),updraft_page_is_visible=1,jQuery("#updraft_migrate .updraft_migrate_widget_module_content").is(":visible")||jQuery(".updraft_migrate_intro").show()}),"migrate"==updraftlion.tab&&jQuery("#updraft-navtab-migrate").trigger("click"),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&0<=t.indexOf("pong")&&(jQuery("#updraft-navtab-backups-content .ud-whitespace-warning").show(),console.log("UpdraftPlus: Extra output warning: response (which should be just (string)'pong') follows."),console.log(t))},{json_parse:!1,type:"GET"});try{"undefined"!=typeof updraft_plupload_config&&((u=new plupload.Uploader(updraft_plupload_config)).bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").on("dragover.wp-uploader",function(){e.addClass("drag-over")}).on("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").off(".wp-uploader"))}),u.init(),u.bind("FilesAdded",function(t,e){plupload.each(e,function(t){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(t.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(t.name)){for(var e=!1,a=0;a"+t.name+"

"+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(t.name+": "+updraftlion.notarchive),void u.removeFile(t)}jQuery("#filelist").append('
'+t.name+" ("+plupload.formatSize(0)+"/"+plupload.formatSize(t.size)+')
')}),t.refresh(),t.start()}),u.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100))),e.size==e.loaded&&(jQuery("#"+e.id).html('
'+e.name+" ("+plupload.formatSize(parseInt(e.size*e.percent/100))+"/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"
"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),u.bind("Error",function(t,e){console.log(e),a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var a,r=updraftlion.uploaderr+" (code "+e.code+") : "+e.message;e.hasOwnProperty("status")&&e.status&&(r+=" ("+updraftlion.http_code+" "+e.status+")"),e.hasOwnProperty("response")&&(console.log("UpdraftPlus: plupload error: "+e.response),e.response.length<100&&(r+=" "+updraftlion.error+" "+e.response+"\n")),r+=" "+a,alert(r)}),u.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{(resp=ud_parse_json(a.response)).e?alert(updraftlion.uploaderror+" "+resp.e):resp.dm?(alert(resp.dm),updraft_updatehistory(1,0)):resp.m?updraft_updatehistory(1,0):alert("Unknown server response: "+a.response)}catch(t){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)}))}catch(t){console.log(t)}function f(t){(params={uri:jQuery("#updraftplus_httpget_uri").val()}).curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("
"+t.r+"
"):console.log(t)},{type:"GET"})}function g(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,_.open(),updraft_activejobs_update(!0)}function i(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");t=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(window.location.href);return null==t?"":decodeURIComponent(t[1].replace(/\+/g," "))}jQuery("#updraftplus_httpget_go").on("click",function(t){t.preventDefault(),f(0)}),jQuery("#updraftplus_httpget_gocurl").on("click",function(t){t.preventDefault(),f(1)}),jQuery("#updraftplus_callwpaction_go").on("click",function(t){t.preventDefault(),updraft_send_command("call_wordpress_action",params={wpaction:jQuery("#updraftplus_callwpaction").val()},function(t){t.e?alert(t.e):t.s||(t.r?jQuery("#updraftplus_callwpaction_results").html(t.r):(console.log(t),alert(updraftlion.jsonnotunderstood)))})}),jQuery("#updraft_activejobs_table, #updraft-navtab-migrate-content").on("click",".updraft_jobinfo_delete",function(t){t.preventDefault();t=jQuery(this).data("jobid");t?(m(this).addClass("disabled"),updraft_activejobs_delete(t)):console.log("UpdraftPlus: A stop job link was clicked, but the Job ID could not be found")}),jQuery("#updraft_activejobs_table, #updraft-navtab-backups-content .updraft_existing_backups, #updraft-backupnow-inpage-modal, #updraft-navtab-migrate-content").on("click",".updraft-log-link",function(t){t.preventDefault();var t=jQuery(this).data("fileid"),e=jQuery(this).data("jobid");t?updraft_popuplog(t):e?updraft_popuplog(e):console.log("UpdraftPlus: A log link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.choose-components-button",function(t){g(jQuery(this).data("entities"),jQuery(this).data("backup_timestamp"),jQuery(this).data("showdata"))}),"initiate_restore"==i("udaction")&&g(i("entities"),i("backup_timestamp"),i("showdata"));t={};t[updraftlion.uploadbutton]=function(){var t=jQuery("#updraft_upload_timestamp").val(),e=jQuery("#updraft_upload_nonce").val(),a="",r=!1;jQuery(".updraft_remote_storage_destination").each(function(t){jQuery(this).is(":checked")&&(r=!0)}),r?(a=jQuery("input[name^='updraft_remote_storage_destination_']").serializeArray(),jQuery(this).dialog("close"),alert(updraftlion.local_upload_started),updraft_send_command("upload_local_backup",{use_nonce:e,use_timestamp:t,services:a},function(t){})):jQuery("#updraft-upload-modal-error").html(updraftlion.local_upload_error)},t[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-upload-modal").dialog({autoOpen:!1,modal:!0,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){m(this).parent().trigger("focus"),m(this).dialog("option","width",308),460
'+updraftlion.loading+"
",updraftlion.raw,780,500)}),jQuery("#backupnow_database_moreoptions").on("click","div.backupnow-db-tables > a",function(t){t.preventDefault(),jQuery("> input",jQuery(this).parents("div.backupnow-db-tables")).prop("checked",!1),jQuery(this).hasClass("backupnow-select-all-table")?jQuery("> input",jQuery(this).parents("div.backupnow-db-tables")).prop("checked",!0):jQuery(this).hasClass("backupnow-select-all-this-site")&&jQuery("> input",jQuery(this).parents("div.backupnow-db-tables")).not("[data-non_wp_table]").prop("checked",!0)})}),jQuery(function(n){var o="#updraft-navtab-settings-content ";n(o+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(t){t.preventDefault(),n(o+"#updraftvault_settings_showoptions").slideUp(),n(o+"#updraftvault_settings_connect").slideUp(),n(o+"#updraftvault_settings_connected").slideUp(),n(o+"#updraftvault_settings_default").slideDown()}),n(o).on("keypress","#updraftvault_settings_connect input",function(t){if(13==t.which)return n(o+"#updraftvault_connect_go").trigger("click"),!1}),n(o+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(t){t.preventDefault(),n(o+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:n("#updraftvault_settings_connect").data("instance_id")},function(t){n(o+"#updraftvault_recountquota").html(updraftlion.updatequotacount),t.hasOwnProperty("html")&&(n(o+"#updraftvault_settings_connected").html(t.html),t.hasOwnProperty("connected")&&(t.connected?(n(o+"#updraftvault_settings_default").hide(),n(o+"#updraftvault_settings_connected").show()):(n(o+"#updraftvault_settings_connected").hide(),n(o+"#updraftvault_settings_default").show())))},{error_callback:function(t,e,a,r){n(o+"#updraftvault_recountquota").html(updraftlion.updatequotacount),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})}catch(t){n(o+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(t)}}),n(o+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(t){t.preventDefault(),n(o+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:n("#updraftvault_settings_connect").data("instance_id")},function(t){n(o+"#updraftvault_disconnect").html(updraftlion.disconnect),t.hasOwnProperty("html")&&(n(o+"#updraftvault_settings_connected").html(t.html).slideUp(),n(o+"#updraftvault_settings_default").slideDown())},{error_callback:function(t,e,a,r){n(o+"#updraftvault_disconnect").html(updraftlion.disconnect),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}})}catch(t){n(o+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(t)}}),n(o+"#remote-storage-holder").on("click","#updraftvault_connect",function(t){t.preventDefault(),n(o+"#updraftvault_settings_default").slideUp(),n(o+"#updraftvault_settings_connect").slideDown()}),n(o+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(t){t.preventDefault(),n(o+"#updraftvault_settings_default").slideUp(),n(o+"#updraftvault_settings_showoptions").slideDown()}),n("#remote-storage-holder").on("keyup",".updraftplus_onedrive_folder_input",function(t){var e=n(this).val(),a=n(this).closest("td");0==e.indexOf("https:")||0==e.indexOf("http:")?a.find(".onedrive_folder_error").length||a.append('
'+updraftlion.onedrive_folder_url_warning+"
"):a.find(".onedrive_folder_error").slideUp("slow",function(){a.find(".onedrive_folder_error").remove()})}),n(o+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(t){return n(o+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:n("#updraftvault_email").val(),pass:n("#updraftvault_pass").val(),instance_id:n("#updraftvault_settings_connect").data("instance_id")},function(t,e,a){n(o+"#updraftvault_connect_go").html(updraftlion.connect),t.hasOwnProperty("e")?(updraft_html_modal('

'+updraftlion.errornocolon+"

"+t.e+"

",updraftlion.disconnect,400,250),t.hasOwnProperty("code")&&"no_quota"==t.code&&(n(o+"#updraftvault_settings_connect").slideUp(),n(o+"#updraftvault_settings_default").slideDown())):t.hasOwnProperty("connected")&&t.connected&&t.hasOwnProperty("html")?(n(o+"#updraftvault_settings_connect").slideUp(),n(o+"#updraftvault_settings_connected").html(t.html).slideDown()):(console.log(t),alert(updraftlion.unexpectedresponse+" "+a))},{error_callback:function(t,e,a,r){n(o+"#updraftvault_connect_go").html(updraftlion.connect),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))}}),!1}),n("#updraft-iframe-modal").on("change","#always_keep_this_backup",function(){var e=n(this).data("backup_key");updraft_send_command("always_keep_this_backup",{backup_key:e,always_keep:n(this).is(":checked")?1:0},function(t){t.hasOwnProperty("rawbackup")&&(jQuery("#updraft-iframe-modal").dialog("close"),jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup",t.rawbackup),updraft_html_modal(jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup"),updraftlion.raw,780,500))})})}),jQuery(function(t){try{"undefined"!=typeof updraft_plupload_config2&&((a=new plupload.Uploader(updraft_plupload_config2)).bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").on("dragover.wp-uploader",function(){e.addClass("drag-over")}).on("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").off(".wp-uploader"))}),a.init(),a.bind("FilesAdded",function(t,e){plupload.each(e,function(t){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(t.name))return alert(t.name+": "+updraftlion.notdba),void a.removeFile(t);jQuery("#filelist2").append('
'+t.name+" ("+plupload.formatSize(0)+"/"+plupload.formatSize(t.size)+')
')}),t.refresh(),t.start()}),a.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100)))}),a.bind("Error",function(t,e){err_makesure="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),a.bind("FileUploaded",function(t,e,a){"200"==a.status?"ERROR:"==a.response.substring(0,6)?alert(updraftlion.uploaderror+" "+a.response.substring(6)):"OK:"==a.response.substring(0,3)?(bkey=a.response.substring(3),jQuery("#"+e.id+" .fileprogress").hide(),jQuery("#"+e.id).append(updraftlion.uploaded+' '+updraftlion.followlink+" "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&").replace(//g,">"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)}))}catch(t){console.log(t)}var a;if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return(t="string"!=typeof t&&null!=t?t.toString():t)===(e="string"!=typeof e&&null!=e?e.toString():e)?a.fn(this):a.inverse(this)}),Handlebars.registerHelper("maskPassword",function(t){return t.replace(/./gi,"*")}),Handlebars.registerHelper("encodeURIComponent",function(t){return encodeURIComponent(t)}),Handlebars.registerHelper("ifCond",function(t,e,a,r){switch(e){case"==":return t==a?r.fn(this):r.inverse(this);case"===":return t===a?r.fn(this):r.inverse(this);case"!=":return t!=a?r.fn(this):r.inverse(this);case"!==":return t!==a?r.fn(this):r.inverse(this);case"<":return t":return a=":return a<=t?r.fn(this):r.inverse(this);case"&&":return t&&a?r.fn(this):r.inverse(this);case"||":return t||a?r.fn(this):r.inverse(this);case"typeof":return t===typeof a?r.fn(this):r.inverse(this);case"not_typeof":return t!==typeof a?r.fn(this):r.inverse(this);default:return r.inverse(this)}}),Handlebars.registerHelper("for",function(t,e,a,r){for(var n="",o=t;o'+jQuery(this).html()+"

"),e=!0}),e&&((t={})[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,resizeOnWindowResize:!0,scrollWithViewport:!0,resizeAccordingToViewport:!0,useContentSize:!1,open:function(t,e){o(this).dialog("option","width",860),o(this).dialog("option","height",260)},buttons:t}).dialog("open"))}(new Image).src=updraftlion.ud_url+"/images/notices/updraft_logo.png",o("#updraft-navtab-settings-content input.updraft_include_entity").on("change",function(t){var e=o(this).attr("id"),a=o(this).is(":checked");o("#backupnow_files_"+e).prop("checked",a)}),o("#updraftplus-settings-save").on("click",function(t){t.preventDefault(),o.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'

'+updraftlion.saving+"
"}),updraft_send_command("savesettings",{settings:a("string"),updraftplus_version:updraftlion.updraftplus_version},function(t,e,a){r(t,a),o("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),window.updraft_main_tour&&!window.updraft_main_tour.canceled?(window.updraft_main_tour.show("settings_saved"),n()):o("html, body").animate({scrollTop:o("#updraft-wrap").offset().top},1e3,function(){n()}),o.unblockUI()},{action:"updraft_savesettings",error_callback:function(t,e,a,r){o.unblockUI(),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),alert(r),console.log(t))},nonce:updraftplus_settings_nonce})}),o("#updraftplus-settings-export").on("click",function(){var t,e;updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),t=a("object"),e=new Date,t=JSON.stringify({version:"1.12.40",epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t}),(e=document.body.appendChild(document.createElement("a"))).setAttribute("download",updraftlion.export_settings_file_name),e.setAttribute("style","display:none;"),e.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),e.click()}),o("#updraftplus-settings-import").on("click",function(){o.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'

'+updraftlion.importing+"
"});var t=document.getElementById("import_settings");if(0==t.files.length)return alert(updraftlion.import_select_file),void o.unblockUI();var t=t.files[0],e=new FileReader;e.onload=function(){var t,e=this.result;try{t=ud_parse_json(e)}catch(t){return void(o.unblockUI(),jQuery("#import_settings").val(""),console.log(e),console.log(t),alert(updraftlion.import_invalid_json_file))}window.confirm(updraftlion.importing_data_from+" "+t.network_site_url+"\n"+updraftlion.exported_on+" "+t.local_date+"\n"+updraftlion.continue_import)?updraft_send_command("importsettings",{settings:JSON.stringify(t.data),updraftplus_version:updraftlion.updraftplus_version},function(t,e,a){t=r(t);!t.hasOwnProperty("saved")||t.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(o.unblockUI(),t.hasOwnProperty("error_message")&&t.error_message&&alert(t.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,error_callback:function(t,e,a,r){o.unblockUI(),void 0!==r&&r.hasOwnProperty("fatal_error")?(console.error(r.fatal_error_message),alert(r.fatal_error_message)):(r="updraft_send_command: error: "+e+" ("+a+")",console.log(r),console.log(t),alert(r))}}):o.unblockUI()},e.readAsText(t)}),o(".udp-replace-with-iframe--js").on("click",function(t){t.preventDefault();t=o(this).prop("href");o('