diff --git a/assets/js/backup-downloader.min.js b/assets/js/backup-downloader.min.js index 1fd5f7ad..3e43b423 100644 --- a/assets/js/backup-downloader.min.js +++ b/assets/js/backup-downloader.min.js @@ -1 +1 @@ -window.BWU=window.BWU||{},function(i,s,n,e,t){var r,o;function c(){this.closeEventSource(),this.cleanUi(),this.decrypter&&this.decrypter.destruct()}function a(e){e&&(e.style.display="none")}function d(e){e&&(e.style.display="block")}e?"EventSource"in window?(r=Object.create({showWaitingMessage:function(){d(this.waitingUi)},showProgressUi:function(){d(this.progressUi)},showSuccessMsg:function(){d(this.successUi)},hideWaitingMessage:function(){a(this.waitingUi)},hideProgressUi:function(){a(this.progressUi)},hideNotice:function(){n.Functions.removeMessages(this.containerUi)},hideSuccessMsg:function(){a(this.successUi)},cleanUi:function(){this.hideWaitingMessage(),this.hideProgressUi(),this.hideNotice(),this.hideSuccessMsg(),this.decrypter&&this.decrypter.hide()},done:function(){this.showSuccessMsg(),window.location.href=this.currentTarget.dataset.url,setTimeout(t,3e3)},onMessage:function(e){var t;try{switch((t=JSON.parse(e.data)).state){case n.States.DOWNLOADING:this.cleanUi(),this.showProgressUi(),i("#progresssteps").css({width:t.download_percent+"%"}).text(t.download_percent+"%");break;case n.States.DONE:this.done(t.message)}}catch(e){n.Functions.printMessageError(e.message,this.containerUi),c.call(this)}},onError:function(e){e=JSON.parse(e.data);return this.closeEventSource(),e.message===n.States.NEED_DECRYPTION_KEY?(this.cleanUi(),this.decrypter&&this.decrypter.needDecryption(e.status)):(n.Functions.printMessageError(e.message,this.containerUi),c.call(this)),this},initializeEventSource:function(){s.isUndefined(this.eventSource)&&(this.eventSource=new EventSource(e+"?action=download_backup_file&destination="+this.currentTarget.dataset.destination+"&jobid="+this.currentTarget.dataset.jobid+"&file="+this.currentTarget.dataset.file+"&local_file="+this.currentTarget.dataset.localFile+"&backwpup_action_nonce="+this.currentTarget.dataset.nonce),this.eventSource.onmessage=this.onMessage,this.eventSource.addEventListener("log",this.onError))},closeEventSource:function(){s.isUndefined(this.eventSource)||(this.eventSource.close(),this.eventSource=void 0)},startDownload:function(e){e.preventDefault(),this.currentTarget=e.target,this.showWaitingMessage(),this.initializeEventSource()},decrypt:function(){this.cleanUi(),this.decrypter&&this.decrypter.decrypt({backwpup_action_nonce:this.currentTarget.dataset.nonce,encrypted_file_path:this.currentTarget.dataset.localFile})},construct:function(e){var t=document.querySelector("#tb_container");return!!t&&(s.bindAll(this,"showWaitingMessage","hideWaitingMessage","showProgressUi","hideSuccessMsg","showSuccessMsg","done","onMessage","onError","initializeEventSource","closeEventSource","startDownload","addListeners","decrypt","hideNotice","cleanUi","init"),this.containerUi=t,this.waitingUi=this.containerUi.querySelector("#download-file-waiting"),this.progressUi=this.containerUi.querySelector(".progressbar"),this.successUi=this.containerUi.querySelector("#download-file-success"),this.currentTarget=void 0,this.eventSource=void 0,this.decrypter=e,this)},addListeners:function(){return s.forEach(document.querySelectorAll("#backup-download-link"),function(e){e.addEventListener("click",this.startDownload)}.bind(this)),i("#submit_decrypt_key").on("click",this.decrypt),i("body").on("thickbox:removed",function(){c.call(this)}.bind(this)),this.decrypter&&i("body").on(this.decrypter.ACTION_DECRYPTION_SUCCESS,this.done),this},init:function(){return this.addListeners(),this}}),s.isUndefined(n.DecrypterFactory)||(o=n.DecrypterFactory(e,document.querySelector("#decrypt_key"),document.querySelector("#decryption_key"))),r.construct(o)&&r.init()):console.warn("Event Source does not exist in this browser"):console.warn("Missing ajaxurl value.")}(window.jQuery,window._,window.BWU,window.ajaxurl,window.tb_remove); \ No newline at end of file +window.BWU=window.BWU||{},function(i,s,n,e,t){var r,o,c;function a(){this.closeEventSource(),this.cleanUi(),this.decrypter&&this.decrypter.destruct()}function d(e){e&&(e.style.display="none")}function h(e){e&&(e.style.display="block")}e?"EventSource"in window?(c={showWaitingMessage:function(){h(this.waitingUi)},showProgressUi:function(){h(this.progressUi)},showSuccessMsg:function(){h(this.successUi)},hideWaitingMessage:function(){d(this.waitingUi)},hideProgressUi:function(){d(this.progressUi)},hideNotice:function(){n.Functions.removeMessages(this.containerUi)},hideSuccessMsg:function(){d(this.successUi)},cleanUi:function(){this.hideWaitingMessage(),this.hideProgressUi(),this.hideNotice(),this.hideSuccessMsg(),this.decrypter&&this.decrypter.hide()},done:function(){this.showSuccessMsg(),window.location.href=this.currentTarget.dataset.url,setTimeout(t,3e3)},onMessage:function(e){var t;try{switch((t=JSON.parse(e.data)).state){case n.States.DOWNLOADING:this.cleanUi(),this.showProgressUi(),i("#progresssteps").css({width:t.download_percent+"%"}).text(t.download_percent+"%");break;case n.States.DONE:this.done(t.message)}}catch(e){n.Functions.printMessageError(e.message,this.containerUi),a.call(this)}},onError:function(e){var t=JSON.parse(e.data);switch(this.closeEventSource(),t.message){case n.States.NEED_DECRYPTION_KEY:this.cleanUi(),this.decrypter&&this.decrypter.needDecryption(t.status);break;default:n.Functions.printMessageError(t.message,this.containerUi),a.call(this)}return this},initializeEventSource:function(){s.isUndefined(this.eventSource)&&(this.eventSource=new EventSource(e+"?action=download_backup_file&destination="+this.currentTarget.dataset.destination+"&jobid="+this.currentTarget.dataset.jobid+"&file="+this.currentTarget.dataset.file+"&local_file="+this.currentTarget.dataset.localFile+"&backwpup_action_nonce="+this.currentTarget.dataset.nonce),this.eventSource.onmessage=this.onMessage,this.eventSource.addEventListener("log",this.onError))},closeEventSource:function(){s.isUndefined(this.eventSource)||(this.eventSource.close(),this.eventSource=void 0)},startDownload:function(e){e.preventDefault(),this.currentTarget=e.target,this.showWaitingMessage(),this.initializeEventSource()},decrypt:function(){this.cleanUi(),this.decrypter&&this.decrypter.decrypt({backwpup_action_nonce:this.currentTarget.dataset.nonce,encrypted_file_path:this.currentTarget.dataset.localFile})},construct:function(e){var t=document.querySelector("#tb_container");return!!t&&(s.bindAll(this,"showWaitingMessage","hideWaitingMessage","showProgressUi","hideSuccessMsg","showSuccessMsg","done","onMessage","onError","initializeEventSource","closeEventSource","startDownload","addListeners","decrypt","hideNotice","cleanUi","init"),this.containerUi=t,this.waitingUi=this.containerUi.querySelector("#download-file-waiting"),this.progressUi=this.containerUi.querySelector(".progressbar"),this.successUi=this.containerUi.querySelector("#download-file-success"),this.currentTarget=void 0,this.eventSource=void 0,this.decrypter=e,this)},addListeners:function(){return s.forEach(document.querySelectorAll("#backup-download-link"),function(e){e.addEventListener("click",this.startDownload)}.bind(this)),i("#submit_decrypt_key").on("click",this.decrypt),i("body").on("thickbox:removed",function(){a.call(this)}.bind(this)),this.decrypter&&i("body").on(this.decrypter.ACTION_DECRYPTION_SUCCESS,this.done),this},init:function(){return this.addListeners(),this}},r=Object.create(c),s.isUndefined(n.DecrypterFactory)||(o=n.DecrypterFactory(e,document.querySelector("#decrypt_key"),document.querySelector("#decryption_key"))),r.construct(o)&&r.init()):console.warn("Event Source does not exist in this browser"):console.warn("Missing ajaxurl value.")}(window.jQuery,window._,window.BWU,window.ajaxurl,window.tb_remove); \ No newline at end of file diff --git a/assets/js/general.min.js b/assets/js/general.min.js index 85b539d3..32e5de80 100644 --- a/assets/js/general.min.js +++ b/assets/js/general.min.js @@ -1 +1 @@ -jQuery(document).ready(function(a){backwpup_htmlspecialchars=function(t){return jQuery("").text(t).html()},a.fn.backwpupDelayKeyup=function(t){var i=0;return a(this).keyup(function(){clearTimeout(i),i=setTimeout(t,200)}),a(this)},backwpup_tb_position=function(){var t=a("#TB_window"),i=a(window).width(),e=a(window).height(),n=720").text(t).html()},a.fn.backwpupDelayKeyup=function(t){var i=0;return a(this).keyup(function(){clearTimeout(i),i=setTimeout(t,200)}),a(this)},backwpup_tb_position=function(){var t=a("#TB_window"),i=a(window).width(),e=a(window).height(),n=720'+backwpup_htmlspecialchars(n(this).val())+"")}),n('input[name="name"]').focus(function(){n(this).val()==n(this).data("empty")&&n(this).val("")}),n('input[name="name"]').blur(function(){""===n(this).val()&&n(this).val(n(this).data("empty"))}),n('input[name="backuptype"]').change(function(){"sync"==n(this).val()?(n(".nosync").hide(),n(".sync").show()):(n(".nosync").show(),n(".sync").hide())}),"sync"==n('input[name="backuptype"]:checked').val()?(n(".nosync").hide(),n(".sync").show()):(n(".nosync").show(),n(".sync").hide()),n('input[name="archivename"]').keyup(function(){var e=n(this).val();e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("%hash%","[hash]")).replace("%d",date("d"))).replace("%j",date("j"))).replace("%m",date("m"))).replace("%n",date("n"))).replace("%Y",date("Y"))).replace("%y",date("y"))).replace("%a",date("a"))).replace("%A",date("A"))).replace("%B",date("B"))).replace("%g",date("g"))).replace("%G",date("G"))).replace("%h",date("h"))).replace("%H",date("H"))).replace("%i",date("i"))).replace("%s",date("s"))).replace("[hash]","%hash%"),n("#archivefilename").replaceWith(''+backwpup_htmlspecialchars(e)+"")}),n('input[name="archiveformart"]').change(function(){n("#archiveformart").replaceWith(''+n(this).val()+"")})}); \ No newline at end of file +function date(e,n){var a,t,r,u=/\\?([a-z])/gi,i=function(e,n){return(e=e.toString()).length'+backwpup_htmlspecialchars(n(this).val())+"")}),n('input[name="name"]').focus(function(){n(this).val()==n(this).data("empty")&&n(this).val("")}),n('input[name="name"]').blur(function(){""===n(this).val()&&n(this).val(n(this).data("empty"))}),n('input[name="backuptype"]').change(function(){"sync"==n(this).val()?(n(".nosync").hide(),n(".sync").show()):(n(".nosync").show(),n(".sync").hide())}),"sync"==n('input[name="backuptype"]:checked').val()?(n(".nosync").hide(),n(".sync").show()):(n(".nosync").show(),n(".sync").hide()),n('input[name="archivename"]').keyup(function(){var e=n(this).val();e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("%hash%","[hash]")).replace("%d",date("d"))).replace("%j",date("j"))).replace("%m",date("m"))).replace("%n",date("n"))).replace("%Y",date("Y"))).replace("%y",date("y"))).replace("%a",date("a"))).replace("%A",date("A"))).replace("%B",date("B"))).replace("%g",date("g"))).replace("%G",date("G"))).replace("%h",date("h"))).replace("%H",date("H"))).replace("%i",date("i"))).replace("%s",date("s"))).replace("[hash]","%hash%"),n("#archivefilename").replaceWith(''+backwpup_htmlspecialchars(e)+"")}),n('input[name="archiveformart"]').change(function(){n("#archiveformart").replaceWith(''+n(this).val()+"")})}); \ No newline at end of file diff --git a/assets/js/page_settings.min.js b/assets/js/page_settings.min.js index 5843e7eb..215f6f51 100644 --- a/assets/js/page_settings.min.js +++ b/assets/js/page_settings.min.js @@ -1 +1 @@ -jQuery(document).ready(function(a){var i=a('input[name="anchor"]'),e=a(".nav-tab-wrapper>a"),t=window.location.hash;""!==(t=""!==t?"#"+t.replace("#",""):t)&&i.val(t),a(".table").addClass("ui-tabs-hide"),a(i.val()).removeClass("ui-tabs-hide"),"#backwpup-tab-information"===i.val()&&(a("#submit").hide(),a("#default_settings").hide()),"#backwpup-tab-license"===i.val()&&(a("#submit").hide(),a("#default_settings").hide(),a('input[name="license_submit"]').attr("type","submit")),e.removeClass("nav-tab-active"),e.each(function(){a(this).attr("href")===i.val()&&a(this).addClass("nav-tab-active")}),e.on("click",function(){var t=a(this).attr("href");return e.removeClass("nav-tab-active"),a(this).addClass("nav-tab-active"),a(".table").addClass("ui-tabs-hide"),a(t).removeClass("ui-tabs-hide"),a("#message").hide(),i.val(t),"#backwpup-tab-information"===t?(a("#submit").hide(),a("#default_settings").hide()):"#backwpup-tab-license"===t?(a("#submit").hide(),a("#default_settings").hide(),a('input[name="license_submit"]').attr("type","submit")):(a("#submit").show(),a("#default_settings").show(),a('input[name="license_submit"]').attr("type","button")),window.location.hash=t,window.scrollTo(0,0),!1}),a("#authentication_method").change(function(){var t=a("#authentication_method").val();""===t?(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"basic"===t?(a(".authentication_basic").show(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"query_arg"===t?(a(".authentication_basic").hide(),a(".authentication_query_arg").show(),a(".authentication_user").hide()):"user"===t&&(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").show())})}); \ No newline at end of file +jQuery(document).ready(function(a){var i=a('input[name="anchor"]'),e=a(".nav-tab-wrapper>a"),t=window.location.hash;""!==t&&(t="#"+t.replace("#","")),""!==t&&i.val(t),a(".table").addClass("ui-tabs-hide"),a(i.val()).removeClass("ui-tabs-hide"),"#backwpup-tab-information"===i.val()&&(a("#submit").hide(),a("#default_settings").hide()),"#backwpup-tab-license"===i.val()&&(a("#submit").hide(),a("#default_settings").hide(),a('input[name="license_submit"]').attr("type","submit")),e.removeClass("nav-tab-active"),e.each(function(){a(this).attr("href")===i.val()&&a(this).addClass("nav-tab-active")}),e.on("click",function(){var t=a(this).attr("href");return e.removeClass("nav-tab-active"),a(this).addClass("nav-tab-active"),a(".table").addClass("ui-tabs-hide"),a(t).removeClass("ui-tabs-hide"),a("#message").hide(),i.val(t),"#backwpup-tab-information"===t?(a("#submit").hide(),a("#default_settings").hide()):"#backwpup-tab-license"===t?(a("#submit").hide(),a("#default_settings").hide(),a('input[name="license_submit"]').attr("type","submit")):(a("#submit").show(),a("#default_settings").show(),a('input[name="license_submit"]').attr("type","button")),window.location.hash=t,window.scrollTo(0,0),!1}),a("#authentication_method").change(function(){var t=a("#authentication_method").val();""===t?(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"basic"===t?(a(".authentication_basic").show(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"query_arg"===t?(a(".authentication_basic").hide(),a(".authentication_query_arg").show(),a(".authentication_user").hide()):"user"===t&&(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").show())})}); \ No newline at end of file diff --git a/assets/js/restore.min.js b/assets/js/restore.min.js index c664afbe..845bbe6d 100644 --- a/assets/js/restore.min.js +++ b/assets/js/restore.min.js @@ -1 +1 @@ -window.BWU=window.BWU||{},function(l,d,u,w,y,p,g){p(window).load(function(){var e=u("?step")?u("?step"):1,o=document.querySelector("#restore_step"),t=o?o.getAttribute("data-nonce"):"",o=l.Restore.FactoryStrategy(d,t),r=l.Restore.FactoryMigrate(d,t),s=l.DecrypterFactory(d,document.querySelector("#decrypt_key"),document.querySelector("#decryption_key")),n=l.Restore.FactoryDatabaseRestore(d,t,{onMessageCallback:function(e){p("#restore_progress").text(g.restoringPrefix+e.message)},onSuccessCallback:function(){l.Restore.Functions.loadNextStep(6,t)}}),c=l.Restore.FactoryFilesRestore(d,t,{onMessageCallback:function(e){p("#restore_progress").text(g.restoringPrefix+e.message)},onSuccessCallback:function(){n.init().restore()}}),a=l.Restore.FactoryDecompress(d,t,u("?restore_file")),i=l.Restore.FactoryDownload(d,t,u("?file"),u("?service"),u("?jobid"),u("?restore_file")),o=l.Restore.FactoryController(d,t,u,w,document.querySelector("#drag-drop-area"),o,n,c,a,i,s,r);o&&(o.init(),y.isFunction(o["step"+e]))&&o["step"+e]()})}(window.BWU,window.ajaxurl,window.url,window.plupload,window._,window.jQuery,window.backwpupRestoreLocalized); \ No newline at end of file +window.BWU=window.BWU||{},function(u,w,y,p,g,f,F){"use strict";f(window).load(function(){var e=y("?step")?y("?step"):1,o=document.querySelector("#restore_step"),t=o?o.getAttribute("data-nonce"):"",r=u.Restore.FactoryStrategy(w,t),s=u.Restore.FactoryMigrate(w,t),n=u.DecrypterFactory(w,document.querySelector("#decrypt_key"),document.querySelector("#decryption_key")),c=u.Restore.FactoryDatabaseRestore(w,t,{onMessageCallback:function(e){f("#restore_progress").text(F.restoringPrefix+e.message)},onSuccessCallback:function(){u.Restore.Functions.loadNextStep(6,t)}}),a=u.Restore.FactoryFilesRestore(w,t,{onMessageCallback:function(e){f("#restore_progress").text(F.restoringPrefix+e.message)},onSuccessCallback:function(){c.init().restore()}}),i=u.Restore.FactoryDecompress(w,t,y("?restore_file")),l=u.Restore.FactoryDownload(w,t,y("?file"),y("?service"),y("?jobid"),y("?restore_file")),d=u.Restore.FactoryController(w,t,y,p,document.querySelector("#drag-drop-area"),r,c,a,i,l,n,s);d&&(d.init(),g.isFunction(d["step"+e])&&d["step"+e]())})}(window.BWU,window.ajaxurl,window.url,window.plupload,window._,window.jQuery,window.backwpupRestoreLocalized); \ No newline at end of file diff --git a/assets/js/settings-encryption.min.js b/assets/js/settings-encryption.min.js index 213d6a33..9d9c27fd 100644 --- a/assets/js/settings-encryption.min.js +++ b/assets/js/settings-encryption.min.js @@ -1 +1 @@ -!function(i,a,r,s,n){function t(e){return{value:e,writable:!1,configurable:!1,enumerable:!1}}function c(){return document.querySelector("#backwpupajaxnonce").value}function y(e){var t=document.querySelector("#asymmetric_key_generation_waiting");t&&(t.style.display=e)}function o(){var e=document.querySelector("#bwu_encrypt_notice");e&&e.remove()}function l(e,t,i){o(),i&&i.insertAdjacentHTML("beforebegin",'

'+e+"

")}var m={generateSymmetricKey:function(e){var t,i;this.disableSaveSettings(),e.preventDefault(),e.stopPropagation(),e={action:"encrypt_key_handler",task:"generateSymmetricKey",_ajax_nonce:c()},t=function(e){var t=e.data;e.success?(a(this.symmetricKeyGenerator).hide(),a(this.symmetricKeyDownloader).show(),this.symmetricKeyField.value=t.key,this.symmetricKey.innerText=t.key,this.symmetricKeyDownloader.setAttribute("href","data:application/octet-stream;charset=utf-16le;base64,"+btoa(t.key)),l(t.message,"success",document.querySelector(".nav-tab-wrapper"))):l(t.message,"error",document.querySelector(".nav-tab-wrapper"))}.bind(this),i=function(e,t,i){l(i,"error",document.querySelector(".nav-tab-wrapper"))}.bind(this),a.post(s,e,t).fail(i)},generateAsymmetricKey:function(e){var t,i;this.disableSaveSettings(),e.preventDefault(),y("block"),e={action:"encrypt_key_handler",task:"generateAsymmetricKeyPair",_ajax_nonce:c()},t=function(e){var t,i=e.data,a=i.keys.publicKey,r=i.keys.privateKey;this.generatedKeyContainer&&(e.success?(e=this.generatedKeyContainer.querySelector("#asymmetric_generated_public_key_downloader"),t=this.generatedKeyContainer.querySelector("#asymmetric_generated_private_key_downloader"),e&&t&&(this.generatedKeyContainer.querySelector(".bwu-generated-key__public .bwu-the-key").innerText=a,this.generatedKeyContainer.querySelector(".bwu-generated-key__private .bwu-the-key").innerText=r,e.setAttribute("href","data:text/plain;base64,"+btoa(a)),t.setAttribute("href","data:text/plain;base64,"+btoa(r)),y("none"),this.asymmetricModal.style.display="block",l(i.message,"success",this.asymmetricModal))):l(i.message,"error",this.asymmetricModal))}.bind(this),i=function(e,t,i){l(i,"error",this.asymmetricModal)}.bind(this),a.post(s,e,t).fail(i)},asymmetricPublicKeyValueToField:function(e){var t=this.generatedKeyContainer.querySelector(".bwu-generated-key__public .bwu-the-key").innerText;e.preventDefault(),e.stopImmediatePropagation(),this.keyHasBeenDownloaded?(this.asymmetricPublicKeyField.setAttribute("value",t),this.asymmetricPublicKey.innerHTML=t,r(),this.enableSaveSettings()):alert(n.mustDownloadPrivateKey)},validateAsymmetricKeysModal:function(e){e.preventDefault(),o(),this.asymmetricPublicKeyField.value||l(n.publicKeyMissed,"warning",this.asymmetricValidateModal)},validateAsymmetricKey:function(){var e,t,i;if(!this.asymmetricPrivateKeyField.value)return alert(n.privateKeyMissed),!1;e={action:"encrypt_key_handler",task:"validateAsymmetricKeyPair",publickey:this.asymmetricPublicKeyField.value,privatekey:this.asymmetricPrivateKeyField.value,_ajax_nonce:c()},t=function(e){var t=e.data;e.success||l(t.message,"error",this.asymmetricValidateModal),t.valid?l(n.validPublicKey,"success",this.asymmetricValidateModal):l(n.invalidPublicKey,"error",this.asymmetricValidateModal)}.bind(this),i=function(e,t,i){l(i,"error",this.asymmetricValidateModal)},a.post(s,e,t).fail(i)},cleanOnThickBoxClosing:function(){this.asymmetricModal.style.display="none",this.asymmetricPrivateKeyField.value=""},toggleEncryptionType:function(e){var t,i;switch(e.target.value){case this.TYPE_SYMMETRIC:t="symmetric",i="asymmetric";break;case this.TYPE_ASYMMETRIC:t="asymmetric",i="symmetric"}a(this.tab.querySelector("#"+t+"_key_container")).show(),a(this.tab.querySelector("#"+i+"_key_container")).hide(),this.enableSaveSettings()},currentOption:function(){return i.filter(this.encryptionKeyOptions,function(e){return e.checked})[0]},ensureDownloadedKeys:function(e){var t;if(a(this.tab).is(":visible"))if(this.keyHasBeenDownloaded)this.disableSaveSettings();else{switch(e.preventDefault(),this.currentOption().value){case this.TYPE_SYMMETRIC:t=n.mustDownloadSymmetricKey;break;case this.TYPE_ASYMMETRIC:t=n.mustDownloadPrivateKey}l(t,"error",document.querySelector(".nav-tab-wrapper"))}},enableSaveSettings:function(){this.keyHasBeenDownloaded=!0},disableSaveSettings:function(){this.keyHasBeenDownloaded=!1},construct:function(){var e,t;return i.bindAll(this,"toggleEncryptionType","addListeners","generateSymmetricKey","generateAsymmetricKey","asymmetricPublicKeyValueToField","validateAsymmetricKeysModal","cleanOnThickBoxClosing","validateAsymmetricKey","ensureDownloadedKeys","enableSaveSettings","disableSaveSettings","init"),!!(e=document.querySelector("#backwpup-tab-encryption"))&&!!(t=e.querySelectorAll(".bwu-encryption-input")).length&&(this.form=document.querySelector("#settingsform"),this.tab=e,this.encryptionKeyOptions=t,this.symmetricKey=this.tab.querySelector("#symmetric_key_code"),this.symmetricKeyField=this.tab.querySelector("#symmetric_key"),this.symmetricKeyDownloader=this.tab.querySelector("#symmetric_key_downloader"),this.asymmetricPublicKey=this.tab.querySelector("#asymmetric_public_key_code"),this.asymmetricPublicKeyField=this.tab.querySelector("#asymmetric_public_key"),this.symmetricKeyGenerator=this.tab.querySelector("#symmetric_key_generator"),this.asymmetricKeyGenerator=this.tab.querySelector("#asymmetric_key_pair_generator"),this.asymmetricKeyOpenValidateModal=this.tab.querySelector("#asymmetric_key_open_validate_modal"),this.asymmetricModal=document.querySelector("#asymmetric_generated_key_modal"),this.generatedKeyContainer=this.asymmetricModal.querySelector(".bwu-generated-key"),this.privateKeyDownloader=this.asymmetricModal.querySelector("#asymmetric_generated_private_key_downloader"),this.asymmetricKeySelector=this.asymmetricModal.querySelector("#asymmetric_keys_selector"),this.keyHasBeenDownloaded=!0,this.asymmetricValidateModal=document.querySelector("#asymmetric_key_pair_validate"),this.asymmetricKeyDoValidation=this.asymmetricValidateModal.querySelector("#asymmetric_key_pair_do_validation"),this.asymmetricPrivateKeyField=this.asymmetricValidateModal.querySelector("#private_key_validate_area"),this)},addListeners:function(){i.each(this.encryptionKeyOptions,function(e){e.addEventListener("change",this.toggleEncryptionType)}.bind(this)),this.symmetricKeyGenerator.addEventListener("click",this.generateSymmetricKey),this.asymmetricKeyGenerator.addEventListener("click",this.generateAsymmetricKey),this.symmetricKeyDownloader.addEventListener("click",this.enableSaveSettings),this.privateKeyDownloader.addEventListener("click",this.enableSaveSettings),this.asymmetricKeySelector.addEventListener("click",this.asymmetricPublicKeyValueToField),this.asymmetricKeyOpenValidateModal.addEventListener("click",this.validateAsymmetricKeysModal),this.asymmetricKeyDoValidation.addEventListener("click",this.validateAsymmetricKey),this.form.addEventListener("submit",this.ensureDownloadedKeys),a("body").on("thickbox:removed",this.cleanOnThickBoxClosing)},init:function(){this.toggleEncryptionType({target:this.currentOption()}),this.addListeners()}};window.addEventListener("load",function(){var e=Object.create(m,{TYPE_ASYMMETRIC:t("asymmetric"),TYPE_SYMMETRIC:t("symmetric")});e.construct()&&e.init()})}(window._,window.jQuery,window.tb_remove,window.ajaxurl,window.settingsEncryptionVariables); \ No newline at end of file +!function(i,r,a,s,n){function t(e){return{value:e,writable:!1,configurable:!1,enumerable:!1}}function c(){return document.querySelector("#backwpupajaxnonce").value}function y(e){var t=document.querySelector("#asymmetric_key_generation_waiting");t&&(t.style.display=e)}function o(){var e=document.querySelector("#bwu_encrypt_notice");e&&e.remove()}function l(e,t,i){o(),i&&i.insertAdjacentHTML("beforebegin",'

'+e+"

")}var m={generateSymmetricKey:function(e){var t,i,a;this.disableSaveSettings(),e.preventDefault(),e.stopPropagation(),a={action:"encrypt_key_handler",task:"generateSymmetricKey",_ajax_nonce:c()},t=function(e){var t=e.data;e.success?(r(this.symmetricKeyGenerator).hide(),r(this.symmetricKeyDownloader).show(),this.symmetricKeyField.value=t.key,this.symmetricKey.innerText=t.key,this.symmetricKeyDownloader.setAttribute("href","data:application/octet-stream;charset=utf-16le;base64,"+btoa(t.key)),l(t.message,"success",document.querySelector(".nav-tab-wrapper"))):l(t.message,"error",document.querySelector(".nav-tab-wrapper"))}.bind(this),i=function(e,t,i){l(i,"error",document.querySelector(".nav-tab-wrapper"))}.bind(this),r.post(s,a,t).fail(i)},generateAsymmetricKey:function(e){var t,i,a;this.disableSaveSettings(),e.preventDefault(),y("block"),t={action:"encrypt_key_handler",task:"generateAsymmetricKeyPair",_ajax_nonce:c()},i=function(e){var t,i,a=e.data,r=a.keys.publicKey,s=a.keys.privateKey;this.generatedKeyContainer&&(e.success?(t=this.generatedKeyContainer.querySelector("#asymmetric_generated_public_key_downloader"),i=this.generatedKeyContainer.querySelector("#asymmetric_generated_private_key_downloader"),t&&i&&(this.generatedKeyContainer.querySelector(".bwu-generated-key__public .bwu-the-key").innerText=r,this.generatedKeyContainer.querySelector(".bwu-generated-key__private .bwu-the-key").innerText=s,t.setAttribute("href","data:text/plain;base64,"+btoa(r)),i.setAttribute("href","data:text/plain;base64,"+btoa(s)),y("none"),this.asymmetricModal.style.display="block",l(a.message,"success",this.asymmetricModal))):l(a.message,"error",this.asymmetricModal))}.bind(this),a=function(e,t,i){l(i,"error",this.asymmetricModal)}.bind(this),r.post(s,t,i).fail(a)},asymmetricPublicKeyValueToField:function(e){var t=this.generatedKeyContainer.querySelector(".bwu-generated-key__public .bwu-the-key").innerText;e.preventDefault(),e.stopImmediatePropagation(),this.keyHasBeenDownloaded?(this.asymmetricPublicKeyField.setAttribute("value",t),this.asymmetricPublicKey.innerHTML=t,a(),this.enableSaveSettings()):alert(n.mustDownloadPrivateKey)},validateAsymmetricKeysModal:function(e){e.preventDefault(),o(),this.asymmetricPublicKeyField.value||l(n.publicKeyMissed,"warning",this.asymmetricValidateModal)},validateAsymmetricKey:function(){var e,t,i;if(!this.asymmetricPrivateKeyField.value)return alert(n.privateKeyMissed),!1;e={action:"encrypt_key_handler",task:"validateAsymmetricKeyPair",publickey:this.asymmetricPublicKeyField.value,privatekey:this.asymmetricPrivateKeyField.value,_ajax_nonce:c()},t=function(e){var t;t=e.data,e.success||l(t.message,"error",this.asymmetricValidateModal),t.valid?l(n.validPublicKey,"success",this.asymmetricValidateModal):l(n.invalidPublicKey,"error",this.asymmetricValidateModal)}.bind(this),i=function(e,t,i){l(i,"error",this.asymmetricValidateModal)},r.post(s,e,t).fail(i)},cleanOnThickBoxClosing:function(){this.asymmetricModal.style.display="none",this.asymmetricPrivateKeyField.value=""},toggleEncryptionType:function(e){var t,i;switch(e.target.value){case this.TYPE_SYMMETRIC:t="symmetric",i="asymmetric";break;case this.TYPE_ASYMMETRIC:t="asymmetric",i="symmetric"}r(this.tab.querySelector("#"+t+"_key_container")).show(),r(this.tab.querySelector("#"+i+"_key_container")).hide(),this.enableSaveSettings()},currentOption:function(){return i.filter(this.encryptionKeyOptions,function(e){return e.checked})[0]},ensureDownloadedKeys:function(e){var t;if(r(this.tab).is(":visible"))if(this.keyHasBeenDownloaded)this.disableSaveSettings();else{switch(e.preventDefault(),this.currentOption().value){case this.TYPE_SYMMETRIC:t=n.mustDownloadSymmetricKey;break;case this.TYPE_ASYMMETRIC:t=n.mustDownloadPrivateKey}l(t,"error",document.querySelector(".nav-tab-wrapper"))}},enableSaveSettings:function(){this.keyHasBeenDownloaded=!0},disableSaveSettings:function(){this.keyHasBeenDownloaded=!1},construct:function(){var e,t;return i.bindAll(this,"toggleEncryptionType","addListeners","generateSymmetricKey","generateAsymmetricKey","asymmetricPublicKeyValueToField","validateAsymmetricKeysModal","cleanOnThickBoxClosing","validateAsymmetricKey","ensureDownloadedKeys","enableSaveSettings","disableSaveSettings","init"),!!(e=document.querySelector("#backwpup-tab-encryption"))&&(!!(t=e.querySelectorAll(".bwu-encryption-input")).length&&(this.form=document.querySelector("#settingsform"),this.tab=e,this.encryptionKeyOptions=t,this.symmetricKey=this.tab.querySelector("#symmetric_key_code"),this.symmetricKeyField=this.tab.querySelector("#symmetric_key"),this.symmetricKeyDownloader=this.tab.querySelector("#symmetric_key_downloader"),this.asymmetricPublicKey=this.tab.querySelector("#asymmetric_public_key_code"),this.asymmetricPublicKeyField=this.tab.querySelector("#asymmetric_public_key"),this.symmetricKeyGenerator=this.tab.querySelector("#symmetric_key_generator"),this.asymmetricKeyGenerator=this.tab.querySelector("#asymmetric_key_pair_generator"),this.asymmetricKeyOpenValidateModal=this.tab.querySelector("#asymmetric_key_open_validate_modal"),this.asymmetricModal=document.querySelector("#asymmetric_generated_key_modal"),this.generatedKeyContainer=this.asymmetricModal.querySelector(".bwu-generated-key"),this.privateKeyDownloader=this.asymmetricModal.querySelector("#asymmetric_generated_private_key_downloader"),this.asymmetricKeySelector=this.asymmetricModal.querySelector("#asymmetric_keys_selector"),this.keyHasBeenDownloaded=!0,this.asymmetricValidateModal=document.querySelector("#asymmetric_key_pair_validate"),this.asymmetricKeyDoValidation=this.asymmetricValidateModal.querySelector("#asymmetric_key_pair_do_validation"),this.asymmetricPrivateKeyField=this.asymmetricValidateModal.querySelector("#private_key_validate_area"),this))},addListeners:function(){i.each(this.encryptionKeyOptions,function(e){e.addEventListener("change",this.toggleEncryptionType)}.bind(this)),this.symmetricKeyGenerator.addEventListener("click",this.generateSymmetricKey),this.asymmetricKeyGenerator.addEventListener("click",this.generateAsymmetricKey),this.symmetricKeyDownloader.addEventListener("click",this.enableSaveSettings),this.privateKeyDownloader.addEventListener("click",this.enableSaveSettings),this.asymmetricKeySelector.addEventListener("click",this.asymmetricPublicKeyValueToField),this.asymmetricKeyOpenValidateModal.addEventListener("click",this.validateAsymmetricKeysModal),this.asymmetricKeyDoValidation.addEventListener("click",this.validateAsymmetricKey),this.form.addEventListener("submit",this.ensureDownloadedKeys),r("body").on("thickbox:removed",this.cleanOnThickBoxClosing)},init:function(){this.toggleEncryptionType({target:this.currentOption()}),this.addListeners()}};window.addEventListener("load",function(){var e=Object.create(m,{TYPE_ASYMMETRIC:t("asymmetric"),TYPE_SYMMETRIC:t("symmetric")});e.construct()&&e.init()})}(window._,window.jQuery,window.tb_remove,window.ajaxurl,window.settingsEncryptionVariables); \ No newline at end of file diff --git a/assets/js/vendor/clipboard.min.min.js b/assets/js/vendor/clipboard.min.min.js new file mode 100644 index 00000000..5e97d597 --- /dev/null +++ b/assets/js/vendor/clipboard.min.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Clipboard=t()}}(function(){return function r(a,c,l){function s(e,t){if(!c[e]){if(!a[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(u)return u(e,!0);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}var i=c[e]={exports:{}};a[e][0].call(i.exports,function(t){return s(a[e][1][t]||t)},i,i.exports,r,a,c,l)}return c[e].exports}for(var u="function"==typeof require&&require,t=0;tis_php_version_compatible() || !$system_tests->is_wp_version_compatible()) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; + // Don't activate on anything less than PHP 7.4 or WordPress 4.9. + if ( ! $system_tests->is_php_version_compatible() || ! $system_tests->is_wp_version_compatible() ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; deactivate_plugins(__FILE__); exit( diff --git a/changelog.txt b/changelog.txt index ec69f18e..98a0fe1e 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,16 @@ == Changelog == += 4.1.5 = +Release date: sept 27, 2024 + +* Added : Restore feature information notice +* Changed : Upgraded Wordpress minimum version to 4.9 +* Removed : Remove the EasyCron integration and switch it with WPCron. +* Removed : Remove Database Backup file name & compression options from the UI can be edited via filter (backwpup_generate_dump_filename) +* Fixed : Conflict with WP Hotel Booking from ThimPress +* Changed : Add the default exclude files in a filter. (backwpup_file_exclude) +* Fixed : Use wp translation + + = 4.1.4 = Release date: jul 22, 2024 diff --git a/inc/Notice/EasycronUpdateNotice.php b/inc/Notice/EasycronUpdateNotice.php new file mode 100644 index 00000000..28b325b5 --- /dev/null +++ b/inc/Notice/EasycronUpdateNotice.php @@ -0,0 +1,74 @@ +view->info( $message, $this->getDismissActionUrl() ); + } + + /** + * {@inheritdoc} + */ + protected function isScreenAllowed(): bool { + return true; + } + + /** + * {@inheritdoc} + */ + protected function shouldDisplay(): bool { + // Check if the notice has been dismissed. + if ( parent::shouldDisplay() ) { + return get_site_option( 'backwpup_easycron_update', false ); + } + return false; + } + + /** + * {@inheritdoc} + * + * @return NoticeMessage + */ + protected function message(): NoticeMessage { + + return new NoticeMessage( 'easycron_update' ); + } + + /** + * {@inheritdoc} + * + * @return string + */ + protected function getDismissActionUrl(): ?string { + if ( $this->dismissible ) { + return DismissibleNoticeOption::dismiss_action_url( + static::ID, + DismissibleNoticeOption::FOR_GOOD_ACTION + ); + } + + return null; + } +} diff --git a/inc/Notice/RestoreFeatureInformationNotice.php b/inc/Notice/RestoreFeatureInformationNotice.php new file mode 100644 index 00000000..d045972e --- /dev/null +++ b/inc/Notice/RestoreFeatureInformationNotice.php @@ -0,0 +1,55 @@ +view->info( $message, null ); + } + + /** + * {@inheritdoc} + */ + protected function isScreenAllowed(): bool { + return true; + } + + /** + * {@inheritdoc} + * + * @return NoticeMessage + */ + protected function message(): NoticeMessage { + $notice_message = new NoticeMessage( + 'restore_feature_information', + 'Leave us a review !', + 'https://wordpress.org/support/plugin/backwpup/reviews/?rate=5#new-post' + ); + $notice_message->dismissurl = DismissibleNoticeOption::dismiss_action_url( + static::ID, + DismissibleNoticeOption::FOR_GOOD_ACTION + ); + return $notice_message; + } +} diff --git a/inc/ThirdParty/HummingbirdPerformance.php b/inc/ThirdParty/HummingbirdPerformance.php index 8b2595f0..b1b13ff2 100644 --- a/inc/ThirdParty/HummingbirdPerformance.php +++ b/inc/ThirdParty/HummingbirdPerformance.php @@ -62,7 +62,7 @@ public function exclude_cache_folders( $excluded_cache_folders ) { * @return bool */ public static function is_active(): bool { - return defined( 'WPHB_VERSION' ); + return ( class_exists( 'Hummingbird\\WP_Hummingbird' ) && defined( 'WPHB_VERSION' ) ); } /** diff --git a/inc/class-admin.php b/inc/class-admin.php index 90792ff5..a2c225b6 100755 --- a/inc/class-admin.php +++ b/inc/class-admin.php @@ -9,6 +9,8 @@ use Inpsyde\BackWPup\Pro\Settings; use Inpsyde\BackWPup\Pro\Settings\AjaxEncryptionKeyHandler; use Inpsyde\BackWPup\Notice\EvaluateNotice; +use Inpsyde\BackWPup\Notice\EasycronUpdateNotice; +use Inpsyde\BackWPup\Notice\RestoreFeatureInformationNotice; /** * BackWPup_Admin. @@ -241,6 +243,18 @@ private function init_notices() { new NoticeView( EvaluateNotice::ID ) ); $evaluate_notice->init( EvaluateNotice::TYPE_ADMIN ); + + $easycron_update_notice = new EasycronUpdateNotice( + new NoticeView( EasycronUpdateNotice::ID ), + true + ); + $easycron_update_notice->init( EasycronUpdateNotice::TYPE_ADMIN ); + + $restore_feature_information_notice = new RestoreFeatureInformationNotice( + new NoticeView( RestoreFeatureInformationNotice::ID ), + true + ); + $restore_feature_information_notice->init( RestoreFeatureInformationNotice::TYPE_ADMIN ); } /** diff --git a/inc/class-easycron.php b/inc/class-easycron.php index 52095781..9cddd9d6 100644 --- a/inc/class-easycron.php +++ b/inc/class-easycron.php @@ -3,13 +3,30 @@ * Class for integration of EasyCron.com * Documentation: https://www.easycron.com/document. */ -class BackWPup_EasyCron -{ - public function __construct() - { - add_action('backwpup_page_settings_tab_apikey', [$this, 'api_key_form'], 11); - add_action('backwpup_page_settings_save', [$this, 'api_key_save_form'], 11); - } +class BackWPup_EasyCron { + + /** + * Constructor. + */ + public function __construct() { + } + + /** + * Update the job to use EasyCron. + * + * @param int $backwpup_jobid The job ID. + */ + public static function update_to_wpcron( $backwpup_jobid ) { + $id = BackWPup_Option::get( $backwpup_jobid, 'easycronjobid' ); + + if ( ! empty( $id ) ) { + $message = self::query_api( 'delete', [ 'id' => $id ] ); + delete_site_transient( 'backwpup_easycron_' . $id ); + } + + BackWPup_Option::delete( $backwpup_jobid, 'easycronjobid' ); + BackWPup_Option::update( $backwpup_jobid, 'activetype', 'wpcron' ); + } public static function update($backwpup_jobid) { diff --git a/inc/class-install.php b/inc/class-install.php index 3b5907f1..becf0a3b 100644 --- a/inc/class-install.php +++ b/inc/class-install.php @@ -42,21 +42,23 @@ public static function activate() add_option('backwpup_jobs', [], null, 'no'); } - //remove old schedule - wp_clear_scheduled_hook('backwpup_cron'); - //make new schedule - $activejobs = BackWPup_Option::get_job_ids('activetype', 'wpcron'); - if (!empty($activejobs)) { - foreach ($activejobs as $id) { - $cron_next = BackWPup_Cron::cron_next(BackWPup_Option::get($id, 'cron')); - wp_schedule_single_event($cron_next, 'backwpup_cron', ['arg' => $id]); - } - } - $activejobs = BackWPup_Option::get_job_ids('activetype', 'easycron'); - if (!empty($activejobs)) { - foreach ($activejobs as $id) { - BackWPup_EasyCron::update($id); - } + // remove old schedule. + wp_clear_scheduled_hook( 'backwpup_cron' ); + // replace easycron with wpcron. + $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'easycron' ); + if ( ! empty( $activejobs ) ) { + update_site_option( 'backwpup_easycron_update', true ); + foreach ( $activejobs as $id ) { + BackWPup_EasyCron::update_to_wpcron( $id ); + } + } + // make new schedule. + $activejobs = BackWPup_Option::get_job_ids( 'activetype', 'wpcron' ); + if ( ! empty( $activejobs ) ) { + foreach ( $activejobs as $id ) { + $cron_next = BackWPup_Cron::cron_next( BackWPup_Option::get( $id, 'cron' ) ); + wp_schedule_single_event( $cron_next, 'backwpup_cron', [ 'arg' => $id ] ); + } } //add Cleanup schedule diff --git a/inc/class-job.php b/inc/class-job.php index 4b7eb992..1c2b7f5b 100755 --- a/inc/class-job.php +++ b/inc/class-job.php @@ -283,17 +283,29 @@ private function create($start_type, $job_id = 0) $this->logfile = $log_folder . 'backwpup_log_' . BackWPup::get_generated_hash(6) . '_' . date( 'Y-m-d_H-i-s', current_time('timestamp') - ) . '.html'; - //write settings to job - BackWPup_Option::update($this->job['jobid'], 'lastrun', $this->start_time); - BackWPup_Option::update($this->job['jobid'], 'logfile', $this->logfile); //Set current logfile - BackWPup_Option::update($this->job['jobid'], 'lastbackupdownloadurl', ''); - //Set needed job values - $this->timestamp_last_update = microtime(true); - $this->exclude_from_backup = explode(',', trim((string) $this->job['fileexclude'])); - $this->exclude_from_backup = array_unique($this->exclude_from_backup); - //setup job steps - $this->steps_data['CREATE']['CALLBACK'] = ''; + ) . '.html'; + // write settings to job. + BackWPup_Option::update( $this->job['jobid'], 'lastrun', $this->start_time ); + BackWPup_Option::update( $this->job['jobid'], 'logfile', $this->logfile ); // Set current logfile. + BackWPup_Option::update( $this->job['jobid'], 'lastbackupdownloadurl', '' ); + // Set needed job values. + $this->timestamp_last_update = microtime( true ); + /** + * Filter to exclude files from backup. + * + * @param array $excluded_files List of excluded files. + */ + $this->exclude_from_backup = (array) apply_filters( + 'backwpup_file_exclude', + explode( ',', trim( (string) $this->job['fileexclude'] ) ) + ); + $this->exclude_from_backup = array_merge( + $this->exclude_from_backup, + [ '.tmp','.svn','.git','desktop.ini','.DS_Store','/node_modules/' ] + ); + $this->exclude_from_backup = array_unique( $this->exclude_from_backup ); + // setup job steps. + $this->steps_data['CREATE']['CALLBACK'] = ''; $this->steps_data['CREATE']['NAME'] = __('Job Start', 'backwpup'); $this->steps_data['CREATE']['STEP_TRY'] = 0; //ADD Job types file @@ -654,6 +666,24 @@ public function generate_filename($name, $suffix = '', $delete_temp_file = true) return $name; } + /** + * Generate a filename for a database dump. + * + * @param string $name The initial filename. + * @param string $suffix The suffix to append to the filename. + * + * @return string The generated filename. + */ + public function generate_db_dump_filename( $name, $suffix = '' ) { + /** + * Filter the db dump filename. + * + * @param bool $name The initial filename. + */ + $name = (string) apply_filters( 'backwpup_generate_dump_filename', $name ); + return $this->generate_filename( $name, $suffix ); + } + /** * Sanitizes a filename, replacing whitespace with underscores. * diff --git a/inc/class-jobtype-dbdump.php b/inc/class-jobtype-dbdump.php index a9939368..7895a1b9 100644 --- a/inc/class-jobtype-dbdump.php +++ b/inc/class-jobtype-dbdump.php @@ -66,41 +66,20 @@ public function edit_tab($jobid) $next_row = ceil(count($tables) / 3); $counter = 0; - foreach ($tables as $table) { - $tabletype = ''; - if ($table[1] !== 'BASE TABLE') { - $tabletype = ' (' . strtolower(esc_html($table[1])) . ')'; - } - echo '
'; - ++$counter; - if ($next_row <= $counter) { - echo '
'; - $counter = 0; - } - } - echo '
'; ?> - - - - - - .sql - - - - - -
- ' . __('none', 'backwpup') . '
'; - if (function_exists('gzopen')) { - echo '
'; - } else { - echo '
'; - } ?> -
+ foreach ( $tables as $table ) { + $tabletype = ''; + if ( 'BASE TABLE' !== $table[1] ) { + $tabletype = ' (' . strtolower( esc_html( $table[1] ) ) . ')'; + } + echo '
'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ++$counter; + if ( $next_row <= $counter ) { + echo '
'; + $counter = 0; + } + } + echo '
'; + ?> @@ -152,10 +131,10 @@ public function job_run(BackWPup_Job $job_object) $job_object->log(sprintf(__('%d. Try to backup database …', 'backwpup'), $job_object->steps_data[$job_object->step_working]['STEP_TRY'])); } - //build filename - if (empty($job_object->steps_data[$job_object->step_working]['dbdumpfile'])) { - $job_object->steps_data[$job_object->step_working]['dbdumpfile'] = $job_object->generate_filename($job_object->job['dbdumpfile'], 'sql') . $job_object->job['dbdumpfilecompression']; - } + // build filename. + if ( empty( $job_object->steps_data[ $job_object->step_working ]['dbdumpfile'] ) ) { + $job_object->steps_data[ $job_object->step_working ]['dbdumpfile'] = $job_object->generate_db_dump_filename( $job_object->job['dbdumpfile'], 'sql' ) . $job_object->job['dbdumpfilecompression']; + } try { //Connect to Database diff --git a/inc/class-jobtype-file.php b/inc/class-jobtype-file.php index 1086c9d4..4b5a3844 100644 --- a/inc/class-jobtype-file.php +++ b/inc/class-jobtype-file.php @@ -74,14 +74,11 @@ public function option_defaults() 'backupuploadsexcludedirs' => apply_filters( 'backwpup_upload_exclude_dirs', [basename($log_folder)] - ), - 'fileexclude' => apply_filters( - 'backwpup_file_exclude', - '.tmp,.svn,.git,desktop.ini,.DS_Store,/node_modules/' - ), - 'dirinclude' => apply_filters('backwpup_dir_include', ''), - 'backupabsfolderup' => false, - ]; + ), + 'fileexclude' => '', + 'dirinclude' => apply_filters( 'backwpup_dir_include', '' ), + 'backupabsfolderup' => false, + ]; } /** diff --git a/inc/class-page-backups.php b/inc/class-page-backups.php index 08b516c5..ad66518c 100644 --- a/inc/class-page-backups.php +++ b/inc/class-page-backups.php @@ -584,11 +584,9 @@ public static function page()
0%
decrypt_key_input(); + if ( \BackWPup::is_pro() ) { + $view = new ViewLoader(); + $view->decrypt_key_input(); } ?> diff --git a/inc/class-page-editjob.php b/inc/class-page-editjob.php index 6214024f..bf6800bf 100644 --- a/inc/class-page-editjob.php +++ b/inc/class-page-editjob.php @@ -593,21 +593,7 @@ public static function page() type="radio" name="activetype" id="idactivetype-wpcron" value="wpcron" />
- -
-