Backup and Restore WordPress – WPBackItUp Backup Plugin - Version 1.15.4

Version Description

*Release Date - January 3, 2018

  • FIX : Fix security issue with delete log
  • UPDATE: Admin notice updates
  • UPDATE: Enhancements to support WPBackItUp Safe cloud storage
Download this release

Release Info

Developer cssimmon
Plugin Icon 128x128 Backup and Restore WordPress – WPBackItUp Backup Plugin
Version 1.15.4
Comparing to
See all releases

Code changes from version 1.15.3 to 1.15.4

js/vue-tabs.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueTabs=e():t.VueTabs=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=5)}([function(t,e){t.exports=function(t,e,n,o){var s,i=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(s=t,i=t.default);var r="function"==typeof i?i.options:i;if(e&&(r.render=e.render,r.staticRenderFns=e.staticRenderFns),n&&(r._scopeId=n),o){var u=Object.create(r.computed||null);Object.keys(o).forEach(function(t){var e=o[t];u[t]=function(){return e}}),r.computed=u}return{esModule:s,exports:i,options:r}}},function(t,e,n){var o=n(0)(n(3),n(8),null,null);o.options.__file="C:\\work\\vue-tabs\\src\\components\\TabContent.vue",o.esModule&&Object.keys(o.esModule).some(function(t){return"default"!==t&&"__esModule"!==t})&&console.error("named exports are not supported in *.vue files."),o.options.functional&&console.error("[vue-loader] TabContent.vue: functional components are not supported with templates, they should use render functions."),t.exports=o.exports},function(t,e,n){n(7),n(6);var o=n(0)(n(4),n(9),null,null);o.options.__file="C:\\work\\vue-tabs\\src\\components\\VueTabs.vue",o.esModule&&Object.keys(o.esModule).some(function(t){return"default"!==t&&"__esModule"!==t})&&console.error("named exports are not supported in *.vue files."),o.options.functional&&console.error("[vue-loader] VueTabs.vue: functional components are not supported with templates, they should use render functions."),t.exports=o.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"v-tab",props:{title:{type:String,default:""},icon:{type:String,default:""},beforeChange:{type:Function},route:{type:[String,Object]},transitionName:String,transitionMode:String},computed:{isValidParent:function(){return"vue-tabs"===this.$parent.$options.name}},data:function(){return{active:!1}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"vue-tabs",props:{activeTabColor:String,activeTextColor:String,textPosition:{type:String,default:"center"},type:{type:String,default:"tabs"},direction:{type:String,default:"horizontal"},centered:Boolean,startIndex:{type:Number,default:0}},data:function(){return{activeTabIndex:0,tabs:[]}},computed:{tabCount:function(){return this.tabs.length},isTabShape:function(){return"tabs"===this.type},isStacked:function(){return"vertical"===this.direction},classList:function(){return"nav "+(this.isTabShape?"nav-tabs":"nav-pills")+" "+(this.centered?"nav-justified":"")+" "+(this.isStacked?"nav-stacked":"")},stackedClass:function(){return this.isStacked?"stacked":""},activeTabStyle:function(){return{backgroundColor:this.activeTabColor,color:this.activeTextColor}},activeTitleColor:function(){return{color:this.activeTabColor}}},methods:{navigateToTab:function(t){this.beforeTabChange(this.activeTabIndex)&&this.changeTab(this.activeTabIndex,t)},beforeTabChange:function(t){var e=this.tabs[t];return!e||void 0===e.beforeChange||e.beforeChange()},changeTab:function(t,e){if(!(e<0||e>=this.tabCount)){var n=this.tabs[t],o=this.tabs[e];n&&(n.active=!1,o&&(o.active=!0)),this.activeTabIndex=e,this.tryChangeRoute(o)}},tryChangeRoute:function(t){this.$router&&t&&t.route&&this.$router.push(t.route)}},mounted:function(){if(this.tabs=this.$children.filter(function(t){return"v-tab"===t.$options.name}),this.tabs.length>0&&0===this.startIndex){var t=this.tabs[this.activeTabIndex];t.active=!0,this.tryChangeRoute(t)}if(this.startIndex<this.tabs.length){var e=this.tabs[this.startIndex];this.activeTabIndex=this.startIndex,e.active=!0,this.tryChangeRoute(this.tabs[this.startIndex])}else console.warn("Prop startIndex set to "+this.startIndex+" is greater than the number of tabs - "+this.tabs.length+". Make sure that the starting index is less than the number of tabs registered")}}},function(t,e,n){t.exports={VueTabs:n(2),VTab:n(1),install:function(e){e.component("vue-tabs",t.exports.VueTabs),e.component("v-tab",t.exports.VTab)}}},function(t,e){},function(t,e){},function(t,e,n){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.active?n("div",{staticClass:"tab-container"},[t._t("default")],2):t._e()},staticRenderFns:[]},t.exports.render._withStripped=!0},function(t,e,n){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-tabs",class:t.stackedClass},[n("ul",{class:t.classList},[t._l(t.tabs,function(e,o){return t._t("tab",[n("li",{key:e,staticClass:"tab",class:{active:e.active}},["top"===t.textPosition?n("span",{staticClass:"title title_top",style:e.active?t.activeTitleColor:{}},[t._v("\n "+t._s(e.title)+"\n ")]):t._e(),t._v(" "),n("a",{style:e.active?t.activeTabStyle:{},attrs:{href:""},on:{click:function(e){e.preventDefault(),t.navigateToTab(o)}}},[n("i",{class:e.icon},["center"===t.textPosition?n("span",[t._v("\n "+t._s(e.title)+"\n ")]):t._e()])]),t._v(" "),"bottom"===t.textPosition?n("span",{staticClass:"title title_bottom",style:e.active?t.activeTitleColor:{}},[t._v("\n "+t._s(e.title)+"\n ")]):t._e()])],{tab:e,index:o,clickHandler:t.navigateToTab})})],2),t._v(" "),n("div",{staticClass:"tab-content"},[t._t("default")],2)])},staticRenderFns:[]},t.exports.render._withStripped=!0}])});
js/wp-backitup-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueTabs=t():e.VueTabs=t()}(this,function(){return function(e){function t(i){if(a[i])return a[i].exports;var s=a[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,i){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var a=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t){e.exports=function(e,t,a,i){var s,n=e=e||{},o=typeof e["default"];"object"!==o&&"function"!==o||(s=e,n=e["default"]);var c="function"==typeof n?n.options:n;if(t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns),a&&(c._scopeId=a),i){var l=Object.create(c.computed||null);Object.keys(i).forEach(function(e){var t=i[e];l[e]=function(){return t}}),c.computed=l}return{esModule:s,exports:n,options:c}}},function(e,t,a){var i=a(0)(a(3),a(8),null,null);i.options.__file="C:\\work\\vue-tabs\\src\\components\\TabContent.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] TabContent.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,a){a(7),a(6);var i=a(0)(a(4),a(9),null,null);i.options.__file="C:\\work\\vue-tabs\\src\\components\\VueTabs.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] VueTabs.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={name:"v-tab",props:{title:{type:String,"default":""},icon:{type:String,"default":""},beforeChange:{type:Function},route:{type:[String,Object]},transitionName:String,transitionMode:String},computed:{isValidParent:function(){return"vue-tabs"===this.$parent.$options.name}},data:function(){return{active:!1}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={name:"vue-tabs",props:{activeTabColor:String,activeTextColor:String,textPosition:{type:String,"default":"center"},type:{type:String,"default":"tabs"},direction:{type:String,"default":"horizontal"},centered:Boolean,startIndex:{type:Number,"default":0}},data:function(){return{activeTabIndex:0,tabs:[]}},computed:{tabCount:function(){return this.tabs.length},isTabShape:function(){return"tabs"===this.type},isStacked:function(){return"vertical"===this.direction},classList:function(){return"nav "+(this.isTabShape?"nav-tabs":"nav-pills")+" "+(this.centered?"nav-justified":"")+" "+(this.isStacked?"nav-stacked":"")},stackedClass:function(){return this.isStacked?"stacked":""},activeTabStyle:function(){return{backgroundColor:this.activeTabColor,color:this.activeTextColor}},activeTitleColor:function(){return{color:this.activeTabColor}}},methods:{navigateToTab:function(e){this.beforeTabChange(this.activeTabIndex)&&this.changeTab(this.activeTabIndex,e)},beforeTabChange:function(e){var t=this.tabs[e];return!t||void 0===t.beforeChange||t.beforeChange()},changeTab:function(e,t){if(!(t<0||t>=this.tabCount)){var a=this.tabs[e],i=this.tabs[t];a&&(a.active=!1,i&&(i.active=!0)),this.activeTabIndex=t,this.tryChangeRoute(i)}},tryChangeRoute:function(e){this.$router&&e&&e.route&&this.$router.push(e.route)}},mounted:function(){if(this.tabs=this.$children.filter(function(e){return"v-tab"===e.$options.name}),this.tabs.length>0&&0===this.startIndex){var e=this.tabs[this.activeTabIndex];e.active=!0,this.tryChangeRoute(e)}if(this.startIndex<this.tabs.length){var t=this.tabs[this.startIndex];this.activeTabIndex=this.startIndex,t.active=!0,this.tryChangeRoute(this.tabs[this.startIndex])}else console.warn("Prop startIndex set to "+this.startIndex+" is greater than the number of tabs - "+this.tabs.length+". Make sure that the starting index is less than the number of tabs registered")}}},function(e,t,a){e.exports={VueTabs:a(2),VTab:a(1),install:function(t){t.component("vue-tabs",e.exports.VueTabs),t.component("v-tab",e.exports.VTab)}}},function(e,t){},function(e,t){},function(e,t,a){e.exports={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.active?a("div",{staticClass:"tab-container"},[e._t("default")],2):e._e()},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,a){e.exports={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vue-tabs","class":e.stackedClass},[a("ul",{"class":e.classList},[e._l(e.tabs,function(t,i){return e._t("tab",[a("li",{key:t,staticClass:"tab","class":{active:t.active}},["top"===e.textPosition?a("span",{staticClass:"title title_top",style:t.active?e.activeTitleColor:{}},[e._v("\n "+e._s(t.title)+"\n ")]):e._e(),e._v(" "),a("a",{style:t.active?e.activeTabStyle:{},attrs:{href:""},on:{click:function(t){t.preventDefault(),e.navigateToTab(i)}}},[a("i",{"class":t.icon},["center"===e.textPosition?a("span",[e._v("\n "+e._s(t.title)+"\n ")]):e._e()])]),e._v(" "),"bottom"===e.textPosition?a("span",{staticClass:"title title_bottom",style:t.active?e.activeTitleColor:{}},[e._v("\n "+e._s(t.title)+"\n ")]):e._e()])],{tab:t,index:i,clickHandler:e.navigateToTab})})],2),e._v(" "),a("div",{staticClass:"tab-content"},[e._t("default")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0}])}),function(e){"use strict";var t="wpbackitup-safe",a={GDRIVE:"GDRIVE",AMAZONS3:"AMAZONS3",DROPBOX:"DROPBOX"},i={READY:"ready",UPLOADING:"uploading",UPLOADED:"uploaded",ERROR:"error"},s=function(e){return t+"_"+e},n=function(t){return e.ajax({url:ajaxurl,type:"GET",data:{action:s(t),security:WPBackItUpSafeLocals[t]},dataType:"json"})},o=function(t){return e.ajax({url:ajaxurl,type:"GET",data:{action:"wp-backitup_"+t,security:wpbackitup_local[t]},dataType:"json"})},c=function(t,a){var a=a||{};return a.action=s(t),a.security=WPBackItUpSafeLocals[t],e.ajax({url:ajaxurl,type:"POST",data:a,dataType:"json"})};if(document.querySelector("#wpbackitup-core-backup"))var l=new Vue({el:"#wpbackitup-core-backup",data:{DROPBOX:{},GDRIVE:{},AMAZONS3:{},providers:[],cloudStatus:{}},methods:{openModal:function(e){this.$refs[e].open()},closeModal:function(e){this.$refs[e].close()},getEnabledProviders:function(){n("get_enabled_providers").then(function(e){e.success&&(l.providers=e.data)})},getAvailableBackups:function(){o("get_available_backups").then(function(e){if(e.success)for(var t=0;t<e.data.length;t++){var a=e.data[t].backup_job_id,i=e.data[t].backup_job_cloud_status;l.$set(l.cloudStatus,a,i)}})},postJobIdToSafe:function(e,t){var a={job_id:e,provider:t};c("queue_job_sync",a).then(function(t){t.success&&l.$set(l.cloudStatus,e,i.UPLOADING)})},saveIndProviders:function(e){for(var t=this.providers.length,i=0;i<t;i++)this.providers[i]===a.DROPBOX&&this.DROPBOX[e]===!0?this.postJobIdToSafe(e,a.DROPBOX):this.providers[i]===a.GDRIVE&&this.GDRIVE[e]===!0?this.postJobIdToSafe(e,a.GDRIVE):this.providers[i]===a.AMAZONS3&&this.AMAZONS3[e]===!0&&this.postJobIdToSafe(e,a.AMAZONS3);l.closeModal("modal"+e)}},mounted:function(){this.getEnabledProviders(),this.getAvailableBackups(),this.getAvailableBackupsInterval=setInterval(function(){this.getAvailableBackups()}.bind(this),3e3)},beforeDestroy:function(){clearInterval(this.getAvailableBackupsInterval)}})}(jQuery),function(e){function t(){e(".viewloglink").click(function(){var t=e(this).attr("href");return e("#backup_name").val(t),e("#viewlog").submit(),!1})}function a(){e(".downloadbackuplink").bind("click",function(){var t=e(this).attr("href");return e("#backup_file").val(t),e(this).append('<i class="fa fa-check"></i>'),e(this).css({color:"green"}),e("#download_backup").submit(),!1})}function i(t,i){var n=({action:f("backup_zip_filelist"),job_id:t},i.replace(/[^A-Za-z0-9\-]/g,"")),o=0,c="",l='<div id="'+n+'"> <h2>'+wpbackitup_local.bl_backup_set+"&nbsp; <em>"+i+'</em></h2> <div class="wpbiu-notes"> <textarea class="backupnotes" id="wpbiu-note-box" placeholder="'+wpbackitup_local.bl_note_placeholder+'"></textarea> <button id="wpbiu-note-btn" class="button-primary">'+wpbackitup_local.bl_note_save+'</button><span id="wpbiu-note-response">'+wpbackitup_local.bl_note_saved_success+"</span></div> <p>"+wpbackitup_local.bl_backup_download+'</p> <table class="widefat" id="datatable"> <tbody>';e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_zip_filelist"),job_id:t},dataType:"json"}).done(function(i){i.data?(e.each(i.data,function(){var t=e(this)[0].name.split(/[\/]+/).pop(),a=e(this)[0].size,i=e(this)[0].file_exists;if(console.log(t,a),t.indexOf("-backupset-")>-1)c='<p><a class="downloadbackuplink" href="'+t+'"><i class="fa fa-cloud-download fa-3x"></i> <strong>'+wpbackitup_local.bl_backup_download_single+"</strong></a> <br><em>"+wpbackitup_local.bl_please_note+a+wpbackitup_local.bl_may_timeout+"</em></p>";else{o++;var s="";o%2!=0&&(s="alternate"),l+='<tr class="'+s+'" id="row'+o+'">',l+=i?'<td><a class="downloadbackuplink" href="'+t+'">'+t+"</a></td>":"<td>"+t+"</td>",l+="<td>"+a+"</td> </tr>"}}),l+=c+"</tbody></table></div>",e("#TB_ajaxContent").html(l),a(),e.ajax({url:ajaxurl,type:"post",data:{action:f("backup_get_note"),job_id:t},success:function(t){e("#wpbiu-note-box").val(t.data)}}),e("#wpbiu-note-btn").click(function(){var a=e("#wpbiu-note-box").val();e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_add_note"),job_id:t,note:a},dataType:"json"}).success(function(t){e("#wpbiu-note-response").fadeIn()})}),e("#wpbiu-note-box").focus(function(){e("#wpbiu-note-response").hide()})):s(i,null,null)}).fail(function(e,t,a){s(e,t,a)})}function s(e,t,a){var i="Error-Invalid response from server: ";t&&(i+=t+"\n"),a&&(i+=a+"\n"),i+="\nResponse: \n\n"+JSON.stringify(e),alert(i)}function n(){var t={action:f("restore_status_reader"),job_id:m};e.post(ajaxurl,t,function(t){var a=e(t);a.each(function(){var t="."+e(this).attr("class"),a="."+e(this).attr("class")+"-icon";0==e(this).html()&&(e(t).find(".status").hide(),e(t).find(".status-icon").hide()),1==e(this).html()&&(e(a).css("visibility","visible"),e(t).find(".status").fadeOut(200),e(t).find(".status-icon").fadeIn(1500)),2==e(this).html()&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".status").fadeIn(1500)),e(this).html()==-1&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".fail").fadeIn(1500),e(t).find(".isa_error").fadeIn(1500),clearInterval(window.intervalDefine)),e(this).html()==-2&&e(t).find(".isa_warning").fadeIn(1500),99==e(this).html()&&(e(t).find(".isa_success").fadeIn(1500),clearInterval(window.intervalDefine))})})}function o(){var t={action:f("backup_status_reader"),job_id:m};e.post(ajaxurl,t,function(t){if(j)return clearInterval(window.intervalDefine),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").fadeOut(200),e(".backup-cancelled").fadeIn(200),!1;var a=e(t);a.each(function(){var t="."+e(this).attr("class"),a="."+e(this).attr("class")+"-icon";0==e(this).html()&&(e(t).find(".status").hide(),e(t).find(".status-icon").hide()),1==e(this).html()&&(e(a).css("visibility","visible"),e(t).find(".status").fadeOut(200),e(t).find(".status-icon").fadeIn(1500)),2==e(this).html()&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".status").fadeIn(1500)),e(this).html()==-1&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".fail").fadeIn(1500),clearInterval(window.intervalDefine),c()),e(this).html()==-2&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".wpbackitup-warning").fadeIn(1500)),99==e(this).html()&&(e(t).find(".status-icon").fadeOut(200),e(t).find(".status").fadeIn(1500),clearInterval(window.intervalDefine),c())})})}function c(){var t=e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_response_reader")},dataType:"json"});t.always(function(t,a,i){if(console.log("Backup Response:"+JSON.stringify(t)),"undefined"!=typeof t.backupStatus&&"undefined"!=typeof t.backupMessage){if(console.log("JSON Backup Status:"+t.backupStatus),console.log("JSON Backup Message:"+t.backupMessage),y)return;switch(y=!0,t.backupStatus){case"success":if(console.log("JSON success response received."),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden"),e(".isa_success").show,e(".backup-success").fadeIn(1500),_(t),"undefined"!=typeof t.backupWarnings){var s=e(".backup-warning"),n=t.backupWarnings;n.forEach(function(e){var t=e.warningMessage;s.append('<li class="isa_warning">'+wpbackitup_local.warning+": "+t+"</li>")}),s.fadeIn(1500)}break;case"error":console.log("JSON error response received.");var o=wpbackitup_local.unexpected_err;"undefined"!=typeof t.backupMessage&&(o=t.backupMessage);var c=wpbackitup_local.error+": &nbsp;"+o,l=e(".backup-error");l.html(c),l.addClass("isa_error"),l.fadeIn(1500),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden");break;default:console.log("Unexpected JSON response status received.");var o=wpbackitup_local.unexpected_err2;"undefined"!=typeof t.backupMessage&&(o=t.backupMessage);var c=wpbackitup_local.error+"(JS998) : &nbsp;"+o,r=e(".backup-error");r.html(c),r.addClass("isa_error"),r.fadeIn(1500),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden")}}else{console.log("NON JSON response received."),console.log("Backup Response:"+i),c=wpbackitup_local.unexpected_err3+": &nbsp;",c+="</br>"+wpbackitup_local.response+": &nbsp;"+JSON.stringify(t),c+="</br>"+wpbackitup_local.status+": &nbsp;"+a,c+="</br>"+wpbackitup_local.error+": &nbsp;"+JSON.stringify(i),e(".backup-status").hide();var r=e(".backup-error");r.html(c),r.addClass("isa_error"),r.show(),e(".status-icon").fadeOut(200)}})}function l(){e(".backup-icon").css("visibility","visible"),e(".backup-icon").show(),e(".backup-success").hide(),e(".default-status").hide(),e(".backup-error").hide(),e(".backup-cancelled").hide(),e("ul.backup-status").children().children().hide(),e(".backup-errors").children().children().hide(),e(".backup-success").children().children().hide(),e(".backup-status").show(),y=!1,window.intervalDefine=setInterval(o,5e3)}function r(){e(".backup-icon").css("visibility","visible"),e(".backup-icon").show(),e(".backup-status").show(),y=!1,clearInterval(window.intervalDefine),window.intervalDefine=setInterval(o,5e3)}function u(){e(".restore-icon").css("visibility","visible"),e(".default-status, .upload-status").hide(),e("ul.restore-status").children().children().hide(),e(".restore-errors").children().children().hide(),e(".restore-success").children().children().hide(),e(".restore-status, .restore-errors, .restore-success").show(),e(".preparing-icon").css("visibility","visible"),e(".preparing").find(".status-icon").fadeIn(1500),window.intervalDefine=setInterval(n,5e3)}function d(t){var a=new plupload.Uploader(t);a.init(),a.bind("FilesAdded",function(t,a){plupload.each(a,function(t){e("#filelist").append('<div id="media-item-'+t.id+'" class="media-item child-of-0"><img class="pinkynail" alt="" src="'+site_url+'/wp-includes/images/media/archive.png"><div class="filename new" id="'+t.id+'">'+t.name+" (<span>"+plupload.formatSize(0)+"</span> of "+plupload.formatSize(t.size)+') <div class="progress" style="width: 0%;"></div></div></div>')}),t.refresh(),t.start()}),a.bind("UploadProgress",function(t,a){e("#"+a.id+" .progress").width(.15*a.percent+"%"),e("#"+a.id+" span").html(plupload.formatSize(parseInt(a.size*a.percent/100)))}),a.bind(" ChunkUploaded",function(e,t,a){console.log("Chunk Uploaded:"),console.log(a),p(a,e,t)&&console.log("chunk error")}),a.bind("Error",function(t,a){console.log("PlUpload Error:"),console.log(a);var i="error-item-"+a.file.id;e("#"+i).length||e("#filelist").append('<div class="error-div error" id="'+i+'" ><strong>'+a.file.name+" has failed to upload due to error:&nbsp;</strong> <span>"+a.message+"</span> </div>")}),a.bind("FileUploaded",function(t,a,i){console.log("File Uploaded"),console.log(i),p(i,t,a)?console.log("uploaded error"):(console.log("uploaded success"),e("#"+a.id+" .progress").css("background-color","green"),e("#import-uploads").show())})}function p(e,t,a){if("200"!=e.status)return alert("Unknown server response status: "+e.code),console.log(e),b(t,a,999,e.response),!0;try{return response_json=jQuery.parseJSON(e.response),!!response_json.error&&(b(t,a,100,response_json.error),!0)}catch(i){return console.log("Unexpected JSON Error"+i),b(t,a,998,e.response),!0}}function b(t,a,i,s){a.status=plupload.FAILED,t.trigger("Error",{code:i,message:s,file:a}),e("#media-item-"+a.id).hide()}function _(i){console.log(i);var s;s='class="success-grid"',e("#datatable tr").first().hasClass("alternate")||(s='class="alternate success-grid"');var n=e("#datatable tr:last")[0].id.replace("row","");if(n++,"undefined"!=typeof i){var o='<td data-th="Type" class="word-capitalize">'+i.backupRuntype+'</td>\n<td data-th="Date">'+i.backupDate+"</td>\n";o+='<td data-th="Duration">'+i.backupDuration+"</td>\n",i.backupMessage&&(o+='<td data-th="Status" class="word-capitalize">'+i.backupMessage+"</td>\n");var c=i.backupName,l=c.replace(/[^A-Za-z0-9\-]/g,""),r=c.lastIndexOf("_"),u=c.substring(r+1),d="<tr "+s+' id="row'+n+'">\n <td data-th="Backup"><a href="#TB_inline?width=600&height=550&inlineId='+l+'" class="thickbox" title="Download Backup" name="'+i.backupName+'" data-jobid="'+u+'"><i class="fa fa-download"></i> '+i.backupName+"</a></td>\n";d+=o,d+="<td>&nbsp;</td><td>&nbsp;</td>",d+="</tr>",e("#nofiles")&&e("#nofiles").remove();e("#datatable tr").length;e("#datatable").prepend(d),e("#datatable tr:first").hide().show("slow"),t(),a()}}function f(e){return v+"_"+e}function h(){notification_bar=e("#wp-backitup-notification-parent"),notification_bar.fadeOut("slow")}function g(t){notification_bar_message=e("#wp-backitup-notification-message"),notification_bar_message.html("<p>"+t+"</p>"),notification_bar=e("#wp-backitup-notification-parent"),notification_bar.toggleClass("error",!1),notification_bar.toggleClass("updated",!0),notification_bar.show(),e("html, body").animate({scrollTop:0},"slow")}function k(t){notification_bar_message=e("#wp-backitup-notification-message"),notification_bar_message.html("<p>"+t+"</p>"),notification_bar=e("#wp-backitup-notification-parent"),notification_bar.toggleClass("updated",!1),notification_bar.toggleClass("error",!0),notification_bar.show(),e("html, body").animate({scrollTop:0},"slow")}var v="wp-backitup",m=0;t(),a();try{"undefined"!=typeof wpbackitup_plupload_config&&d(wpbackitup_plupload_config)}catch(w){console.log(w)}e(".logs_backup").click(function(){var t=e(this).attr("href");return e("#backup_file").val(t),e("#download_logs").val(),e("#download_backup").submit(),!1}),e("#scheduled-backups-accordian").click(function(){scheduled_backups=e("#scheduled-backups"),scheduled_backups_button=e("#scheduled-backups-accordian"),e(this).is(".fa-angle-double-down")?(scheduled_backups.fadeIn("slow"),scheduled_backups_button.toggleClass("fa-angle-double-down",!1),scheduled_backups_button.toggleClass("fa-angle-double-up",!0)):(scheduled_backups_button.toggleClass("fa-angle-double-down",!0),scheduled_backups_button.toggleClass("fa-angle-double-up",!1),scheduled_backups.fadeOut("slow"))}),e("#upload-backups-accordian").click(function(){upload_backups=e("#wpbackitup-plupload-modal"),upload_backups_button=e("#upload-backups-accordian"),e(this).is(".fa-angle-double-down")?(upload_backups.fadeIn("slow"),upload_backups_button.toggleClass("fa-angle-double-down",!1),upload_backups_button.toggleClass("fa-angle-double-up",!0)):(upload_backups_button.toggleClass("fa-angle-double-down",!0),upload_backups_button.toggleClass("fa-angle-double-up",!1),upload_backups.fadeOut("slow"))}),e("#wpbackitup-zip").bind("change",function(){var t=this.files[0].size,a=e("#maxfilesize").val();"undefined"!=t&&"undefined"!=a&&""!=t&&""!=a&&t>a&&(alert(wpbackitup_local.upload_file_size_exceed),e("#wpbackitup-zip").val(""))}),e("#import-uploads").click(function(){setTimeout(function(){window.location.reload()},100)}),e(document.body).on("click",".thickbox",function(){if(!e(this).parents(".wpbiu-restore-item").length){var t=e(this).data("jobid");console.log(t);var a=this.name;i(t,a)}}),e(document.body).on("click",".thickbox",function(){var t=e(this).data("jobid"),a=e(this).attr("name");if(e(this).parents(".wpbiu-restore-item").length){var i="<h2>"+wpbackitup_local.bl_backup_set+"&nbsp;<em>"+a+'</em></h2> <div class="wpbiu-notes"> <textarea class="backupnotes" id="wpbiu-restore-note-box" placeholder="'+wpbackitup_local.bl_note_placeholder+'"></textarea> <button id="wpbiu-restore-note-btn" class="button-primary">'+wpbackitup_local.bl_note_save+'</button> <span id="wpbiu-restore-note-response">'+wpbackitup_local.bl_note_saved_success+"</span> </div>";e("#wpbiu-restore-note").html(i),e("#wpbiu-restore-note-response").hide(),e.ajax({url:ajaxurl,type:"post",data:{action:f("backup_get_note"),job_id:t},success:function(t){e("#wpbiu-restore-note-box").val(t.data)}}),e("#wpbiu-restore-note-btn").click(function(){var a=e("#wpbiu-restore-note-box").val();e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_add_note"),job_id:t,note:a},dataType:"json"}).success(function(t){e("#wpbiu-restore-note-response").fadeIn()})})}e("#wpbiu-restore-note-box").focus(function(){e("#wpbiu-restore-note-response").hide()})});var y=!1;e("#wp-backitup-notification-widget-close").click(function(){notification_bar=e("#wp-backitup-notification-widget"),notification_bar.fadeOut("slow");var t=e.ajax({url:ajaxurl,type:"POST",data:{action:f("delete_transient")},dataType:"json"});t.always(function(t,a,i){t!==!1&&(notification_bar.removeClass(),notification_bar.addClass("notice"),notification_bar.addClass("notice-"+t.message_type),e("#wp-backitup-notification-widget-message p").html(t.message),notification_bar.hide().fadeIn("slow"))})}),e("#wp-backitup-notification-close").click(function(){h()}),e("#wp-backitup-save_schedule_form").submit(function(){var t=new FormData;t.append("action",f("update-schedule")),t.append("_wpnonce",e("#wp-backitup_nonce-update-schedule").val()),t.append("_wp_http_referer",e("[name='_wp_http_referer']").val());var a=[];return e.each(e("input[name='dow']:checked"),function(){a.push(e(this).val())}),t.append("days_selected",a),jQuery.ajax({url:ajaxurl,type:"POST",cache:!1,contentType:!1,processData:!1,dataType:"json",data:t,success:function(e,t,a){switch(response=e.message,console.log("Success:"+response),response){case"success":g(wpbackitup_local.scheduled_saved);break;case"error":k(wpbackitup_local.scheduled_not_saved)}},error:function(e,t,a){console.log("Error."+t+":"+a)},complete:function(e,t){console.log("Complete")}}),!1});var x=null;e(".backup-button").click(function(t){t.preventDefault(),j=!1,e("#backup-button").attr("disabled","disabled"),e("#cancel-button").removeClass("cancel-hidden"),e("#cancel-button").removeAttr("disabled"),e("#cancel-button").fadeIn(200),x=e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup")},cache:!1,dataType:"json",beforeSend:function(e,t){console.log("BeforeSend:Nothing to report."),l()}}),x.always(function(e,t,a){console.log("Backup Button Click - Always"),console.log(e.message),"undefined"!=typeof e.job_id?(m=e.job_id,console.log("Job_Id:"+e.job_id)):console.log("No Job Id found:"+e)})});var j=!1;e(".cancel-button").click(function(t){t.preventDefault(),e("#cancel-button").attr("disabled","disabled"),null!=x&&(x.abort(),x=null),x=e.ajax({url:ajaxurl,type:"POST",data:{action:f("cancel_backup"),job_id:m},cache:!1,dataType:"json",beforeSend:function(e,t){console.log("BeforeSend:Nothing to report."),r()}}),x.always(function(e,t,a){console.log("Cancel Button Click - Always"),console.log(e),"undefined"!=typeof e.success&&1==e.success?console.log("Job Cancelled successfully"):console.log("Job was not cancelled successfully"),j=!0})}),e("#datatable").on("click","a.restoreRow",function(t){if(t.preventDefault(),confirm(wpbackitup_local.confirm_restore)){var a=this.title;this.id.replace("restoreRow","row");userid=e("input[name=user_id]").val();var i=e.ajax({url:ajaxurl,type:"post",data:{action:f("restore"),selected_file:a,user_id:userid},cache:!1,dataType:"json",beforeSend:function(){console.log("BeforeSend:Nothing to report."),u()}});i.always(function(e,t,a){"undefined"!=typeof e.job_id?(m=e.job_id,console.log("Job_Id:"+e.job_id)):console.log("No Job Id found:"+e)})}}),e("#datatable").on("click","a.deleteRow",function(t){if(t.preventDefault(),confirm(wpbackitup_local.sure)){var a=this.title,i=e(this).data("id"),s=this.id.replace("deleteRow","row");e.ajax({url:ajaxurl,type:"post",data:{action:f("delete_file"),filed:a,post_id:i},success:function(t){var a=t.search("deleted");0==a?e("#"+s).remove():alert(wpbackitup_local.file_not_del)}})}})}(jQuery);var validators={email:new RegExp(/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/),text:new RegExp(/^[a-zA-Z]+$/),digits:new RegExp(/^[\d() \.\:\-\+#]+$/)};Vue.component("input-tags",{template:"#input-tags-template",props:{tags:{type:Array,"default":[]},placeholder:{type:String,"default":""},onChange:{type:Function},readOnly:{type:Boolean,"default":!1},validate:{type:String,"default":""}},data:function(){return{newTag:""}},methods:{focusNewTag:function(){this.readOnly||this.$el.querySelector(".new-tag").focus()},addNew:function(e){e&&this.tags.indexOf(e)===-1&&this.validateIfNeeded(e)&&(this.tags.push(e),this.tagChange()),this.newTag=""},validateIfNeeded:function(e){return""===this.validate||void 0===this.validate||(!(Object.keys(validators).indexOf(this.validate)>-1)||validators[this.validate].test(e))},remove:function(e){this.tags.splice(e,1),this.tagChange()},removeLastTag:function(){this.newTag||(this.tags.pop(),this.tagChange())},tagChange:function(){this.onChange&&this.onChange(JSON.parse(JSON.stringify(this.tags)))}}}),function(e){"use strict";var t="wp-backitup",a=function(e){return t+"_"+e},i=function(t){return e.ajax({url:ajaxurl,type:"GET",data:{action:a(t)},dataType:"json"})},s=function(t,i){var i=i||{};return i.action=a(t),i.security=e("#wpbackitup-core-ajax-nonce").val(),e.ajax({url:ajaxurl,type:"POST",data:i,dataType:"json"})};e(window).load(function(){if(document.querySelector("#wpbackitup-core-settings")){Vue.use(VueTabs);var e=new Vue({el:"#wpbackitup-core-settings",data:{loading:!1,updated:!1,emailsArray:[],errorMessages:{},backup_retained_number:3,logging:!1,single_file_db:!1,single_file_backupset:!1,rversion_compare:!1,remove_supporting_zip_files:!1,backup_plugins_filter:[],backup_themes_filter:[],backup_uploads_filter:[],backup_others_filter:[],dbFilterOptions:[],db_filters:[],backup_dbtables_batch_size:1e4,backup_sql_merge_batch_size:1e4,backup_sql_batch_size:1e4,backup_plugins_batch_size:5e3,backup_themes_batch_size:5e3,backup_uploads_batch_size:500,backup_others_batch_size:500,backup_zip_max_size:524288e3,backup_max_timeout:120,delete_all:!1},computed:{dbFilterHasSearch:function(){return 0==this.dbFilterOptions.length},dbFilterPlaceholder:function(){return this.dbFilterOptions.length>0?wpbackitup_local.settings_select_database_table_to_filter:wpbackitup_local.settings_no_database_table_to_filter}},methods:{handleEmailInput:function(e){},handleTagsInput:function(e){},setSettings:function(){var t={data:{notification_email:this.emailsArray.join(","),backup_retained_number:this.backup_retained_number,logging:this.logging,single_file_db:this.single_file_db,single_file_backupset:this.single_file_backupset,rversion_compare:this.rversion_compare,remove_supporting_zip_files:this.remove_supporting_zip_files,backup_plugins_filter:this.backup_plugins_filter.join(","),backup_themes_filter:this.backup_themes_filter.join(","),backup_uploads_filter:this.backup_uploads_filter.join(","),backup_others_filter:this.backup_others_filter.join(","),backup_dbtables_filter_list:this.db_filters.map(function(e){return e.value}).join(","),backup_dbtables_batch_size:this.backup_dbtables_batch_size,backup_sql_merge_batch_size:this.backup_sql_merge_batch_size,backup_sql_batch_size:this.backup_sql_batch_size,backup_plugins_batch_size:this.backup_plugins_batch_size,backup_themes_batch_size:this.backup_themes_batch_size,backup_uploads_batch_size:this.backup_uploads_batch_size,backup_others_batch_size:this.backup_others_batch_size,backup_zip_max_size:this.backup_zip_max_size,backup_max_timeout:this.backup_max_timeout,delete_all:this.delete_all}};console.log(t),s("set_settings",t).then(function(t){t.success?(e.updated=!0,e.errorMessages={},swal(wpbackitup_local.settings_save_awesome,wpbackitup_local.settings_save_success_message,"success")):(e.errorMessages=t.data,swal(wpbackitup_local.settings_save_oops,wpbackitup_local.settings_save_error_message,"error"))})},getSettings:function(){this.loading=!0,i("get_settings").then(function(t){e.loading=!1,t.success&&(console.log(t),e.emailsArray=t.data.notification_email.split(",").filter(Boolean),e.backup_retained_number=t.data.backup_retained_number,e.logging="1"===t.data.logging,e.single_file_db="1"===t.data.single_file_db,e.rversion_compare="1"===t.data.rversion_compare,e.single_file_backupset="1"===t.data.single_file_backupset,e.remove_supporting_zip_files="1"===t.data.remove_supporting_zip_files,e.backup_plugins_filter=t.data.backup_plugins_filter.split(",").filter(Boolean),e.backup_themes_filter=t.data.backup_themes_filter.split(",").filter(Boolean),e.backup_uploads_filter=t.data.backup_uploads_filter.split(",").filter(Boolean),e.backup_others_filter=t.data.backup_others_filter.split(",").filter(Boolean),e.db_filters=t.data.backup_dbtables_filter_list.split(",").filter(Boolean).map(function(e){return{label:e,value:e}}),e.dbFilterOptions=Object.keys(t.data.backup_dbtables_filterable).map(function(e){var a=t.data.backup_dbtables_filterable[e];return{label:a,value:a}}),e.backup_dbtables_batch_size=t.data.backup_dbtables_batch_size,e.backup_sql_merge_batch_size=t.data.backup_sql_merge_batch_size,e.backup_sql_batch_size=t.data.backup_sql_batch_size,e.backup_plugins_batch_size=t.data.backup_plugins_batch_size,e.backup_themes_batch_size=t.data.backup_themes_batch_size,e.backup_uploads_batch_size=t.data.backup_uploads_batch_size,e.backup_others_batch_size=t.data.backup_others_batch_size,e.backup_zip_max_size=t.data.backup_zip_max_size,e.backup_max_timeout=t.data.backup_max_timeout,e.delete_all="1"===t.data.delete_all)})}},created:function(){this.getSettings()}})}})}(jQuery);
1
+ var WPBNewBackupData={},ajaxNamespace="wpbackitup-safe",ENUM={GDRIVE:"GDRIVE",AMAZONS3:"AMAZONS3",DROPBOX:"DROPBOX"},CLOUDSTATUS={READY:"ready",UPLOADING:"uploading",UPLOADED:"uploaded",ERROR:"error"},wpbackitup_get_action_name=function(e){return ajaxNamespace+"_"+e},AjaxGetSafe=function(e){return jQuery.ajax({url:ajaxurl,type:"GET",data:{action:wpbackitup_get_action_name(e),security:WPBackItUpSafeLocals[e]},dataType:"json"})},AjaxGetCore=function(e){var a=wpbackitup_local[e];return jQuery.ajax({url:ajaxurl,type:"GET",data:{action:"wp-backitup_"+e,security:a},dataType:"json"})},AjaxPostSafe=function(e,a){var a=a||{};return a.action=wpbackitup_get_action_name(e),a.security=WPBackItUpSafeLocals[e],jQuery.ajax({url:ajaxurl,type:"POST",data:a,dataType:"json"})};!function(e){"use strict";if(document.querySelector("#wpbackitup-core-backup"))var a=new Vue({el:"#wpbackitup-core-backup",data:{cloudStatus:{},isNewRowAvailable:!1,backupNewRow:{}},methods:{getAvailableBackups:function(){AjaxGetCore("get_available_backups").then(function(e){if(e.success)for(var t=0;t<e.data.length;t++){var i=e.data[t].backup_job_id,s=e.data[t].backup_job_cloud_status;a.$set(a.cloudStatus,i,s)}})},getBackupStatus:function(){var e=WPBNewBackupData;if("success"===e.backupStatus){var a=e.backupName,t=a.lastIndexOf("_"),i=a.substring(t+1);this.isNewRowAvailable=!0,this.backupNewRow={name:e.backupName,type:e.backupRuntype,date:e.backupDate,duration:e.backupDuration,status:e.backupStatus,row:99999,jobId:i,zipExist:!0},WPBNewBackupData={}}}},mounted:function(){this.getAvailableBackups(),this.getBackupStatusInterval=setInterval(function(){0!==Object.keys(WPBNewBackupData).length&&this.getBackupStatus()}.bind(this),1e3),this.getAvailableBackupsInterval=setInterval(function(){this.getAvailableBackups()}.bind(this),3e3)},beforeDestroy:function(){clearInterval(this.getAvailableBackupsInterval),clearInterval(this.getBackupStatusInterval)}})}(jQuery),function(e){function a(){e(".viewloglink").click(function(){var a=e(this).attr("href");return e("#backup_name").val(a),e("#viewlog").submit(),!1})}function t(){e(".downloadbackuplink").bind("click",function(){var a=e(this).attr("href");return e("#backup_file").val(a),e(this).append('<i class="fa fa-check"></i>'),e(this).css({color:"green"}),e("#download_backup").submit(),!1})}function i(a,i){var n=({action:f("backup_zip_filelist"),job_id:a},i.replace(/[^A-Za-z0-9\-]/g,"")),o=0,c="",l='<div id="'+n+'"> <h2>'+wpbackitup_local.bl_backup_set+"&nbsp; <em>"+i+'</em></h2> <div class="wpbiu-notes"> <textarea class="backupnotes" id="wpbiu-note-box" placeholder="'+wpbackitup_local.bl_note_placeholder+'"></textarea> <button id="wpbiu-note-btn" class="button-primary">'+wpbackitup_local.bl_note_save+'</button><span id="wpbiu-note-response">'+wpbackitup_local.bl_note_saved_success+"</span></div> <p>"+wpbackitup_local.bl_backup_download+'</p> <table class="widefat" id="datatable"> <tbody>';e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_zip_filelist"),job_id:a},dataType:"json"}).done(function(i){i.data?(e.each(i.data,function(){var a=e(this)[0].name.split(/[\/]+/).pop(),t=e(this)[0].size,i=e(this)[0].file_exists;if(console.log(a,t),a.indexOf("-backupset-")>-1)c='<p><a class="downloadbackuplink" href="'+a+'"><i class="fa fa-cloud-download fa-3x"></i> <strong>'+wpbackitup_local.bl_backup_download_single+"</strong></a> <br><em>"+wpbackitup_local.bl_please_note+t+wpbackitup_local.bl_may_timeout+"</em></p>";else{o++;var s="";o%2!=0&&(s="alternate"),l+='<tr class="'+s+'" id="row'+o+'">',l+=i?'<td><a class="downloadbackuplink" href="'+a+'">'+a+"</a></td>":"<td>"+a+"</td>",l+="<td>"+t+"</td> </tr>"}}),l+=c+"</tbody></table></div>",e("#TB_ajaxContent").html(l),t(),e.ajax({url:ajaxurl,type:"post",data:{action:f("backup_get_note"),job_id:a},success:function(a){e("#wpbiu-note-box").val(a.data)}}),e("#wpbiu-note-btn").click(function(){var t=e("#wpbiu-note-box").val();e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_add_note"),job_id:a,note:t},dataType:"json"}).success(function(a){e("#wpbiu-note-response").fadeIn()})}),e("#wpbiu-note-box").focus(function(){e("#wpbiu-note-response").hide()})):s(i,null,null)}).fail(function(e,a,t){s(e,a,t)})}function s(e,a,t){var i="Error-Invalid response from server: ";a&&(i+=a+"\n"),t&&(i+=t+"\n"),i+="\nResponse: \n\n"+JSON.stringify(e),alert(i)}function n(){var a={action:f("restore_status_reader"),job_id:v};e.post(ajaxurl,a,function(a){var t=e(a);t.each(function(){var a="."+e(this).attr("class"),t="."+e(this).attr("class")+"-icon";0==e(this).html()&&(e(a).find(".status").hide(),e(a).find(".status-icon").hide()),1==e(this).html()&&(e(t).css("visibility","visible"),e(a).find(".status").fadeOut(200),e(a).find(".status-icon").fadeIn(1500)),2==e(this).html()&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".status").fadeIn(1500)),e(this).html()==-1&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".fail").fadeIn(1500),e(a).find(".isa_error").fadeIn(1500),clearInterval(window.intervalDefine)),e(this).html()==-2&&e(a).find(".isa_warning").fadeIn(1500),99==e(this).html()&&(e(a).find(".isa_success").fadeIn(1500),clearInterval(window.intervalDefine))})})}function o(){var a={action:f("backup_status_reader"),job_id:v};e.post(ajaxurl,a,function(a){if(x)return clearInterval(window.intervalDefine),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").fadeOut(200),e(".backup-cancelled").fadeIn(200),!1;var t=e(a);t.each(function(){var a="."+e(this).attr("class"),t="."+e(this).attr("class")+"-icon";0==e(this).html()&&(e(a).find(".status").hide(),e(a).find(".status-icon").hide()),1==e(this).html()&&(e(t).css("visibility","visible"),e(a).find(".status").fadeOut(200),e(a).find(".status-icon").fadeIn(1500)),2==e(this).html()&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".status").fadeIn(1500)),e(this).html()==-1&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".fail").fadeIn(1500),clearInterval(window.intervalDefine),c()),e(this).html()==-2&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".wpbackitup-warning").fadeIn(1500)),99==e(this).html()&&(e(a).find(".status-icon").fadeOut(200),e(a).find(".status").fadeIn(1500),clearInterval(window.intervalDefine),c())})})}function c(){var a=e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_response_reader")},dataType:"json"});a.always(function(a,t,i){if(console.log("Backup Response:"+JSON.stringify(a)),"undefined"!=typeof a.backupStatus&&"undefined"!=typeof a.backupMessage){if(console.log("JSON Backup Status:"+a.backupStatus),console.log("JSON Backup Message:"+a.backupMessage),y)return;switch(y=!0,a.backupStatus){case"success":if(console.log("JSON success response received."),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden"),e(".isa_success").show,e(".backup-success").fadeIn(1500),_(a),"undefined"!=typeof a.backupWarnings){var s=e(".backup-warning"),n=a.backupWarnings;n.forEach(function(e){var a=e.warningMessage;s.append('<li class="isa_warning">'+wpbackitup_local.warning+": "+a+"</li>")}),s.fadeIn(1500)}break;case"error":console.log("JSON error response received.");var o=wpbackitup_local.unexpected_err;"undefined"!=typeof a.backupMessage&&(o=a.backupMessage);var c=wpbackitup_local.error+": &nbsp;"+o,l=e(".backup-error");l.html(c),l.addClass("isa_error"),l.fadeIn(1500),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden");break;default:console.log("Unexpected JSON response status received.");var o=wpbackitup_local.unexpected_err2;"undefined"!=typeof a.backupMessage&&(o=a.backupMessage);var c=wpbackitup_local.error+"(JS998) : &nbsp;"+o,u=e(".backup-error");u.html(c),u.addClass("isa_error"),u.fadeIn(1500),e(".status-icon").fadeOut(200),e("#backup-button").removeAttr("disabled"),e("#cancel-button").addClass("cancel-hidden")}}else{console.log("NON JSON response received."),console.log("Backup Response:"+i),c=wpbackitup_local.unexpected_err3+": &nbsp;",c+="</br>"+wpbackitup_local.response+": &nbsp;"+JSON.stringify(a),c+="</br>"+wpbackitup_local.status+": &nbsp;"+t,c+="</br>"+wpbackitup_local.error+": &nbsp;"+JSON.stringify(i),e(".backup-status").hide();var u=e(".backup-error");u.html(c),u.addClass("isa_error"),u.show(),e(".status-icon").fadeOut(200)}})}function l(){e(".backup-icon").css("visibility","visible"),e(".backup-icon").show(),e(".backup-success").hide(),e(".default-status").hide(),e(".backup-error").hide(),e(".backup-cancelled").hide(),e("ul.backup-status").children().children().hide(),e(".backup-errors").children().children().hide(),e(".backup-success").children().children().hide(),e(".backup-status").show(),y=!1,window.intervalDefine=setInterval(o,5e3)}function u(){e(".backup-icon").css("visibility","visible"),e(".backup-icon").show(),e(".backup-status").show(),y=!1,clearInterval(window.intervalDefine),window.intervalDefine=setInterval(o,5e3)}function r(){e(".restore-icon").css("visibility","visible"),e(".default-status, .upload-status").hide(),e("ul.restore-status").children().children().hide(),e(".restore-errors").children().children().hide(),e(".restore-success").children().children().hide(),e(".restore-status, .restore-errors, .restore-success").show(),e(".preparing-icon").css("visibility","visible"),e(".preparing").find(".status-icon").fadeIn(1500),window.intervalDefine=setInterval(n,5e3)}function p(a){var t=new plupload.Uploader(a);t.init(),t.bind("FilesAdded",function(a,t){plupload.each(t,function(a){e("#filelist").append('<div id="media-item-'+a.id+'" class="media-item child-of-0"><img class="pinkynail" alt="" src="'+site_url+'/wp-includes/images/media/archive.png"><div class="filename new" id="'+a.id+'">'+a.name+" (<span>"+plupload.formatSize(0)+"</span> of "+plupload.formatSize(a.size)+') <div class="progress" style="width: 0%;"></div></div></div>')}),a.refresh(),a.start()}),t.bind("UploadProgress",function(a,t){e("#"+t.id+" .progress").width(.15*t.percent+"%"),e("#"+t.id+" span").html(plupload.formatSize(parseInt(t.size*t.percent/100)))}),t.bind(" ChunkUploaded",function(e,a,t){console.log("Chunk Uploaded:"),console.log(t),d(t,e,a)&&console.log("chunk error")}),t.bind("Error",function(a,t){console.log("PlUpload Error:"),console.log(t);var i="error-item-"+t.file.id;e("#"+i).length||e("#filelist").append('<div class="error-div error" id="'+i+'" ><strong>'+t.file.name+" has failed to upload due to error:&nbsp;</strong> <span>"+t.message+"</span> </div>")}),t.bind("FileUploaded",function(a,t,i){console.log("File Uploaded"),console.log(i),d(i,a,t)?console.log("uploaded error"):(console.log("uploaded success"),e("#"+t.id+" .progress").css("background-color","green"),e("#import-uploads").show())})}function d(e,a,t){if("200"!=e.status)return alert("Unknown server response status: "+e.code),console.log(e),b(a,t,999,e.response),!0;try{return response_json=jQuery.parseJSON(e.response),!!response_json.error&&(b(a,t,100,response_json.error),!0)}catch(i){return console.log("Unexpected JSON Error"+i),b(a,t,998,e.response),!0}}function b(a,t,i,s){t.status=plupload.FAILED,a.trigger("Error",{code:i,message:s,file:t}),e("#media-item-"+t.id).hide()}function _(i){"undefined"!=typeof i&&(WPBNewBackupData=i,e("#nofiles")&&e("#nofiles").remove(),a(),t())}function f(e){return w+"_"+e}function k(){notification_bar=e("#wp-backitup-notification-parent"),notification_bar.fadeOut("slow")}function h(a){notification_bar_message=e("#wp-backitup-notification-message"),notification_bar_message.html("<p>"+a+"</p>"),notification_bar=e("#wp-backitup-notification-parent"),notification_bar.toggleClass("error",!1),notification_bar.toggleClass("updated",!0),notification_bar.show(),e("html, body").animate({scrollTop:0},"slow")}function g(a){notification_bar_message=e("#wp-backitup-notification-message"),notification_bar_message.html("<p>"+a+"</p>"),notification_bar=e("#wp-backitup-notification-parent"),notification_bar.toggleClass("updated",!1),notification_bar.toggleClass("error",!0),notification_bar.show(),e("html, body").animate({scrollTop:0},"slow")}var w="wp-backitup",v=0;a(),t();try{"undefined"!=typeof wpbackitup_plupload_config&&p(wpbackitup_plupload_config)}catch(m){console.log(m)}e(".logs_backup").click(function(){var a=e(this).attr("href");return e("#backup_file").val(a),e("#download_logs").val(),e("#download_backup").submit(),!1}),e("#scheduled-backups-accordian").click(function(){scheduled_backups=e("#scheduled-backups"),scheduled_backups_button=e("#scheduled-backups-accordian"),e(this).is(".fa-angle-double-down")?(scheduled_backups.fadeIn("slow"),scheduled_backups_button.toggleClass("fa-angle-double-down",!1),scheduled_backups_button.toggleClass("fa-angle-double-up",!0)):(scheduled_backups_button.toggleClass("fa-angle-double-down",!0),scheduled_backups_button.toggleClass("fa-angle-double-up",!1),scheduled_backups.fadeOut("slow"))}),e("#upload-backups-accordian").click(function(){upload_backups=e("#wpbackitup-plupload-modal"),upload_backups_button=e("#upload-backups-accordian"),e(this).is(".fa-angle-double-down")?(upload_backups.fadeIn("slow"),upload_backups_button.toggleClass("fa-angle-double-down",!1),upload_backups_button.toggleClass("fa-angle-double-up",!0)):(upload_backups_button.toggleClass("fa-angle-double-down",!0),upload_backups_button.toggleClass("fa-angle-double-up",!1),upload_backups.fadeOut("slow"))}),e("#wpbackitup-zip").bind("change",function(){var a=this.files[0].size,t=e("#maxfilesize").val();"undefined"!=a&&"undefined"!=t&&""!=a&&""!=t&&a>t&&(alert(wpbackitup_local.upload_file_size_exceed),e("#wpbackitup-zip").val(""))}),e("#import-uploads").click(function(){setTimeout(function(){window.location.reload()},100)}),e(document.body).on("click",".thickbox",function(){if(!e(this).parents(".wpbiu-restore-item").length){var a=e(this).data("jobid");console.log(a);var t=this.name;i(a,t)}}),e(document.body).on("click",".thickbox",function(){var a=e(this).data("jobid"),t=e(this).attr("name");if(e(this).parents(".wpbiu-restore-item").length){var i="<h2>"+wpbackitup_local.bl_backup_set+"&nbsp;<em>"+t+'</em></h2> <div class="wpbiu-notes"> <textarea class="backupnotes" id="wpbiu-restore-note-box" placeholder="'+wpbackitup_local.bl_note_placeholder+'"></textarea> <button id="wpbiu-restore-note-btn" class="button-primary">'+wpbackitup_local.bl_note_save+'</button> <span id="wpbiu-restore-note-response">'+wpbackitup_local.bl_note_saved_success+"</span> </div>";e("#wpbiu-restore-note").html(i),e("#wpbiu-restore-note-response").hide(),e.ajax({url:ajaxurl,type:"post",data:{action:f("backup_get_note"),job_id:a},success:function(a){e("#wpbiu-restore-note-box").val(a.data)}}),e("#wpbiu-restore-note-btn").click(function(){var t=e("#wpbiu-restore-note-box").val();e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup_add_note"),job_id:a,note:t},dataType:"json"}).success(function(a){e("#wpbiu-restore-note-response").fadeIn()})})}e("#wpbiu-restore-note-box").focus(function(){e("#wpbiu-restore-note-response").hide()})});var y=!1;e("#wp-backitup-notification-widget-close").click(function(){notification_bar=e("#wp-backitup-notification-widget"),notification_bar.fadeOut("slow");var a=e.ajax({url:ajaxurl,type:"POST",data:{action:f("delete_transient")},dataType:"json"});a.always(function(a,t,i){a!==!1&&(notification_bar.removeClass(),notification_bar.addClass("notice"),notification_bar.addClass("notice-"+a.message_type),e("#wp-backitup-notification-widget-message p").html(a.message),notification_bar.hide().fadeIn("slow"))})}),e("#wp-backitup-notification-close").click(function(){k()}),e("#wp-backitup-save_schedule_form").submit(function(){var a=new FormData;a.append("action",f("update-schedule")),a.append("_wpnonce",e("#wp-backitup_nonce-update-schedule").val()),a.append("_wp_http_referer",e("[name='_wp_http_referer']").val());var t=[];return e.each(e("input[name='dow']:checked"),function(){t.push(e(this).val())}),a.append("days_selected",t),jQuery.ajax({url:ajaxurl,type:"POST",cache:!1,contentType:!1,processData:!1,dataType:"json",data:a,success:function(e,a,t){switch(response=e.message,console.log("Success:"+response),response){case"success":h(wpbackitup_local.scheduled_saved);break;case"error":g(wpbackitup_local.scheduled_not_saved)}},error:function(e,a,t){console.log("Error."+a+":"+t)},complete:function(e,a){console.log("Complete")}}),!1});var j=null;e(".backup-button").click(function(a){a.preventDefault(),x=!1,e("#backup-button").attr("disabled","disabled"),e("#cancel-button").removeClass("cancel-hidden"),e("#cancel-button").removeAttr("disabled"),e("#cancel-button").fadeIn(200),j=e.ajax({url:ajaxurl,type:"POST",data:{action:f("backup")},cache:!1,dataType:"json",beforeSend:function(e,a){console.log("BeforeSend:Nothing to report."),l()}}),j.always(function(e,a,t){console.log("Backup Button Click - Always"),console.log(e.message),"undefined"!=typeof e.job_id?(v=e.job_id,console.log("Job_Id:"+e.job_id)):console.log("No Job Id found:"+e)})});var x=!1;e(".cancel-button").click(function(a){a.preventDefault(),e("#cancel-button").attr("disabled","disabled"),null!=j&&(j.abort(),j=null),j=e.ajax({url:ajaxurl,type:"POST",data:{action:f("cancel_backup"),job_id:v},cache:!1,dataType:"json",beforeSend:function(e,a){console.log("BeforeSend:Nothing to report."),u()}}),j.always(function(e,a,t){console.log("Cancel Button Click - Always"),console.log(e),"undefined"!=typeof e.success&&1==e.success?console.log("Job Cancelled successfully"):console.log("Job was not cancelled successfully"),x=!0})}),e("#datatable").on("click","a.restoreRow",function(a){if(a.preventDefault(),confirm(wpbackitup_local.confirm_restore)){var t=this.title;this.id.replace("restoreRow","row");userid=e("input[name=user_id]").val();var i=e.ajax({url:ajaxurl,type:"post",data:{action:f("restore"),selected_file:t,user_id:userid},cache:!1,dataType:"json",beforeSend:function(){console.log("BeforeSend:Nothing to report."),r()}});i.always(function(e,a,t){"undefined"!=typeof e.job_id?(v=e.job_id,console.log("Job_Id:"+e.job_id)):console.log("No Job Id found:"+e)})}}),e("#datatable").on("click","a.deleteRow",function(a){if(a.preventDefault(),confirm(wpbackitup_local.sure)){var t=this.title,i=e(this).data("id"),s=this.id.replace("deleteRow","row");e.ajax({url:ajaxurl,type:"post",data:{action:f("delete_file"),filed:t,post_id:i},success:function(a){var t=a.search("deleted");0==t?e("#"+s).remove():alert(wpbackitup_local.file_not_del)}})}})}(jQuery),function(e){"use strict";var a="wp-backitup",t=function(e){return a+"_"+e},i=function(a){return e.ajax({url:ajaxurl,type:"GET",data:{action:t(a)},dataType:"json"})},s=function(a,i){var i=i||{};return i.action=t(a),i.security=e("#wpbackitup-core-ajax-nonce").val(),e.ajax({url:ajaxurl,type:"POST",data:i,dataType:"json"})};e(window).load(function(){if(document.querySelector("#wpbackitup-core-settings")){Vue.use(VueTabs);var e=new Vue({el:"#wpbackitup-core-settings",data:{loading:!1,updated:!1,emailsArray:[],errorMessages:{},backup_retained_number:3,logging:!1,single_file_db:!1,single_file_backupset:!1,rversion_compare:!1,remove_supporting_zip_files:!1,backup_plugins_filter:[],backup_themes_filter:[],backup_uploads_filter:[],backup_others_filter:[],dbFilterOptions:[],db_filters:[],backup_dbtables_batch_size:1e4,backup_sql_merge_batch_size:1e4,backup_sql_batch_size:1e4,backup_plugins_batch_size:5e3,backup_themes_batch_size:5e3,backup_uploads_batch_size:500,backup_others_batch_size:500,backup_zip_max_size:524288e3,backup_max_timeout:120,delete_all:!1},computed:{dbFilterHasSearch:function(){return 0==this.dbFilterOptions.length},dbFilterPlaceholder:function(){return this.dbFilterOptions.length>0?wpbackitup_local.settings_select_database_table_to_filter:wpbackitup_local.settings_no_database_table_to_filter}},methods:{handleEmailInput:function(e){},handleTagsInput:function(e){},setSettings:function(){var a={data:{notification_email:this.emailsArray.join(","),backup_retained_number:this.backup_retained_number,logging:this.logging,single_file_db:this.single_file_db,single_file_backupset:this.single_file_backupset,rversion_compare:this.rversion_compare,remove_supporting_zip_files:this.remove_supporting_zip_files,backup_plugins_filter:this.backup_plugins_filter.join(","),backup_themes_filter:this.backup_themes_filter.join(","),backup_uploads_filter:this.backup_uploads_filter.join(","),backup_others_filter:this.backup_others_filter.join(","),backup_dbtables_filter_list:this.db_filters.map(function(e){return e.value}).join(","),backup_dbtables_batch_size:this.backup_dbtables_batch_size,backup_sql_merge_batch_size:this.backup_sql_merge_batch_size,backup_sql_batch_size:this.backup_sql_batch_size,backup_plugins_batch_size:this.backup_plugins_batch_size,backup_themes_batch_size:this.backup_themes_batch_size,backup_uploads_batch_size:this.backup_uploads_batch_size,backup_others_batch_size:this.backup_others_batch_size,backup_zip_max_size:this.backup_zip_max_size,backup_max_timeout:this.backup_max_timeout,delete_all:this.delete_all}};console.log(a),s("set_settings",a).then(function(a){a.success?(e.updated=!0,e.errorMessages={},swal(wpbackitup_local.settings_save_awesome,wpbackitup_local.settings_save_success_message,"success")):(e.errorMessages=a.data,swal(wpbackitup_local.settings_save_oops,wpbackitup_local.settings_save_error_message,"error"))})},getSettings:function(){this.loading=!0,i("get_settings").then(function(a){e.loading=!1,a.success&&(console.log(a),e.emailsArray=a.data.notification_email.split(",").filter(Boolean),e.backup_retained_number=a.data.backup_retained_number,e.logging="1"===a.data.logging,e.single_file_db="1"===a.data.single_file_db,e.rversion_compare="1"===a.data.rversion_compare,e.single_file_backupset="1"===a.data.single_file_backupset,e.remove_supporting_zip_files="1"===a.data.remove_supporting_zip_files,e.backup_plugins_filter=a.data.backup_plugins_filter.split(",").filter(Boolean),e.backup_themes_filter=a.data.backup_themes_filter.split(",").filter(Boolean),e.backup_uploads_filter=a.data.backup_uploads_filter.split(",").filter(Boolean),e.backup_others_filter=a.data.backup_others_filter.split(",").filter(Boolean),e.db_filters=a.data.backup_dbtables_filter_list.split(",").filter(Boolean).map(function(e){return{label:e,value:e}}),e.dbFilterOptions=Object.keys(a.data.backup_dbtables_filterable).map(function(e){var t=a.data.backup_dbtables_filterable[e];return{label:t,value:t}}),e.backup_dbtables_batch_size=a.data.backup_dbtables_batch_size,e.backup_sql_merge_batch_size=a.data.backup_sql_merge_batch_size,e.backup_sql_batch_size=a.data.backup_sql_batch_size,e.backup_plugins_batch_size=a.data.backup_plugins_batch_size,e.backup_themes_batch_size=a.data.backup_themes_batch_size,e.backup_uploads_batch_size=a.data.backup_uploads_batch_size,e.backup_others_batch_size=a.data.backup_others_batch_size,e.backup_zip_max_size=a.data.backup_zip_max_size,e.backup_max_timeout=a.data.backup_max_timeout,e.delete_all="1"===a.data.delete_all)})}},created:function(){this.getSettings()}})}})}(jQuery);
js/wp-backitup-components.min.js ADDED
@@ -0,0 +1 @@
 
1
+ Vue.component("backup-row",{template:"#backup-row-template",props:{name:{type:String,"default":""},type:{type:String},date:{type:String},duration:{type:String},status:{type:String},row:{type:Number},jobId:{type:String},zipExist:{type:Boolean}},data:function(){return{}},methods:{},computed:{klass:function(){return this.row%2==0?"alternate":""},backupParsedId:function(){return this.name.replace(/[^A-Za-z0-9\-]/g,"")},cloudVisible:function(){return"SUCCESS"===this.status.toUpperCase()},cstatus:function(){return this.$parent.cloudStatus[this.jobId]}}}),Vue.component("send-cloud",{template:"#send-to-cloud",props:{visible:{type:Boolean,"default":!1},kloudStatus:{type:String}},data:function(){return{providers:[],DROPBOX:{},GDRIVE:{},AMAZONS3:{},jobId:this.$parent.jobId,row:this.$parent.row}},methods:{openModal:function(t){this.$refs[t].open()},closeModal:function(t){this.$refs[t].close()},getEnabledProviders:function(){AjaxGetSafe("get_enabled_providers").then(function(t){t.success&&(this.providers=t.data)}.bind(this))},saveIndProviders:function(t){for(var e=this.providers.length,s=0;s<e;s++)this.providers[s]===ENUM.DROPBOX&&this.DROPBOX[t]===!0?this.postJobIdToSafe(t,ENUM.DROPBOX):this.providers[s]===ENUM.GDRIVE&&this.GDRIVE[t]===!0?this.postJobIdToSafe(t,ENUM.GDRIVE):this.providers[s]===ENUM.AMAZONS3&&this.AMAZONS3[t]===!0&&this.postJobIdToSafe(t,ENUM.AMAZONS3);this.closeModal("modal"+t)},postJobIdToSafe:function(t,e){var s={job_id:t,provider:e};AjaxPostSafe("queue_job_sync",s).then(function(t){t.success&&(this.kloudStatus=CLOUDSTATUS.UPLOADING)}.bind(this))}},mounted:function(){this.getEnabledProviders()}});var validators={email:new RegExp(/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/),text:new RegExp(/^[a-zA-Z]+$/),digits:new RegExp(/^[\d() \.\:\-\+#]+$/)};Vue.component("input-tags",{template:"#input-tags-template",props:{tags:{type:Array,"default":[]},placeholder:{type:String,"default":""},onChange:{type:Function},readOnly:{type:Boolean,"default":!1},validate:{type:String,"default":""}},data:function(){return{newTag:""}},methods:{focusNewTag:function(){this.readOnly||this.$el.querySelector(".new-tag").focus()},addNew:function(t){t&&this.tags.indexOf(t)===-1&&this.validateIfNeeded(t)&&(this.tags.push(t),this.tagChange()),this.newTag=""},validateIfNeeded:function(t){return""===this.validate||void 0===this.validate||(!(Object.keys(validators).indexOf(this.validate)>-1)||validators[this.validate].test(t))},remove:function(t){this.tags.splice(t,1),this.tagChange()},removeLastTag:function(){this.newTag||(this.tags.pop(),this.tagChange())},tagChange:function(){this.onChange&&this.onChange(JSON.parse(JSON.stringify(this.tags)))}}});
lib/includes/class-admin-notice.php CHANGED
@@ -62,6 +62,7 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
62
  public function __construct($args){
63
 
64
  $args = wp_parse_args( $args, $this->default_args() );
 
65
  $this->id = $args['id'];
66
  $this->days = $args['days_after']; //Show the notice after these days
67
  $this->temp_days = $args['temp_days_after']; //Show the notice again after these days after temporary dismiss
@@ -103,6 +104,14 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
103
  */
104
  private function default_args() {
105
 
 
 
 
 
 
 
 
 
106
  $defaults = array(
107
  'id' => 'wpbackitup_initial_id',
108
  'days_after' => 10,
@@ -115,7 +124,7 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
115
  esc_html__( "We would be extremely grateful if you would take just a few minutes to leave a review on WordPress.org. It really does help the entire community. Many thanks in advance :)", "wp-backitup" )
116
  ),
117
 
118
- 'link_1' => $this->get_review_link_1(),
119
  'link_2' => '#',
120
  'link_3' => '#',
121
 
@@ -123,8 +132,8 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
123
  'link_label_2' => esc_html__( 'Nope, maybe later', 'wp-backitup' ),
124
  'link_label_3' => esc_html__( 'I already did', 'wp-backitup' ),
125
 
126
- 'rating' => 5,
127
- 'slug' => 'wp-backitup',
128
 
129
  // Parameters used in WP Dismissible Notices Handler
130
  'cap' => 'administrator',
@@ -133,7 +142,6 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
133
  );
134
 
135
  return apply_filters( 'wp-backitup_default_args', $defaults );
136
-
137
  }
138
 
139
 
@@ -453,13 +461,16 @@ if ( ! class_exists( 'WPBackitup_Admin_Notice' ) ) {
453
  * @return string
454
  */
455
 
456
- protected function get_review_link_1() {
457
- $link = 'https://wordpress.org/support/plugin/';
458
- $link .= $this->slug . '/reviews/';
459
- $link = add_query_arg( '?filter', $this->rating, $link );
460
- $link = esc_url( $link . '#new-post' );
461
- return $link;
462
- }
 
 
 
463
 
464
  /**
465
  * Notice dismissal triggered by Ajax
62
  public function __construct($args){
63
 
64
  $args = wp_parse_args( $args, $this->default_args() );
65
+
66
  $this->id = $args['id'];
67
  $this->days = $args['days_after']; //Show the notice after these days
68
  $this->temp_days = $args['temp_days_after']; //Show the notice again after these days after temporary dismiss
104
  */
105
  private function default_args() {
106
 
107
+ $slug = 'wp-backitup';
108
+ $rating =5;
109
+
110
+ $link = 'https://wordpress.org/support/plugin/';
111
+ $link .= $slug . '/reviews/';
112
+ $link = add_query_arg( '?filter', $rating, $link );
113
+ $link = esc_url( $link . '#new-post' );
114
+
115
  $defaults = array(
116
  'id' => 'wpbackitup_initial_id',
117
  'days_after' => 10,
124
  esc_html__( "We would be extremely grateful if you would take just a few minutes to leave a review on WordPress.org. It really does help the entire community. Many thanks in advance :)", "wp-backitup" )
125
  ),
126
 
127
+ 'link_1' => $link,
128
  'link_2' => '#',
129
  'link_3' => '#',
130
 
132
  'link_label_2' => esc_html__( 'Nope, maybe later', 'wp-backitup' ),
133
  'link_label_3' => esc_html__( 'I already did', 'wp-backitup' ),
134
 
135
+ 'rating' => $rating,
136
+ 'slug' => $slug,
137
 
138
  // Parameters used in WP Dismissible Notices Handler
139
  'cap' => 'administrator',
142
  );
143
 
144
  return apply_filters( 'wp-backitup_default_args', $defaults );
 
145
  }
146
 
147
 
461
  * @return string
462
  */
463
 
464
+ // protected function get_review_link_1() {
465
+ // $link = 'https://wordpress.org/support/plugin/';
466
+ // //$link .= $this->slug . '/reviews/';
467
+ //
468
+ //
469
+ // $link .= $this->slug . '/reviews/';
470
+ // $link = add_query_arg( '?filter', 5, $link );
471
+ // $link = esc_url( $link . '#new-post' );
472
+ // return $link;
473
+ // }
474
 
475
  /**
476
  * Notice dismissal triggered by Ajax
lib/includes/class-admin-notices.php CHANGED
@@ -12,20 +12,50 @@
12
 
13
  if ( ! class_exists( 'WPBackitup_Admin_Notices' ) ) {
14
 
 
15
  class WPBackitup_Admin_Notices {
16
 
17
  private $promo;
18
  private $today;
19
 
20
- public function __construct(){
 
 
21
 
22
- //$test_date = date("Y-m-d H:i", strtotime("16 November 2017 5:00 AM UTC")); //todo: comment for LIVE
23
- //$this->today =$test_date;//todo:remove this line for LIVE
24
 
25
- $this->today =date("Y-m-d H:i"); //todo:uncomment for LIVE
 
 
26
 
27
  //IS there a promo to run
28
- $this->promo = $this->get_active_notice();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
 
31
  /**
@@ -35,16 +65,24 @@ if ( ! class_exists( 'WPBackitup_Admin_Notices' ) ) {
35
  */
36
  public function run() {
37
  try {
38
- //Which promo should be run
39
  switch ( $this->promo ) {
40
- case "black-friday":
41
- $this->black_friday();
42
- break;
 
 
 
 
 
 
 
 
 
43
  default:
44
- //Run the wordpress review promo if nothing else is going on
45
  $this->wordpress_review();
46
- break;
47
  }
 
48
  } catch ( Exception $e ) {
49
 
50
  }
@@ -69,130 +107,199 @@ if ( ! class_exists( 'WPBackitup_Admin_Notices' ) ) {
69
  }
70
 
71
  /**
72
- * Black Friday Notice
73
  *
 
 
74
  */
75
- private function black_friday() {
76
-
77
- $black_friday_notice = $this->get_blackfriday_notice();
78
-
79
- //black friday sale notice
80
- $days_after=0;
81
- $black_friday_sale = array(
82
- 'id' => 'black-friday-sale',
83
- 'days_after' => 0,
84
- 'temp_days_after' => $black_friday_notice['temp_days_after'],
85
- 'type' => 'updated',
86
- 'message' => $black_friday_notice['message'],
87
- 'link_1' => $black_friday_notice['link_1'],
88
- 'link_label_1' => $black_friday_notice['link_label_1'],
89
- 'link_label_2' => $black_friday_notice['link_label_2'],
90
- 'link_label_3' => $black_friday_notice['link_label_3'],
91
- );
92
-
93
- new WPBackitup_Admin_Notice($black_friday_sale);
94
- }
95
 
96
  /**
97
- * Get the active notice
 
 
 
98
  */
99
- private function get_active_notice() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
- $wpbacktiup_license = new WPBackItUp_License();
102
 
103
- //Don't show notice when premium is installed
104
- if (!$wpbacktiup_license->is_premium_license() || ! $wpbacktiup_license->is_license_active() ){
105
- return 'black-friday';
106
- }
107
-
108
- }
109
-
110
-
111
- private function get_black_friday_day_id() {
112
- $id = false;
113
-
114
- //12:00 AM EST = 5:00 AM UTC
115
- //11:59 PM EST = 4:59 AM UTC
116
-
117
- $pre_sale_start = date( "Y-m-d H:i", strtotime( "16 November 2017 5:00 AM UTC" ) ); // 16th 12:00 AM EST
118
- $pre_sale_end = date( "Y-m-d H:i", strtotime( "24 November 2017 4:59 AM UTC" ) ); // 23rd 11:59 PM EST
119
-
120
- $sale_start = date( "Y-m-d H:i", strtotime( "24 November 2017 5:00 AM UTC" ) );// 24th 12:00 AM EST
121
- $sale_end = date( "Y-m-d H:i", strtotime( "27 November 2017 4:59 AM UTC" ) );// 26th 11:59 PM EST
122
-
123
- $lastday_start = date( "Y-m-d H:i", strtotime( "27 November 2017 5:00 AM UTC" ) );// 27th 12:00 AM EST
124
- $lastday_end = date( "Y-m-d H:i", strtotime( "28 November 2017 4:59 AM UTC" ) );// 27th 11:59 PM EST
125
-
126
-
127
- if ( $this->today >= $pre_sale_start && $this->today <= $pre_sale_end ) {
128
- $id = 0;
129
- } elseif ( $this->today >= $sale_start && $this->today <= $sale_end ) {
130
- $id = 1;
131
- } elseif ( $this->today >= $lastday_start && $this->today <= $lastday_end ) {
132
- $id = 2;
133
- }
 
134
 
135
- return $id;
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
- private function get_blackfriday_notice() {
139
- $message= array();
140
- $link_1=array();
141
- $link_label_1=array();
142
- $link_label_2=array();
143
- $link_label_3=array();
144
- $temp_days_after=array();
145
-
146
- $id = $this->get_black_friday_day_id();
147
-
148
- //PRESALE
149
- $message[]=sprintf( "%s<p>%s<p>%s",
150
- '<h2>' . esc_html__( "Black Friday/Cyber Monday Sale Starts Soon!", "wp-backitup") . ' </h2>',
151
- __( "Save <b>30%</b> on WPBackItUp Premium for a limited time!", "wp-backitup" ),
152
- __( "We just wanted to let you know that WPBackItUp will be participating in the Black Friday and Cyber Monday craziness next week.<br/><br/>If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get <b>30%</b> off our regular prices.", "wp-backitup" )
153
- );
154
- $temp_days_after[]=1;
155
- $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-1";
156
- $link_label_1[] = esc_html__( 'Buy now, I don\'t need the discount!', 'wp-backitup' );
157
- $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
158
- $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
159
-
160
- //SALE
161
- $message[]=sprintf( "%s<p>%s<p>%s",
162
- '<h2>' . esc_html__( "WPBackItUp Black Friday SALE! Save 30% on all purchases and upgrades!", "wp-backitup") . ' </h2>',
163
- __( "<b>It’s SALE time!</b><br/><br/>The WPBackItUp Black Friday sale has started so if you have been thinking about safeguarding your WordPress site with WPBackItUp Premium then now is the time.", "wp-backitup" ),
164
- __( "If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get 30% off our regular prices.", "wp-backitup" )
165
- );
166
- $temp_days_after[]=1;
167
- $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-2";;
168
- $link_label_1[] = esc_html__( 'Buy now and save 30%', 'wp-backitup' );
169
- $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
170
- $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
171
-
172
- //LAST DAY
173
- $message[]=sprintf( "%s<p>%s<p>%s",
174
- '<h2>' . esc_html__( "Less than 24 hours left to save 30% on WPBackItUp Premium!", "wp-backitup") . ' </h2>',
175
- __( "Happy Cyber Monday! Today is your last chance to save <b>30% </b> on WPBackItUp Premium.", "wp-backitup" ),
176
- __( "If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get 30% off our regular prices.", "wp-backitup" )
177
- );
178
- $temp_days_after[]=1;
179
- $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-3";;
180
- $link_label_1[] = esc_html__( 'Buy now and save 30%', 'wp-backitup' );
181
- $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
182
- $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
183
-
184
- $rtn = array(
185
- 'message'=>$message[$id],
186
- 'temp_days_after'=>$temp_days_after[$id],
187
- 'link_1'=>$link_1[$id],
188
- 'link_label_1'=>$link_label_1[$id],
189
- 'link_label_2'=>$link_label_2[$id],
190
- 'link_label_3'=>$link_label_3[$id],
191
- );
192
-
193
- return $rtn;
194
 
195
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
 
197
  }
198
  }
12
 
13
  if ( ! class_exists( 'WPBackitup_Admin_Notices' ) ) {
14
 
15
+
16
  class WPBackitup_Admin_Notices {
17
 
18
  private $promo;
19
  private $today;
20
 
21
+ //PROMO Constants
22
+ private $BLACK_FRIDAY_2017_PROMO = 'black-friday-2017';
23
+ private $SAFE_BETA_PROMO = 'safe-beta-december';
24
 
25
+ public function __construct(){
 
26
 
27
+ $today = date("Y-m-d H:i");
28
+ //$today = date("Y-m-d H:i", strtotime("01 December 2017 5:00 AM UTC")); //todo: comment for LIVE
29
+ $this->today =$today;
30
 
31
  //IS there a promo to run
32
+ $this->promo = $this->get_active_promo();
33
+ }
34
+
35
+ /**
36
+ * Get the active notice
37
+ *
38
+ */
39
+ private function get_active_promo() {
40
+
41
+ //Is the safe beta promo active
42
+ // if ( false !== $this->get_safe_beta_notice_id()) {
43
+ // return $this->SAFE_BETA_PROMO;
44
+ // }
45
+ //
46
+ //
47
+ // //Is the black friday active
48
+ // if ( false !== $this->get_black_friday_day_id()) {
49
+ // $wpbacktiup_license = new WPBackItUp_License();
50
+ //
51
+ // //Don't show notice when premium is installed
52
+ // if (!$wpbacktiup_license->is_premium_license() || ! $wpbacktiup_license->is_license_active() ) {
53
+ // return $this->BLACK_FRIDAY_2017_PROMO;
54
+ // }
55
+ // }
56
+
57
+ return false; //no active promos
58
+
59
  }
60
 
61
  /**
65
  */
66
  public function run() {
67
  try {
68
+
69
  switch ( $this->promo ) {
70
+ // case $this->SAFE_BETA_PROMO:
71
+ // $promo = sprintf("%s-%s",$this->promo,$this->get_safe_beta_notice_id());
72
+ // $notice = $this->get_safe_beta_notice();
73
+ // $this->show_notice($promo,$notice);
74
+ // break;
75
+ // case $this->BLACK_FRIDAY_2017_PROMO:
76
+ // $promo = sprintf("%s-%s",$this->promo,$this->get_black_friday_day_id());
77
+ // $notice = $this->get_black_friday_notice();
78
+ // $this->show_notice($promo,$notice);
79
+ // break;
80
+
81
+
82
  default:
 
83
  $this->wordpress_review();
 
84
  }
85
+
86
  } catch ( Exception $e ) {
87
 
88
  }
107
  }
108
 
109
  /**
110
+ * Show Notice
111
  *
112
+ * @param $id
113
+ * @param $notice
114
  */
115
+ // private function show_notice($id, $notice) {
116
+ //
117
+ // if (is_array($notice)) {
118
+ // $promo_notice = array(
119
+ // 'id' => $id,
120
+ // 'days_after' => $notice['days_after'],
121
+ // 'temp_days_after' => $notice['temp_days_after'],
122
+ // 'type' => 'updated',
123
+ // 'message' => $notice['message'],
124
+ // 'link_1' => $notice['link_1'],
125
+ // 'link_label_1' => $notice['link_label_1'],
126
+ // 'link_label_2' => $notice['link_label_2'],
127
+ // 'link_label_3' => $notice['link_label_3'],
128
+ // );
129
+ //
130
+ // new WPBackitup_Admin_Notice($promo_notice);
131
+ // }
132
+ // }
 
 
133
 
134
  /**
135
+ * Get SAFE promo ID
136
+ *
137
+ * @return bool|int false = no promo
138
+ *
139
  */
140
+ // private function get_safe_beta_notice_id() {
141
+ // $id = false;
142
+ //
143
+ // //12:00 AM EST = 5:00 AM UTC
144
+ // //11:59 PM EST = 4:59 AM UTC
145
+ //
146
+ // $promo_start = date( "Y-m-d H:i", strtotime( "01 December 2017 5:00 AM UTC" ) );
147
+ // $promo_end = date( "Y-m-d H:i", strtotime( "30 December 2017 4:59 AM UTC" ) );
148
+ //
149
+ // if ( $this->today >= $promo_start && $this->today <= $promo_end ) {
150
+ // $id = 0;
151
+ // }
152
+ //
153
+ // return $id;
154
+ // }
155
 
 
156
 
157
+ /**
158
+ * Get Black Friday Promo ID
159
+ *
160
+ * @return bool|int false = no promo
161
+ *
162
+ */
163
+ // private function get_black_friday_day_id() {
164
+ // $id = false;
165
+ //
166
+ // //12:00 AM EST = 5:00 AM UTC
167
+ // //11:59 PM EST = 4:59 AM UTC
168
+ //
169
+ // $pre_sale_start = date( "Y-m-d H:i", strtotime( "16 November 2017 5:00 AM UTC" ) ); // 16th 12:00 AM EST
170
+ // $pre_sale_end = date( "Y-m-d H:i", strtotime( "24 November 2017 4:59 AM UTC" ) ); // 23rd 11:59 PM EST
171
+ //
172
+ // $sale_start = date( "Y-m-d H:i", strtotime( "24 November 2017 5:00 AM UTC" ) );// 24th 12:00 AM EST
173
+ // $sale_end = date( "Y-m-d H:i", strtotime( "27 November 2017 4:59 AM UTC" ) );// 26th 11:59 PM EST
174
+ //
175
+ // $lastday_start = date( "Y-m-d H:i", strtotime( "27 November 2017 5:00 AM UTC" ) );// 27th 12:00 AM EST
176
+ // $lastday_end = date( "Y-m-d H:i", strtotime( "28 November 2017 4:59 AM UTC" ) );// 27th 11:59 PM EST
177
+ //
178
+ //
179
+ // if ( $this->today >= $pre_sale_start && $this->today <= $pre_sale_end ) {
180
+ // $id = 0;
181
+ // } elseif ( $this->today >= $sale_start && $this->today <= $sale_end ) {
182
+ // $id = 1;
183
+ // } elseif ( $this->today >= $lastday_start && $this->today <= $lastday_end ) {
184
+ // $id = 2;
185
+ // }
186
+ //
187
+ // return $id;
188
+ // }
189
 
190
+ /**
191
+ * Get Black Friday notice
192
+ *
193
+ * @return array|false on no notice
194
+ */
195
+ // private function get_black_friday_notice() {
196
+ // $message= array();
197
+ // $link_1=array();
198
+ // $link_label_1=array();
199
+ // $link_label_2=array();
200
+ // $link_label_3=array();
201
+ // $days_after=array();
202
+ // $temp_days_after=array();
203
+ //
204
+ // $id = $this->get_black_friday_day_id();
205
+ // if (false===$id) return false;
206
+ //
207
+ // //PRESALE
208
+ // $message[]=sprintf( "%s<p>%s<p>%s",
209
+ // '<h2>' . esc_html__( "Black Friday/Cyber Monday Sale Starts Soon!", "wp-backitup") . ' </h2>',
210
+ // __( "Save <b>30%</b> on WPBackItUp Premium for a limited time!", "wp-backitup" ),
211
+ // __( "We just wanted to let you know that WPBackItUp will be participating in the Black Friday and Cyber Monday craziness next week.<br/><br/>If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get <b>30%</b> off our regular prices.", "wp-backitup" )
212
+ // );
213
+ //
214
+ // $days_after[]=0;
215
+ // $temp_days_after[]=1;
216
+ // $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-1";
217
+ // $link_label_1[] = esc_html__( 'Buy now, I don\'t need the discount!', 'wp-backitup' );
218
+ // $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
219
+ // $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
220
+ //
221
+ // //SALE
222
+ // $message[]=sprintf( "%s<p>%s<p>%s",
223
+ // '<h2>' . esc_html__( "WPBackItUp Black Friday SALE! Save 30% on all purchases and upgrades!", "wp-backitup") . ' </h2>',
224
+ // __( "<b>It’s SALE time!</b><br/><br/>The WPBackItUp Black Friday sale has started so if you have been thinking about safeguarding your WordPress site with WPBackItUp Premium then now is the time.", "wp-backitup" ),
225
+ // __( "If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get 30% off our regular prices.", "wp-backitup" )
226
+ // );
227
+ // $days_after[]=0;
228
+ // $temp_days_after[]=1;
229
+ // $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-2";;
230
+ // $link_label_1[] = esc_html__( 'Buy now and save 30%', 'wp-backitup' );
231
+ // $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
232
+ // $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
233
+ //
234
+ // //LAST DAY
235
+ // $message[]=sprintf( "%s<p>%s<p>%s",
236
+ // '<h2>' . esc_html__( "Less than 24 hours left to save 30% on WPBackItUp Premium!", "wp-backitup") . ' </h2>',
237
+ // __( "Happy Cyber Monday! Today is your last chance to save <b>30% </b> on WPBackItUp Premium.", "wp-backitup" ),
238
+ // __( "If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get 30% off our regular prices.", "wp-backitup" )
239
+ // );
240
+ // $days_after[]=0;
241
+ // $temp_days_after[]=1;
242
+ // $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-3";;
243
+ // $link_label_1[] = esc_html__( 'Buy now and save 30%', 'wp-backitup' );
244
+ // $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
245
+ // $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
246
+ //
247
+ // $rtn = array(
248
+ // 'message'=>$message[$id],
249
+ // 'days_after'=>$days_after[$id],
250
+ // 'temp_days_after'=>$temp_days_after[$id],
251
+ // 'link_1'=>$link_1[$id],
252
+ // 'link_label_1'=>$link_label_1[$id],
253
+ // 'link_label_2'=>$link_label_2[$id],
254
+ // 'link_label_3'=>$link_label_3[$id],
255
+ // );
256
+ //
257
+ // return $rtn;
258
+ //
259
+ // }
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
 
262
+ /**
263
+ * Get SAFE beta promo
264
+ * *
265
+ * @return array|false false on no notice
266
+ */
267
+ // private function get_safe_beta_notice() {
268
+ // $message= array();
269
+ // $link_1=array();
270
+ // $link_label_1=array();
271
+ // $link_label_2=array();
272
+ // $link_label_3=array();
273
+ // $days_after=array();
274
+ // $temp_days_after=array();
275
+ //
276
+ // $id = $this->get_safe_beta_notice_id();
277
+ // if (false===$id) return false;
278
+ //
279
+ // $message[]=sprintf( "%s<p>%s<p>%s",
280
+ // '<h2>' . esc_html__( "SAFE BETA - Black Friday/Cyber Monday Sale Starts Soon!", "wp-backitup") . ' </h2>',
281
+ // __( "Save <b>30%</b> on WPBackItUp Premium for a limited time!", "wp-backitup" ),
282
+ // __( "We just wanted to let you know that WPBackItUp will be participating in the Black Friday and Cyber Monday craziness next week.<br/><br/>If you purchase WPBackItUp Premium or upgrade an existing license between <b>Friday, November 24, 2017, 12 AM EST (5 AM UTC)</b> and <b>Monday, November 27, 2017, 11:59 PM EST ( 4:59 AM UTC )</b> you'll automatically get <b>30%</b> off our regular prices.", "wp-backitup" )
283
+ // );
284
+ // $days_after[]=0;
285
+ // $temp_days_after[]=1;
286
+ // $link_1[] = "https://www.wpbackitup.com/pricing-purchase/?utm_medium=plugin&utm_source=wp-backitup&utm_campaign=plugin-black-friday-1";
287
+ // $link_label_1[] = esc_html__( 'Buy now, I don\'t need the discount!', 'wp-backitup' );
288
+ // $link_label_2[] = esc_html__( 'Remind me later', 'wp-backitup' );
289
+ // $link_label_3[] = esc_html__( 'I already purchased', 'wp-backitup' );
290
+ //
291
+ //
292
+ // return array(
293
+ // 'message'=>$message[$id],
294
+ // 'days_after'=>$days_after[$id],
295
+ // 'temp_days_after'=>$temp_days_after[$id],
296
+ // 'link_1'=>$link_1[$id],
297
+ // 'link_label_1'=>$link_label_1[$id],
298
+ // 'link_label_2'=>$link_label_2[$id],
299
+ // 'link_label_3'=>$link_label_3[$id],
300
+ // );
301
+ //
302
+ // }
303
 
304
  }
305
  }
lib/includes/class-download-log.php CHANGED
@@ -89,9 +89,9 @@ class WPBackitup_Download_Logs extends WPBackitup_WP_List_Table {
89
  * @return string
90
  */
91
  function column_job_name($item){
92
-
93
  $actions = array(
94
- 'delete' => sprintf('<a href="?page=%s&action=%s&delete_log=%s" onclick="%s">'.__('Delete', 'wp-backitup').'</a>','wp-backitup-support&tab=download-logs','delete',$item['job_name'],"return confirm('".__('Are you sure?', 'wp-backitup')."')"),
95
  'download' => sprintf('<a href="'.$item['job_name'].'" class="logs_backup">'.__('Download', 'wp-backitup').'</a>',$item['job_name'],'download')
96
 
97
  );
@@ -183,18 +183,19 @@ class WPBackitup_Download_Logs extends WPBackitup_WP_List_Table {
183
  */
184
  public function process_bulk_action() {
185
 
186
- if( 'delete'===$this->current_action() ) {
187
-
188
- foreach($_POST['download_log'] as $single_val){
189
-
190
- $path = WPBACKITUP__LOGS_PATH.'/'.$single_val;
191
- unlink($path);
 
 
 
 
 
192
  }
193
-
194
- $redirect = get_admin_url(null,'admin.php?page=wp-backitup-support&tab=download-logs' );
195
- wp_safe_redirect($redirect);
196
- }
197
-
198
  }
199
 
200
  /**
@@ -205,8 +206,8 @@ class WPBackitup_Download_Logs extends WPBackitup_WP_List_Table {
205
  * @access public
206
  * @abstract
207
  */
208
- function prepare_items() {
209
-
210
  $per_page = 15;
211
  $columns = $this->get_columns();
212
  $hidden = array();
@@ -217,7 +218,7 @@ class WPBackitup_Download_Logs extends WPBackitup_WP_List_Table {
217
  $extensions = "zip";
218
  $fileSystem = new WPBackItUp_FileSystem($this->log_name);
219
  $file_list = $fileSystem->get_fileonly_list($path, $extensions);
220
-
221
  foreach($file_list as $file){
222
  $create_date = $fileSystem->get_filetime_with_filename($file);
223
  $log_name = explode('logs/',$file);
89
  * @return string
90
  */
91
  function column_job_name($item){
92
+
93
  $actions = array(
94
+ 'delete' => sprintf('<a href="?page=%s&action=%s&delete_log=%s&s=%s" onclick="%s">'.__('Delete', 'wp-backitup').'</a>','wp-backitup-support&tab=download-logs','delete',$item['job_name'],wp_create_nonce('wp-backitup'. "-delete_log"),"return confirm('".__('Are you sure?', 'wp-backitup')."')"),
95
  'download' => sprintf('<a href="'.$item['job_name'].'" class="logs_backup">'.__('Download', 'wp-backitup').'</a>',$item['job_name'],'download')
96
 
97
  );
183
  */
184
  public function process_bulk_action() {
185
 
186
+ $nonce = filter_input( INPUT_POST, '_wpnonce', FILTER_SANITIZE_STRING );
187
+ $action = 'bulk-' . $this->_args['plural'];
188
+ if ( false !== wp_verify_nonce( $nonce, $action ) ) {
189
+ if( 'delete'===$this->current_action() ) {
190
+ foreach($_POST['download_log'] as $single_val){
191
+ $path = WPBACKITUP__LOGS_PATH.'/'.basename(sanitize_file_name($single_val));
192
+ unlink($path);
193
+ }
194
+
195
+ $redirect = get_admin_url(null,'admin.php?page=wp-backitup-support&tab=download-logs' );
196
+ wp_safe_redirect($redirect);
197
  }
198
+ }
 
 
 
 
199
  }
200
 
201
  /**
206
  * @access public
207
  * @abstract
208
  */
209
+ function prepare_items() {
210
+
211
  $per_page = 15;
212
  $columns = $this->get_columns();
213
  $hidden = array();
218
  $extensions = "zip";
219
  $fileSystem = new WPBackItUp_FileSystem($this->log_name);
220
  $file_list = $fileSystem->get_fileonly_list($path, $extensions);
221
+
222
  foreach($file_list as $file){
223
  $create_date = $fileSystem->get_filetime_with_filename($file);
224
  $log_name = explode('logs/',$file);
lib/includes/class-wpbackitup-admin.php CHANGED
@@ -314,7 +314,7 @@ class WPBackitup_Admin {
314
  // Enqueue Style for Settings page
315
  // Todo:: Maybe Removes these file loadings from wpbackitup-safe
316
  wp_enqueue_style( $this->namespace . '_vue_tab', WPBACKITUP__PLUGIN_URL . 'css/vue-tabs.min.css', array(), $this->version, false );
317
- wp_enqueue_style( $this->namespace . '_sweetalert', WPBACKITUP__PLUGIN_URL . 'css/sweetalert.css', array(), $this->version, false);
318
  wp_enqueue_style( $this->namespace . '_vue_keen_ui', WPBACKITUP__PLUGIN_URL . 'css/keen-ui.min.css', array(), $this->version, false);
319
 
320
 
@@ -330,9 +330,10 @@ class WPBackitup_Admin {
330
  // Loading new JS files for VueJS
331
  // Todo:: Maybe Removes these file loadings from wpbackitup-safe
332
  wp_enqueue_script($this->namespace . '_vue', WPBACKITUP__PLUGIN_URL . 'js/vue.min.js', array(), $this->version, false);
333
- wp_enqueue_script($this->namespace . '_vue_tabs', WPBACKITUP__PLUGIN_URL . 'js/vue-tabs.js', array(), $this->version, false);
334
  wp_enqueue_script($this->namespace . '_jquery_sweetalert', WPBACKITUP__PLUGIN_URL . 'js/sweetalert.min.js', array('jquery'), $this->version, false);
335
  wp_enqueue_script($this->namespace . '_vue_keen_ui', WPBACKITUP__PLUGIN_URL . 'js/keen-ui.min.js', array(), $this->version, false);
 
336
 
337
  // Loading tagit and core JS
338
  wp_enqueue_script( "{$this->namespace}-admin" );
314
  // Enqueue Style for Settings page
315
  // Todo:: Maybe Removes these file loadings from wpbackitup-safe
316
  wp_enqueue_style( $this->namespace . '_vue_tab', WPBACKITUP__PLUGIN_URL . 'css/vue-tabs.min.css', array(), $this->version, false );
317
+ // wp_enqueue_style( $this->namespace . '_sweetalert', WPBACKITUP__PLUGIN_URL . 'css/sweetalert.css', array(), $this->version, false);
318
  wp_enqueue_style( $this->namespace . '_vue_keen_ui', WPBACKITUP__PLUGIN_URL . 'css/keen-ui.min.css', array(), $this->version, false);
319
 
320
 
330
  // Loading new JS files for VueJS
331
  // Todo:: Maybe Removes these file loadings from wpbackitup-safe
332
  wp_enqueue_script($this->namespace . '_vue', WPBACKITUP__PLUGIN_URL . 'js/vue.min.js', array(), $this->version, false);
333
+ wp_enqueue_script($this->namespace . '_vue_tabs', WPBACKITUP__PLUGIN_URL . 'js/vue-tabs.min.js', array(), $this->version, false);
334
  wp_enqueue_script($this->namespace . '_jquery_sweetalert', WPBACKITUP__PLUGIN_URL . 'js/sweetalert.min.js', array('jquery'), $this->version, false);
335
  wp_enqueue_script($this->namespace . '_vue_keen_ui', WPBACKITUP__PLUGIN_URL . 'js/keen-ui.min.js', array(), $this->version, false);
336
+ wp_enqueue_script($this->namespace . '_vue_components', WPBACKITUP__PLUGIN_URL . 'js/wp-backitup-components.min.js', array(), $this->version, false);
337
 
338
  // Loading tagit and core JS
339
  wp_enqueue_script( "{$this->namespace}-admin" );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: backup, backups, back up, backup plugin, database backup, multisite backup
4
  Requires at least: 3.8.0
5
  Requires PHP: 5.2.4
6
  Tested up to: 4.9
7
- Stable tag: 1.15.1
8
  Author URI: https://www.wpbackitup.com
9
  Donate link: https://www.wpbackitup.com
10
  License: GPLv2 or later
@@ -214,6 +214,13 @@ Our online documentation and full list of FAQs can be found at [support.wpbackit
214
 
215
 
216
  == Changelog ==
 
 
 
 
 
 
 
217
  = 1.15.3 =
218
  *Release Date - November 16, 2017
219
 
4
  Requires at least: 3.8.0
5
  Requires PHP: 5.2.4
6
  Tested up to: 4.9
7
+ Stable tag: 1.15.3
8
  Author URI: https://www.wpbackitup.com
9
  Donate link: https://www.wpbackitup.com
10
  License: GPLv2 or later
214
 
215
 
216
  == Changelog ==
217
+ = 1.15.4 =
218
+ *Release Date - January 3, 2018
219
+
220
+ * FIX : Fix security issue with delete log
221
+ * UPDATE: Admin notice updates
222
+ * UPDATE: Enhancements to support WPBackItUp Safe cloud storage
223
+
224
  = 1.15.3 =
225
  *Release Date - November 16, 2017
226
 
views/backup.php CHANGED
@@ -332,6 +332,18 @@ if (!$backup_folder_exists) {
332
  </tr>
333
  </thead>
334
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
335
  <?php
336
 
337
  if ($backup_job_list!=false)
@@ -360,82 +372,23 @@ if (!$backup_folder_exists) {
360
 
361
  }
362
 
363
-
364
- $class = $i % 2 == 0 ? 'class="alternate"' : '';
 
 
 
365
  ?>
366
-
367
- <tr <?php echo $class ?> id="row<?php echo $i; ?>">
368
- <td data-th="<?php _e('Backup', 'wp-backitup') ?>">
369
- <?php
370
- $zip_files = $job->getJobMetaValue('backup_zip_files');
371
- if(is_array($zip_files) && count($zip_files)>0) { ?>
372
- <a href="#TB_inline?width=600&height=550&inlineId=<?php echo preg_replace('/[^A-Za-z0-9\-]/', '', $backup_name) ?>" class="thickbox" title="Download Backup" name="<?php echo $backup_name ?>" data-jobid="<?php echo $job->getJobId(); ?>">
373
- <i class="fa fa-download"></i>
374
- <?php echo $backup_name ?>
375
- </a>
376
- <?php } else {
377
- echo $backup_name;
378
- } ?>
379
- </td>
380
-
381
- <td class="word-capitalize" data-th="<?php _e('Type', 'wp-backitup') ?>"><?php echo $backup_run_type ?></td>
382
- <!--date-->
383
- <td data-th="<?php _e('Date', 'wp-backitup') ?>"><?php echo $file_datetime ?></td>
384
-
385
- <td data-th="<?php _e('Duration', 'wp-backitup') ?>"><?php echo $job->getJobDurationFormatted() ?></td>
386
-
387
- <td data-th="<?php _e('Status', 'wp-backitup') ?>"><?php echo $status ?></td>
388
-
389
- <td>
390
- <?php // WPBACKITUP__SAFE_SYNC_ON is temporary flag used to turn on sync functionality
391
- if (true==WPBACKITUP__SAFE_SYNC_ON && strtoupper($status)== "SUCCESS") : ?>
392
- <span v-if="cloudStatus['<?php echo $job->getJobId() ?>'] == 'uploaded' " class="fa-stack" title="<?php _e('Backup safely stored in cloud', 'wp-backitup'); ?>" >
393
- <a href="#" @click="openModal('modal<?php echo $job->getJobId() ?>')">
394
- <i class="fa fa fa-cloud fa-stack-2x" style="color:dodgerblue;"></i>
395
- <i class="fa fa-check fa-stack-1x fa-inverse"></i>
396
- </a>
397
- </span>
398
-
399
- <span v-else-if="cloudStatus['<?php echo $job->getJobId() ?>'] == 'uploading'" class="fa-stack" title="<?php _e('Sending backup to cloud', 'wp-backitup'); ?>" >
400
- <i class="fa fa-refresh fa-spin fa-2x fa-fw" style="color:dodgerblue;"></i>
401
- </span>
402
-
403
- <span v-else-if="cloudStatus['<?php echo $job->getJobId() ?>'] == 'error'" class="fa-stack" title="<?php _e('Error sending backup to cloud', 'wp-backitup'); ?>" >
404
- <a href="#" @click="openModal('modal<?php echo $job->getJobId() ?>')">
405
- <i class="fa fa-exclamation-circle fa-2x" style="color:#d9534f;"></i>
406
- </a>
407
- </span>
408
-
409
- <span v-else class="fa-stack">
410
- <i class="fa fa-refresh fa-spin fa-2x fa-fw" style="color:dodgerblue;display: none"></i>
411
- <a href="#" @click="openModal('modal<?php echo $job->getJobId() ?>')" title="Send to Cloud" data-id="<?php echo $job->getJobId() ?>" class="safeUploadRow" id="safeUploadRow<?php echo $i; ?>">
412
- <i class="fa fa-cloud-upload fa-2x" style="color:grey;" aria-hidden="true"></i>
413
- </a>
414
- </span>
415
-
416
- <!-- safe modal -->
417
- <div class="page__demo-group">
418
- <ui-modal ref="modal<?php echo $job->getJobId() ?>" title="<?php _e('Upload to Cloud','wp-backitup') ?>">
419
- <h2>Which cloud storage provider(s) would like to use?</h2>
420
- <div v-for="provider in providers">
421
- <ui-checkbox v-if="provider === 'DROPBOX' " v-model="DROPBOX['<?php echo $job->getJobId() ?>']">{{ provider }}</ui-checkbox>
422
- <ui-checkbox v-if="provider === 'GDRIVE' " v-model="GDRIVE['<?php echo $job->getJobId() ?>']">{{ provider }}</ui-checkbox>
423
- <ui-checkbox v-if="provider === 'AMAZONS3' " v-model="AMAZONS3['<?php echo $job->getJobId() ?>']">{{ provider }}</ui-checkbox>
424
- </div>
425
-
426
- <div slot="footer">
427
- <ui-button color="primary" @click="saveIndProviders('<?php echo $job->getJobId() ?>')"><?php _e('Save', 'wp-backitup'); ?></ui-button>
428
- <ui-button @click="closeModal('modal<?php echo $job->getJobId() ?>')"><?php _e('Close', 'wp-backitup'); ?></ui-button>
429
- </div>
430
- </ui-modal>
431
- </div>
432
- <?php endif ?>
433
- </td>
434
- <td>
435
- <a href="#" title="Delete Backup" data-id="<?php echo $job->getJobId() ?>" class="deleteRow" id="deleteRow<?php echo $i; ?>"><i class="fa fa-trash-o fa-2x"></i></a>
436
- </td>
437
- </tr>
438
-
439
  <?php
440
  $i++;
441
  }
@@ -577,3 +530,87 @@ if (!$backup_folder_exists) {
577
  <span class="hidden" id="popupbox">
578
  <?php add_thickbox(); ?>
579
  </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  </tr>
333
  </thead>
334
  <tbody>
335
+ <tr v-if="isNewRowAvailable" is="backup-row"
336
+ class="success-grid"
337
+ :name="backupNewRow.name"
338
+ :type="backupNewRow.type"
339
+ :date="backupNewRow.date"
340
+ :duration="backupNewRow.duration"
341
+ :status="backupNewRow.status"
342
+ :row="backupNewRow.row"
343
+ :job-id="backupNewRow.jobId"
344
+ :zip-exist="backupNewRow.zipExist"
345
+ >
346
+ </tr>
347
  <?php
348
 
349
  if ($backup_job_list!=false)
372
 
373
  }
374
 
375
+ $zip_exist = false;
376
+ $zip_files = $job->getJobMetaValue('backup_zip_files');
377
+ if(is_array($zip_files) && count($zip_files)>0) {
378
+ $zip_exist = true;
379
+ }
380
  ?>
381
+ <tr is="backup-row"
382
+ name="<?php echo $backup_name; ?>"
383
+ type="<?php echo $backup_run_type; ?>"
384
+ date="<?php echo $file_datetime; ?>"
385
+ duration="<?php echo $job->getJobDurationFormatted() ?>"
386
+ status="<?php echo $status; ?>"
387
+ row="<?php echo $i ?>"
388
+ job-id="<?php echo $job->getJobId(); ?>"
389
+ zip-exist="<?php echo $zip_exist ?>"
390
+ >
391
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  <?php
393
  $i++;
394
  }
530
  <span class="hidden" id="popupbox">
531
  <?php add_thickbox(); ?>
532
  </span>
533
+
534
+
535
+
536
+ <!--Vue JS component for backup row-->
537
+ <script type="text/x-template" id="backup-row-template">
538
+ <tr v-bind:class="klass" v-bind:id="'row' + row">
539
+ <td data-th="<?php _e('Backup', 'wp-backitup') ?>" v-if="zipExist">
540
+ <a v-bind:href="'#TB_inline?width=600&height=550&inlineId=' + backupParsedId" class="thickbox" title="Download Backup" v-bind:name="name" v-bind:data-jobid="jobId">
541
+ <i class="fa fa-download"></i>
542
+ {{ name }}
543
+ </a>
544
+ </td>
545
+ <td data-th="<?php _e('Backup', 'wp-backitup') ?>" v-else>
546
+ {{ name }}
547
+ </td>
548
+
549
+ <td class="word-capitalize" data-th="<?php _e('Type', 'wp-backitup') ?>"> {{ type }}</td>
550
+ <!--date-->
551
+ <td data-th="<?php _e('Date', 'wp-backitup') ?>">{{ date }}</td>
552
+
553
+ <td data-th="<?php _e('Duration', 'wp-backitup') ?>">{{ duration }}</td>
554
+
555
+ <td data-th="<?php _e('Status', 'wp-backitup') ?>">{{ status }}</td>
556
+
557
+ <send-cloud v-bind:visible="cloudVisible"
558
+ v-bind:kloud-status="cstatus"
559
+ >
560
+ </send-cloud>
561
+
562
+ <td>
563
+ <a href="#" title="Delete Backup" v-bind:data-id="jobId" class="deleteRow" v-bind:id="'deleteRow'+row"><i class="fa fa-trash-o fa-2x"></i></a>
564
+ </td>
565
+ </tr>
566
+ </script>
567
+
568
+
569
+
570
+ <!--Vue Send to cloud-->
571
+ <script type="text/x-template" id="send-to-cloud">
572
+ <td v-if="visible">
573
+ <?php if (true==WPBACKITUP__SAFE_SYNC_ON) : ?>
574
+ <span v-if="kloudStatus == 'uploaded' " class="fa-stack" title="<?php _e('Backup safely stored in cloud', 'wp-backitup'); ?>" >
575
+ <a href="#" @click="openModal('modal'+ jobId)">
576
+ <i class="fa fa fa-cloud fa-stack-2x" style="color:dodgerblue;"></i>
577
+ <i class="fa fa-check fa-stack-1x fa-inverse"></i>
578
+ </a>
579
+ </span>
580
+
581
+ <span v-else-if="kloudStatus == 'uploading'" class="fa-stack" title="<?php _e('Sending backup to cloud', 'wp-backitup'); ?>" >
582
+ <i class="fa fa-refresh fa-spin fa-2x fa-fw" style="color:dodgerblue;"></i>
583
+ </span>
584
+
585
+ <span v-else-if="kloudStatus == 'error'" class="fa-stack" title="<?php _e('Error sending backup to cloud', 'wp-backitup'); ?>" >
586
+ <a href="#" @click="openModal('modal'+ jobId)">
587
+ <i class="fa fa-exclamation-circle fa-2x" style="color:#d9534f;"></i>
588
+ </a>
589
+ </span>
590
+
591
+ <span v-else class="fa-stack">
592
+ <i class="fa fa-refresh fa-spin fa-2x fa-fw" style="color:dodgerblue;display: none"></i>
593
+ <a href="#" @click="openModal('modal'+ jobId)" title="Send to Cloud" v-bind:data-id="jobId" class="safeUploadRow" id="'safeUploadRow'+ row">
594
+ <i class="fa fa-cloud-upload fa-2x" style="color:grey;" aria-hidden="true"></i>
595
+ </a>
596
+ </span>
597
+
598
+ <div class="page__demo-group">
599
+ <ui-modal v-bind:ref="'modal'+ jobId" title="<?php _e('Upload to Cloud','wp-backitup') ?>">
600
+ <h2>Which cloud storage provider(s) would like to use?</h2>
601
+ <div v-for="provider in providers">
602
+ <ui-checkbox v-if="provider === 'DROPBOX' " v-model="DROPBOX[jobId]">{{ provider }}</ui-checkbox>
603
+ <ui-checkbox v-if="provider === 'GDRIVE' " v-model="GDRIVE[jobId]">{{ provider }}</ui-checkbox>
604
+ <ui-checkbox v-if="provider === 'AMAZONS3' " v-model="AMAZONS3[jobId]">{{ provider }}</ui-checkbox>
605
+ </div>
606
+
607
+ <div slot="footer">
608
+ <ui-button color="primary" @click="saveIndProviders(jobId)"><?php _e('Save', 'wp-backitup'); ?></ui-button>
609
+ <ui-button @click="closeModal('modal'+ jobId)"><?php _e('Close', 'wp-backitup'); ?></ui-button>
610
+ </div>
611
+ </ui-modal>
612
+ </div>
613
+
614
+ <?php endif ?>
615
+ </td>
616
+ </script>
views/support.php CHANGED
@@ -286,11 +286,14 @@ class WPBackItUp_Support {
286
  }
287
 
288
  /* For delete data data on delete action */
 
289
  private function delete_action(){
290
-
291
- $filename = WPBACKITUP__LOGS_PATH.'/'.$_GET['delete_log'];
292
- if (file_exists($filename)) {
293
- unlink($filename);
 
 
294
  }
295
  }
296
 
286
  }
287
 
288
  /* For delete data data on delete action */
289
+ //http://localhost/wp-admin/admin.php?page=wp-backitup-support&delete_log=..%2F..%2F..%2F..%2Ftest-delete.php
290
  private function delete_action(){
291
+ if (false!==wp_verify_nonce($_GET['s'],'wp-backitup'. "-delete_log")){
292
+ $file_name = basename(sanitize_file_name($_GET['delete_log']));
293
+ $filename = WPBACKITUP__LOGS_PATH.'/'.$file_name;
294
+ if (file_exists($filename)) {
295
+ unlink($filename);
296
+ }
297
  }
298
  }
299
 
wp-backitup.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
7
  * Author: WPBackItUp
8
  * Author URI: https://www.wpbackitup.com
9
- * Version: 1.15.3
10
  * Text Domain: wp-backitup
11
  *
12
  * License: GPL3
@@ -33,7 +33,7 @@ define( 'WPBACKITUP__CLASSNAMESPACE', 'WPBackItUp' );
33
 
34
  define( 'WPBACKITUP__MAJOR_VERSION', 1);
35
  define( 'WPBACKITUP__MINOR_VERSION', 15);
36
- define( 'WPBACKITUP__MAINTENANCE_VERSION', 3); //Dont forget to update version in header on WP release
37
  define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
38
 
39
  define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));
6
  * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
7
  * Author: WPBackItUp
8
  * Author URI: https://www.wpbackitup.com
9
+ * Version: 1.15.4
10
  * Text Domain: wp-backitup
11
  *
12
  * License: GPL3
33
 
34
  define( 'WPBACKITUP__MAJOR_VERSION', 1);
35
  define( 'WPBACKITUP__MINOR_VERSION', 15);
36
+ define( 'WPBACKITUP__MAINTENANCE_VERSION', 4); //Dont forget to update version in header on WP release
37
  define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
38
 
39
  define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));