Ubuntu
var updraft_restore_screen=!0;jQuery(document).ready(function(e){function t(t,a){var o=new XMLHttpRequest,n="action="+a+"&updraftplus_ajax_restore=do_ajax_restore&job_id="+t,d=0,u=!0,l=e("#updraftplus_ajax_restore_debug").length;o.open("POST",ajaxurl,!0),o.onprogress=function(e){if(e.currentTarget.status>=200&&e.currentTarget.status<300){if(-1!==e.currentTarget.responseText.indexOf(""+t.data.fileindex+"").replace("%s2",""+t.data.total_files+"")),"db"==t.stage&&t.data.hasOwnProperty("stage")&&("table"==t.data.stage?r.find(".updraft_component--progress").html(" — "+updraftlion.restore_db_table_progress.replace("%s",""+t.data.table+"")):"stored_routine"==t.data.stage?r.find(".updraft_component--progress").html(" — "+updraftlion.restore_db_stored_routine_progress.replace("%s",""+t.data.routine_name+"")):"finished"==t.data.stage?r.find(".updraft_component--progress").html(" — "+updraftlion.finished):"begun"==t.data.stage&&r.find(".updraft_component--progress").html(" — "+updraftlion.begun+"...")),u!==l){if(u){var s=f.find("[data-component="+u+"]");s.find(".updraft_component--progress").html(""),s.removeClass("active").addClass("done")}if("finished"==l){if(r.addClass("done"),f.find("[data-component]").each(function(t,r){$el=e(r),$el.is(".done")||$el.addClass("error")}),t.data.hasOwnProperty("actions")&&"object"==typeof t.data.actions){var o=n(t.data.urls);e.isEmptyObject(o)||(e(".updraft_restore_result").before(updraftlion.ajax_restore_404_detected),e.each(o,function(t,r){e(".updraft_missing_pages").append(""+r+"")})),e.each(t.data.actions,function(e,t){f.after(''+e+"")})}}else r.addClass("active")}u=l}}function a(){var t=Math.round(Date.now()/1e3),r=t-c;if(60>r)e("#updraftplus_ajax_restore_last_activity").html(updraftlion.last_activity.replace("%d",r));else{var a=120-r;0h?(h++,t(p,"updraft_ajaxrestore_continue")):e(".updraft_restore_main--components").prepend(r.html)):r.hasOwnProperty("error_code")&&r.hasOwnProperty("error_message")&&(d&&clearInterval(d),alert(r.error_code+": "+r.error_message),console.log(r.error_code+": "+r.error_message))},{error_callback:function(e,a,s,o){if(500==e.status&&3>m)m++,t(p,"updraft_ajaxrestore_continue");else{r({stage:"finished",type:"state_change"});var n="updraft_send_command: error: "+a+" ("+s+")";alert(n),console.log(n),console.log(e)}}})}function n(t){var r=[];return e.each(t,function(e,t){var a=new XMLHttpRequest;a.open("GET",t,!1),a.send(null),404==a.status&&r.push(t)}),r}var d,u,l,p=e("#updraftplus_ajax_restore_job_id").val(),i=e("#updraftplus_ajax_restore_action").val(),c=0,_=e("#updraftplus_ajax_restore_output"),f=e(".updraft_restore_components_list"),g=!1,h=0,m=0;t(p,i),e("#updraftplus_ajax_restore_progress").on("click","#updraft_restore_resume",function(r){r.preventDefault(),e("#updraftplus_ajax_restore_progress").slideUp(1e3,function(){e(this).remove()}),t(p,"updraft_ajaxrestore_continue")}),e(document).on("heartbeat-tick",function(e,t){if(t.hasOwnProperty("wp-auth-check")){if(!t["wp-auth-check"])return void(g=!0);if(g&&t["wp-auth-check"]&&(c=Math.round(Date.now()/1e3),g=!1),t.hasOwnProperty("updraftplus")){var r=t.updraftplus;r.hasOwnProperty("updraft_credentialtest_nonce")&&(updraft_credentialtest_nonce=r.updraft_credentialtest_nonce,c=Math.round(Date.now()/1e3))}}})});