WordPress.org

Plugin Directory

Changeset 1782865


Ignore:
Timestamp:
12/07/17 17:33:45 (6 weeks ago)
Author:
DavidAnderson
Message:

handlebars fix into current release

Location:
updraftplus
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • updraftplus/tags/1.13.16/includes/updraftplus-admin.js

    r1777080 r1782865  
    26522652 
    26532653    Handlebars.registerHelper('ifeq', function (a, b, opts) { 
    2654         if ('string' !== typeof a && 'undefined' !== typeof a) a = a.toString(); 
    2655         if ('string' !== typeof b && 'undefined' !== typeof b) b = b.toString(); 
     2654        if ('string' !== typeof a && 'undefined' !== typeof a && null !== a) a = a.toString(); 
     2655        if ('string' !== typeof b && 'undefined' !== typeof b && null !== b) b = b.toString(); 
    26562656        if (a === b) { 
    26572657            return opts.fn(this); 
  • updraftplus/tags/1.13.16/includes/updraftplus-admin.min.js

    r1777080 r1782865  
    11function updraft_send_command(t,e,a,r){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"},"undefined"==typeof r&&(r={});for(var n in default_options)r.hasOwnProperty(n)||(r[n]=default_options[n]);var o={action:r.action,subaction:t};if(o[r.nonce_key]=r.nonce,"object"==typeof e)for(var u in e)o[u]=e[u];else o.action_data=e;var d={type:r.type,url:ajaxurl,data:o,success:function(t,e){if(r.json_parse){try{var n=ud_parse_json(t)}catch(o){return console.log(o),console.log(t),void(r.alert_on_error&&alert(updraftlion.unexpectedresponse+" "+t))}"function"==typeof a&&a(n,e,t)}else"function"==typeof a&&a(t,e)},error:function(t,e,a){"function"==typeof r.error_callback?r.error_callback(t,e,a):(console.log("updraft_send_command: error: "+e+" ("+a+")"),console.log(t))},dataType:"text",async:r.async};null!=r.timeout&&(d.timeout=r.timeout),jQuery.ajax(d)}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").removeAttr("disabled").show():jQuery("#updraft-delete-remote-section, #updraft_delete_remote").hide().attr("disabled","disabled"),t.indexOf(",")>-1?(jQuery("#updraft_delete_question_singular").hide(),jQuery("#updraft_delete_question_plural").show()):(jQuery("#updraft_delete_question_plural").hide(),jQuery("#updraft_delete_question_singular").show()),jQuery("#updraft-delete-modal").dialog("open")}function updraft_remote_storage_tab_activation(t){jQuery(".updraftplusmethod").hide(),jQuery(".remote-tab").data("active",!1),jQuery(".remote-tab").removeClass("nav-tab-active"),jQuery(".updraftplusmethod."+t).show(),jQuery(".remote-tab-"+t).data("active",!0),jQuery(".remote-tab-"+t).addClass("nav-tab-active")}function updraft_check_overduecrons(){updraft_send_command("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&jQuery("#updraft-insert-admin-warning").html(t.m)},{alert_on_error:!1})}function updraft_remote_storage_tabs_setup(){var t=0,e=jQuery(".updraft_servicecheckbox:checked");jQuery(e).each(function(a,r){var n=jQuery(r).val();"updraft_servicecheckbox_none"!=jQuery(r).attr("id")&&t++,jQuery(".remote-tab-"+n).show(),a==jQuery(e).length-1&&updraft_remote_storage_tab_activation(n)}),t>0&&jQuery(".updraftplusmethod.none").hide(),jQuery(document).keyup(function(t){if((32===t.keyCode||13===t.keyCode)&&jQuery(document.activeElement).is("input.labelauty + label")){var e=jQuery(document.activeElement).attr("for");e&&jQuery("#"+e).change()}}),jQuery(".updraft_servicecheckbox").change(function(){var e=jQuery(this).attr("id");if("updraft_servicecheckbox_"==e.substring(0,24)){var a=e.substring(24);null!=a&&""!=a&&(jQuery(this).is(":checked")?(t++,jQuery(".remote-tab-"+a).fadeIn(),updraft_remote_storage_tab_activation(a)):(t--,jQuery(".remote-tab-"+a).hide(),1==jQuery(".remote-tab-"+a).data("active")&&updraft_remote_storage_tab_activation(jQuery(".remote-tab:visible").last().attr("name"))))}t<=0?jQuery(".updraftplusmethod.none").fadeIn():jQuery(".updraftplusmethod.none").hide()}),jQuery(".updraft_servicecheckbox:not(.multi)").change(function(){var t=jQuery(this).attr("value");jQuery(this).is(":not(:checked)")?(jQuery(".updraftplusmethod."+t).hide(),jQuery(".updraftplusmethod.none").fadeIn()):jQuery(".updraft_servicecheckbox").not(this).prop("checked",!1)});var a=jQuery(".updraft_servicecheckbox");"function"==typeof a.labelauty&&a.labelauty()}function updraft_remote_storage_test(t,e,a){var r,n;a?(r=jQuery("#updraft-"+t+"-test-"+a),n=".updraftplusmethod."+t+"-"+a):(r=jQuery("#updraft-"+t+"-test"),n=".updraftplusmethod."+t);var o=r.data("method_label");r.html(updraftlion.testing_settings.replace("%s",o));var u={method:t};jQuery("#updraft-navtab-settings-content "+n+" input[data-updraft_settings_test], #updraft-navtab-settings-content .expertmode input[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test"),r=jQuery(e).attr("type");if(a){r||(console.log("UpdraftPlus: settings test input item with no type found"),console.log(e),r="text");var n=null;"checkbox"==r?n=jQuery(e).is(":checked")?1:0:"text"==r||"password"==r?n=jQuery(e).val():(console.log("UpdraftPlus: settings test input item with unrecognised type ("+r+") found"),console.log(e)),u[a]=n}}),jQuery("#updraft-navtab-settings-content "+n+" textarea[data-updraft_settings_test], #updraft-navtab-settings-content "+n+" select[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test");u[a]=jQuery(e).val()}),updraft_send_command("test_storage_settings",u,function(t,a){r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof e&&0!=e&&(e=e.call(this,t,a,u)),"undefined"!=typeof e&&!1===e&&(alert(updraftlion.settings_test_result.replace("%s",o)+" "+t.output),t.hasOwnProperty("data")&&console.log(t.data))})}function backupnow_whichfiles_checked(t){return jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(e){if(jQuery(this).is(":checked")){var a=jQuery(this).attr("name");if("updraft_include_"==a.substring(0,16)){var r=a.substring(16);""!=t&&(t+=","),t+=r}}}),t}function backupnow_whichtables_checked(t){var e=!1;return jQuery('#backupnow_database_moreoptions input[type="checkbox"]').each(function(t){if(!jQuery(this).is(":checked"))return void(e=!0)}),t=jQuery("input[name^='updraft_include_tables_']").serializeArray(),!e||t}function updraft_deleteallselected(){var t=0,e="",a="",r="";jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").each(function(n){t++;var o=jQuery(this).data("nonce");a&&(a+=","),a+=o;var u=jQuery(this).data("key");e&&(e+=","),e+=u;var d=jQuery(this).find(".updraftplus-remove").data("hasremote");r&&(r+=","),r+=d}),updraft_delete(e,a,r)}function updraft_openrestorepanel(t){updraft_console_focussed_tab=2,updraft_historytimertoggle(t),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-backups-content").show(),jQuery("#updraft-navtab-backups").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active")}function updraft_delete_old_dirs(){return!0}function updraft_initiate_restore(t){jQuery("#updraft-migrate-modal").dialog("close"),jQuery('#updraft-navtab-backups-content .updraft_existing_backups button[data-backup_timestamp="'+t+'"]').click()}function updraft_restore_setoptions(t){var e=0;jQuery('input[name="updraft_restore[]"]').each(function(a,r){var n=jQuery(r).val(),o=n+"=([0-9,]+)",u=new RegExp(o),d=t.match(u);d?(jQuery(r).removeAttr("disabled").data("howmany",d[1]).parent().show(),e++,"db"==n&&(e+=4.5),jQuery(r).is(":checked")&&jQuery("#updraft_restorer_"+n+"options").show()):jQuery(r).attr("disabled","disabled").parent().hide()});var a=t.match(/dbcrypted=1/);a?jQuery(".updraft_restore_crypteddb").show():jQuery(".updraft_restore_crypteddb").hide();var r=t.match(/meta_foreign=([12])/);r?jQuery("#updraft_restore_meta_foreign").val(r[1]):jQuery("#updraft_restore_meta_foreign").val("0");var n=336+20*e;jQuery("#updraft-restore-modal").dialog("option","height",n)}function updraft_backup_dialog_open(){jQuery("#backupnow_includefiles_moreoptions").hide(),updraft_settings_form_changed?window.confirm(updraftlion.unsavedsettingsbackup)&&(jQuery("#backupnow_label").val(""),jQuery("#updraft-backupnow-modal").dialog("open")):(jQuery("#backupnow_label").val(""),jQuery("#updraft-backupnow-modal").dialog("open"))}function updraft_migrate_dialog_open(){jQuery("#updraft_migrate_modal_alt").hide(),updraft_migrate_modal_default_buttons={},updraft_migrate_modal_default_buttons[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-migrate-modal").dialog("option","buttons",updraft_migrate_modal_default_buttons),jQuery("#updraft-migrate-modal").dialog("open"),jQuery("#updraft_migrate_modal_main").show()}function updraft_check_page_visibility(t){"hidden"==document.visibilityState?updraft_page_is_visible=0:(updraft_page_is_visible=1,1!==t&&updraft_activejobs_update(!0))}function updraft_backupnow_inpage_go(t,e,a,r,n,o,u){r="undefined"==typeof r?0:r,n="undefined"==typeof n?0:n,o="undefined"==typeof o?0:o,u="undefined"==typeof u?updraftlion.automaticbackupbeforeupdate:u,updraft_console_focussed_tab=1,updraft_inpage_success_callback=t;var d={},s=jQuery("#updraft-backupnow-inpage-modal").length;s&&jQuery("#updraft-backupnow-inpage-modal").dialog("option","buttons",d),jQuery("#updraft_inpage_prebackup").hide(),s&&jQuery("#updraft-backupnow-inpage-modal").dialog("open"),jQuery("#updraft_inpage_backup").show(),updraft_activejobslist_backupnownonce_only=1,updraft_inpage_hasbegun=0,updraft_backupnow_go(r,n,o,e,a,u,"")}function updraft_activejobs_update(t){var e=(new Date).getTime();if(!(0==t&&e<updraft_activejobs_nextupdate)){updraft_activejobs_nextupdate=e+5500;var a="";jQuery(".ud_downloadstatus .updraftplus_downloader, #ud_downloadstatus2 .updraftplus_downloader").each(function(t,e){var r=jQuery(e).data("downloaderfor");"object"==typeof r&&(""!=a&&(a+=":"),a=a+r.base+","+r.nonce+","+r.what+","+r.index)});var r={downloaders:a};try{jQuery("#updraft-poplog").dialog("isOpen")&&(r.log_fetch=1,r.log_nonce=updraft_poplog_log_nonce,r.log_pointer=updraft_poplog_log_pointer)}catch(n){console.log(n)}updraft_activejobslist_backupnownonce_only&&"undefined"!=typeof updraft_backupnow_nonce&&""!=updraft_backupnow_nonce&&(r.thisjobonly=updraft_backupnow_nonce),updraft_send_command("activejobs_list",r,function(t){try{resp=ud_parse_json(t),resp.hasOwnProperty("l")&&(resp.l?(jQuery("#updraft_lastlogmessagerow").show(),jQuery("#updraft_lastlogcontainer").html(resp.l)):(jQuery("#updraft_lastlogmessagerow").hide(),jQuery("#updraft_lastlogcontainer").html("("+updraftlion.nothing_yet_logged+")")));var n=-1;if(jQuery("#updraft_activejobs").html(resp.j),jQuery("#updraft_activejobs .updraft_jobtimings").each(function(t,a){var r=jQuery(a);if(r.data("lastactivity")&&r.data("jobid")){var o=r.data("jobid"),u=r.data("lastactivity");(n==-1||u<n)&&(n=u);var d=r.data("nextresumptionafter"),s=r.data("nextresumption");e=(new Date).getTime(),u>50&&s>0&&d<-30&&e>updraft_last_forced_when+1e5&&(updraft_last_forced_jobid!=o||s!=updraft_last_forced_resumption)&&(updraft_last_forced_resumption=s,updraft_last_forced_jobid=o,updraft_last_forced_when=e,console.log("UpdraftPlus: force resumption: job_id="+o+", resumption="+s),updraft_send_command("forcescheduledresumption",{resumption:s,job_id:o},function(t){console.log(t)},{json_parse:!1,alert_on_error:!1}))}}),e=(new Date).getTime(),updraft_activejobs_nextupdate=e+18e4,1==updraft_page_is_visible&&(1==updraft_console_focussed_tab||2==updraft_console_focussed_tab&&""!=a)&&(updraft_activejobs_nextupdate=n>-1?n<5?e+1750:e+5e3:lastlog_lastdata==t?e+7500:e+1750),lastlog_lastdata=t,null!=resp.j&&""!=resp.j?(jQuery("#updraft_activejobsrow").show(),r.hasOwnProperty("thisjobonly")&&!updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+r.thisjobonly).length?(updraft_inpage_hasbegun=1,console.log("UpdraftPlus: the start of the requested backup job has been detected")):!updraft_inpage_hasbegun&&updraft_activejobslist_backupnownonce_only&&jQuery(".updraft_jobtimings.isautobackup").length?(autobackup_nonce=jQuery(".updraft_jobtimings.isautobackup").first().data("jobid"),autobackup_nonce&&(updraft_inpage_hasbegun=1,updraft_backupnow_nonce=autobackup_nonce,r.thisjobonly=autobackup_nonce,console.log("UpdraftPlus: the start of the requested backup job has been detected; id: "+autobackup_nonce))):1==updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+r.thisjobonly+".updraft_finished").length&&(updraft_inpage_hasbegun=2,console.log("UpdraftPlus: the end of the requested backup job has been detected"),"undefined"!=typeof updraft_inpage_success_callback&&""!=updraft_inpage_success_callback?updraft_inpage_success_callback.call(!1):jQuery("#updraft-backupnow-inpage-modal").dialog("close")),""==lastlog_jobs&&setTimeout(function(){jQuery("#updraft_backup_started").slideUp()},3500)):jQuery("#updraft_activejobsrow").is(":hidden")||("undefined"!=typeof lastbackup_laststatus&&updraft_showlastbackup(),jQuery("#updraft_activejobsrow").hide()),lastlog_jobs=resp.j,null!=resp.ds&&""!=resp.ds&&jQuery(resp.ds).each(function(e,a){""!=a.base&&updraft_downloader_status_update(a.base,a.timestamp,a.what,a.findex,a,t)}),null!=resp.u&&""!=resp.u&&jQuery("#updraft-poplog").dialog("isOpen")){var o=resp.u;if(o.nonce==updraft_poplog_log_nonce&&(updraft_poplog_log_pointer=o.pointer,null!=o.log&&""!=o.log)){var u=jQuery("#updraft-poplog").scrollTop();jQuery("#updraft-poplog-content").append(o.log),updraft_poplog_lastscroll!=u&&updraft_poplog_lastscroll!=-1||(jQuery("#updraft-poplog").scrollTop(jQuery("#updraft-poplog-content").prop("scrollHeight")),updraft_poplog_lastscroll=jQuery("#updraft-poplog").scrollTop())}}}catch(d){console.log(updraftlion.unexpectedresponse+" "+t),console.log(d)}},{json_parse:!1,type:"GET"})}}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("<em>"+e+" ...</em> "),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;jQuery("#updraft-poplog-content").html(t.log);var a={};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){var 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"})}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){var a=Math.round((new Date).getTime()/1e3);if(1==t||1==e)updraft_historytimer_notbefore=a+30;else if(a<updraft_historytimer_notbefore)return void console.log("Update history skipped: "+a.toString()+" < "+updraft_historytimer_notbefore.toString());1==t&&(1==e?(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanningremote+"</em></p>")):(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanning+"</em></p>")));var r=e?"remotescan":!!t&&"rescan";updraft_send_command("rescan",r,function(t){if(t.hasOwnProperty("logs_exist")&&t.logs_exist&&jQuery("#updraft_lastlogmessagerow .updraft-log-link").show(),t.hasOwnProperty("migrate_modal")&&t.migrate_modal&&jQuery("#updraft_migrate_modal_main").replaceWith(t.migrate_modal),null!=t.n&&jQuery("#updraft-navtab-backups").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),t.data&&console.log(t.data)}})}function updraft_intervals_monthly_or_not(t,e){var a="#updraft-navtab-settings-content #"+t,r=jQuery(a+" option").length,n="monthly"==e,o=!1;if(r>10&&(o=!0),n||o){if(n&&o)return void("monthly"==e&&(jQuery(".updraft_monthly_extra_words_"+t).remove(),jQuery(a).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>")));if(jQuery(".updraft_monthly_extra_words_"+t).remove(),n){updraft_interval_week_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.mdayselector).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>");var u=updraft_interval_month_val===!1?1:updraft_interval_month_val;u-=1,jQuery(a+" option:eq("+u+")").prop("selected",!0)}else{updraft_interval_month_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.dayselector);var d=updraft_interval_week_val===!1?1:updraft_interval_week_val;jQuery(a+" option:eq("+d+")").prop("selected",!0)}}}function updraft_check_same_times(){var t=0,e=jQuery("#updraft-navtab-settings-content .updraft_interval").val();"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());var a=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(t){updraft_send_command("activejobs_delete",t,function(e){"Y"==e.ok?jQuery("#updraft-jobid-"+t).html(e.m).fadeOut("slow").remove():"N"==e.ok?alert(e.m):(alert(updraftlion.unexpectedresponse),console.log(e))})}function updraftplus_diskspace_entity(t){jQuery("#updraft_diskspaceused_"+t).html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:t},function(e){jQuery("#updraft_diskspaceused_"+t).html(e.output)},{type:"GET"})}function updraft_iframe_modal(t,e){var a=780,r=500;jQuery("#updraft-iframe-modal-innards").html('<iframe width="100%" height="430px" src="'+ajaxurl+"?action=updraft_ajax&subaction="+t+"&nonce="+updraft_credentialtest_nonce+'"></iframe>'),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("open")}function updraft_html_modal(t,e,a,r){jQuery("#updraft-iframe-modal-innards").html(t);var n={};a<450&&(n[updraftlion.close]=function(){jQuery(this).dialog("close")}),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("option","buttons",n).dialog("open")}function updraftplus_diskspace(){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(t.output)},{type:"GET"})}function updraftplus_deletefromserver(t,e,a){a||(a=0);var r={stage:"delete",timestamp:t,type:e,findex:a};updraft_send_command("updraft_download_backup",r,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+"&timestamp="+t+"&type="+e+"&stage=2&findex="+a+"&action=updraft_download_backup"}function updraftplus_show_contents(t,e,a){var r='<div id="updraft_zip_files_container" class="hidden-in-updraftcentral" style="clear:left;"><div id="updraft_zip_info_container"><p><span id="updraft_zip_path_text">'+updraftlion.zip_file_contents_info+'</span> - <span id="updraft_zip_size_text"></span></p>'+updraftlion.browse_download_link+'</div><div id="updraft_zip_files_jstree_container"><input type="search" id="zip_files_jstree_search" name="zip_files_jstree_search" placeholder="'+updraftlion.search+'"><div id="updraft_zip_files_jstree"></div></div></div>';updraft_html_modal(r,updraftlion.zip_file_contents,780,500),zip_files_jstree("zipbrowser",t,e,a)}function zip_files_jstree(t,e,a,r){jQuery("#updraft_zip_files_jstree").jstree({core:{multiple:!1,data:function(n,o){updraft_send_command("get_jstree_directory_nodes",{entity:t,node:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):o.call(this,t.nodes)})},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 n=!1;jQuery("#zip_files_jstree_search").keyup(function(){n&&clearTimeout(n),n=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").click(function(t){t.preventDefault();var n=jQuery("#updraft_zip_path_text").text();updraft_send_command("get_zipfile_download",{path:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):t.hasOwnProperty("path")?location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+e+"&type="+a+"&stage=2&findex="+r+"&filepath="+t.path+"&action=updraft_download_backup":alert(updraftlion.download_timeout)})})}function updraft_downloader(t,e,a,r,n,o,u){"string"!=typeof n&&(n=n.toString());for(var n=n.split(","),d=0;d<n.length;d++){var s=t+e+"_"+a+"_"+n[d],i="."+s,p=parseInt(n[d]);p++;var l=0==n[d]?"":" ("+p+")";if(!jQuery(i).length){var c=o?o:e;jQuery(r).append('<div style="clear:left; border: 1px solid; padding: 8px; margin-top: 4px; max-width:840px;" class="'+s+' updraftplus_downloader"><button onclick="jQuery(this).parent().fadeOut().remove();" type="button" style="float:right; margin-bottom: 8px;">X</button><strong>'+updraftlion.download+" "+a+l+" ("+c+')</strong>:<div class="raw">'+updraftlion.begunlooking+'</div><div class="file '+s+'_st"><div class="dlfileprogress" style="width: 0;"></div></div></div>'),jQuery(i).data("downloaderfor",{base:t,nonce:e,what:a,index:n[d]}),setTimeout(function(){updraft_activejobs_update(!0)},1500)}jQuery(i).data("lasttimebegan",(new Date).getTime()),u=!!u;var f=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+n[d]).data("wp_nonce").toString(),_={type:a,timestamp:e,findex:n[d]},g={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:f,timeout:1e4,async:u};updraft_send_command("updraft_download_backup",_,function(t){},g)}return!1}function ud_parse_json(t){t.charAt(0),t.charAt(t.length-1);try{var e=JSON.parse(t);return e}catch(a){console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse"),console.log(t)}var r=t.indexOf("{"),n=t.lastIndexOf("}");if(r>-1&&n>-1){var o=t.slice(r,n+1);try{var u=JSON.parse(o);return console.log("UpdraftPlus: JSON re-parse successful"),u}catch(a){throw console.log("UpdraftPlus: Exception when trying to parse JSON (2)"),a}}throw"UpdraftPlus: could not parse the JSON"}function updraft_restorer_checkstage2(t){var e=jQuery("#ud_downloadstatus2 .file").length;return e>0?void(t&&alert(updraftlion.stilldownloading)):(jQuery("#updraft-restore-modal-stage2a").html(updraftlion.processing),void updraft_send_command("restore_alldownloaded",{timestamp:jQuery("#updraft_restore_timestamp").val(),restoreopts:jQuery("#updraft_restore_form").serialize()},function(t){var e=null;jQuery("#updraft_restorer_restore_options").val("");try{var a=ud_parse_json(t);if(null==a)return void jQuery("#updraft-restore-modal-stage2a").html(updraftlion.emptyresponse);var r=a.m;if(""!=a.w&&(r=r+"<p><strong>"+updraftlion.warnings+"</strong><br>"+a.w+"</p>"),""!=a.e?r=r+"<p><strong>"+updraftlion.errors+"</strong><br>"+a.e+"</p>":updraft_restore_stage=3,a.hasOwnProperty("i")){try{if(e=ud_parse_json(a.i),e.hasOwnProperty("addui")){console.log("Further UI options are being displayed");var n=e.addui;r+='<div id="updraft_restoreoptions_ui" style="clear:left; padding-top:10px;">'+n+"</div>","object"==typeof JSON&&"function"==typeof JSON.stringify&&(delete e.addui,a.i=JSON.stringify(e))}}catch(o){console.log(o),console.log(a)}jQuery("#updraft_restorer_backup_info").val(a.i)}else jQuery("#updraft_restorer_backup_info").val();jQuery("#updraft-restore-modal-stage2a").html(r),jQuery("#updraft-restore-modal-stage2a .updraft_select2").length>0&&jQuery("#updraft-restore-modal-stage2a .updraft_select2").select2()}catch(o){console.log(t),console.log(o),jQuery("#updraft-restore-modal-stage2a").text(updraftlion.jsonnotunderstood+" "+updraftlion.errordata+": "+t).html()}},{json_parse:!1}))}function updraft_downloader_status(t,e,a,r){}function updraft_downloader_status_update(t,e,a,r,n,o){var u=t+e+"_"+a+"_"+r,d="."+u,s=0;if(null!=n.e)jQuery(d+" .raw").html("<strong>"+updraftlion.error+"</strong> "+n.e),console.log(n);else if(null!=n.p){if(jQuery(d+"_st .dlfileprogress").width(n.p+"%"),null!=n.a&&n.a>0){var i=(new Date).getTime(),p=jQuery(d).data("lasttimebegan"),l=i-p;if(n.a>90&&l>6e4){console.log(e+" "+a+" "+r+": restarting download: file_age="+n.a+", sincelastrestart_ms="+l),jQuery(d).data("lasttimebegan",(new Date).getTime());var c=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+r),f={type:a,timestamp:e,findex:r},_={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:c.data("wp_nonce").toString(),timeout:1e4};updraft_send_command("updraft_download_backup",f,function(t){},_),jQuery(d).data("lasttimebegan",(new Date).getTime())}}if(null!=n.m)if(n.p>=100&&"udrestoredlstatus_"==t)jQuery(d+" .raw").html(n.m),jQuery(d).fadeOut("slow",function(){jQuery(this).remove(),updraft_restorer_checkstage2(0)});else if(n.p<100||"uddlstatus_"!=t)jQuery(d+" .raw").html(n.m);else{var g=updraftlion.fileready+" "+updraftlion.actions+': \t\t\t\t<button type="button" onclick="updraftplus_downloadstage2(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.downloadtocomputer+'</button> \t\t\t\t<button id="uddownloaddelete_'+e+"_"+a+'" type="button" onclick="updraftplus_deletefromserver(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.deletefromserver+"</button>";n.hasOwnProperty("can_show_contents")&&n.can_show_contents&&(g+=' <button type="button" onclick="updraftplus_show_contents(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.browse_contents+"</button>"),jQuery(d+" .raw").html(g)}}else null!=n.m?jQuery(d+" .raw").html(n.m):(jQuery(d+" .raw").html(updraftlion.jsonnotunderstood+" ("+o+")"),s=1);return s}function updraft_backupnow_go(t,e,a,r,n,o,u){jQuery("#updraft_backup_started").html("<em>"+updraftlion.requeststart+"</em>").slideDown(""),setTimeout(function(){jQuery("#updraft_backup_started").fadeOut("slow")},75e3);var d={backupnow_nodb:t,backupnow_nofiles:e,backupnow_nocloud:a,backupnow_label:o,extradata:n};""!=r&&(d.onlythisfileentity=r),""!=u&&(d.onlythesetableentities=u),updraft_send_command("backupnow",d,function(t){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)})}var onlythesefileentities=backupnow_whichfiles_checked("");""==onlythesefileentities?jQuery("#backupnow_includefiles_moreoptions").show():jQuery("#backupnow_includefiles_moreoptions").hide();var updraft_restore_stage=1,lastlog_lastmessage="",lastlog_lastdata="",lastlog_jobs="",updraft_activejobs_nextupdate=(new Date).getTime()+1e3,updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_settings_form_changed=!1;window.onbeforeunload=function(t){if(updraft_settings_form_changed)return updraftlion.unsavedsettings},"undefined"!=typeof document.hidden&&document.addEventListener("visibilitychange",function(){updraft_check_page_visibility(0)},!1),updraft_check_page_visibility(1);var updraft_poplog_log_nonce,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_historytimer=0,calculated_diskspace=0,updraft_historytimer_notbefore=0,updraft_history_lastchecksum=!1,updraft_interval_week_val=!1,updraft_interval_month_val=!1;"undefined"!=typeof updraft_siteurl&&setInterval(function(){jQuery.get(updraft_siteurl+"/wp-cron.php")},21e4);var lastlog_lastmessage="";jQuery(document).ajaxError(function(t,e,a,r){if(null!=r&&""!=r&&null!=e.responseText&&""!=e.responseText&&(console.log("Error caught by UpdraftPlus ajaxError handler (follows) for "+a.url),console.log(r),0==a.url.search(ajaxurl)))if(a.url.search("subaction=downloadstatus")>=0){var n=a.url.match(/timestamp=\d+/),o=a.url.match(/type=[a-z]+/),u=a.url.match(/findex=\d+/),d=a.url.match(/base=[a-z_]+/);if(u=u instanceof Array?parseInt(u[0].substr(7)):0,o=o instanceof Array?o[0].substr(5):"",d=d instanceof Array?d[0].substr(5):"",n=n instanceof Array?parseInt(n[0].substr(10)):0,""!=d&&""!=o&&n>0){var s=d+n+"_"+o+"_"+u;jQuery("."+s+" .raw").html("<strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode)}}else a.url.search("subaction=restore_alldownloaded")>=0&&jQuery("#updraft-restore-modal-stage2a").append("<br><strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode+": "+r)}),jQuery(document).ready(function(t){function e(e){t('.expertmode .advanced_settings_container .advanced_tools:not(".'+e+'")').hide(),t(".expertmode .advanced_settings_container .advanced_tools."+e).fadeIn("slow"),t(".expertmode .advanced_settings_container .advanced_tools_button:not(#"+e+")").removeClass("active"),t(".expertmode .advanced_settings_container .advanced_tools_button#"+e).addClass("active")}function a(t){var e=!!jQuery("#updraftcentral_mothership_other").is(":checked");e?(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!1),t?jQuery("#updraftcentral_keycreate_mothership_firewalled_container").show():(jQuery(".updraftcentral_wizard_self_hosted_stage2").show(),jQuery("#updraftcentral_keycreate_mothership_firewalled_container").slideDown(),jQuery("#updraftcentral_keycreate_mothership").focus())):(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!0),t||(jQuery(".updraftcentral_wizard_self_hosted_stage2").hide(),r()))}function r(){jQuery("#updraftcentral_wizard_stage1_error").text(""); 
    2 var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function n(e,a,r,o){jQuery("#updraft-delete-waitwarning").slideDown();var u=e,d=a,s=r,i=o,p=jQuery("#updraft_delete_timestamp").val().split(","),l=jQuery("#updraft_delete_form").serializeArray(),c={};t.each(l,function(){void 0!==c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c.remote_delete_limit=updraftlion.remote_delete_limit,delete c.action,delete c.subaction,delete c.nonce,updraft_send_command("deleteset",c,function(t){if(t.hasOwnProperty("result")&&null!=t.result)if("error"==t.result)alert(updraftlion.error+" "+t.message);else if("continue"==t.result)u=u+t.backup_local+t.backup_remote,d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,jQuery("#updraft-deleted-files-total").text(u+" "+updraftlion.remote_files_deleted),n(u,d,s,i);else if("success"==t.result){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp(),t.hasOwnProperty("count_backups")&&jQuery("#updraft-navtab-backups").html(updraftlion.existing_backups+" ("+t.count_backups+")");for(var e=0;e<p.length;e++){var a=p[e];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+a).slideUp().remove()}jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length<1&&jQuery("#ud_massactions").hide(),updraft_history_lastchecksum=!1,jQuery("#updraft-delete-modal").dialog("close"),d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,alert(t.set_message+" "+i+"\n"+t.local_message+" "+d+"\n"+t.remote_message+" "+s)}})}function o(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideUp()}function u(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.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('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var 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)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.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(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function d(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function s(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-migrate-modal").dialog("close"),jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function i(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}if(t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var p=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||p.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[],a="";t(".updraft_webdav_settings").each(function(r,n){var o=t(n).attr("id");if(o&&"updraft_webdav_"==o.substring(0,15)){var u=o.substring(15);id_split=u.split("_"),u=id_split[0],a=id_split[1],e[u]=this.value}});var r="",n="@",o="/",u=":",d=":";(e.host.indexOf("@")>=0||""===e.host)&&(n=""),e.host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e.path.indexOf("/")&&""!==e.path||(o=""),""!==e.user&&""!==e.pass||(u=""),""!==e.host&&""!==e.port||(d=""),r=e.webdav+e.user+u+e.pass+n+encodeURIComponent(e.host)+d+e.port+o+e.path,t("#updraft_webdav_url_"+a).val(r)}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(e){(e.ctrlKey||e.metaKey)&&(t(this).toggleClass("backuprowselected"),t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length>0?t("#ud_massactions").show():t("#ud_massactions").hide())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var t=jQuery(this).data("method"),e=jQuery(this).data("instance_id");updraft_remote_storage_test(t,function(e,a,r){return"sftp"==t&&(r.hasOwnProperty("scp")&&r.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+e.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+e.output),e.hasOwnProperty("data")&&console.log(e.data),!0)},e)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),updraftplus_diskspace()}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){a(!1)}),a(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});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('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),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(),r()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(resp=ud_parse_json(t),resp.hasOwnProperty("error"))return alert(resp.error),void console.log(resp);alert(resp.r),resp.hasOwnProperty("bundle")&&resp.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(resp.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+resp.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+resp.bundle+"</textarea></div>")):console.log(resp),resp.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(resp.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+t),console.log(e)}},{json_parse:!1})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)}))}),jQuery("#updraft_reset_sid").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").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var l=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>l&&(l=a)}),l>180&&jQuery(".updraft-bigbutton").width(l),setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var c={};c[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:c});var f={};f[updraftlion.deletebutton]=function(){n(0,0,0,0)},f[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:262,width:430,modal:!0,buttons:f});var _={};_[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var u=jQuery(o).data("howmany"),d=jQuery(o).val();if((1==r||2==r&&"db"!=d)&&("wpcore"!=d&&(u=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),d="wpcore"),"wpcore"!=d||0==a){var s=[d,u];e.push(s),"wpcore"==d&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,u=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:u},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",u,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1})}catch(d){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(d),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},_[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:_}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:345,width:580,modal:!0});var g={};g[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=backupnow_whichtables_checked("");if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var n=backupnow_whichfiles_checked("");return""==n&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,n,"",jQuery("#backupnow_label").val(),r))},g[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:g}),jQuery("#updraft-migrate-modal").dialog({autoOpen:!1,height:updraftlion.migratemodalheight,width:updraftlion.migratemodalwidth,modal:!0}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&o(t,!1)}),jQuery("#updraft-navtab-settings-content .updraft-service").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").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-status-content").show(),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-expert-content").show(),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=4}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-settings-content").show(),jQuery("#updraft-navtab-settings").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=3}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").show(),jQuery("#updraft-navtab-addons").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=5}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_openrestorepanel(1)}),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(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()}catch(y){console.log(y)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),d(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),d(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,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").on("click",".updraft_jobinfo_delete",function(t){t.preventDefault();var e=jQuery(this).data("jobid");e?updraft_activejobs_delete(e):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").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("jobid");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){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");s(e,a,r)}),"initiate_restore"==i("udaction")){var h=i("entities"),m=i("backup_timestamp"),v=i("showdata");s(h,m,v)}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),u=jQuery(this).data("prettydate"),d=!0;updraft_downloader(e,a,r,n,o,u,d)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e+"#updraftvault_settings_connect input").keypress(function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))}),!1})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.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)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.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+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]);for(var u in updraftlion.remote_storage_options[n]){var d=updraftlion.remote_storage_options[n][u];r+=o(d)}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup()})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40",epoch_date:e.getTime(), 
    3 local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var u=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:u,updraftplus_version:updraftlion.updraftplus_version},function(e){var a=n(e);!a.hasOwnProperty("saved")||a.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),a.hasOwnProperty("error_message")&&a.error_message&&alert(a.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,json_parse:!1})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e){try{var a=ud_parse_json(e),r=(a.messages,a.backup_dir.writable),n=a.backup_dir.message,o=a.backup_dir.button_title}catch(u){return console.log(u),console.log(e),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(a.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(a.changed);for(prop in a.changed)if("object"==typeof a.changed[prop])for(innerprop in a.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(a.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(a.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),a.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(a.updraft_include_more_path),a.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(a.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(a.messages),t("#next-backup-table-inner").html(a.scheduled),a}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var u=new Image;u.src=updraftlion.ud_url+"/images/udlogo-rotating.gif",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e){n(e),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",nonce:updraftplus_settings_nonce,json_parse:!1})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)})}),jQuery(document).ready(function(t){jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}})}); 
     2var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function n(e,a,r,o){jQuery("#updraft-delete-waitwarning").slideDown();var u=e,d=a,s=r,i=o,p=jQuery("#updraft_delete_timestamp").val().split(","),l=jQuery("#updraft_delete_form").serializeArray(),c={};t.each(l,function(){void 0!==c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c.remote_delete_limit=updraftlion.remote_delete_limit,delete c.action,delete c.subaction,delete c.nonce,updraft_send_command("deleteset",c,function(t){if(t.hasOwnProperty("result")&&null!=t.result)if("error"==t.result)alert(updraftlion.error+" "+t.message);else if("continue"==t.result)u=u+t.backup_local+t.backup_remote,d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,jQuery("#updraft-deleted-files-total").text(u+" "+updraftlion.remote_files_deleted),n(u,d,s,i);else if("success"==t.result){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp(),t.hasOwnProperty("count_backups")&&jQuery("#updraft-navtab-backups").html(updraftlion.existing_backups+" ("+t.count_backups+")");for(var e=0;e<p.length;e++){var a=p[e];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+a).slideUp().remove()}jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length<1&&jQuery("#ud_massactions").hide(),updraft_history_lastchecksum=!1,jQuery("#updraft-delete-modal").dialog("close"),d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,alert(t.set_message+" "+i+"\n"+t.local_message+" "+d+"\n"+t.remote_message+" "+s)}})}function o(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideUp()}function u(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.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('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var 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)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.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(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function d(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function s(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-migrate-modal").dialog("close"),jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function i(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}if(t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var p=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||p.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[],a="";t(".updraft_webdav_settings").each(function(r,n){var o=t(n).attr("id");if(o&&"updraft_webdav_"==o.substring(0,15)){var u=o.substring(15);id_split=u.split("_"),u=id_split[0],a=id_split[1],e[u]=this.value}});var r="",n="@",o="/",u=":",d=":";(e.host.indexOf("@")>=0||""===e.host)&&(n=""),e.host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e.path.indexOf("/")&&""!==e.path||(o=""),""!==e.user&&""!==e.pass||(u=""),""!==e.host&&""!==e.port||(d=""),r=e.webdav+e.user+u+e.pass+n+encodeURIComponent(e.host)+d+e.port+o+e.path,t("#updraft_webdav_url_"+a).val(r)}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(e){(e.ctrlKey||e.metaKey)&&(t(this).toggleClass("backuprowselected"),t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length>0?t("#ud_massactions").show():t("#ud_massactions").hide())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var t=jQuery(this).data("method"),e=jQuery(this).data("instance_id");updraft_remote_storage_test(t,function(e,a,r){return"sftp"==t&&(r.hasOwnProperty("scp")&&r.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+e.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+e.output),e.hasOwnProperty("data")&&console.log(e.data),!0)},e)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),updraftplus_diskspace()}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){a(!1)}),a(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});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('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),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(),r()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(resp=ud_parse_json(t),resp.hasOwnProperty("error"))return alert(resp.error),void console.log(resp);alert(resp.r),resp.hasOwnProperty("bundle")&&resp.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(resp.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+resp.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+resp.bundle+"</textarea></div>")):console.log(resp),resp.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(resp.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+t),console.log(e)}},{json_parse:!1})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)}))}),jQuery("#updraft_reset_sid").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").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var l=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>l&&(l=a)}),l>180&&jQuery(".updraft-bigbutton").width(l),setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var c={};c[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:c});var f={};f[updraftlion.deletebutton]=function(){n(0,0,0,0)},f[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:262,width:430,modal:!0,buttons:f});var _={};_[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var u=jQuery(o).data("howmany"),d=jQuery(o).val();if((1==r||2==r&&"db"!=d)&&("wpcore"!=d&&(u=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),d="wpcore"),"wpcore"!=d||0==a){var s=[d,u];e.push(s),"wpcore"==d&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,u=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:u},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",u,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1})}catch(d){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(d),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},_[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:_}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:345,width:580,modal:!0});var g={};g[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=backupnow_whichtables_checked("");if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var n=backupnow_whichfiles_checked("");return""==n&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,n,"",jQuery("#backupnow_label").val(),r))},g[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:g}),jQuery("#updraft-migrate-modal").dialog({autoOpen:!1,height:updraftlion.migratemodalheight,width:updraftlion.migratemodalwidth,modal:!0}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&o(t,!1)}),jQuery("#updraft-navtab-settings-content .updraft-service").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").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-status-content").show(),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-expert-content").show(),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=4}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-settings-content").show(),jQuery("#updraft-navtab-settings").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=3}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").show(),jQuery("#updraft-navtab-addons").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=5}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_openrestorepanel(1)}),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(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()}catch(y){console.log(y)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),d(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),d(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,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").on("click",".updraft_jobinfo_delete",function(t){t.preventDefault();var e=jQuery(this).data("jobid");e?updraft_activejobs_delete(e):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").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("jobid");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){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");s(e,a,r)}),"initiate_restore"==i("udaction")){var h=i("entities"),m=i("backup_timestamp"),v=i("showdata");s(h,m,v)}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),u=jQuery(this).data("prettydate"),d=!0;updraft_downloader(e,a,r,n,o,u,d)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e+"#updraftvault_settings_connect input").keypress(function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))}),!1})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.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)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.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+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&null!==t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&null!==e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]);for(var u in updraftlion.remote_storage_options[n]){var d=updraftlion.remote_storage_options[n][u];r+=o(d)}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup()})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40", 
     3epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var u=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:u,updraftplus_version:updraftlion.updraftplus_version},function(e){var a=n(e);!a.hasOwnProperty("saved")||a.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),a.hasOwnProperty("error_message")&&a.error_message&&alert(a.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,json_parse:!1})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e){try{var a=ud_parse_json(e),r=(a.messages,a.backup_dir.writable),n=a.backup_dir.message,o=a.backup_dir.button_title}catch(u){return console.log(u),console.log(e),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(a.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(a.changed);for(prop in a.changed)if("object"==typeof a.changed[prop])for(innerprop in a.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(a.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(a.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),a.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(a.updraft_include_more_path),a.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(a.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(a.messages),t("#next-backup-table-inner").html(a.scheduled),a}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var u=new Image;u.src=updraftlion.ud_url+"/images/udlogo-rotating.gif",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e){n(e),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",nonce:updraftplus_settings_nonce,json_parse:!1})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)})}),jQuery(document).ready(function(t){jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}})}); 
  • updraftplus/tags/1.13.16/readme.txt

    r1782821 r1782865  
    1 === UpdraftPlus WordPress Backup Plugin === 
     1=== UpdraftPlus WordPress Backup Plugin === 
    22Contributors: Backup with UpdraftPlus, DavidAnderson, DNutbourne, aporter, snightingale, bcrodua 
    33Tags: backup, restore, database backup, wordpress backup, cloud backup, s3, dropbox, google drive, onedrive, ftp, backups 
     
    163163* TWEAK: Resolve PSR4 autoloading conflict with older version of Composer 
    164164* TWEAK: Pruning will now prune backups from multiple storage destinations of the same type (not yet a user-visible feature) 
     165* TWEAK: Update the 'ifeq' handlebars helper to resolve a conflict with MainWP 
    165166 
    166167= 1.13.15 - 28/Nov/2017 = 
  • updraftplus/trunk/includes/updraftplus-admin.js

    r1777080 r1782865  
    26522652 
    26532653    Handlebars.registerHelper('ifeq', function (a, b, opts) { 
    2654         if ('string' !== typeof a && 'undefined' !== typeof a) a = a.toString(); 
    2655         if ('string' !== typeof b && 'undefined' !== typeof b) b = b.toString(); 
     2654        if ('string' !== typeof a && 'undefined' !== typeof a && null !== a) a = a.toString(); 
     2655        if ('string' !== typeof b && 'undefined' !== typeof b && null !== b) b = b.toString(); 
    26562656        if (a === b) { 
    26572657            return opts.fn(this); 
  • updraftplus/trunk/includes/updraftplus-admin.min.js

    r1777080 r1782865  
    11function updraft_send_command(t,e,a,r){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"},"undefined"==typeof r&&(r={});for(var n in default_options)r.hasOwnProperty(n)||(r[n]=default_options[n]);var o={action:r.action,subaction:t};if(o[r.nonce_key]=r.nonce,"object"==typeof e)for(var u in e)o[u]=e[u];else o.action_data=e;var d={type:r.type,url:ajaxurl,data:o,success:function(t,e){if(r.json_parse){try{var n=ud_parse_json(t)}catch(o){return console.log(o),console.log(t),void(r.alert_on_error&&alert(updraftlion.unexpectedresponse+" "+t))}"function"==typeof a&&a(n,e,t)}else"function"==typeof a&&a(t,e)},error:function(t,e,a){"function"==typeof r.error_callback?r.error_callback(t,e,a):(console.log("updraft_send_command: error: "+e+" ("+a+")"),console.log(t))},dataType:"text",async:r.async};null!=r.timeout&&(d.timeout=r.timeout),jQuery.ajax(d)}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").removeAttr("disabled").show():jQuery("#updraft-delete-remote-section, #updraft_delete_remote").hide().attr("disabled","disabled"),t.indexOf(",")>-1?(jQuery("#updraft_delete_question_singular").hide(),jQuery("#updraft_delete_question_plural").show()):(jQuery("#updraft_delete_question_plural").hide(),jQuery("#updraft_delete_question_singular").show()),jQuery("#updraft-delete-modal").dialog("open")}function updraft_remote_storage_tab_activation(t){jQuery(".updraftplusmethod").hide(),jQuery(".remote-tab").data("active",!1),jQuery(".remote-tab").removeClass("nav-tab-active"),jQuery(".updraftplusmethod."+t).show(),jQuery(".remote-tab-"+t).data("active",!0),jQuery(".remote-tab-"+t).addClass("nav-tab-active")}function updraft_check_overduecrons(){updraft_send_command("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&jQuery("#updraft-insert-admin-warning").html(t.m)},{alert_on_error:!1})}function updraft_remote_storage_tabs_setup(){var t=0,e=jQuery(".updraft_servicecheckbox:checked");jQuery(e).each(function(a,r){var n=jQuery(r).val();"updraft_servicecheckbox_none"!=jQuery(r).attr("id")&&t++,jQuery(".remote-tab-"+n).show(),a==jQuery(e).length-1&&updraft_remote_storage_tab_activation(n)}),t>0&&jQuery(".updraftplusmethod.none").hide(),jQuery(document).keyup(function(t){if((32===t.keyCode||13===t.keyCode)&&jQuery(document.activeElement).is("input.labelauty + label")){var e=jQuery(document.activeElement).attr("for");e&&jQuery("#"+e).change()}}),jQuery(".updraft_servicecheckbox").change(function(){var e=jQuery(this).attr("id");if("updraft_servicecheckbox_"==e.substring(0,24)){var a=e.substring(24);null!=a&&""!=a&&(jQuery(this).is(":checked")?(t++,jQuery(".remote-tab-"+a).fadeIn(),updraft_remote_storage_tab_activation(a)):(t--,jQuery(".remote-tab-"+a).hide(),1==jQuery(".remote-tab-"+a).data("active")&&updraft_remote_storage_tab_activation(jQuery(".remote-tab:visible").last().attr("name"))))}t<=0?jQuery(".updraftplusmethod.none").fadeIn():jQuery(".updraftplusmethod.none").hide()}),jQuery(".updraft_servicecheckbox:not(.multi)").change(function(){var t=jQuery(this).attr("value");jQuery(this).is(":not(:checked)")?(jQuery(".updraftplusmethod."+t).hide(),jQuery(".updraftplusmethod.none").fadeIn()):jQuery(".updraft_servicecheckbox").not(this).prop("checked",!1)});var a=jQuery(".updraft_servicecheckbox");"function"==typeof a.labelauty&&a.labelauty()}function updraft_remote_storage_test(t,e,a){var r,n;a?(r=jQuery("#updraft-"+t+"-test-"+a),n=".updraftplusmethod."+t+"-"+a):(r=jQuery("#updraft-"+t+"-test"),n=".updraftplusmethod."+t);var o=r.data("method_label");r.html(updraftlion.testing_settings.replace("%s",o));var u={method:t};jQuery("#updraft-navtab-settings-content "+n+" input[data-updraft_settings_test], #updraft-navtab-settings-content .expertmode input[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test"),r=jQuery(e).attr("type");if(a){r||(console.log("UpdraftPlus: settings test input item with no type found"),console.log(e),r="text");var n=null;"checkbox"==r?n=jQuery(e).is(":checked")?1:0:"text"==r||"password"==r?n=jQuery(e).val():(console.log("UpdraftPlus: settings test input item with unrecognised type ("+r+") found"),console.log(e)),u[a]=n}}),jQuery("#updraft-navtab-settings-content "+n+" textarea[data-updraft_settings_test], #updraft-navtab-settings-content "+n+" select[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test");u[a]=jQuery(e).val()}),updraft_send_command("test_storage_settings",u,function(t,a){r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof e&&0!=e&&(e=e.call(this,t,a,u)),"undefined"!=typeof e&&!1===e&&(alert(updraftlion.settings_test_result.replace("%s",o)+" "+t.output),t.hasOwnProperty("data")&&console.log(t.data))})}function backupnow_whichfiles_checked(t){return jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(e){if(jQuery(this).is(":checked")){var a=jQuery(this).attr("name");if("updraft_include_"==a.substring(0,16)){var r=a.substring(16);""!=t&&(t+=","),t+=r}}}),t}function backupnow_whichtables_checked(t){var e=!1;return jQuery('#backupnow_database_moreoptions input[type="checkbox"]').each(function(t){if(!jQuery(this).is(":checked"))return void(e=!0)}),t=jQuery("input[name^='updraft_include_tables_']").serializeArray(),!e||t}function updraft_deleteallselected(){var t=0,e="",a="",r="";jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").each(function(n){t++;var o=jQuery(this).data("nonce");a&&(a+=","),a+=o;var u=jQuery(this).data("key");e&&(e+=","),e+=u;var d=jQuery(this).find(".updraftplus-remove").data("hasremote");r&&(r+=","),r+=d}),updraft_delete(e,a,r)}function updraft_openrestorepanel(t){updraft_console_focussed_tab=2,updraft_historytimertoggle(t),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-backups-content").show(),jQuery("#updraft-navtab-backups").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active")}function updraft_delete_old_dirs(){return!0}function updraft_initiate_restore(t){jQuery("#updraft-migrate-modal").dialog("close"),jQuery('#updraft-navtab-backups-content .updraft_existing_backups button[data-backup_timestamp="'+t+'"]').click()}function updraft_restore_setoptions(t){var e=0;jQuery('input[name="updraft_restore[]"]').each(function(a,r){var n=jQuery(r).val(),o=n+"=([0-9,]+)",u=new RegExp(o),d=t.match(u);d?(jQuery(r).removeAttr("disabled").data("howmany",d[1]).parent().show(),e++,"db"==n&&(e+=4.5),jQuery(r).is(":checked")&&jQuery("#updraft_restorer_"+n+"options").show()):jQuery(r).attr("disabled","disabled").parent().hide()});var a=t.match(/dbcrypted=1/);a?jQuery(".updraft_restore_crypteddb").show():jQuery(".updraft_restore_crypteddb").hide();var r=t.match(/meta_foreign=([12])/);r?jQuery("#updraft_restore_meta_foreign").val(r[1]):jQuery("#updraft_restore_meta_foreign").val("0");var n=336+20*e;jQuery("#updraft-restore-modal").dialog("option","height",n)}function updraft_backup_dialog_open(){jQuery("#backupnow_includefiles_moreoptions").hide(),updraft_settings_form_changed?window.confirm(updraftlion.unsavedsettingsbackup)&&(jQuery("#backupnow_label").val(""),jQuery("#updraft-backupnow-modal").dialog("open")):(jQuery("#backupnow_label").val(""),jQuery("#updraft-backupnow-modal").dialog("open"))}function updraft_migrate_dialog_open(){jQuery("#updraft_migrate_modal_alt").hide(),updraft_migrate_modal_default_buttons={},updraft_migrate_modal_default_buttons[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-migrate-modal").dialog("option","buttons",updraft_migrate_modal_default_buttons),jQuery("#updraft-migrate-modal").dialog("open"),jQuery("#updraft_migrate_modal_main").show()}function updraft_check_page_visibility(t){"hidden"==document.visibilityState?updraft_page_is_visible=0:(updraft_page_is_visible=1,1!==t&&updraft_activejobs_update(!0))}function updraft_backupnow_inpage_go(t,e,a,r,n,o,u){r="undefined"==typeof r?0:r,n="undefined"==typeof n?0:n,o="undefined"==typeof o?0:o,u="undefined"==typeof u?updraftlion.automaticbackupbeforeupdate:u,updraft_console_focussed_tab=1,updraft_inpage_success_callback=t;var d={},s=jQuery("#updraft-backupnow-inpage-modal").length;s&&jQuery("#updraft-backupnow-inpage-modal").dialog("option","buttons",d),jQuery("#updraft_inpage_prebackup").hide(),s&&jQuery("#updraft-backupnow-inpage-modal").dialog("open"),jQuery("#updraft_inpage_backup").show(),updraft_activejobslist_backupnownonce_only=1,updraft_inpage_hasbegun=0,updraft_backupnow_go(r,n,o,e,a,u,"")}function updraft_activejobs_update(t){var e=(new Date).getTime();if(!(0==t&&e<updraft_activejobs_nextupdate)){updraft_activejobs_nextupdate=e+5500;var a="";jQuery(".ud_downloadstatus .updraftplus_downloader, #ud_downloadstatus2 .updraftplus_downloader").each(function(t,e){var r=jQuery(e).data("downloaderfor");"object"==typeof r&&(""!=a&&(a+=":"),a=a+r.base+","+r.nonce+","+r.what+","+r.index)});var r={downloaders:a};try{jQuery("#updraft-poplog").dialog("isOpen")&&(r.log_fetch=1,r.log_nonce=updraft_poplog_log_nonce,r.log_pointer=updraft_poplog_log_pointer)}catch(n){console.log(n)}updraft_activejobslist_backupnownonce_only&&"undefined"!=typeof updraft_backupnow_nonce&&""!=updraft_backupnow_nonce&&(r.thisjobonly=updraft_backupnow_nonce),updraft_send_command("activejobs_list",r,function(t){try{resp=ud_parse_json(t),resp.hasOwnProperty("l")&&(resp.l?(jQuery("#updraft_lastlogmessagerow").show(),jQuery("#updraft_lastlogcontainer").html(resp.l)):(jQuery("#updraft_lastlogmessagerow").hide(),jQuery("#updraft_lastlogcontainer").html("("+updraftlion.nothing_yet_logged+")")));var n=-1;if(jQuery("#updraft_activejobs").html(resp.j),jQuery("#updraft_activejobs .updraft_jobtimings").each(function(t,a){var r=jQuery(a);if(r.data("lastactivity")&&r.data("jobid")){var o=r.data("jobid"),u=r.data("lastactivity");(n==-1||u<n)&&(n=u);var d=r.data("nextresumptionafter"),s=r.data("nextresumption");e=(new Date).getTime(),u>50&&s>0&&d<-30&&e>updraft_last_forced_when+1e5&&(updraft_last_forced_jobid!=o||s!=updraft_last_forced_resumption)&&(updraft_last_forced_resumption=s,updraft_last_forced_jobid=o,updraft_last_forced_when=e,console.log("UpdraftPlus: force resumption: job_id="+o+", resumption="+s),updraft_send_command("forcescheduledresumption",{resumption:s,job_id:o},function(t){console.log(t)},{json_parse:!1,alert_on_error:!1}))}}),e=(new Date).getTime(),updraft_activejobs_nextupdate=e+18e4,1==updraft_page_is_visible&&(1==updraft_console_focussed_tab||2==updraft_console_focussed_tab&&""!=a)&&(updraft_activejobs_nextupdate=n>-1?n<5?e+1750:e+5e3:lastlog_lastdata==t?e+7500:e+1750),lastlog_lastdata=t,null!=resp.j&&""!=resp.j?(jQuery("#updraft_activejobsrow").show(),r.hasOwnProperty("thisjobonly")&&!updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+r.thisjobonly).length?(updraft_inpage_hasbegun=1,console.log("UpdraftPlus: the start of the requested backup job has been detected")):!updraft_inpage_hasbegun&&updraft_activejobslist_backupnownonce_only&&jQuery(".updraft_jobtimings.isautobackup").length?(autobackup_nonce=jQuery(".updraft_jobtimings.isautobackup").first().data("jobid"),autobackup_nonce&&(updraft_inpage_hasbegun=1,updraft_backupnow_nonce=autobackup_nonce,r.thisjobonly=autobackup_nonce,console.log("UpdraftPlus: the start of the requested backup job has been detected; id: "+autobackup_nonce))):1==updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+r.thisjobonly+".updraft_finished").length&&(updraft_inpage_hasbegun=2,console.log("UpdraftPlus: the end of the requested backup job has been detected"),"undefined"!=typeof updraft_inpage_success_callback&&""!=updraft_inpage_success_callback?updraft_inpage_success_callback.call(!1):jQuery("#updraft-backupnow-inpage-modal").dialog("close")),""==lastlog_jobs&&setTimeout(function(){jQuery("#updraft_backup_started").slideUp()},3500)):jQuery("#updraft_activejobsrow").is(":hidden")||("undefined"!=typeof lastbackup_laststatus&&updraft_showlastbackup(),jQuery("#updraft_activejobsrow").hide()),lastlog_jobs=resp.j,null!=resp.ds&&""!=resp.ds&&jQuery(resp.ds).each(function(e,a){""!=a.base&&updraft_downloader_status_update(a.base,a.timestamp,a.what,a.findex,a,t)}),null!=resp.u&&""!=resp.u&&jQuery("#updraft-poplog").dialog("isOpen")){var o=resp.u;if(o.nonce==updraft_poplog_log_nonce&&(updraft_poplog_log_pointer=o.pointer,null!=o.log&&""!=o.log)){var u=jQuery("#updraft-poplog").scrollTop();jQuery("#updraft-poplog-content").append(o.log),updraft_poplog_lastscroll!=u&&updraft_poplog_lastscroll!=-1||(jQuery("#updraft-poplog").scrollTop(jQuery("#updraft-poplog-content").prop("scrollHeight")),updraft_poplog_lastscroll=jQuery("#updraft-poplog").scrollTop())}}}catch(d){console.log(updraftlion.unexpectedresponse+" "+t),console.log(d)}},{json_parse:!1,type:"GET"})}}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("<em>"+e+" ...</em> "),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;jQuery("#updraft-poplog-content").html(t.log);var a={};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){var 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"})}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){var a=Math.round((new Date).getTime()/1e3);if(1==t||1==e)updraft_historytimer_notbefore=a+30;else if(a<updraft_historytimer_notbefore)return void console.log("Update history skipped: "+a.toString()+" < "+updraft_historytimer_notbefore.toString());1==t&&(1==e?(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanningremote+"</em></p>")):(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanning+"</em></p>")));var r=e?"remotescan":!!t&&"rescan";updraft_send_command("rescan",r,function(t){if(t.hasOwnProperty("logs_exist")&&t.logs_exist&&jQuery("#updraft_lastlogmessagerow .updraft-log-link").show(),t.hasOwnProperty("migrate_modal")&&t.migrate_modal&&jQuery("#updraft_migrate_modal_main").replaceWith(t.migrate_modal),null!=t.n&&jQuery("#updraft-navtab-backups").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),t.data&&console.log(t.data)}})}function updraft_intervals_monthly_or_not(t,e){var a="#updraft-navtab-settings-content #"+t,r=jQuery(a+" option").length,n="monthly"==e,o=!1;if(r>10&&(o=!0),n||o){if(n&&o)return void("monthly"==e&&(jQuery(".updraft_monthly_extra_words_"+t).remove(),jQuery(a).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>")));if(jQuery(".updraft_monthly_extra_words_"+t).remove(),n){updraft_interval_week_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.mdayselector).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>");var u=updraft_interval_month_val===!1?1:updraft_interval_month_val;u-=1,jQuery(a+" option:eq("+u+")").prop("selected",!0)}else{updraft_interval_month_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.dayselector);var d=updraft_interval_week_val===!1?1:updraft_interval_week_val;jQuery(a+" option:eq("+d+")").prop("selected",!0)}}}function updraft_check_same_times(){var t=0,e=jQuery("#updraft-navtab-settings-content .updraft_interval").val();"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());var a=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(t){updraft_send_command("activejobs_delete",t,function(e){"Y"==e.ok?jQuery("#updraft-jobid-"+t).html(e.m).fadeOut("slow").remove():"N"==e.ok?alert(e.m):(alert(updraftlion.unexpectedresponse),console.log(e))})}function updraftplus_diskspace_entity(t){jQuery("#updraft_diskspaceused_"+t).html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:t},function(e){jQuery("#updraft_diskspaceused_"+t).html(e.output)},{type:"GET"})}function updraft_iframe_modal(t,e){var a=780,r=500;jQuery("#updraft-iframe-modal-innards").html('<iframe width="100%" height="430px" src="'+ajaxurl+"?action=updraft_ajax&subaction="+t+"&nonce="+updraft_credentialtest_nonce+'"></iframe>'),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("open")}function updraft_html_modal(t,e,a,r){jQuery("#updraft-iframe-modal-innards").html(t);var n={};a<450&&(n[updraftlion.close]=function(){jQuery(this).dialog("close")}),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("option","buttons",n).dialog("open")}function updraftplus_diskspace(){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(t.output)},{type:"GET"})}function updraftplus_deletefromserver(t,e,a){a||(a=0);var r={stage:"delete",timestamp:t,type:e,findex:a};updraft_send_command("updraft_download_backup",r,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+"&timestamp="+t+"&type="+e+"&stage=2&findex="+a+"&action=updraft_download_backup"}function updraftplus_show_contents(t,e,a){var r='<div id="updraft_zip_files_container" class="hidden-in-updraftcentral" style="clear:left;"><div id="updraft_zip_info_container"><p><span id="updraft_zip_path_text">'+updraftlion.zip_file_contents_info+'</span> - <span id="updraft_zip_size_text"></span></p>'+updraftlion.browse_download_link+'</div><div id="updraft_zip_files_jstree_container"><input type="search" id="zip_files_jstree_search" name="zip_files_jstree_search" placeholder="'+updraftlion.search+'"><div id="updraft_zip_files_jstree"></div></div></div>';updraft_html_modal(r,updraftlion.zip_file_contents,780,500),zip_files_jstree("zipbrowser",t,e,a)}function zip_files_jstree(t,e,a,r){jQuery("#updraft_zip_files_jstree").jstree({core:{multiple:!1,data:function(n,o){updraft_send_command("get_jstree_directory_nodes",{entity:t,node:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):o.call(this,t.nodes)})},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 n=!1;jQuery("#zip_files_jstree_search").keyup(function(){n&&clearTimeout(n),n=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").click(function(t){t.preventDefault();var n=jQuery("#updraft_zip_path_text").text();updraft_send_command("get_zipfile_download",{path:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):t.hasOwnProperty("path")?location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+e+"&type="+a+"&stage=2&findex="+r+"&filepath="+t.path+"&action=updraft_download_backup":alert(updraftlion.download_timeout)})})}function updraft_downloader(t,e,a,r,n,o,u){"string"!=typeof n&&(n=n.toString());for(var n=n.split(","),d=0;d<n.length;d++){var s=t+e+"_"+a+"_"+n[d],i="."+s,p=parseInt(n[d]);p++;var l=0==n[d]?"":" ("+p+")";if(!jQuery(i).length){var c=o?o:e;jQuery(r).append('<div style="clear:left; border: 1px solid; padding: 8px; margin-top: 4px; max-width:840px;" class="'+s+' updraftplus_downloader"><button onclick="jQuery(this).parent().fadeOut().remove();" type="button" style="float:right; margin-bottom: 8px;">X</button><strong>'+updraftlion.download+" "+a+l+" ("+c+')</strong>:<div class="raw">'+updraftlion.begunlooking+'</div><div class="file '+s+'_st"><div class="dlfileprogress" style="width: 0;"></div></div></div>'),jQuery(i).data("downloaderfor",{base:t,nonce:e,what:a,index:n[d]}),setTimeout(function(){updraft_activejobs_update(!0)},1500)}jQuery(i).data("lasttimebegan",(new Date).getTime()),u=!!u;var f=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+n[d]).data("wp_nonce").toString(),_={type:a,timestamp:e,findex:n[d]},g={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:f,timeout:1e4,async:u};updraft_send_command("updraft_download_backup",_,function(t){},g)}return!1}function ud_parse_json(t){t.charAt(0),t.charAt(t.length-1);try{var e=JSON.parse(t);return e}catch(a){console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse"),console.log(t)}var r=t.indexOf("{"),n=t.lastIndexOf("}");if(r>-1&&n>-1){var o=t.slice(r,n+1);try{var u=JSON.parse(o);return console.log("UpdraftPlus: JSON re-parse successful"),u}catch(a){throw console.log("UpdraftPlus: Exception when trying to parse JSON (2)"),a}}throw"UpdraftPlus: could not parse the JSON"}function updraft_restorer_checkstage2(t){var e=jQuery("#ud_downloadstatus2 .file").length;return e>0?void(t&&alert(updraftlion.stilldownloading)):(jQuery("#updraft-restore-modal-stage2a").html(updraftlion.processing),void updraft_send_command("restore_alldownloaded",{timestamp:jQuery("#updraft_restore_timestamp").val(),restoreopts:jQuery("#updraft_restore_form").serialize()},function(t){var e=null;jQuery("#updraft_restorer_restore_options").val("");try{var a=ud_parse_json(t);if(null==a)return void jQuery("#updraft-restore-modal-stage2a").html(updraftlion.emptyresponse);var r=a.m;if(""!=a.w&&(r=r+"<p><strong>"+updraftlion.warnings+"</strong><br>"+a.w+"</p>"),""!=a.e?r=r+"<p><strong>"+updraftlion.errors+"</strong><br>"+a.e+"</p>":updraft_restore_stage=3,a.hasOwnProperty("i")){try{if(e=ud_parse_json(a.i),e.hasOwnProperty("addui")){console.log("Further UI options are being displayed");var n=e.addui;r+='<div id="updraft_restoreoptions_ui" style="clear:left; padding-top:10px;">'+n+"</div>","object"==typeof JSON&&"function"==typeof JSON.stringify&&(delete e.addui,a.i=JSON.stringify(e))}}catch(o){console.log(o),console.log(a)}jQuery("#updraft_restorer_backup_info").val(a.i)}else jQuery("#updraft_restorer_backup_info").val();jQuery("#updraft-restore-modal-stage2a").html(r),jQuery("#updraft-restore-modal-stage2a .updraft_select2").length>0&&jQuery("#updraft-restore-modal-stage2a .updraft_select2").select2()}catch(o){console.log(t),console.log(o),jQuery("#updraft-restore-modal-stage2a").text(updraftlion.jsonnotunderstood+" "+updraftlion.errordata+": "+t).html()}},{json_parse:!1}))}function updraft_downloader_status(t,e,a,r){}function updraft_downloader_status_update(t,e,a,r,n,o){var u=t+e+"_"+a+"_"+r,d="."+u,s=0;if(null!=n.e)jQuery(d+" .raw").html("<strong>"+updraftlion.error+"</strong> "+n.e),console.log(n);else if(null!=n.p){if(jQuery(d+"_st .dlfileprogress").width(n.p+"%"),null!=n.a&&n.a>0){var i=(new Date).getTime(),p=jQuery(d).data("lasttimebegan"),l=i-p;if(n.a>90&&l>6e4){console.log(e+" "+a+" "+r+": restarting download: file_age="+n.a+", sincelastrestart_ms="+l),jQuery(d).data("lasttimebegan",(new Date).getTime());var c=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+r),f={type:a,timestamp:e,findex:r},_={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:c.data("wp_nonce").toString(),timeout:1e4};updraft_send_command("updraft_download_backup",f,function(t){},_),jQuery(d).data("lasttimebegan",(new Date).getTime())}}if(null!=n.m)if(n.p>=100&&"udrestoredlstatus_"==t)jQuery(d+" .raw").html(n.m),jQuery(d).fadeOut("slow",function(){jQuery(this).remove(),updraft_restorer_checkstage2(0)});else if(n.p<100||"uddlstatus_"!=t)jQuery(d+" .raw").html(n.m);else{var g=updraftlion.fileready+" "+updraftlion.actions+': \t\t\t\t<button type="button" onclick="updraftplus_downloadstage2(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.downloadtocomputer+'</button> \t\t\t\t<button id="uddownloaddelete_'+e+"_"+a+'" type="button" onclick="updraftplus_deletefromserver(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.deletefromserver+"</button>";n.hasOwnProperty("can_show_contents")&&n.can_show_contents&&(g+=' <button type="button" onclick="updraftplus_show_contents(\''+e+"', '"+a+"', '"+r+"')\">"+updraftlion.browse_contents+"</button>"),jQuery(d+" .raw").html(g)}}else null!=n.m?jQuery(d+" .raw").html(n.m):(jQuery(d+" .raw").html(updraftlion.jsonnotunderstood+" ("+o+")"),s=1);return s}function updraft_backupnow_go(t,e,a,r,n,o,u){jQuery("#updraft_backup_started").html("<em>"+updraftlion.requeststart+"</em>").slideDown(""),setTimeout(function(){jQuery("#updraft_backup_started").fadeOut("slow")},75e3);var d={backupnow_nodb:t,backupnow_nofiles:e,backupnow_nocloud:a,backupnow_label:o,extradata:n};""!=r&&(d.onlythisfileentity=r),""!=u&&(d.onlythesetableentities=u),updraft_send_command("backupnow",d,function(t){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)})}var onlythesefileentities=backupnow_whichfiles_checked("");""==onlythesefileentities?jQuery("#backupnow_includefiles_moreoptions").show():jQuery("#backupnow_includefiles_moreoptions").hide();var updraft_restore_stage=1,lastlog_lastmessage="",lastlog_lastdata="",lastlog_jobs="",updraft_activejobs_nextupdate=(new Date).getTime()+1e3,updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_settings_form_changed=!1;window.onbeforeunload=function(t){if(updraft_settings_form_changed)return updraftlion.unsavedsettings},"undefined"!=typeof document.hidden&&document.addEventListener("visibilitychange",function(){updraft_check_page_visibility(0)},!1),updraft_check_page_visibility(1);var updraft_poplog_log_nonce,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_historytimer=0,calculated_diskspace=0,updraft_historytimer_notbefore=0,updraft_history_lastchecksum=!1,updraft_interval_week_val=!1,updraft_interval_month_val=!1;"undefined"!=typeof updraft_siteurl&&setInterval(function(){jQuery.get(updraft_siteurl+"/wp-cron.php")},21e4);var lastlog_lastmessage="";jQuery(document).ajaxError(function(t,e,a,r){if(null!=r&&""!=r&&null!=e.responseText&&""!=e.responseText&&(console.log("Error caught by UpdraftPlus ajaxError handler (follows) for "+a.url),console.log(r),0==a.url.search(ajaxurl)))if(a.url.search("subaction=downloadstatus")>=0){var n=a.url.match(/timestamp=\d+/),o=a.url.match(/type=[a-z]+/),u=a.url.match(/findex=\d+/),d=a.url.match(/base=[a-z_]+/);if(u=u instanceof Array?parseInt(u[0].substr(7)):0,o=o instanceof Array?o[0].substr(5):"",d=d instanceof Array?d[0].substr(5):"",n=n instanceof Array?parseInt(n[0].substr(10)):0,""!=d&&""!=o&&n>0){var s=d+n+"_"+o+"_"+u;jQuery("."+s+" .raw").html("<strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode)}}else a.url.search("subaction=restore_alldownloaded")>=0&&jQuery("#updraft-restore-modal-stage2a").append("<br><strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode+": "+r)}),jQuery(document).ready(function(t){function e(e){t('.expertmode .advanced_settings_container .advanced_tools:not(".'+e+'")').hide(),t(".expertmode .advanced_settings_container .advanced_tools."+e).fadeIn("slow"),t(".expertmode .advanced_settings_container .advanced_tools_button:not(#"+e+")").removeClass("active"),t(".expertmode .advanced_settings_container .advanced_tools_button#"+e).addClass("active")}function a(t){var e=!!jQuery("#updraftcentral_mothership_other").is(":checked");e?(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!1),t?jQuery("#updraftcentral_keycreate_mothership_firewalled_container").show():(jQuery(".updraftcentral_wizard_self_hosted_stage2").show(),jQuery("#updraftcentral_keycreate_mothership_firewalled_container").slideDown(),jQuery("#updraftcentral_keycreate_mothership").focus())):(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!0),t||(jQuery(".updraftcentral_wizard_self_hosted_stage2").hide(),r()))}function r(){jQuery("#updraftcentral_wizard_stage1_error").text(""); 
    2 var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function n(e,a,r,o){jQuery("#updraft-delete-waitwarning").slideDown();var u=e,d=a,s=r,i=o,p=jQuery("#updraft_delete_timestamp").val().split(","),l=jQuery("#updraft_delete_form").serializeArray(),c={};t.each(l,function(){void 0!==c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c.remote_delete_limit=updraftlion.remote_delete_limit,delete c.action,delete c.subaction,delete c.nonce,updraft_send_command("deleteset",c,function(t){if(t.hasOwnProperty("result")&&null!=t.result)if("error"==t.result)alert(updraftlion.error+" "+t.message);else if("continue"==t.result)u=u+t.backup_local+t.backup_remote,d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,jQuery("#updraft-deleted-files-total").text(u+" "+updraftlion.remote_files_deleted),n(u,d,s,i);else if("success"==t.result){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp(),t.hasOwnProperty("count_backups")&&jQuery("#updraft-navtab-backups").html(updraftlion.existing_backups+" ("+t.count_backups+")");for(var e=0;e<p.length;e++){var a=p[e];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+a).slideUp().remove()}jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length<1&&jQuery("#ud_massactions").hide(),updraft_history_lastchecksum=!1,jQuery("#updraft-delete-modal").dialog("close"),d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,alert(t.set_message+" "+i+"\n"+t.local_message+" "+d+"\n"+t.remote_message+" "+s)}})}function o(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideUp()}function u(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.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('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var 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)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.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(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function d(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function s(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-migrate-modal").dialog("close"),jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function i(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}if(t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var p=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||p.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[],a="";t(".updraft_webdav_settings").each(function(r,n){var o=t(n).attr("id");if(o&&"updraft_webdav_"==o.substring(0,15)){var u=o.substring(15);id_split=u.split("_"),u=id_split[0],a=id_split[1],e[u]=this.value}});var r="",n="@",o="/",u=":",d=":";(e.host.indexOf("@")>=0||""===e.host)&&(n=""),e.host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e.path.indexOf("/")&&""!==e.path||(o=""),""!==e.user&&""!==e.pass||(u=""),""!==e.host&&""!==e.port||(d=""),r=e.webdav+e.user+u+e.pass+n+encodeURIComponent(e.host)+d+e.port+o+e.path,t("#updraft_webdav_url_"+a).val(r)}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(e){(e.ctrlKey||e.metaKey)&&(t(this).toggleClass("backuprowselected"),t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length>0?t("#ud_massactions").show():t("#ud_massactions").hide())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var t=jQuery(this).data("method"),e=jQuery(this).data("instance_id");updraft_remote_storage_test(t,function(e,a,r){return"sftp"==t&&(r.hasOwnProperty("scp")&&r.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+e.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+e.output),e.hasOwnProperty("data")&&console.log(e.data),!0)},e)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),updraftplus_diskspace()}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){a(!1)}),a(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});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('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),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(),r()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(resp=ud_parse_json(t),resp.hasOwnProperty("error"))return alert(resp.error),void console.log(resp);alert(resp.r),resp.hasOwnProperty("bundle")&&resp.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(resp.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+resp.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+resp.bundle+"</textarea></div>")):console.log(resp),resp.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(resp.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+t),console.log(e)}},{json_parse:!1})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)}))}),jQuery("#updraft_reset_sid").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").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var l=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>l&&(l=a)}),l>180&&jQuery(".updraft-bigbutton").width(l),setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var c={};c[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:c});var f={};f[updraftlion.deletebutton]=function(){n(0,0,0,0)},f[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:262,width:430,modal:!0,buttons:f});var _={};_[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var u=jQuery(o).data("howmany"),d=jQuery(o).val();if((1==r||2==r&&"db"!=d)&&("wpcore"!=d&&(u=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),d="wpcore"),"wpcore"!=d||0==a){var s=[d,u];e.push(s),"wpcore"==d&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,u=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:u},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",u,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1})}catch(d){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(d),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},_[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:_}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:345,width:580,modal:!0});var g={};g[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=backupnow_whichtables_checked("");if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var n=backupnow_whichfiles_checked("");return""==n&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,n,"",jQuery("#backupnow_label").val(),r))},g[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:g}),jQuery("#updraft-migrate-modal").dialog({autoOpen:!1,height:updraftlion.migratemodalheight,width:updraftlion.migratemodalwidth,modal:!0}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&o(t,!1)}),jQuery("#updraft-navtab-settings-content .updraft-service").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").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-status-content").show(),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-expert-content").show(),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=4}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-settings-content").show(),jQuery("#updraft-navtab-settings").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=3}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").show(),jQuery("#updraft-navtab-addons").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=5}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_openrestorepanel(1)}),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(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()}catch(y){console.log(y)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),d(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),d(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,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").on("click",".updraft_jobinfo_delete",function(t){t.preventDefault();var e=jQuery(this).data("jobid");e?updraft_activejobs_delete(e):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").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("jobid");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){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");s(e,a,r)}),"initiate_restore"==i("udaction")){var h=i("entities"),m=i("backup_timestamp"),v=i("showdata");s(h,m,v)}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),u=jQuery(this).data("prettydate"),d=!0;updraft_downloader(e,a,r,n,o,u,d)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e+"#updraftvault_settings_connect input").keypress(function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))}),!1})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.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)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.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+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]);for(var u in updraftlion.remote_storage_options[n]){var d=updraftlion.remote_storage_options[n][u];r+=o(d)}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup()})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40",epoch_date:e.getTime(), 
    3 local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var u=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:u,updraftplus_version:updraftlion.updraftplus_version},function(e){var a=n(e);!a.hasOwnProperty("saved")||a.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),a.hasOwnProperty("error_message")&&a.error_message&&alert(a.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,json_parse:!1})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e){try{var a=ud_parse_json(e),r=(a.messages,a.backup_dir.writable),n=a.backup_dir.message,o=a.backup_dir.button_title}catch(u){return console.log(u),console.log(e),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(a.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(a.changed);for(prop in a.changed)if("object"==typeof a.changed[prop])for(innerprop in a.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(a.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(a.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),a.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(a.updraft_include_more_path),a.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(a.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(a.messages),t("#next-backup-table-inner").html(a.scheduled),a}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var u=new Image;u.src=updraftlion.ud_url+"/images/udlogo-rotating.gif",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e){n(e),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",nonce:updraftplus_settings_nonce,json_parse:!1})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)})}),jQuery(document).ready(function(t){jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}})}); 
     2var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function n(e,a,r,o){jQuery("#updraft-delete-waitwarning").slideDown();var u=e,d=a,s=r,i=o,p=jQuery("#updraft_delete_timestamp").val().split(","),l=jQuery("#updraft_delete_form").serializeArray(),c={};t.each(l,function(){void 0!==c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c.remote_delete_limit=updraftlion.remote_delete_limit,delete c.action,delete c.subaction,delete c.nonce,updraft_send_command("deleteset",c,function(t){if(t.hasOwnProperty("result")&&null!=t.result)if("error"==t.result)alert(updraftlion.error+" "+t.message);else if("continue"==t.result)u=u+t.backup_local+t.backup_remote,d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,jQuery("#updraft-deleted-files-total").text(u+" "+updraftlion.remote_files_deleted),n(u,d,s,i);else if("success"==t.result){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp(),t.hasOwnProperty("count_backups")&&jQuery("#updraft-navtab-backups").html(updraftlion.existing_backups+" ("+t.count_backups+")");for(var e=0;e<p.length;e++){var a=p[e];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+a).slideUp().remove()}jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length<1&&jQuery("#ud_massactions").hide(),updraft_history_lastchecksum=!1,jQuery("#updraft-delete-modal").dialog("close"),d+=t.backup_local,s+=t.backup_remote,i+=t.backup_sets,alert(t.set_message+" "+i+"\n"+t.local_message+" "+d+"\n"+t.remote_message+" "+s)}})}function o(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").slideUp()}function u(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.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('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var 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)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.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(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function d(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function s(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-migrate-modal").dialog("close"),jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function i(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}if(t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var p=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||p.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[],a="";t(".updraft_webdav_settings").each(function(r,n){var o=t(n).attr("id");if(o&&"updraft_webdav_"==o.substring(0,15)){var u=o.substring(15);id_split=u.split("_"),u=id_split[0],a=id_split[1],e[u]=this.value}});var r="",n="@",o="/",u=":",d=":";(e.host.indexOf("@")>=0||""===e.host)&&(n=""),e.host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e.path.indexOf("/")&&""!==e.path||(o=""),""!==e.user&&""!==e.pass||(u=""),""!==e.host&&""!==e.port||(d=""),r=e.webdav+e.user+u+e.pass+n+encodeURIComponent(e.host)+d+e.port+o+e.path,t("#updraft_webdav_url_"+a).val(r)}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(e){(e.ctrlKey||e.metaKey)&&(t(this).toggleClass("backuprowselected"),t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length>0?t("#ud_massactions").show():t("#ud_massactions").hide())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var t=jQuery(this).data("method"),e=jQuery(this).data("instance_id");updraft_remote_storage_test(t,function(e,a,r){return"sftp"==t&&(r.hasOwnProperty("scp")&&r.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+e.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+e.output),e.hasOwnProperty("data")&&console.log(e.data),!0)},e)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),updraftplus_diskspace()}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){a(!1)}),a(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});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('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),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(),r()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(resp=ud_parse_json(t),resp.hasOwnProperty("error"))return alert(resp.error),void console.log(resp);alert(resp.r),resp.hasOwnProperty("bundle")&&resp.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(resp.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+resp.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+resp.bundle+"</textarea></div>")):console.log(resp),resp.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(resp.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+t),console.log(e)}},{json_parse:!1})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)}))}),jQuery("#updraft_reset_sid").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").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var l=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>l&&(l=a)}),l>180&&jQuery(".updraft-bigbutton").width(l),setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var c={};c[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:c});var f={};f[updraftlion.deletebutton]=function(){n(0,0,0,0)},f[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:262,width:430,modal:!0,buttons:f});var _={};_[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var u=jQuery(o).data("howmany"),d=jQuery(o).val();if((1==r||2==r&&"db"!=d)&&("wpcore"!=d&&(u=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),d="wpcore"),"wpcore"!=d||0==a){var s=[d,u];e.push(s),"wpcore"==d&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,u=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:u},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",u,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1})}catch(d){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(d),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},_[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:_}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:345,width:580,modal:!0});var g={};g[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=backupnow_whichtables_checked("");if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var n=backupnow_whichfiles_checked("");return""==n&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,n,"",jQuery("#backupnow_label").val(),r))},g[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:g}),jQuery("#updraft-migrate-modal").dialog({autoOpen:!1,height:updraftlion.migratemodalheight,width:updraftlion.migratemodalwidth,modal:!0}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&o(t,!1)}),jQuery("#updraft-navtab-settings-content .updraft-service").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").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-status-content").show(),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=1,updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),jQuery(this).addClass("nav-tab-active"),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-expert-content").show(),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=4}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-addons-content").hide(),jQuery("#updraft-navtab-settings-content").show(),jQuery("#updraft-navtab-settings").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-addons").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=3}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),jQuery("#updraft-navtab-status-content").hide(),jQuery("#updraft-navtab-backups-content").hide(),jQuery("#updraft-navtab-expert-content").hide(),jQuery("#updraft-navtab-settings-content").hide(),jQuery("#updraft-navtab-addons-content").show(),jQuery("#updraft-navtab-addons").addClass("nav-tab-active"),jQuery("#updraft-navtab-expert").removeClass("nav-tab-active"),jQuery("#updraft-navtab-backups").removeClass("nav-tab-active"),jQuery("#updraft-navtab-status").removeClass("nav-tab-active"),jQuery("#updraft-navtab-settings").removeClass("nav-tab-active"),updraft_page_is_visible=1,updraft_console_focussed_tab=5}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_openrestorepanel(1)}),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(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()}catch(y){console.log(y)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),d(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),d(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,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").on("click",".updraft_jobinfo_delete",function(t){t.preventDefault();var e=jQuery(this).data("jobid");e?updraft_activejobs_delete(e):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").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("jobid");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){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");s(e,a,r)}),"initiate_restore"==i("udaction")){var h=i("entities"),m=i("backup_timestamp"),v=i("showdata");s(h,m,v)}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),u=jQuery(this).data("prettydate"),d=!0;updraft_downloader(e,a,r,n,o,u,d)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e+"#updraftvault_settings_connect input").keypress(function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))}),!1})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.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)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.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+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&null!==t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&null!==e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]);for(var u in updraftlion.remote_storage_options[n]){var d=updraftlion.remote_storage_options[n][u];r+=o(d)}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup()})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40", 
     3epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var u=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:u,updraftplus_version:updraftlion.updraftplus_version},function(e){var a=n(e);!a.hasOwnProperty("saved")||a.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),a.hasOwnProperty("error_message")&&a.error_message&&alert(a.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,json_parse:!1})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e){try{var a=ud_parse_json(e),r=(a.messages,a.backup_dir.writable),n=a.backup_dir.message,o=a.backup_dir.button_title}catch(u){return console.log(u),console.log(e),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(a.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(a.changed);for(prop in a.changed)if("object"==typeof a.changed[prop])for(innerprop in a.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(a.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(a.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),a.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(a.updraft_include_more_path),a.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(a.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(a.messages),t("#next-backup-table-inner").html(a.scheduled),a}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var u=new Image;u.src=updraftlion.ud_url+"/images/udlogo-rotating.gif",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e){n(e),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",nonce:updraftplus_settings_nonce,json_parse:!1})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)})}),jQuery(document).ready(function(t){jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}})}); 
  • updraftplus/trunk/readme.txt

    r1782821 r1782865  
    1 === UpdraftPlus WordPress Backup Plugin === 
     1=== UpdraftPlus WordPress Backup Plugin === 
    22Contributors: Backup with UpdraftPlus, DavidAnderson, DNutbourne, aporter, snightingale, bcrodua 
    33Tags: backup, restore, database backup, wordpress backup, cloud backup, s3, dropbox, google drive, onedrive, ftp, backups 
     
    163163* TWEAK: Resolve PSR4 autoloading conflict with older version of Composer 
    164164* TWEAK: Pruning will now prune backups from multiple storage destinations of the same type (not yet a user-visible feature) 
     165* TWEAK: Update the 'ifeq' handlebars helper to resolve a conflict with MainWP 
    165166 
    166167= 1.13.15 - 28/Nov/2017 = 
Note: See TracChangeset for help on using the changeset viewer.