Backup Migration - Version 1.1.7

Version Description

  • Tested up with WP Version 5.9 (up to beta 3)
  • Fixed restoration issues for Windows and Windows Server
  • Fixed notifications via e-mail - now you can receive max 1 e-mail per day
  • Adjusted cleanup of restoration files - GC processing
  • Fixed restore process request, after Super-Quick Migration (sometimes it was hanging)
  • Fixed restoration process via shell due to syntax error
  • Adjusted important parts to be compatible with Windows systems
  • Modified default value of query output to 300
  • By default SQL-Splitting will be enabled since this version (adjusted for all users)
  • Removed/fixed unnecessary notices in error log above PHP 7.4
  • Added new indicators in restore and backup logs
  • Now newly created backups saves WP version of source site
  • Restore and backup logs will display version of current backup
  • PHP CLI will be disabled by default for new users
  • Fixed some JavaScript issues of front-end process manager
Download this release

Release Info

Developer iclyde
Plugin Icon wp plugin Backup Migration
Version 1.1.7
Comparing to
See all releases

Code changes from version 1.1.6 to 1.1.7

admin/js/backup-migration.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},i="undefined"!=typeof window?window:null,o={hasTouchCapability:!(!i||!("ontouchstart"in i||i.DocumentTouch&&i.document instanceof i.DocumentTouch||i.navigator.maxTouchPoints)),hasTransitions:function(){if(!i)return!1;var t=(i.document.body||i.document.documentElement).style,e="transition",o=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[e])return!0;e=e.charAt(0).toUpperCase()+e.substr(1);for(var n=0;n<o.length;n++)if("string"==typeof t[o[n]+e])return!0;return!1}(),IE:!1,semVer:"4.2.8",window:i},n=function(){this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__instancesLatestArr=[],this.__plugins={},this._env=o};function s(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function r(e,i){var o=!0;return t.each(e,function(t,n){if(void 0===i[t]||e[t]!==i[t])return o=!1,!1}),o}function a(e){var i=e.attr("id"),n=i?o.window.document.getElementById(i):null;return n?n===e[0]:t.contains(o.window.document.body,e[0])}n.prototype={__bridge:function(e,i,o){if(!i[o]){var n=function(){};n.prototype=e;var s=new n;s.__init&&s.__init(i),t.each(e,function(t,e){0!=t.indexOf("__")&&(i[t]||(i[t]=function(){return s[t].apply(s,Array.prototype.slice.apply(arguments))},i[t].bridged=s))}),i[o]=s}return this},__setWindow:function(t){return o.window=t,this},_getRuler:function(t){return new s(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(e){if("string"==typeof e){var i=e,o=null;return i.indexOf(".")>0?o=this.__plugins[i]:t.each(this.__plugins,function(t,e){if(e.name.substring(e.name.length-i.length-1)=="."+i)return o=e,!1}),o}if(e.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return this.__plugins[e.name]=e,e.core&&this.__bridge(e.core,this,e.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(e){var i=[];return t(e||".tooltipstered").each(function(){var e=t(this),o=e.data("tooltipster-ns");o&&t.each(o,function(t,o){i.push(e.data(o))})}),i},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(e){return t((e?e+" ":"")+".tooltipstered").toArray()},setDefaults:function(i){return t.extend(e,i),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.tooltipster=new n,t.Tooltipster=function(e,i){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(e,i)},t.Tooltipster.prototype={__init:function(i,n){var s=this;if(s._$origin=t(i),s.__options=t.extend(!0,{},e,n),s.__optionsFormat(),!o.IE||o.IE>=s.__options.IEmin){var r=null;if(void 0===s._$origin.data("tooltipster-initialTitle")&&(void 0===(r=s._$origin.attr("title"))&&(r=null),s._$origin.data("tooltipster-initialTitle",r)),null!==s.__options.content)s.__contentSet(s.__options.content);else{var a,l=s._$origin.attr("data-tooltip-content");l&&(a=t(l)),a&&a[0]?s.__contentSet(a.first()):s.__contentSet(r)}s._$origin.removeAttr("title").addClass("tooltipstered"),s.__prepareOrigin(),s.__prepareGC(),t.each(s.__options.plugins,function(t,e){s._plug(e)}),o.hasTouchCapability&&t(o.window.document.body).on("touchmove."+s.__namespace+"-triggerOpen",function(t){s._touchRecordEvent(t)}),s._on("created",function(){s.__prepareTooltip()})._on("repositioned",function(t){s.__lastPosition=t.position})}else s.__options.disabled=!0},__contentInsert:function(){var t=this._$tooltip.find(".tooltipster-content"),e=this.__Content;return this._trigger({type:"format",content:this.__Content,format:function(t){e=t}}),this.__options.functionFormat&&(e=this.__options.functionFormat.call(this,this,{origin:this._$origin[0]},this.__Content)),"string"!=typeof e||this.__options.contentAsHTML?t.empty().append(e):t.text(e),this},__contentSet:function(e){return e instanceof t&&this.__options.contentCloning&&(e=e.clone(!0)),this.__Content=e,this._trigger({type:"updated",content:e}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var e=this._$origin,i=this._$origin.is("area");if(i){var n=this._$origin.parent().attr("name");e=t('img[usemap="#'+n+'"]')}var s=e[0].getBoundingClientRect(),r=t(o.window.document),a=t(o.window),l=e,c={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:o.window.scrollX||o.window.document.documentElement.scrollLeft,top:o.window.scrollY||o.window.document.documentElement.scrollTop},size:{height:a.height(),width:a.width()}},origin:{fixedLineage:!1,offset:{},size:{height:s.bottom-s.top,width:s.right-s.left},usemapImage:i?e[0]:null,windowOffset:{bottom:s.bottom,left:s.left,right:s.right,top:s.top}}};if(i){var p=this._$origin.attr("shape"),u=this._$origin.attr("coords");if(u&&(u=u.split(","),t.map(u,function(t,e){u[e]=parseInt(t)})),"default"!=p)switch(p){case"circle":var d=u[0],_=u[1],f=u[2],h=_-f,m=d-f;c.origin.size.height=2*f,c.origin.size.width=c.origin.size.height,c.origin.windowOffset.left+=m,c.origin.windowOffset.top+=h;break;case"rect":var g=u[0],b=u[1],w=u[2],v=u[3];c.origin.size.height=v-b,c.origin.size.width=w-g,c.origin.windowOffset.left+=g,c.origin.windowOffset.top+=b;break;case"poly":for(var y=0,k=0,x=0,C=0,$="even",T=0;T<u.length;T++){var I=u[T];"even"==$?(I>x&&(x=I,0===T&&(y=x)),I<y&&(y=I),$="odd"):(I>C&&(C=I,1==T&&(k=C)),I<k&&(k=I),$="even")}c.origin.size.height=C-k,c.origin.size.width=x-y,c.origin.windowOffset.left+=y,c.origin.windowOffset.top+=k}}for(this._trigger({type:"geometry",edit:function(t){c.origin.size.height=t.height,c.origin.windowOffset.left=t.left,c.origin.windowOffset.top=t.top,c.origin.size.width=t.width},geometry:{height:c.origin.size.height,left:c.origin.windowOffset.left,top:c.origin.windowOffset.top,width:c.origin.size.width}}),c.origin.windowOffset.right=c.origin.windowOffset.left+c.origin.size.width,c.origin.windowOffset.bottom=c.origin.windowOffset.top+c.origin.size.height,c.origin.offset.left=c.origin.windowOffset.left+c.window.scroll.left,c.origin.offset.top=c.origin.windowOffset.top+c.window.scroll.top,c.origin.offset.bottom=c.origin.offset.top+c.origin.size.height,c.origin.offset.right=c.origin.offset.left+c.origin.size.width,c.available.document={bottom:{height:c.document.size.height-c.origin.offset.bottom,width:c.document.size.width},left:{height:c.document.size.height,width:c.origin.offset.left},right:{height:c.document.size.height,width:c.document.size.width-c.origin.offset.right},top:{height:c.origin.offset.top,width:c.document.size.width}},c.available.window={bottom:{height:Math.max(c.window.size.height-Math.max(c.origin.windowOffset.bottom,0),0),width:c.window.size.width},left:{height:c.window.size.height,width:Math.max(c.origin.windowOffset.left,0)},right:{height:c.window.size.height,width:Math.max(c.window.size.width-Math.max(c.origin.windowOffset.right,0),0)},top:{height:Math.max(c.origin.windowOffset.top,0),width:c.window.size.width}};"html"!=l[0].tagName.toLowerCase();){if("fixed"==l.css("position")){c.origin.fixedLineage=!0;break}l=l.parent()}return c},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=t(o.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=t(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var e=this;return e.__options.selfDestruction?e.__garbageCollector=setInterval(function(){var i=(new Date).getTime();e.__touchEvents=t.grep(e.__touchEvents,function(t,e){return i-t.time>6e4}),a(e._$origin)||e.close(function(){e.destroy()})},2e4):clearInterval(e.__garbageCollector),e},__prepareOrigin:function(){var t=this;if(t._$origin.off("."+t.__namespace+"-triggerOpen"),o.hasTouchCapability&&t._$origin.on("touchstart."+t.__namespace+"-triggerOpen touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen",function(e){t._touchRecordEvent(e)}),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&o.hasTouchCapability){var e="";t.__options.triggerOpen.click&&(e+="click."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.tap&&o.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&t._open(e)})}if(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&o.hasTouchCapability){e="";t.__options.triggerOpen.mouseenter&&(e+="mouseenter."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.touchstart&&o.hasTouchCapability&&(e+="touchstart."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){!t._touchIsTouchEvent(e)&&t._touchIsEmulatedEvent(e)||(t.__pointerIsOverOrigin=!0,t._openShortly(e))})}if(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&o.hasTouchCapability){e="";t.__options.triggerClose.mouseleave&&(e+="mouseleave."+t.__namespace+"-triggerOpen "),t.__options.triggerClose.touchleave&&o.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&(t.__pointerIsOverOrigin=!1)})}return t},__prepareTooltip:function(){var e=this,i=e.__options.interactive?"auto":"";return e._$tooltip.attr("id",e.__namespace).css({"pointer-events":i,zIndex:e.__options.zIndex}),t.each(e.__previousThemes,function(t,i){e._$tooltip.removeClass(i)}),t.each(e.__options.theme,function(t,i){e._$tooltip.addClass(i)}),e.__previousThemes=t.merge([],e.__options.theme),e},__scrollHandler:function(e){if(this.__options.triggerClose.scroll)this._close(e);else if(a(this._$origin)&&a(this._$tooltip)){var i=null;if(e.target===o.window.document)this.__Geometry.origin.fixedLineage||this.__options.repositionOnScroll&&this.reposition(e);else{i=this.__geometry();var n=!1;if("fixed"!=this._$origin.css("position")&&this.__$originParents.each(function(e,o){var s=t(o),r=s.css("overflow-x"),a=s.css("overflow-y");if("visible"!=r||"visible"!=a){var l=o.getBoundingClientRect();if("visible"!=r&&(i.origin.windowOffset.left<l.left||i.origin.windowOffset.right>l.right))return n=!0,!1;if("visible"!=a&&(i.origin.windowOffset.top<l.top||i.origin.windowOffset.bottom>l.bottom))return n=!0,!1}if("fixed"==s.css("position"))return!1}),n)this._$tooltip.css("visibility","hidden");else if(this._$tooltip.css("visibility","visible"),this.__options.repositionOnScroll)this.reposition(e);else{var s=i.origin.offset.left-this.__Geometry.origin.offset.left,r=i.origin.offset.top-this.__Geometry.origin.offset.top;this._$tooltip.css({left:this.__lastPosition.coord.left+s,top:this.__lastPosition.coord.top+r})}}this._trigger({type:"scroll",event:e,geo:i})}return this},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,t.each(this.__timeouts.close,function(t,e){clearTimeout(e)}),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,e=t._$tooltip.find(".tooltipster-content");return t.__options.trackTooltip&&(t.__contentBcr=e[0].getBoundingClientRect()),t.__tracker=setInterval(function(){if(a(t._$origin)&&a(t._$tooltip)){if(t.__options.trackOrigin){var i=t.__geometry(),o=!1;r(i.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?r(i.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(o=!0):r(i.origin.offset,t.__Geometry.origin.offset)&&(o=!0)),o||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var n=e[0].getBoundingClientRect();n.height===t.__contentBcr.height&&n.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=n)}}else t._close()},t.__options.trackerInterval),t},_close:function(e,i,n){var s=this,r=!0;if(s._trigger({type:"close",event:e,stop:function(){r=!1}}),r||n){i&&s.__callbacks.close.push(i),s.__callbacks.open=[],s.__timeoutsClear();var a=function(){t.each(s.__callbacks.close,function(t,i){i.call(s,s,{event:e,origin:s._$origin[0]})}),s.__callbacks.close=[]};if("closed"!=s.__state){var l=!0,c=(new Date).getTime()+s.__options.animationDuration[1];if("disappearing"==s.__state&&c>s.__closingTime&&s.__options.animationDuration[1]>0&&(l=!1),l){s.__closingTime=c,"disappearing"!=s.__state&&s.__stateSet("disappearing");var p=function(){clearInterval(s.__tracker),s._trigger({type:"closing",event:e}),s._$tooltip.off("."+s.__namespace+"-triggerClose").removeClass("tooltipster-dying"),t(o.window).off("."+s.__namespace+"-triggerClose"),s.__$originParents.each(function(e,i){t(i).off("scroll."+s.__namespace+"-triggerClose")}),s.__$originParents=null,t(o.window.document.body).off("."+s.__namespace+"-triggerClose"),s._$origin.off("."+s.__namespace+"-triggerClose"),s._off("dismissable"),s.__stateSet("closed"),s._trigger({type:"after",event:e}),s.__options.functionAfter&&s.__options.functionAfter.call(s,s,{event:e,origin:s._$origin[0]}),a()};o.hasTransitions?(s._$tooltip.css({"-moz-animation-duration":s.__options.animationDuration[1]+"ms","-ms-animation-duration":s.__options.animationDuration[1]+"ms","-o-animation-duration":s.__options.animationDuration[1]+"ms","-webkit-animation-duration":s.__options.animationDuration[1]+"ms","animation-duration":s.__options.animationDuration[1]+"ms","transition-duration":s.__options.animationDuration[1]+"ms"}),s._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),s.__options.animationDuration[1]>0&&s._$tooltip.delay(s.__options.animationDuration[1]),s._$tooltip.queue(p)):s._$tooltip.stop().fadeOut(s.__options.animationDuration[1],p)}}else a()}return s},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(e,i){var n=this;if(!n.__destroying&&a(n._$origin)&&n.__enabled){var s=!0;if("closed"==n.__state&&(n._trigger({type:"before",event:e,stop:function(){s=!1}}),s&&n.__options.functionBefore&&(s=n.__options.functionBefore.call(n,n,{event:e,origin:n._$origin[0]}))),!1!==s&&null!==n.__Content){i&&n.__callbacks.open.push(i),n.__callbacks.close=[],n.__timeoutsClear();var r,l=function(){"stable"!=n.__state&&n.__stateSet("stable"),t.each(n.__callbacks.open,function(t,e){e.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}),n.__callbacks.open=[]};if("closed"!==n.__state)r=0,"disappearing"===n.__state?(n.__stateSet("appearing"),o.hasTransitions?(n._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(l)):n._$tooltip.stop().fadeIn(l)):"stable"==n.__state&&l();else{if(n.__stateSet("appearing"),r=n.__options.animationDuration[0],n.__contentInsert(),n.reposition(e,!0),o.hasTransitions?(n._$tooltip.addClass("tooltipster-"+n.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":n.__options.animationDuration[0]+"ms","-ms-animation-duration":n.__options.animationDuration[0]+"ms","-o-animation-duration":n.__options.animationDuration[0]+"ms","-webkit-animation-duration":n.__options.animationDuration[0]+"ms","animation-duration":n.__options.animationDuration[0]+"ms","transition-duration":n.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=n.__state&&(n._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(l))},0)):n._$tooltip.css("display","none").fadeIn(n.__options.animationDuration[0],l),n.__trackerStart(),t(o.window).on("resize."+n.__namespace+"-triggerClose",function(e){var i=t(document.activeElement);(i.is("input")||i.is("textarea"))&&t.contains(n._$tooltip[0],i[0])||n.reposition(e)}).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)}),n.__$originParents=n._$origin.parents(),n.__$originParents.each(function(e,i){t(i).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)})}),n.__options.triggerClose.mouseleave||n.__options.triggerClose.touchleave&&o.hasTouchCapability){n._on("dismissable",function(t){t.dismissable?t.delay?(d=setTimeout(function(){n._close(t.event)},t.delay),n.__timeouts.close.push(d)):n._close(t):clearTimeout(d)});var c=n._$origin,p="",u="",d=null;n.__options.interactive&&(c=c.add(n._$tooltip)),n.__options.triggerClose.mouseleave&&(p+="mouseenter."+n.__namespace+"-triggerClose ",u+="mouseleave."+n.__namespace+"-triggerClose "),n.__options.triggerClose.touchleave&&o.hasTouchCapability&&(p+="touchstart."+n.__namespace+"-triggerClose",u+="touchend."+n.__namespace+"-triggerClose touchcancel."+n.__namespace+"-triggerClose"),c.on(u,function(t){if(n._touchIsTouchEvent(t)||!n._touchIsEmulatedEvent(t)){var e="mouseleave"==t.type?n.__options.delay:n.__options.delayTouch;n._trigger({delay:e[1],dismissable:!0,event:t,type:"dismissable"})}}).on(p,function(t){!n._touchIsTouchEvent(t)&&n._touchIsEmulatedEvent(t)||n._trigger({dismissable:!1,event:t,type:"dismissable"})})}n.__options.triggerClose.originClick&&n._$origin.on("click."+n.__namespace+"-triggerClose",function(t){n._touchIsTouchEvent(t)||n._touchIsEmulatedEvent(t)||n._close(t)}),(n.__options.triggerClose.click||n.__options.triggerClose.tap&&o.hasTouchCapability)&&setTimeout(function(){if("closed"!=n.__state){var e="",i=t(o.window.document.body);n.__options.triggerClose.click&&(e+="click."+n.__namespace+"-triggerClose "),n.__options.triggerClose.tap&&o.hasTouchCapability&&(e+="touchend."+n.__namespace+"-triggerClose"),i.on(e,function(e){n._touchIsMeaningfulEvent(e)&&(n._touchRecordEvent(e),n.__options.interactive&&t.contains(n._$tooltip[0],e.target)||n._close(e))}),n.__options.triggerClose.tap&&o.hasTouchCapability&&i.on("touchstart."+n.__namespace+"-triggerClose",function(t){n._touchRecordEvent(t)})}},0),n._trigger("ready"),n.__options.functionReady&&n.__options.functionReady.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}if(n.__options.timer>0){d=setTimeout(function(){n._close()},n.__options.timer+r);n.__timeouts.close.push(d)}}}return n},_openShortly:function(t){var e=this,i=!0;if("stable"!=e.__state&&"appearing"!=e.__state&&!e.__timeouts.open&&(e._trigger({type:"start",event:t,stop:function(){i=!1}}),i)){var o=0==t.type.indexOf("touch")?e.__options.delayTouch:e.__options.delay;o[0]?e.__timeouts.open=setTimeout(function(){e.__timeouts.open=null,e.__pointerIsOverOrigin&&e._touchIsMeaningfulEvent(t)?(e._trigger("startend"),e._open(t)):e._trigger("startcancel")},o[0]):(e._trigger("startend"),e._open(t))}return e},_optionsExtract:function(e,i){var o=this,n=t.extend(!0,{},i),s=o.__options[e];return s||(s={},t.each(i,function(t,e){var i=o.__options[t];void 0!==i&&(s[t]=i)})),t.each(n,function(e,i){void 0!==s[e]&&("object"!=typeof i||i instanceof Array||null==i||"object"!=typeof s[e]||s[e]instanceof Array||null==s[e]?n[e]=s[e]:t.extend(n[e],s[e]))}),n},_plug:function(e){var i=t.tooltipster._plugin(e);if(!i)throw new Error('The "'+e+'" plugin is not defined');return i.instance&&t.tooltipster.__bridge(i.instance,this,i.name),this},_touchIsEmulatedEvent:function(t){for(var e=!1,i=(new Date).getTime(),o=this.__touchEvents.length-1;o>=0;o--){var n=this.__touchEvents[o];if(!(i-n.time<500))break;n.target===t.target&&(e=!0)}return e},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var e=!1,i=this.__touchEvents.length-1;i>=0;i--){var o=this.__touchEvents[i];if("touchmove"==o.type){e=!0;break}if("touchstart"==o.type&&t===o.target)break}return e},_trigger:function(){var e=Array.prototype.slice.apply(arguments);return"string"==typeof e[0]&&(e[0]={type:e[0]}),e[0].instance=this,e[0].origin=this._$origin?this._$origin[0]:null,e[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,e),t.tooltipster._trigger.apply(t.tooltipster,e),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,e),this},_unplug:function(e){var i=this;if(i[e]){var o=t.tooltipster._plugin(e);o.instance&&t.each(o.instance,function(t,o){i[t]&&i[t].bridged===i[e]&&delete i[t]}),i[e].__destroy&&i[e].__destroy(),delete i[e]}return i},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var e=this;if(void 0===t)return e.__Content;if(e.__destroyed)e.__destroyError();else if(e.__contentSet(t),null!==e.__Content){if("closed"!==e.__state&&(e.__contentInsert(),e.reposition(),e.__options.updateAnimation))if(o.hasTransitions){var i=e.__options.updateAnimation;e._$tooltip.addClass("tooltipster-update-"+i),setTimeout(function(){"closed"!=e.__state&&e._$tooltip.removeClass("tooltipster-update-"+i)},1e3)}else e._$tooltip.fadeTo(200,.5,function(){"closed"!=e.__state&&e._$tooltip.fadeTo(200,1)})}else e._close();return e},destroy:function(){var e=this;if(e.__destroyed)e.__destroyError();else{"closed"!=e.__state?e.option("animationDuration",0)._close(null,null,!0):e.__timeoutsClear(),e._trigger("destroy"),e.__destroyed=!0,e._$origin.removeData(e.__namespace).off("."+e.__namespace+"-triggerOpen"),t(o.window.document.body).off("."+e.__namespace+"-triggerOpen");var i=e._$origin.data("tooltipster-ns");if(i)if(1===i.length){var n=null;"previous"==e.__options.restoration?n=e._$origin.data("tooltipster-initialTitle"):"current"==e.__options.restoration&&(n="string"==typeof e.__Content?e.__Content:t("<div></div>").append(e.__Content).html()),n&&e._$origin.attr("title",n),e._$origin.removeClass("tooltipstered"),e._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else i=t.grep(i,function(t,i){return t!==e.__namespace}),e._$origin.data("tooltipster-ns",i);e._trigger("destroyed"),e._off(),e.off(),e.__Content=null,e.__$emitterPrivate=null,e.__$emitterPublic=null,e.__options.parent=null,e._$origin=null,e._$tooltip=null,t.tooltipster.__instancesLatestArr=t.grep(t.tooltipster.__instancesLatestArr,function(t,i){return e!==t}),clearInterval(e.__garbageCollector)}return e},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(e,i){return void 0===i?this.__options[e]:(this.__destroyed?this.__destroyError():(this.__options[e]=i,this.__optionsFormat(),t.inArray(e,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===e&&this.__prepareGC()),this)},reposition:function(t,e){return this.__destroyed?this.__destroyError():"closed"!=this.__state&&a(this._$origin)&&(e||a(this._$tooltip))&&(e||this._$tooltip.detach(),this.__Geometry=this.__geometry(),this._trigger({type:"reposition",event:t,helper:{geo:this.__Geometry}})),this},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.fn.tooltipster=function(){var i=Array.prototype.slice.apply(arguments);if(0===this.length)return this;if("string"==typeof i[0]){var o="#*$~&";return this.each(function(){var e=t(this).data("tooltipster-ns"),n=e?t(this).data(e[0]):null;if(!n)throw new Error("You called Tooltipster's \""+i[0]+'" method on an uninitialized element');if("function"!=typeof n[i[0]])throw new Error('Unknown method "'+i[0]+'"');this.length>1&&"content"==i[0]&&(i[1]instanceof t||"object"==typeof i[1]&&null!=i[1]&&i[1].tagName)&&!n.__options.contentCloning&&n.__options.debug;var s=n[i[0]](i[1],i[2]);if(s!==n||"instance"===i[0])return o=s,!1}),"#*$~&"!==o?o:this}t.tooltipster.__instancesLatestArr=[];var n=i[0]&&void 0!==i[0].multiple,s=n&&i[0].multiple||!n&&e.multiple,r=i[0]&&void 0!==i[0].content,a=r&&i[0].content||!r&&e.content,l=i[0]&&void 0!==i[0].contentCloning,c=(l&&i[0].contentCloning,i[0]&&void 0!==i[0].debug);c&&i[0].debug;return this.length>1&&(a instanceof t||"object"==typeof a&&null!=a&&a.tagName),this.each(function(){var e=!1,o=t(this),n=o.data("tooltipster-ns"),r=null;n?s&&(e=!0):e=!0,e&&(r=new t.Tooltipster(this,i[0]),n||(n=[]),n.push(r.__namespace),o.data("tooltipster-ns",n),o.data(r.__namespace,r),r.__options.functionInit&&r.__options.functionInit.call(r,r,{origin:this}),r._trigger("init")),t.tooltipster.__instancesLatestArr.push(r)}),this},s.prototype={__init:function(e){this.__$tooltip=e,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=t('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(o.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),e={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var i=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),s=i[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&s.width>=i[0].scrollWidth-1};e.fits=r.height&&r.width}return o.IE&&o.IE<=11&&e.size.width!==o.window.document.documentElement.clientWidth&&(e.size.width=Math.ceil(e.size.width)+1),e}};var l=navigator.userAgent.toLowerCase();-1!=l.indexOf("msie")?o.IE=parseInt(l.split("msie")[1]):-1!==l.toLowerCase().indexOf("trident")&&-1!==l.indexOf(" rv:11")?o.IE=11:-1!=l.toLowerCase().indexOf("edge/")&&(o.IE=parseInt(l.toLowerCase().split("edge/")[1])),t.tooltipster._plugin({name:"tooltipster.sideTip",instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof t&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var e=t('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||e.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&e.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&e.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=e,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){if(this.__options=this.__instance._optionsExtract("tooltipster.sideTip",this.__defaults()),this.__options.position&&(this.__options.side=this.__options.position),"object"!=typeof this.__options.distance&&(this.__options.distance=[this.__options.distance]),this.__options.distance.length<4&&(void 0===this.__options.distance[1]&&(this.__options.distance[1]=this.__options.distance[0]),void 0===this.__options.distance[2]&&(this.__options.distance[2]=this.__options.distance[0]),void 0===this.__options.distance[3]&&(this.__options.distance[3]=this.__options.distance[1])),this.__options.distance={top:this.__options.distance[0],right:this.__options.distance[1],bottom:this.__options.distance[2],left:this.__options.distance[3]},"string"==typeof this.__options.side){this.__options.side=[this.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[this.__options.side]],"left"==this.__options.side[0]||"right"==this.__options.side[0]?this.__options.side.push("top","bottom"):this.__options.side.push("right","left")}6===t.tooltipster._env.IE&&!0!==this.__options.arrow&&(this.__options.arrow=!1)},__reposition:function(e,i){var o,n=this,s=n.__targetFind(i),r=[];n.__instance._$tooltip.detach();var a=n.__instance._$tooltip.clone(),l=t.tooltipster._getRuler(a),c=!1,p=n.__instance.option("animation");switch(p&&a.removeClass("tooltipster-"+p),t.each(["window","document"],function(o,p){var u=null;if(n.__instance._trigger({container:p,helper:i,satisfied:c,takeTest:function(t){u=t},results:r,type:"positionTest"}),1==u||0!=u&&0==c&&("window"!=p||n.__options.viewportAware))for(o=0;o<n.__options.side.length;o++){var d={horizontal:0,vertical:0},_=n.__options.side[o];"top"==_||"bottom"==_?d.vertical=n.__options.distance[_]:d.horizontal=n.__options.distance[_],n.__sideChange(a,_),t.each(["natural","constrained"],function(t,o){if(u=null,n.__instance._trigger({container:p,event:e,helper:i,mode:o,results:r,satisfied:c,side:_,takeTest:function(t){u=t},type:"positionTest"}),1==u||0!=u&&0==c){var a={container:p,distance:d,fits:null,mode:o,outerSize:null,side:_,size:null,target:s[_],whole:null},f=("natural"==o?l.free():l.constrain(i.geo.available[p][_].width-d.horizontal,i.geo.available[p][_].height-d.vertical)).measure();if(a.size=f.size,a.outerSize={height:f.size.height+d.vertical,width:f.size.width+d.horizontal},"natural"==o?i.geo.available[p][_].width>=a.outerSize.width&&i.geo.available[p][_].height>=a.outerSize.height?a.fits=!0:a.fits=!1:a.fits=f.fits,"window"==p&&(a.fits?a.whole="top"==_||"bottom"==_?i.geo.origin.windowOffset.right>=n.__options.minIntersection&&i.geo.window.size.width-i.geo.origin.windowOffset.left>=n.__options.minIntersection:i.geo.origin.windowOffset.bottom>=n.__options.minIntersection&&i.geo.window.size.height-i.geo.origin.windowOffset.top>=n.__options.minIntersection:a.whole=!1),r.push(a),a.whole)c=!0;else if("natural"==a.mode&&(a.fits||a.size.width<=i.geo.available[p][_].width))return!1}})}}),n.__instance._trigger({edit:function(t){r=t},event:e,helper:i,results:r,type:"positionTested"}),r.sort(function(t,e){return t.whole&&!e.whole?-1:!t.whole&&e.whole?1:t.whole&&e.whole?(i=n.__options.side.indexOf(t.side))<(o=n.__options.side.indexOf(e.side))?-1:i>o?1:"natural"==t.mode?-1:1:t.fits&&!e.fits?-1:!t.fits&&e.fits?1:t.fits&&e.fits?(i=n.__options.side.indexOf(t.side))<(o=n.__options.side.indexOf(e.side))?-1:i>o?1:"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1;var i,o}),(o=r[0]).coord={},o.side){case"left":case"right":o.coord.top=Math.floor(o.target-o.size.height/2);break;case"bottom":case"top":o.coord.left=Math.floor(o.target-o.size.width/2)}switch(o.side){case"left":o.coord.left=i.geo.origin.windowOffset.left-o.outerSize.width;break;case"right":o.coord.left=i.geo.origin.windowOffset.right+o.distance.horizontal;break;case"top":o.coord.top=i.geo.origin.windowOffset.top-o.outerSize.height;break;case"bottom":o.coord.top=i.geo.origin.windowOffset.bottom+o.distance.vertical}"window"==o.container?"top"==o.side||"bottom"==o.side?o.coord.left<0?i.geo.origin.windowOffset.right-this.__options.minIntersection>=0?o.coord.left=0:o.coord.left=i.geo.origin.windowOffset.right-this.__options.minIntersection-1:o.coord.left>i.geo.window.size.width-o.size.width&&(i.geo.origin.windowOffset.left+this.__options.minIntersection<=i.geo.window.size.width?o.coord.left=i.geo.window.size.width-o.size.width:o.coord.left=i.geo.origin.windowOffset.left+this.__options.minIntersection+1-o.size.width):o.coord.top<0?i.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?o.coord.top=0:o.coord.top=i.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:o.coord.top>i.geo.window.size.height-o.size.height&&(i.geo.origin.windowOffset.top+this.__options.minIntersection<=i.geo.window.size.height?o.coord.top=i.geo.window.size.height-o.size.height:o.coord.top=i.geo.origin.windowOffset.top+this.__options.minIntersection+1-o.size.height):(o.coord.left>i.geo.window.size.width-o.size.width&&(o.coord.left=i.geo.window.size.width-o.size.width),o.coord.left<0&&(o.coord.left=0)),n.__sideChange(a,o.side),i.tooltipClone=a[0],i.tooltipParent=n.__instance.option("parent").parent[0],i.mode=o.mode,i.whole=o.whole,i.origin=n.__instance._$origin[0],i.tooltip=n.__instance._$tooltip[0],delete o.container,delete o.fits,delete o.mode,delete o.outerSize,delete o.whole,o.distance=o.distance.horizontal||o.distance.vertical;var u,d,_,f=t.extend(!0,{},o);if(n.__instance._trigger({edit:function(t){o=t},event:e,helper:i,position:f,type:"position"}),n.__options.functionPosition){var h=n.__options.functionPosition.call(n,n.__instance,i,f);h&&(o=h)}l.destroy(),"top"==o.side||"bottom"==o.side?(u={prop:"left",val:o.target-o.coord.left},d=o.size.width-this.__options.minIntersection):(u={prop:"top",val:o.target-o.coord.top},d=o.size.height-this.__options.minIntersection),u.val<this.__options.minIntersection?u.val=this.__options.minIntersection:u.val>d&&(u.val=d),_=i.geo.origin.fixedLineage?i.geo.origin.windowOffset:{left:i.geo.origin.windowOffset.left+i.geo.window.scroll.left,top:i.geo.origin.windowOffset.top+i.geo.window.scroll.top},o.coord={left:_.left+(o.coord.left-i.geo.origin.windowOffset.left),top:_.top+(o.coord.top-i.geo.origin.windowOffset.top)},n.__sideChange(n.__instance._$tooltip,o.side),i.geo.origin.fixedLineage?n.__instance._$tooltip.css("position","fixed"):n.__instance._$tooltip.css("position",""),n.__instance._$tooltip.css({left:o.coord.left,top:o.coord.top,height:o.size.height,width:o.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(u.prop,u.val),n.__instance._$tooltip.appendTo(n.__instance.option("parent")),n.__instance._trigger({type:"repositioned",event:e,position:o})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},i=this.__instance._$origin[0].getClientRects();i.length>1&&(1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),i=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)));if(i.length<2)e.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),e.bottom=e.top,e.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),e.right=e.left;else{var o=i[0];e.top=Math.floor(o.left+(o.right-o.left)/2),o=i.length>2?i[Math.ceil(i.length/2)-1]:i[0],e.right=Math.floor(o.top+(o.bottom-o.top)/2),o=i[i.length-1],e.bottom=Math.floor(o.left+(o.right-o.left)/2),o=i.length>2?i[Math.ceil((i.length+1)/2)-1]:i[i.length-1],e.left=Math.floor(o.top+(o.bottom-o.top)/2)}return e}}})}),jQuery(document).ready(function($){var fchunker_upload={fchunker:function(t){$.extend(t),$.upId&&$.upUrl&&($.domHtml=$("#"+$.upId).html(),$.upInputId=$.upId+"_input")},fchunker_limitFileSize:function(t,e){for(var i=["KB","MB","GB"],o=e.toUpperCase(),n=0,s=0;s<i.length;s++){var r=o.indexOf(i[s]);if(r>-1){n=parseInt(o.substr(0,r))*Math.pow(1024,s+1);break}}return!(t.size>n)},upErrorMsg:function(t){$.upError=t},upStop:function(t){$.upError=t},upStatus:function(){return!$.upError||("function"==typeof $.upStop&&$.upStop($.upError),!1)},fchunker_getPercent:function(t,e){if(t=parseFloat(t),e=parseFloat(e),isNaN(t)||isNaN(e))return"-";return e<=0?0:Math.round(t/e*1e4)/100},fchunker_upload:function(t,e){$.upError="",$.tempFile=$("#"+$.upInputId)[0].files[0],"file"==t&&($.tempFile=e);var i=$.tempFile;if(!i)return!1;"function"==typeof $.upStart&&$.upStart();var o=i.name,n=o.lastIndexOf("."),s=o.length,r=o.substring(n+1,s);if($.upType&&(uptype=$.upType.split(","),-1==$.inArray(r,uptype)&&($.upError="Type error: Error-"+r)),$.upMaxSize&&($.fchunker_limitFileSize(i,$.upMaxSize+"MB")||($.upError="Error")),0==$.upStatus())return!1;$.taskStart=+new Date,setTimeout("jQuery.fchunker_upload_core()","100")},fchunker_upload_core:function(){var file=$.tempFile;if(!file)return!1;$.upShardSize||($.upShardSize=2);for(var filename=file.name,size=file.size,index1=filename.lastIndexOf("."),index2=filename.length,suffix=filename.substring(index1+1,index2),shardSize=1024*$.upShardSize*1024,succeed=0,shardCount=Math.ceil(size/shardSize),re=[],start,end=0,i=0;i<shardCount;++i)re[i]=[],start=i*shardSize,end=Math.min(size,start+shardSize),re[i].file_data=file.slice(start,end),re[i].file_name=filename,re[i].file_size=size;const URL=$.upUrl;var i2=0,i3=1,fcs=Array(),xhr=new XMLHttpRequest;function ajaxStack(stack){if(0!=$.upStatus()){var form=new FormData;stack[i2]&&(fcs=stack[i2],form.append("file_data",fcs.file_data),form.append("file_name",fcs.file_name),form.append("file_size",fcs.file_size),form.append("file_total",shardCount),form.append("file_index",i3),form.append("taskStart",$.taskStart),form.append("action","backup_migration"),form.append("token","bmi"),form.append("f","upload-backup"),xhr.open("POST",URL,!0),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.setRequestHeader("HTTP_X_REQUESTED_WITH","XMLHttpRequest"),xhr.onload=function(){ajaxStack(stack)},xhr.onreadystatechange=function(){if(0!=$.upStatus()&&4==xhr.readyState&&200==xhr.status){var data=xhr.responseText?eval("("+xhr.responseText+")"):"";++succeed;var cent=$.fchunker_getPercent(succeed,shardCount);"function"==typeof $.upEvent&&$.upEvent(cent),100==cent?setTimeout(function(){"function"==typeof $.upCallBack&&$.upCallBack(data)},500):"function"==typeof $.upCallBack&&$.upCallBack(data)}},xhr.send(form),i2++,i3++,form.delete("file_data"),form.delete("file_name"),form.delete("file_size"),form.delete("file_total"),form.delete("taskStart"),form.delete("file_index"),form.delete("action"),form.delete("token"),form.delete("f"))}}ajaxStack(re),re=null,file=null}};$.extend(fchunker_upload)}),jQuery(window).on("load",function(){setTimeout(function(){jQuery("#bmi").css({opacity:0}),jQuery("#bmi-preload").css({opacity:1}),jQuery("#bmi-preload").animate({opacity:0},150,function(){jQuery("#bmi-preload").remove(),jQuery("#bmi").css({display:"block"}),jQuery.bmi.dropdowns.init(),setTimeout(function(){jQuery("#wpfooter").show(200),jQuery("#bmi").animate({opacity:1},350)},100)})},50)}),jQuery(document).ready(function(t){let e=!1;t.extend({bmi:{clipboard:function(e){try{const i=document.createElement("textarea");return i.value=e,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),t.bmi.alert("success",t("#bmi-success-copy").text(),3e3),!0}catch(e){return console.log(e),t.bmi.alert("warning",t("#bmi-failed-copy").text(),3e3),!1}},alert:function(e="default",i="---",o=7e3){t(".bmi-notification-box").length<=0&&t("body").find("#bmi").prepend(t('<div class="bmi-notification-box"></div>')),e="default"==e?"":"success"==e?" is-success":"warning"==e?" is-warning":"error"==e?" is-danger":" is-info";let n=Math.floor(Math.random()*Math.floor(64e3)),s=`<div style="display: none;" id="ntf-${n}" class="bmi-notification${e}">\n <button class="bmi-times-button" onclick="jQuery.bmi.hideAlert(this)">&times;</button>\n <div class="bmi-cf">\n <div class="bmi-left bmi-alert-icon"><div class="bmi-icon-bg"></div></div>\n <div class="bmi-left bmi-alert-msg-title">\n <div class="bmi-title${e}">Backup Migration</div>\n <div>${i}</div>\n </div>\n </div>\n </div>`;t(".bmi-notification-box").prepend(s);let r=t(`#ntf-${n}`);r.css({opacity:0,display:"block"});let a=r.outerWidth();r.outerHeight();r.css({right:"-35vw","font-size":"0px",width:0,padding:0,opacity:"0"}),r.animate({right:"15px",width:a,padding:"1rem 2rem 1rem 1.5rem",opacity:"1"},{duration:200,queue:!1}),r.animate({"font-size":"16px"},{duration:300,queue:!1}),setTimeout(()=>{t(`#ntf-${n}`).css({width:""})},250),setTimeout(()=>{r.animate({"font-size":"0px"},{duration:200,queue:!1}),r.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){r.remove()})},o)},_msg:function(e){"msg"==e.status&&(void 0===e.level&&(e.level="info"),t.bmi.alert(e.level,e.why,3e3),console.log("Backup-migration: ","["+e.level.toUpperCase()+"]",e.why))},hideAlert:function(e){let i=t(e).parents(".bmi-notification");i.animate({"font-size":"0px"},{duration:200,queue:!1}),i.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){i.remove()})},modal:function(e=!1){let i=!1;return 0!=e&&(i=document.getElementById(e)),{clearModal:function(){i.querySelectorAll(".customselect").forEach(function(t){t.classList.remove("active")}),i.querySelectorAll('input[type="text"]').forEach(function(t){t.value="",t.setAttribute("value","")})},open:function(e=function(){}){i.classList.add("before-open"),setTimeout(function(){i.classList.add("open"),t("html")[0].style.overflowY="hidden",setTimeout(e,410)},10)},close:function(e=function(){}){i.offsetWidth>0&&i.offsetHeight>0?(i.classList.add("before-close"),setTimeout(function(){i.classList.add("closed"),setTimeout(function(){i.classList.remove("before-open"),i.classList.remove("open"),i.classList.remove("before-close"),i.classList.remove("closed"),t.bmi.modal(i.id).clearModal(),e()},410)},10)):(i.classList.remove("before-open"),i.classList.remove("open"),i.classList.remove("before-close"),i.classList.remove("closed"),e()),t("html")[0].style.overflowY="auto"},closeAll:function(){document.querySelectorAll(".modal").forEach(function(e){t.bmi.modal(e.id).close()}),t("html")[0].style.overflowY="auto"}}},json:function(e){return new Promise(function(i,o){try{return i(JSON.parse(e))}catch(n){if("string"!=typeof e)return o(!1);{let n=t.bmi.reverse(e).indexOf("}");n=0==n?e.length:-n,e=e.slice(e.indexOf("{"),n);try{return i(JSON.parse(e))}catch(t){return o(!1)}}}})},reverse:function(e){return"string"==typeof e?""===e?"":t.bmi.reverse(e.substr(1))+e.charAt(0):e},ajax:function(e,i={}){return new Promise(function(o,n){function s(t,i){i||(i=t),console.log("------- BACKUP MIGRATION ERROR START -------"),!1===t?(console.log("Call: ",e),console.log("Status: ",i.status),console.log("Error: ",i.responseText)):console.log(i),console.log("-------- BACKUP MIGRATION ERROR END --------\n\n"),n(t,i.responseText)}i.action="backup_migration",i.token="bmi",i.f=e,t.post(ajaxurl,i).done(e=>{t.bmi.json(e).then(function(t){o(t)}).catch(function(t){s("json")})}).fail(t=>{s(!1,t)})})},tooltips:{init:function(){let e={delay:200,debug:!1,delayTouch:[100,200],interactive:!1,distance:0,side:"top",contentAsHTML:!1,maxWidth:460,triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},theme:["bmi-tooltip","bmi-tt-default","bmi-tt-default-customized"],repositionOnScroll:!0,functionReady:function(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}},i=t(".tooltip"),o=t(".tooltip-html"),n=t(".premium-wrapper"),s=JSON.parse(JSON.stringify(e));s.contentAsHTML=!0,s.interactive=!0;for(let o=0;o<i.length;++o){let n=i[o],s=n.getAttribute("data-top"),r=n.getAttribute("side"),a=JSON.parse(JSON.stringify(e));a.content=n.getAttribute("tooltip"),s&&(a.distance=parseInt(s)),r&&r.trim().length>0&&(a.side=r),t(n).tooltipster(a)}for(let e=0;e<o.length;++e){let i=o[e],n=i.getAttribute("side"),r=JSON.parse(JSON.stringify(s));r.content=i.getAttribute("tooltip"),n&&n.trim().length>0&&(r.side=n),t(i).tooltipster(r)}for(let i=0;i<n.length;++i){let o=n[i],s=JSON.parse(JSON.stringify(e));s.contentAsHTML=!0,s.interactive=!0,s.maxWidth=500,o.getAttribute("tooltip")?s.content=o.getAttribute("tooltip"):s.content=t("#premium-tooltip")[0].innerHTML,o.getAttribute("side")&&(s.side=o.getAttribute("side")),t(o).tooltipster(s)}},hideAll:function(e=!1){function i(){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}e?i():setTimeout(i,10)}},collapsers:{toggle:function(i){if(!0===e)return;e=!0;let o=i.getAttribute("group");i.classList.contains("active")?t.bmi.collapsers.close(i):t.bmi.collapsers.open(i,o)},open:function(i,o){t.bmi.collapsers.closeGroup(o),t(i).addClass("active"),t(i).find(".content").show(300),setTimeout(function(){e=!1},300)},close:function(i){t(i).removeClass("active"),t(i).find(".content").hide(300),setTimeout(function(){e=!1},300)},closeGroup:function(i){t('.collapser[group="'+i+'"]').removeClass("active"),t('.collapser[group="'+i+'"]').find(".content").hide(300),setTimeout(function(){e=!1},300)},closeAll:function(){t(".collapser").removeClass("active"),t(".collapser").find(".content").hide(300),setTimeout(function(){e=!1},300)}},isUrlValid:function(t){return!!new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i").test(t)},bytesToHuman:function(t,e,i,o,n){return(e=Math,i=e.log,o=1024,n=i(t)/i(o)|0,t/e.pow(o,n)).toFixed(2)+" "+(n?"KMGTPEZY"[--n]+"B":"Bytes")},getCurrentBackups:function(e=function(){}){t("#reloading-bm-list").length>0&&"none"==t("#reloading-bm-list")[0].style.display&&(t("#reloading-bm-list").show(),t.bmi.ajax("get-current-backups",{}).then(function(i){t("#reloading-bm-list").hide(),e(i)}).catch(function(t){console.log(t)}))},fillWithNewBackups:function(e,i=function(){}){backups={},t("#bmi_restore_tbody").html("");let o=t("#bmi-manual-locked").text().trim(),n=Object.keys(e).sort(function(t,i){return+new Date(e[t][1].replace(/\-/g,"/"))-+new Date(e[i][1].replace(/\-/g,"/"))}),s=0;for(;s<n.length;++s){let i=n[s],r="locked"===e[i][5];i=(i=i.replace(/ /g,"")).trim();let a="bmi_br_backup_"+s,l=t(".br_tr_template").clone();l.removeClass("br_tr_template"),l[0].style.display="none",l.find(".br_label").attr("for",a),l.find(".br_checkbox").attr("id",a),l.find(".bc-download-btn").attr("href",t("#BMI_BLOG_URL").text().trim()+"/?backup-migration=BMI_BACKUP&backup-id="+i),l.find(".bc-logs-btn").attr("href",t("#BMI_BLOG_URL").text().trim()+"/?backup-migration=BMI_BACKUP_LOGS&backup-id="+i),l.find(".br_date").text(e[i][1]),l.find(".br_name").text(i),l.find(".br_size").text(t.bmi.bytesToHuman(e[i][4])+" ("+e[i][2]+")"),0!=(""+e[i][6]).trim().length&&e[i][6]+""!="false"||(l.find(".bc-locked-btn").addClass("forever"),l.find(".bc-locked-btn").attr("tooltip",o),r=!0),r?l.find(".bc-unlocked-btn").hide():l.find(".bc-locked-btn").hide(),l.prependTo("#bmi_restore_tbody"),e[i].push(i),backups[a]=e[i]}if(0==s){let e=t("#bmi_restore_tbody").data("empty");t("#bmi_restore_tbody").html('<tr><td class="center text-muted" colspan="100%">'+e+"</td></tr>")}t.bmi.tooltips.init(),t.bmi.showMoreBackups(),i()},showMoreBackups:function(e){backups={};let i=t("#bmi_restore_tbody").find("tr:hidden");for(let e=0;e<i.length&&e<10;++e)setTimeout(function(){t(i[e]).show(300)},50*e);i.length-10<=0?t("#load-more-backups-wrp").hide(300):t("#load-more-backups-wrp").show(300)},reloadBackups:function(e=function(){}){t.bmi.getCurrentBackups(function(i){t.bmi.fillWithNewBackups(i.backups,function(){e(),t("#backups-select-all").prop("checked",!1),t(".del-all-btn-wrp").hide(300)})})},hideAllLists:function(){let e=t(".dropdown-open");if(!(e.length<=0))for(let i=0;i<e.length;++i){let o=t(e[i]);o.hasClass("ignored-open")?o.removeClass("ignored-open"):(o.hide(300),o.removeClass("dropdown-open"),t(o[0].closest(".bmi-dropdown")).removeClass("active"))}},setOption:function(e,i=null,o=!1){let n=e.find(".dropdown-options");e.attr("data-optioner")&&(n=t(".optioner-"+e.attr("data-optioner"))),n.find(".active-option").removeClass("active-option"),!1!==o&&(i=n.find('.dropdown-option[data-value="'+o+'"]')),t(i).hasClass("active-option")||(e.find(".dropdown-title").text(i.text()),e.attr("data-selected",i.data("value")),i.addClass("active-option"),!1===o&&e.change(),t.bmi.hideAllLists())},prepareFile:function(e,i){let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(i)),o.setAttribute("download",e),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),t.bmi.alert("success",t("#bmi-download-should-start").text(),3e3)}}})}),jQuery(document).ready(function(t){t(".collapser .header").on("click",function(e){e.preventDefault();let i=t(this).parent(".collapser")[0];t.bmi.collapsers.toggle(i)}),t(".bmi_will_collapse").on("change",function(e){e.preventDefault();let i=!1;"radio"==this.getAttribute("type")&&"false"==this.getAttribute("value")&&(i=!0),$child=t(this).data("if-checked"),!0!==this.checked||i?t("#"+$child).hide(300):t("#"+$child).show(300)}),t(".collapser-openner").on("click",function(e){e.preventDefault();let i="configuration",o=t(this).data("el");t(this).data("group")&&(i=t(this).data("group")),t.bmi.collapsers.open(o,i),setTimeout(function(){t([document.documentElement,document.body]).animate({scrollTop:t(o).offset().top-50+"px"},300)},300)}),function(){let e=t(".bmi_will_collapse");for(let i=0;i<e.length;++i){let o=!1;$trigger=e[i],$child=t($trigger).data("if-checked"),"radio"==$trigger.getAttribute("type")&&"false"==$trigger.getAttribute("value")&&(o=!0),!0===$trigger.checked?t("#"+$child).show():t("#"+$child).hide()}}()}),jQuery(document).ready(function(t){var e=!0,i=!1;t.bmi.crons=function(){function o(){!function(e,i){t.bmi.ajax("calculate-cron",e).then(function(e){"success"==e.status?i(e):(i(!1),t.bmi._msg(e))}).catch(function(t){i(!1),console.log(t)})}({type:t('[data-id="cron-period"]').attr("data-selected"),day:t('[data-id="cron-day"]').attr("data-selected"),week:t('[data-id="cron-week"]').attr("data-selected"),hour:t('[data-id="cron-hour"]').attr("data-selected"),minute:t('[data-id="cron-minute"]').attr("data-selected"),keep:t('[data-id="cron-keep-backups"]').attr("data-selected"),enabled:!0==!t("#cron-btn-toggle")[0].checked},function(i){"success"===i.status&&!1!==i?(t(".cron-time-server").tooltipster("option","interactive",!1),t(".cron-time-server").tooltipster("option","contentAsHTML",!0),!0===t("#cron-btn-toggle")[0].checked&&(i.data="---"),t(".cron-time-server").tooltipster("content","<b>"+t("#bmi-next-cron").text()+"</b>"+i.data+"<br><b>"+t("#bmi-current-time").text()+"</b>"+i.currdata),e?e=!1:t.bmi.alert("success",t("#bmi-cron-updated").text(),1500)):e?e=!1:t.bmi.alert("error",t("#bmi-cron-updated-fail").text(),2500)})}function n(e){"month"==e?(t(".cron-the").show(),t('[data-id="cron-day"]').show(),t('[data-id="cron-week"]').hide(),t("#cron-on-word").show()):"week"==e?(t(".cron-the").hide(),t('[data-id="cron-day"]').hide(),t('[data-id="cron-week"]').show(),t("#cron-on-word").show()):(t(".cron-the").hide(),t('[data-id="cron-day"]').hide(),t('[data-id="cron-week"]').hide(),t("#cron-on-word").hide())}!0!==i&&(i=!0,t("#bmi").on("change",'[data-id="cron-period"]',function(t){o(),n(t.target.getAttribute("data-selected"))}),t("#bmi").on("change",'[data-id="cron-day"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-week"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-hour"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-minute"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-keep-backups"]',function(t){t.target.getAttribute("data-selected");o()}),t("#i-backup-cron").on("click",function(){t(".cron-backups").find(".turned-off").is(":visible")&&(t("#cron-btn-toggle").prop("checked",!1),t(".cron-backups").removeClass("disabled"),o(),t(".cron-backups").find(".turned-on").css({opacity:0}),t(".cron-backups").find(".turned-off").css({opacity:0}),t(".cron-backups").find(".turned-on").show(),t(".cron-backups").find(".turned-on").css({opacity:1}),setTimeout(function(){t(".cron-backups").find(".turned-off").hide()},300))}),t("#cron-btn-toggle").on("change",function(){this.checked?t(".cron-backups").addClass("disabled"):t(".cron-backups").removeClass("disabled"),o()}),n(t('[data-id="cron-period"]')[0].getAttribute("data-selected")),o())}}),jQuery(document).ready(function(t){t.bmi.dropdowns={init:function(){let e=t("#bmi");function i(e="null",i="---"){let o=t(".option-template").clone();return o.removeClass("option-template"),o.attr("data-value",e),o.text(i),o}function o(o){if("none"!=o.style.display){o.style.display="none";let n=t(o),s=n.find("option"),r=function(e="---"){let i=t(".dropdown-template").clone();return i.removeClass("dropdown-template"),i.find(".dropdown-title").text(e),i}(function(t){let e="";for(let i=0;i<t.length;++i){let o=t[i].innerText;e.length<o.length&&(e=o)}return e}(s));r=function(e,o){let n=t(e).find(".dropdown-options");t(e).attr("data-optioner")&&(n=t(".optioner-"+t(e).attr("data-optioner")));for(let t=0;t<o.length;++t){let e=o[t];n.append(i(e.value,e.innerText))}return e}(r,s);let a=s[0].value,l=o.getAttribute("data-parent"),c=o.getAttribute("data-classes"),p="true"===o.getAttribute("data-hide");if(n.attr("data-def")&&(a=n.attr("data-def")),t(r).attr("data-id",o.id),t(r).attr("class",((null!=c?c:"")+" bmi-dropdown").trim()),t(r).insertBefore(n),null!==l){let e=parseInt(864197532*Math.random()+123456789);t(r).attr("data-optioner",e),t(r).find(".dropdown-options").attr("data-oparent",e),t(r).find(".dropdown-options").addClass("optioner-"+e),t(r).find(".dropdown-options").appendTo(l),t(l).css({position:"relative"})}let u=t(r).clone();if(!u)return;u[0].style.visibility="hidden",e.append(u);let d=u.width();u.remove(),t.bmi.setOption(t(r),null,a),t(r).find(".dropdown-title")[0].style.minWidth=d+10+"px",p&&t(r).hide()}}!function(){let t=e.find("select");for(let e=0;e<t.length;++e)o(t[e])}(),t.bmi.crons(),e.on("click",function(e){t(e.target).hasClass("bmi-dropdown")||e.target.closest(".bmi-dropdown")||t.bmi.hideAllLists()}),e.on("click",".dropdown-title",function(e){$dropdown=t(e.target.closest(".bmi-dropdown")),function(e){let i=e.find(".dropdown-options");if(e.attr("data-optioner")){(i=t(".optioner-"+e.attr("data-optioner"))).css({position:"absolute"});let o=e[0].offsetWidth,n=e[0].offsetLeft+240,s=e[0].offsetTop+e[0].offsetHeight+5;i.css({maxWidth:o+"px",minWidth:o+"px",top:s+"px",left:n+"px"})}i.hasClass("dropdown-open")?(e.removeClass("active"),i.removeClass("dropdown-open"),i.hide(300)):(e.addClass("active"),i.addClass("dropdown-open"),i.addClass("ignored-open"),i.show(300))}($dropdown),t.bmi.hideAllLists()}),e.on("click",".dropdown-option",function(e){t(e.target.closest(".dropdown-options")).attr("data-oparent")?($dropdown=t('.bmi-dropdown[data-optioner="'+t(e.target.closest(".dropdown-options")).attr("data-oparent")+'"]'),$option=t(e.target),t.bmi.setOption($dropdown,$option)):($dropdown=t(e.target.closest(".bmi-dropdown")),$option=t(e.target),t.bmi.setOption($dropdown,$option))})}}}),jQuery(document).ready(function(t){var e,i,o=!1,n=!1,s=0;let r=0,a=0,l=null,c=null,p=null,u=!1,d=!1,_=4500,f=!1,h=!1,m=null,g=!1,b=!1,w=!1,v={};function y(e){return $cb=t("#"+e).is(":checked"),!0===$cb?"true":"false"}function k(){return size=0,t("#files-group-plugins").is(":checked")&&(size+=parseInt(t('label[for="files-group-plugins"]').find(".value").attr("bytes"))),t("#files-group-uploads").is(":checked")&&(size+=parseInt(t('label[for="files-group-uploads"]').find(".value").attr("bytes"))),t("#files-group-themes").is(":checked")&&(size+=parseInt(t('label[for="files-group-themes"]').find(".value").attr("bytes"))),t("#files-group-other-contents").is(":checked")&&(size+=parseInt(t('label[for="files-group-other-contents"]').find(".value").attr("bytes"))),t("#files-group-wp-install").is(":checked")&&(size+=parseInt(t('label[for="files-group-wp-install"]').find(".value").attr("bytes"))),size}function x(e,i){if(a+=1,r+=parseInt(i.bytes),i.bytes<=1e4)t("#bmi-scan-"+e).find(".value").text("(0 MB)");else{let o=(parseInt(i.bytes)/1024/1024).toFixed(2);t("#bmi-scan-"+e).find(".value").text("("+o+" MB)")}t("#bmi-scan-"+e).find(".value").attr("bytes",parseInt(i.bytes)),5==a&&(t("#bmi-scan-total").find(".value").text("("+t.bmi.bytesToHuman(r)+")"),t("#bmi-scan-total").find(".value").attr("bytes",parseInt(r)),T())}function C(e){t.bmi.ajax("scan-directory",{folder:e}).then(function(t){x(e,t)}).catch(function(t){x(t,{bytes:"0",readable:"0 B"})})}function $(e=!1,i=function(){}){t.bmi.ajax("is-running-backup",{}).then(function(o){"success"==o.status?i(!1):1==e?i(!0):t.bmi._msg(o)}).catch(function(t){i(!1),console.log(t)})}function T(){let e=parseInt(t("#bmi-scan-total").find(".value").attr("bytes")),i=parseInt(k());t("#files-group-backup").is(":checked")||(e=0,i=0);let o=((e-i)/1024/1024).toFixed(2),n=(i/1024/1024).toFixed(2);"0.00"==o&&(o="0"),"0.00"==n&&(n="0"),t("#esta-exclude").text(o+" MB"),t("#esta-size-for").text(n+" MB")}function I(){t("#prenotice-modal .prenotice").hide(),t("#prenotice-size").text(t.bmi.bytesToHuman(k())),t(".prenotic-3").show(),"true"!==y("database-group-backup")||"true"!==y("database-group-backup")||"true"===y("files-group-backup")&&("true"!==y("files-group-plugins")&&"true"!==y("files-group-themes")&&"true"!==y("files-group-uploads")&&"true"!==y("files-group-wp-install")&&y("files-group-other-contents"),1)||t(".prenotic-6").show(),"true"===y("database-group-backup")||"true"===y("database-group-backup")||"true"!==y("files-group-backup")||"true"!==y("files-group-plugins")&&"true"!==y("files-group-themes")&&"true"!==y("files-group-uploads")&&"true"!==y("files-group-wp-install")&&"true"!==y("files-group-other-contents")||t(".prenotic-5").show(),"true"===y("database-group-backup")&&"true"===y("files-group-backup")&&"true"===y("files-group-plugins")&&"true"===y("files-group-themes")&&"true"===y("files-group-uploads")&&"true"===y("files-group-other-contents")||t(".prenotic-4").show(),t("#prenotice-modal .prenotice:visible").css({background:""});let e=t("#prenotice-modal .prenotice"),i=[];for(let t=0;t<e.length;++t)"none"!==e[t].style.display&&i.push(e[t]);for(let t=0;t<i.length;t+=2)i[t].style.background="#f8f8f8"}function O(t,e=function(){}){let i=window.location.protocol.includes("https");t=t.includes("https")?t.slice(5):t.slice(4),t=i?"https"+t:"http"+t;try{window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp.onloadend=function(){4==xmlhttp.readyState&&200==xmlhttp.status?e(xmlhttp.responseText):e(!1)},xmlhttp.open("GET",t),xmlhttp.send()}catch(t){e(!1)}}function E(i,r){if(!1===i)return;let a=i.split("\n"),c=s;s=a.length,c>0&&c--;for(let i=c;i<a.length;++i){let c=a[i],p=document.createElement("DIV"),_="";if("[INFO]"==c.substr(0,6))_="blue";else if("[SUCCESS]"==c.substr(0,9))_="green";else if("[WARN]"==c.substr(0,6))_="orange";else if("[ERROR]"==c.substr(0,7))_="red";else if("[END-CODE]"==c.substr(0,10))_="hide_so_much";else if("[STEP]"==c.substr(0,6))p.classList.add("bold"),p.classList.add("step"),t("#restore-progress-modal").hasClass("open")?t("#restore_current_step").text(c.slice(29)):t("#current_step").text(c.slice(29));else if(c&&c.trim().length>0&&"["!=c[0]){s--;continue}_.length>0&&p.classList.add(_),p.style.display="none",p.innerText=c,setTimeout(function(){if(r.appendChild(p),c&&c.trim().includes("[END-CODE]")&&(!0===h||!0===w||!0===b)){let i=c;!0===b?i.includes("001")?(l=".cli_download",b=!1,t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%",J(!0)):Q():!0===w?(i.includes("001")?setTimeout(function(){W()},1e3):Q(),d=!1,w=!1):(h=!1,i.includes("001")&&(o=!0,n=!0,clearTimeout(e),u=!1,D({filename:m},!0)),i.includes("002")&&P(),i.includes("003")&&(t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3)))}t(p).show(55),r.scrollTop=r.scrollHeight},55*i)}setTimeout(function(){r.scrollTop=r.scrollHeight},110)}function z(e=0,s=1e3,r=null){if(c==e)return;c=e,clearInterval(i);let a=parseFloat(t(".progress-percentage")[0].style.left)-1;if(t("#restore-progress-modal").hasClass("open")&&(a=parseFloat(t("#restore-progress-modal .progress-percentage")[0].style.left)-1),a>e&&0!=e)return;let l=e-a,p=a,d=Math.abs(Math.floor(s/l));i=setInterval(function(){if(p+=1,t("#restore-progress-modal").hasClass("open")?(t("#restore-progress-modal .progress-active-bar")[0].style.width=p.toFixed(2)+"%",t("#restore-progress-modal .progress-percentage")[0].style.left=p.toFixed(2)+"%",t("#restore-progress-modal .progress-percentage")[0].innerText=p.toFixed(0)+"%"):(t(".progress-active-bar")[0].style.width=p.toFixed(2)+"%",t(".progress-percentage")[0].style.left=p.toFixed(2)+"%",t(".progress-percentage")[0].innerText=p.toFixed(0)+"%"),p>=100&&clearInterval(i),p>=100&&null!=r&&(c=null,t("#backup-progress-modal").hasClass("open"))){o=!0,n=!0,D(r,0==u)}p>e&&clearInterval(i)},d)}t("#live-log-toggle").on("click",function(){t(".expanded-logs").length>0?t(this).text(t(this).data("hide")):t(this).text(t(this).data("show")),t("#live-log-wrapper").toggleClass("expanded-logs")}),t("#backup-stop").on("click",function(){t.bmi.ajax("stop-backup",{}).then(function(e){"success"==e.status?t.bmi.alert("success",t("#bmi-abort-soon").text(),3e3):t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#bmi-force-backup-to-stop").on("click",function(e){e.preventDefault(),t.bmi.alert("info",t("#bmi-force-stop-in-progress").text(),3e3),t.bmi.ajax("force-backup-to-stop").then(function(e){t.bmi.alert("success",t("#bmi-force-stop-success").text(),6e3)}).catch(function(e){t.bmi.alert("error",t("#failed-to-stop").text(),6e3),console.log(e)})}),t("#bmi-force-restore-to-stop").on("click",function(e){e.preventDefault(),t.bmi.alert("info",t("#bmi-force-stop-in-progress").text(),3e3),t.bmi.ajax("force-restore-to-stop").then(function(e){t.bmi.alert("success",t("#bmi-force-stop-success").text(),6e3)}).catch(function(e){t.bmi.alert("error",t("#failed-to-stop").text(),6e3),console.log(e)})}),t("#bmi_restore_tbody").on("click",".bc-unlocked-btn",function(e){e.preventDefault();let i=e.target,o=i.closest("tr").querySelector(".br_name").innerText.trim();t.bmi.ajax("lock-backup",{filename:o}).then(function(e){"success"==e.status?(t.bmi.alert("success",t("#bmi-lock-success").text(),6e3),t(i.closest("tr").querySelector(".bc-unlocked-btn")).hide(),t(i.closest("tr").querySelector(".bc-locked-btn")).show()):(t.bmi.alert("error",t("#bmi-lock-error").text(),8e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#files-group-backup").on("change",T),t(".basic-file-exlusion").on("change",'input[type="checkbox"]',T),t("#bmi_restore_tbody").on("click",".bc-locked-btn",function(e){if(e.preventDefault(),t(e.target).hasClass("forever"))return;let i=e.target,o=i.closest("tr").querySelector(".br_name").innerText.trim();t.bmi.ajax("unlock-backup",{filename:o}).then(function(e){"success"==e.status?(t.bmi.alert("success",t("#bmi-unlock-success").text(),3e3),t(i.closest("tr").querySelector(".bc-locked-btn")).hide(),t(i.closest("tr").querySelector(".bc-unlocked-btn")).show()):(t.bmi.alert("error",t("#bmi-unlock-error").text(),3e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#bmi_restore_tbody").on("click",".bc-url-btn",function(e){let i=e.target.closest("tr").querySelector(".bc-download-btn").getAttribute("href");t.bmi.clipboard(i)}),t("#bmi_restore_tbody").on("click",".bc-remove-btn",function(e){let i=e.target.closest("tr").querySelector(".br_name").innerText.trim();p=[i],t("#delete-confirm-modal").find(".text2").hide(),t("#delete-confirm-modal").find(".text1").show(),t.bmi.modal("delete-confirm-modal").open()}),t("#sure_delete").on("click",function(){t.bmi.ajax("delete-backup",{filenames:p}).then(function(e){p=null,"success"==e.status?(t.bmi.reloadBackups(),t.bmi.modal("delete-confirm-modal").close(),t.bmi.alert("success",t("#bmi-remove-success").text(),3e3)):(t.bmi.alert("warning",t("#bmi-remove-error").text(),3e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#add-exclusion-rule").on("click",function(e){e.preventDefault();let i=t(".exclusion_template").clone();i[0].classList.remove("exclusion_template"),i[0].style.display="none",t("#bmi_exclusion_rules").append(i),i.show(300)}),t("#bmi_exclusion_rules").on("click",".kill-exclusion-rule",function(e){e.preventDefault(),$el=e.target,$parent=$el.closest(".exclude-row"),$parent&&(t($parent).hide(300),setTimeout(function(){$parent.remove()},320))}),t("#i-backup-creator").on("click",function(){if(!isNaN(k()))return k()/1024/1024>1e3*parseInt(t("#BMI_REV").text().trim())?j():void("true"===y("database-group-backup")||"true"===y("files-group-backup")&&("true"===y("files-group-plugins")||"true"===y("files-group-themes")||"true"===y("files-group-uploads")||"true"===y("files-group-wp-install")||"true"===y("files-group-other-contents"))?(I(),$(!1,function(){t.bmi.modal("prenotice-modal").open()})):t.bmi.alert("warning",t("#bmi-no-selected").text(),3e3));t.bmi.alert("warning",t("#bmi-preb-processing").text(),3e3)}),t("#BFFSIN").on("change",function(t){let e=parseInt(this.value);isNaN(e)?this.value=1:this.value=e>9999?9999:e<=0?1:e}),t(".save-btn").on("click",function(e){e.preventDefault();let i={},o=t(this.closest(".save-action")).data("save");if(o){if("save-storage"==o)i.directory=t("#bmi_path_storage_default").val(),i.access="true"===t('[name="radioAccessViaLink"]:checked').val()?"true":"false";else if("save-file-config"==o){i.database_group=y("database-group-backup"),i.files_group=y("files-group-backup"),i["files-group-plugins"]=y("files-group-plugins"),i["files-group-uploads"]=y("files-group-uploads"),i["files-group-themes"]=y("files-group-themes"),i["files-group-other-contents"]=y("files-group-other-contents"),i["files-group-wp-install"]=y("files-group-wp-install"),i.files_by_filters=y("files_by_filters"),i.ex_b_fs=y("ex_b_fs"),i.BFFSIN=t("#BFFSIN").val()?t("#BFFSIN").val():"1",i.ex_b_names=y("ex_b_names"),i.ex_b_fpaths=y("ex_b_fpaths"),i.ex_b_dpaths=y("ex_b_dpaths");let e=[],o=t("#bmi_exclusion_rules").find(".exclude-row");for(let i=0;i<o.length;++i){let n=t(o[i]),s=n.find(".exclusion_txt").val(),r=n.find(".exclusion_position").find(".bmi-dropdown").data("selected")+"",a=n.find(".exclusion_where").find(".bmi-dropdown").data("selected")+"";e.push({txt:s,pos:r,whr:a})}i["dynamic-names"]=e,i["dynamic-fpaths-names"]=t("#dynamic-fpaths-names").val().split("\n"),i["dynamic-dpaths-names"]=t("#dynamic-dpaths-names").val().split("\n")}else if("store-config"==o)i.name=t("#backup_filename").val().trim();else{if("save-other-options"!=o)return;i.email=t("#email-for-notices").val().trim(),i.email_title=t("#email-title-for-notices").val().trim(),i.schedule_issues=y("scheduled-issues"),i.experiment_timeout=y("experimental-timeout"),i.experimental_hard_timeout=y("experimental-hard-timeout"),i.php_cli_disable_others=y("cli-disable-others"),i.php_cli_manual_path=t("#cli-manual-path").val().trim(),i.download_technique=y("download-technique"),i.uninstall_config=y("uninstalling-configs"),i.uninstall_backups=y("uninstalling-backups"),i.normal_timeout=y("normal-timeout"),i.db_queries_amount=t("#db_queries_amount").val().trim(),i["bmi-restore-splitting"]=y("bmi-restore-splitting")}t.bmi.ajax(o,i).then(function(e){"success"==e.status?e.errors<=0?(t.bmi.alert("success",t("#bmi-save-success").text(),3e3),t.bmi.collapsers.closeAll()):t.bmi.alert("warning",t("#bmi-save-issues").text(),3e3):t.bmi._msg(e)}).catch(function(t){console.log(t)})}}),t(".close-chapters").on("click",function(e){e.preventDefault(),t.bmi.collapsers.closeAll()}),t("#rescan-for-backups").on("click",function(){t.bmi.reloadBackups()}),t(".storage-checkbox").on("click",function(){let e=t(this).attr("data-toggle"),i=t(t(this)[0].closest(".tab2-item"));t(this).is(":checked")?(t("#"+e).show(300),i.addClass("activeList")):(t("#"+e).hide(300),i.removeClass("activeList"))});var S=0;function A(e=function(){}){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_full.log&backup-id=current&t="+ +new Date,function(i){if(!i)return e();let o=i.split("\n").slice(0,1)[0];""===o.trim()?(o=i.split("\n").slice(0,2)[1],i=i.split("\n").slice(2).join("\n")):i=i.split("\n").slice(1).join("\n");let n=t(".log-wrapper").find("pre")[0],s=t("#bmi-making-archive").text().trim();if(o&&0!=o&&void 0!==o&&t("#current_step").text().trim().slice(0,s.length)==s){let e=document.getElementById("bmi_counter_magic");if(e){let i=parseInt(e.innerText);S=parseInt(o.split("/")[0]),isNaN(i)||isNaN(S)||(z(parseInt(o.split("/")[0])/parseInt(o.split("/")[1])*100),async function(t,e,i,o){let n=null,s=function(r){if(S>i)return;n||(n=r);let a=Math.min((r-n)/o,1);t.innerText=Math.floor(a*(i-e)+e),a<1&&window.requestAnimationFrame(s)};window.requestAnimationFrame(s)}(e,i,S,2e3),"---"===t("#bmi_magic_max_count").text()&&100!=parseInt(o.split("/")[1])&&(t("#bmi_magic_max_count").text(parseInt(o.split("/")[1])),t("#entire_magic_counter").is(":hidden")&&t("#entire_magic_counter").show()))}else{let e=parseInt(o.split("/")[1]);100==e&&(e="---"),t("#current_step").html(s+' <span id="entire_magic_counter">(<span id="bmi_counter_magic">0</span>/<span id="bmi_magic_max_count">'+e+"</span>)</span>"),(isNaN(parseInt(e))||"---"==e)&&t("#entire_magic_counter").hide()}}i&&0!=i&&void 0!==i&&E(i,n),e()})}function B(){t(".log-wrapper").find("pre")[0].innerText="",z(0),setTimeout(function(){A(function(){!function t(){A(function(){clearTimeout(e),e=setTimeout(function(){!0===u&&t()},1500)})}()})},300)}function R(i=!0){!0===i&&(t(".log-wrapper").find("pre")[0].innerText="",z(0)),N(function(){clearTimeout(e),function t(){N(function(){e=setTimeout(function(){!0!==d&&!0!==b||t()},800)})}()})}function L(t=function(){}){$(!0,function(e){t(e)})}function M(e=!1,i=function(){}){t.bmi.ajax("reset-latest",{}).then(function(o){!0===e?i():"success"==o.status?(i(),t.bmi.modal("backup-progress-modal").open()):t.bmi._msg(o)}).catch(function(t){console.log(t)})}function D(s,r=!1){(o&&n||r)&&setTimeout(function(){u=!1,t("#backup-progress-modal").hasClass("open")&&(t.bmi.modal("backup-progress-modal").close(),"true"==t('[name="radioAccessViaLink"]:checked').val()?t("#accessible-at-section").show():t("#accessible-at-section").hide(),t.bmi.modal("backup-success-modal").open()),clearInterval(i),clearTimeout(e);let o=t("#BMI_BLOG_URL").text().trim()+"?backup-migration=BMI_BACKUP&backup-id="+s.filename+"&t="+ +new Date,n=t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date;t("#text-input-copy")[0].value=o,t("#download-backup-url").attr("href",o),t("#download-backup-log-url").attr("href",n),t.bmi.reloadBackups(),setTimeout(function(){clearInterval(i),t(".log-wrapper").find("pre")[0].innerText="",t(".progress-active-bar")[0].style.width="0%",t(".progress-percentage")[0].style.left="0%",t(".progress-percentage")[0].innerText="0%"},300)},700)}function P(i=!1){setTimeout(function(){$(!0,function(o){if(!0===o)return;t.bmi.modal("backup-progress-modal").close(),clearTimeout(e),t.bmi.modal("backup-progress-modal").close(),t("#backup-error-pre").text(t("#bmi-loading-translation").text().trim()),t.bmi.modal("backup-error-modal").open(),O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date,function(o){if(clearTimeout(e),0!=o||i){let e=t("#backup-error-pre")[0];t("#backup-error-pre").text(""),s=0,E(o,e)}else P(!0)})})},2e3)}function j(){t.bmi.modal("bfs-modal").open()}function q(e){let i=e.status,o=parseInt(e.errors),n=parseInt(e.iteratio),s=parseInt(e.sf);if(!0===i&&-1===n)return g=!1,window.onbeforeunload=null,t(".backup-minimize").removeClass("disabled"),D({filename:m},!0);if(!isNaN(s)&&s>-1&&(g.filessofar=s),!isNaN(n)&&n>-1&&(g.iteratio+=1),isNaN(o)||o>0||0==i){if(!isNaN(o)&&o>4)return h=!1,m=!1,g=!1,window.onbeforeunload=null,t(".backup-minimize").removeClass("disabled"),P();setTimeout(function(){return F(g,o)},1500)}else F(g,o)}function F(t,e=0){!1===g&&(t.iteratio=0,g=t),function(t,e,i=0){let o=new XMLHttpRequest;o.open("POST",t.url,!0),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Content-Accept","*/*"),o.setRequestHeader("Access-Control-Allow-Origin","*"),o.setRequestHeader("Content-ConfigDir",t.config_dir),o.setRequestHeader("Content-Content",t.content_dir),o.setRequestHeader("Content-Backups",t.backup_dir),o.setRequestHeader("Content-Identy",t.identy),o.setRequestHeader("Content-Url",t.url),o.setRequestHeader("Content-Abs",t.abs_dir),o.setRequestHeader("Content-Dir",t.root_dir),o.setRequestHeader("Content-Manifest",t.manifest),o.setRequestHeader("Content-Name",t.backupname),o.setRequestHeader("Content-Safelimit",t.safelimit),o.setRequestHeader("Content-Start",t.start),o.setRequestHeader("Content-Filessofar",t.filessofar),o.setRequestHeader("Content-Total",t.total_files),o.setRequestHeader("Content-Rev",t.rev),o.setRequestHeader("Content-It",t.iteratio),o.setRequestHeader("Content-Browser",!0),o.onload=function(){if(200===o.status){let t=o.getResponseHeader("Content-Finished");if(void 0!==t&&t&&"true"==t)return e({status:!0,iteratio:-1,sf:-1,errors:i=0});let n=o.getResponseHeader("Content-It"),s=o.getResponseHeader("Content-Filessofar");return e(void 0!==n&&n?{status:!0,iteratio:n,sf:s,errors:i}:{status:!1,iteratio:-1,sf:-1,errors:++i})}return e({status:!1,iteratio:-1,sf:-1,errors:++i})},o.onerror=function(){return e({status:!1,iteratio:-1,sf:-1,errors:++i})},o.send()}(g,q,e)}function H(e=function(){}){L(function(i){!0===i?t("#backup-progress-modal").hasClass("open")||(!1===u&&(o=!1,u=!0,f=!0),t("#bmi-ongoing-backup").show(300)):(t("#bmi-ongoing-backup").is(":visible")&&t("#bmi-ongoing-backup").hide(300),t("#backup-progress-modal").hasClass("open")&&!0===f?(!0===u&&(u=!1),f=!1,t.bmi.getCurrentBackups(function(e){t.bmi.fillWithNewBackups(e.backups,function(){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date,function(e){if(!1===e)t.bmi.modal("backup-progress-modal").close();else{let i="Backup process aborted",o="[ERROR]";if((e=e.split("\n"))[e.length-1].includes(i)||e[e.length-2].includes(i))t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3);else if(e[e.length-1].includes(o)||e[e.length-2].includes(o))P();else{t.bmi.modal("backup-progress-modal").close(),t.bmi.modal("backup-success-modal").open();let e=t(t("#bmi_restore_tbody").find("tr")[0]).find(".bc-download-btn").attr("href");t("#download-backup-url").attr({href:e}),t("#text-input-copy").val(e)}}})})})):!0!==u||t("#backup-progress-modal").hasClass("open")||(u=!1,t.bmi.reloadBackups())),e()})}function N(e=function(){}){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_migration_full.log&backup-id=current&t="+ +new Date,function(i){if(!i)return e();let o=i.split("\n").slice(0,1)[0];if(i=i.split("\n").slice(1).join("\n"),!1===o||isNaN(parseFloat(o)))return e();let n=t("#restore-live-log-wrapper").find("pre")[0];i.includes("<")||i.includes(">")||i&&0!=i&&void 0!==i&&E(i,n),z(o),e()})}function G(e=function(){}){t.bmi.ajax("htaccess-litespeed",{}).then(function(t){setTimeout(function(){e(!0)},400)}).catch(function(t){e(!1),console.log(t)})}function U(e=function(){},i=!1){t.bmi.ajax("migration-locked",{}).then(function(o){"success"==o.status?e(!0):(i||t.bmi._msg(o),e(!1))}).catch(function(t){console.log(t)})}function Q(e=""){U(function(e){e&&setTimeout(function(){if(!t("#restore-progress-modal").hasClass("open"))return;d=!1,b=!1,t("#restore-error-pre").text(t("#bmi-loading-translation").text().trim()),O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_migration.log&backup-id=current&t="+ +new Date,function(e){if(0==e)setTimeout(function(){Q()},1500);else{let i=t("#restore-error-pre")[0];t("#restore-error-pre").text(""),s=0,E(e,i)}}),t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-error-modal").open()},1e3)},!0)}function W(){t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-success-modal").open(),setTimeout(function(){t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%"},500),w=!1}function J(o=!1,n=null){let r=l;if(!r||r.trim().length<=0)return t.bmi.alert("warning",t("#bmi-no-file").text(),3e3);t("#pre-restore-modal").hasClass("open")&&t.bmi.modal("pre-restore-modal").close(),t("#restore-progress-modal").hasClass("open")||t.bmi.modal("restore-progress-modal").open(),o||(t("#restore-live-log-wrapper").find("pre")[0].innerText=""),null==n&&(s=0,d=!0,clearTimeout(e),M(!0,function(){G(function(){N(function(){!function o(n,s,r,a=!1,l="false",c={}){null==r&&R(!0);t.bmi.ajax("restore-backup",{file:n,remote:s,secret:r,ignoreRunning:l,tmpname:a,options:c}).then(function(r){if("cli"===r.status){v={l:r.login,u:r.url},w=!0;let t=document.querySelector(".hide_so_much");if(t){let e=t.innerText;e.includes("001")?setTimeout(function(){W()},1e3):Q(),d=!1,w=!1}}else"success"===r.status?(v={l:r.login,u:r.url},N(function(){setTimeout(function(){clearInterval(i),clearTimeout(e),d=!1,t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-success-modal").open(),setTimeout(function(){t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%"},500)},1500)})):"secret"===r.status?(r.options.step=parseInt(r.options.step)+1,o(n,s,r.secret,r.tmp,"true",r.options)):"restore_ongoing"===r.status?(void 0!==r.options.firstDB&&(r.options.firstDB=!1),void 0!==r.options.dbFinished?!0!==r.options.dbFinished&&"true"!==r.options.dbFinished&&"1"!==r.options.dbFinished||(r.options.step=parseInt(r.options.step)+1):void 0!==r.options.dbConvertionFinished?"true"!==r.options.dbConvertionFinished&&!0!==r.options.dbConvertionFinished||(r.options.step=parseInt(r.options.step)+1):(r.options.step=parseInt(r.options.step)+1,4!=r.options.step&&"4"!=r.options.step||void 0===r.options.repeat_export||!0!==r.options.repeat_export&&"true"!==r.options.repeat_export&&"1"!==r.options.repeat_export||(r.options.step=3,r.options.firstExtract="false")),o(n,s,r.secret,r.tmp,"true",r.options)):"error"===r.status?setTimeout(function(){clearInterval(i),clearTimeout(e),Q()},1e3):(t.bmi.modal("pre-restore-modal").close(),t.bmi.modal("restore-progress-modal").close(),t.bmi._msg(r))}).catch(function(t,e){Q(e),console.log(t)})}(r,o,n)})})}))}function X(){return t("#bmi_restore_tbody").find('input[type="checkbox"]:checked')}function K(e){e.preventDefault(),t("#format-tip-wrp")[0].style.minWidth="calc(100% - 120px)","none"===t("#format-tip-wrp")[0].style.display?t("#format-tip-wrp").show(300):t("#format-tip-wrp").hide(300)}t("#configuration-reset-absolute").on("click",function(e){e.preventDefault(),t.bmi.ajax("reset-configuration",{}).then(function(e){"success"==e.status?window.location.reload():t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#download-site-infos").on("click",function(e){e.preventDefault(),t.bmi.ajax("get-site-data",{}).then(function(e){"success"==e.status?t.bmi.prepareFile("bmi-site-info.debug",JSON.stringify(e.data)):t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#start-entire-backup").on("click",function(){t.bmi.modal("prenotice-modal").close(),t(".backup-minimize").removeClass("disabled"),clearTimeout(e),M(!1,function(){G(function(){f=!1,o=!1,u=!0,t.bmi.ajax("create-backup",{estaminated_size:k()}).then(function(s){if("success"==s.status)o=!0,clearTimeout(e),u=!1,A(function(){setTimeout(function(){D(s,!0)},350)});else if("background"==s.status){h=!0,m=s.filename;let i=document.querySelector(".hide_so_much");if(i){let s=i.innerText;s.includes("001")&&(o=!0,n=!0,clearTimeout(e),u=!1,D({filename:m},!0)),s.includes("002")&&P(),s.includes("003")&&(t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3))}}else"background_hard"==s.status?(h=!0,m=s.filename,s.settings.url=s.url,t.bmi.alert("success",t("#bmi-received-hard").text(),3e3),t(".backup-minimize").addClass("disabled"),t("#backup-progress-modal").hasClass("open")||t.bmi.modal("backup-progress-modal").open(),window.onbeforeunload=function(){return"Backup in progress..."},F(s.settings)):(u=!1,setTimeout(function(){clearInterval(i),t(".log-wrapper").find("pre")[0].innerText="",t(".progress-active-bar")[0].style.width="0%",t(".progress-percentage")[0].style.left="0%",t(".progress-percentage")[0].innerText="0%"},300),t.bmi._msg(s),t("#backup-progress-modal").hasClass("open")&&(void 0!==s.bfs?j():P()))}).catch(function(e){t("#backup-progress-modal").hasClass("open")&&P(),console.log(e)}),s=0,u=!0,B()})})}),t("#open_trouble_extenstion").on("click",function(){t("#trouble_extenstion").hasClass("openned")?(t("#trouble_extenstion").hide(300),t("#trouble_extenstion").removeClass("openned"),t(this).removeClass("active")):(t("#trouble_extenstion").show(300),t("#trouble_extenstion").addClass("openned"),t(this).addClass("active"))}),t("#switch-show-trs").on("click",function(){let e=this.dataset.see,i=this.dataset.hide,o=t(".hide-show-tr");t(this).hasClass("shown")?(o.hide(300),t(this).removeClass("shown"),this.innerText=e):(o.show(300),t(this).addClass("shown"),this.innerText=i)}),t("#ex_b_fs").on("change",function(){t("#ex_b_fs").is(":checked")?t("#bmi__collon").show():t("#bmi__collon").hide()}),t("#show-upload-area").on("click",function(){t(".upload_area").hasClass("hidden")?(t(".upload_area").show(300),t(".upload_area").removeClass("hidden"),t([document.documentElement,document.body]).animate({scrollTop:t(this).offset().top-50+"px"},300)):(t(".upload_area").hide(300),t(".upload_area").addClass("hidden"))}),t(".bmi-copper").on("click",function(e){e.preventDefault();let i=t("#"+this.getAttribute("data-copy"))[0];i.value&&i.value.length>0?t.bmi.clipboard(i.value):t.bmi.clipboard(i.innerText)}),t("#bmi_restore_tbody").on("click",".restore-btn",function(e){U(function(i){if(i){let i=e.target.closest("tr").querySelector(".br_name").innerText;if(l=i,!i||i.trim().length<=0)return t.bmi.alert("warning",t("#bmi-no-file").text(),3e3);t("#restore-ok").prop("checked",!1),t.bmi.modal("pre-restore-modal").open()}})}),t("#quick-download-migration").on("click",function(){let e=t("#bm-d-url").val();t.bmi.isUrlValid(e)?U(function(i){i&&(e.length>0?(l=-100,t("#restore-ok").prop("checked",!1),t.bmi.modal("pre-restore-modal").open()):t.bmi.alert("warning",t("#bmi-invalid-url").text(),5e3))}):t.bmi.alert("warning",t("#bmi-invalid-url").text(),5e3)}),t("#restore-start-sure").on("click",function(){t("#restore-ok").is(":checked")?-100===l?(l=null,t("#restore-live-log-wrapper").find("pre")[0].innerText="",U(function(o){M(!0,function(){G(function(){if(o){let o=t("#bm-d-url").val();t("#restore_current_step").text(t("#bmi-downloading-remote").text()),t.bmi.ajax("download-backup",{url:o}).then(function(o){clearInterval(i),clearTimeout(e),"success"===o.status?(t.bmi.reloadBackups(),l=o.name,setTimeout(function(){clearInterval(i),t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%",t("#restore_current_step").text(t("#bmi-restoring-prepare").text()),setTimeout(function(){J(!0)},300)},600)):"cli_download"==o.status?(b=!0,R(!1)):"error"===o.status?Q():(t.bmi._msg(o),Q())}).catch(function(t,e){Q(e),console.log(t)}),t("#restore-live-log-wrapper").find("pre")[0].innerText="",s=0,d=!0,R(),t.bmi.modal("pre-restore-modal").close(),t.bmi.modal("restore-progress-modal").open()}})})})):J():t.bmi.alert("warning",t("#bmi-restore-require-checkmark").text(),3e3)}),t(".backup-minimize").on("click",function(){L(function(e){!0===e?t("#bmi-ongoing-backup").show(300):t("#bmi-ongoing-backup").hide()})}),function t(){H(function(){setTimeout(function(){t()},_)})}(),t("#bmi-ongoing-backup").on("click",function(){L(function(e){!0===e?(s=0,B(),t.bmi.modal("backup-progress-modal").open()):(t.bmi.alert("info",t("#bmi-bc-ended").text(),3e3),t.bmi.reloadBackups()),t("#bmi-ongoing-backup").hide(300)})}),t("#bmi_support_chat").on("click",function(){if(0===t("#support-bmi").length){t("#bmi").append('<script id="support-bmi" src="'+t("#bmi-support-url-translation").val()+'" async><\/script>'),setTimeout(function(){t("#bmi_support_chat").hide()},100);var e=!1;let i=setInterval(function(){1==e&&clearInterval(i),void 0!==window.jivo_api&&(window.jivo_api.open(),e=!0)},30)}}),t("#bmi_restore_tbody").on("change",'input[type="checkbox"]',function(e){let i=X().length;i>0?t(".del-all-btn-wrp").show(300):t(".del-all-btn-wrp").hide(300),i==t("#bmi_restore_tbody").find('input[type="checkbox"]').length?t("#backups-select-all").prop("checked",!0):t("#backups-select-all").prop("checked",!1)}),t("#fix-uname-issues").on("click",function(e){e.preventDefault(),t.bmi.ajax("fix_uname_issues",{}).then(function(e){t.bmi.alert("success",t("#bmi-default-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-default-fail").text(),3e3)})}),t("#revert-uname-issues").on("click",function(e){e.preventDefault(),t.bmi.ajax("revert_uname_issues",{}).then(function(e){t.bmi.alert("success",t("#bmi-default-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-default-fail").text(),3e3)})}),t("#backups-select-all").on("change",function(){!0===this.checked?t("#bmi_restore_tbody").find('input[type="checkbox"]').prop("checked",!0):t("#bmi_restore_tbody").find('input[type="checkbox"]').prop("checked",!1),X().length>0?t(".del-all-btn-wrp").show(300):t(".del-all-btn-wrp").hide(300)}),t(".lrn-mr-btn, .closer-learn-more").on("click",function(){t(".learn_more_about_cron").hasClass("open")?(t(".learn_more_about_cron").removeClass("open"),t(".learn_more_about_cron").hide(300),t(".lrn-mr-btn").show(),t(".lrn-mr-btn").css({opacity:0}),t(".lrn-mr-btn").animate({opacity:1},300)):(t(".learn_more_about_cron").addClass("open"),t(".learn_more_about_cron").show(300),t(".lrn-mr-btn").css({opacity:1}),t(".lrn-mr-btn").animate({opacity:0},300,function(){t(".lrn-mr-btn").hide()}))}),t("#bmi-error-toggle").on("click",function(){t(".error-body").hasClass("open")?(t(".error-body").hide(300),t(".error-body").removeClass("open"),t("#bmi-error-toggle").text(t("#bmi-error-toggle").data("expand"))):(t(".error-body").show(300),t(".error-body").addClass("open"),t("#bmi-error-toggle").text(t("#bmi-error-toggle").data("collapse")))}),t("#bmi_send_test_mail").on("click",function(e){e.preventDefault(),t.bmi.ajax("send-test-mail",{}).then(function(e){t.bmi.alert("success",t("#bmi-email-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-email-fail").text(),3e3)})}),t("#bmi-error-dismiss").on("click",function(){t(".error-noticer").hide(300),setTimeout(function(){t(".error-noticer").remove()},330),t.bmi.ajax("dismiss-error-notice",{}).then(function(t){}).catch(function(t){})}),t(".deleteAllSelected").on("click",function(){let e=X(),i=[];for(let t=0;t<e.length;++t){let o=e[t].closest("tr");i.push(o.querySelector(".br_name").innerText)}t("#delete-confirm-modal").find(".text1").hide(),t("#delete-confirm-modal").find(".text2").show();let o=i.length;o<=0||(t("#backup-multiple-del-count").text(o),o>1?(t("#del-only-one").hide(),t("#del-more-than-one").show()):(t("#del-more-than-one").hide(),t("#del-only-one").show()),p=i,t.bmi.modal("delete-confirm-modal").open())}),t("#load-more-backups").on("click",function(e){e.preventDefault(),t.bmi.showMoreBackups()}),t("#show-format-tip").on("click",K),t("#hide-format-tip").on("click",K),t(".go-to-marbs").on("click",function(e){e.preventDefault(),document.getElementById("marbs").click(),t.bmi.modal().closeAll()}),t(".site-reloader").on("click",function(){let t=v.u+"?backup-migration=AFTER_RESTORE&backup-id="+v.l+"&progress-id=4u70L051n&t="+ +new Date;window.location=t}),async function(){C("plugins"),C("uploads"),C("themes"),C("contents_others"),C("wordpress")}(),t.bmi.ajax("get-dynamic-names",{}).then(function(e){let i=e.data;if(t("#bmi_exclusion_rules").text(""),void 0!==i&&void 0!==i.length){for(let e=0;e<i.length;++e){let o=t(".exclusion_template").clone();o.removeClass("exclusion_template"),o.find(".exclusion_txt").val(i[e].txt);let n=o.find(".exclusion_position").find("select"),s=o.find(".exclusion_where").find("select");n&&(n[0].setAttribute("data-def",i[e].pos),s&&(s[0].setAttribute("data-def",i[e].whr),t("#bmi_exclusion_rules").append(o),o.find(".exclusion_position").find(".bmi-dropdown").length>0&&t.bmi.setOption(o.find(".exclusion_position").find(".bmi-dropdown"),null,i[e].pos),o.find(".exclusion_where").find(".bmi-dropdown").length>0&&t.bmi.setOption(o.find(".exclusion_where").find(".bmi-dropdown"),null,i[e].whr)))}t("#dynamic-fpaths-names").text(e["dynamic-fpaths-names"].join("\n")),t("#dynamic-dpaths-names").text(e["dynamic-dpaths-names"].join("\n"))}}).catch(function(t){console.log(t)}),t.bmi.reloadBackups(),function(){let e=1e3*parseInt(t("#server-time-auto").attr("data-time")),i=new Date(e);t("#server-time-auto").text(i.toUTCString()),setInterval(function(){e+=1e3,i=new Date(e),t("#server-time-auto").text(i.toUTCString())},1e3),t("#ex_b_fs").is(":checked")?t("#bmi__collon").show():t("#bmi__collon").hide()}()}),jQuery(document).ready(function(t){t(".modal-opener").on("click",function(e){this.getAttribute("data-modal")&&""!=this.getAttribute("data-modal")&&(e.preventDefault(),this.getAttribute("data-close")&&t.bmi.modal(this.getAttribute("data-close")).close(),t.bmi.modal(this.getAttribute("data-modal")).open())}),t(".modal-closer").on("click",function(e){this.getAttribute("data-close")&&""!=this.getAttribute("data-close")?(e.preventDefault(),t.bmi.modal(this.getAttribute("data-close")).close()):this.closest(".modal")&&(e.preventDefault(),t("#"+this.closest(".modal").getAttribute("id")).length>0&&t.bmi.modal(this.closest(".modal").getAttribute("id")).close())}),t(".modal-close").on("click",function(e){this.closest(".modal")&&(e.preventDefault(),t.bmi.modal(this.closest(".modal").id).close())}),t(".modal").on("click",function(e){e.target!=this||t(e.target).hasClass("modal-no-close")||t.bmi.modal(this.id).close()})}),jQuery(document).ready(function(t){t.bmi.tooltips.init();let e,i=-1,o=!1,n="";for(let t=0;t<12;++t)n+="<div></div>";function s(o){clearInterval(e),0==o?(t(".upload-progress-bar").find("span")[0].style.width=o+"%",t(".upload-percentage").text(o+"%")):100==o?(t(".upload-progress-bar").find("span")[0].style.width=o+"%",t(".upload-percentage").text(o+"%")):function(o=0,n=1e3){if(i==o)return;i=o,clearInterval(e);let s=parseInt(t(".upload-percentage").text())-1;if(s>o&&0!=o)return;let r=o-s,a=s,l=Math.abs(Math.floor(n/r));e=setInterval(function(){a+=1,t(".upload-progress-bar").find("span")[0].style.width=a+"%",t(".upload-percentage").text(a+"%"),a>=100&&(clearInterval(e),i=null)},l)}(o,1e3)}t(".spinner-loader").html(n).addClass("lds-spinner"),t.fchunker({upId:"upid",upShardSize:"5",upMaxSize:"2000",upUrl:ajaxurl,upType:"zip",upCallBack:function(e){var i=e.status,n=e.message;e.url,Math.random();2==i&&(setTimeout(function(){t("#drop-area").show(300),t(".upload-progress").hide(300)},100),t.bmi.alert("success",t("#bmi-upload-end").text(),3e3),t.bmi.modal("upload-success-modal").open(),t.bmi.reloadBackups()),1==i&&(o||(t.bmi.alert("success",t("#bmi-upload-start").text(),3e3),o=!0)),0==i&&(t.upErrorMsg(n),t("#drop-area").show(300),t(".upload-progress").hide(300)),5==i&&(t.bmi.modal("upload-invalid-manifest-modal").open(),t("#drop-area").show(300),t(".upload-progress").hide(300)),3==i&&(s(100),t.upErrorMsg(n),t("#drop-area").show(300),t(".upload-progress").hide(300))},upEvent:function(t){s(t)},upStop:function(e){s(0),setTimeout(function(){t("#drop-area").show(300),t(".upload-progress").hide(300)},100),e.includes("Type error")?(t.bmi.modal("upload-wrong-file-modal").open(),t.bmi.alert("warning",t("#bmi-upload-wrong").text(),3e3)):e.includes("File already exists")?(t.bmi.modal("upload-exist-file-modal").open(),t.bmi.alert("warning",t("#bmi-upload-exists").text(),3e3)):(t.bmi.alert("error",t("#bmi-upload-error").text(),3e3),console.error(e))},upStart:function(){o=!1,i=-1,s(0),setTimeout(function(){t("#drop-area").hide(300),t(".upload-progress").show(300)},100)}})}),jQuery(document).ready(function(t){function e(t){for(let e=0;e<t.length;++e){let i=t[e].closest(".container-radio");i&&void 0!=typeof i.classList&&(i.classList.remove("active"),!0===t[e].checked&&i.classList.add("active"))}}t('input[type="radio"]').on("change",function(){let t=this.getAttribute("name");this.closest(".container-radio");e(document.querySelectorAll('[name="'+t+'"]'))}),e(document.getElementById("bmi").querySelectorAll('input[type="radio"]'))}),jQuery(document).ready(function(t){let e=!1;t(".tabs").on("click",".tab",function(i){if(this.classList.contains("active"))return;if(!0===e)return;e=!0,t.bmi.collapsers.closeAll();let o=this.getAttribute("data-point");"manage-restore-wrapper"==o?(t("#create-backup-wrapper").hide(300),t('[data-point="create-backup-wrapper"]').removeClass("active")):"create-backup-wrapper"==o&&(t("#manage-restore-wrapper").hide(300),t('[data-point="manage-restore-wrapper"]').removeClass("active")),t("#"+o).show(300),t(this).addClass("active"),setTimeout(function(){e=!1},320)})}),jQuery(document).ready(function(t){let e=document.getElementById("drop-area");function i(t){t.preventDefault(),t.stopPropagation()}function o(t){e.classList.add("highlight")}function n(t){e.classList.remove("highlight")}e&&(["dragenter","dragover","dragleave","drop"].forEach(t=>{e.addEventListener(t,i,!1)}),["dragenter","dragover"].forEach(t=>{e.addEventListener(t,o,!1),document.querySelector("body").addEventListener(t,o,!1)}),["dragleave","drop","mouseleave"].forEach(t=>{e.addEventListener(t,n,!1)}),t("body, #drop-area").on("mouseleave dragleave drop",function(){n()}),e.addEventListener("drop",function(t){!function(t){t=[...t],jQuery.fchunker_upload("file",t[0])}(t.dataTransfer.files)},!1))});
1
+ !function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},i="undefined"!=typeof window?window:null,o={hasTouchCapability:!(!i||!("ontouchstart"in i||i.DocumentTouch&&i.document instanceof i.DocumentTouch||i.navigator.maxTouchPoints)),hasTransitions:function(){if(!i)return!1;var t=(i.document.body||i.document.documentElement).style,e="transition",o=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[e])return!0;e=e.charAt(0).toUpperCase()+e.substr(1);for(var n=0;n<o.length;n++)if("string"==typeof t[o[n]+e])return!0;return!1}(),IE:!1,semVer:"4.2.8",window:i},n=function(){this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__instancesLatestArr=[],this.__plugins={},this._env=o};function s(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function r(e,i){var o=!0;return t.each(e,function(t,n){if(void 0===i[t]||e[t]!==i[t])return o=!1,!1}),o}function a(e){var i=e.attr("id"),n=i?o.window.document.getElementById(i):null;return n?n===e[0]:t.contains(o.window.document.body,e[0])}n.prototype={__bridge:function(e,i,o){if(!i[o]){var n=function(){};n.prototype=e;var s=new n;s.__init&&s.__init(i),t.each(e,function(t,e){0!=t.indexOf("__")&&(i[t]||(i[t]=function(){return s[t].apply(s,Array.prototype.slice.apply(arguments))},i[t].bridged=s))}),i[o]=s}return this},__setWindow:function(t){return o.window=t,this},_getRuler:function(t){return new s(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(e){if("string"==typeof e){var i=e,o=null;return i.indexOf(".")>0?o=this.__plugins[i]:t.each(this.__plugins,function(t,e){if(e.name.substring(e.name.length-i.length-1)=="."+i)return o=e,!1}),o}if(e.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return this.__plugins[e.name]=e,e.core&&this.__bridge(e.core,this,e.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(e){var i=[];return t(e||".tooltipstered").each(function(){var e=t(this),o=e.data("tooltipster-ns");o&&t.each(o,function(t,o){i.push(e.data(o))})}),i},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(e){return t((e?e+" ":"")+".tooltipstered").toArray()},setDefaults:function(i){return t.extend(e,i),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.tooltipster=new n,t.Tooltipster=function(e,i){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(e,i)},t.Tooltipster.prototype={__init:function(i,n){var s=this;if(s._$origin=t(i),s.__options=t.extend(!0,{},e,n),s.__optionsFormat(),!o.IE||o.IE>=s.__options.IEmin){var r=null;if(void 0===s._$origin.data("tooltipster-initialTitle")&&(void 0===(r=s._$origin.attr("title"))&&(r=null),s._$origin.data("tooltipster-initialTitle",r)),null!==s.__options.content)s.__contentSet(s.__options.content);else{var a,l=s._$origin.attr("data-tooltip-content");l&&(a=t(l)),a&&a[0]?s.__contentSet(a.first()):s.__contentSet(r)}s._$origin.removeAttr("title").addClass("tooltipstered"),s.__prepareOrigin(),s.__prepareGC(),t.each(s.__options.plugins,function(t,e){s._plug(e)}),o.hasTouchCapability&&t(o.window.document.body).on("touchmove."+s.__namespace+"-triggerOpen",function(t){s._touchRecordEvent(t)}),s._on("created",function(){s.__prepareTooltip()})._on("repositioned",function(t){s.__lastPosition=t.position})}else s.__options.disabled=!0},__contentInsert:function(){var t=this._$tooltip.find(".tooltipster-content"),e=this.__Content;return this._trigger({type:"format",content:this.__Content,format:function(t){e=t}}),this.__options.functionFormat&&(e=this.__options.functionFormat.call(this,this,{origin:this._$origin[0]},this.__Content)),"string"!=typeof e||this.__options.contentAsHTML?t.empty().append(e):t.text(e),this},__contentSet:function(e){return e instanceof t&&this.__options.contentCloning&&(e=e.clone(!0)),this.__Content=e,this._trigger({type:"updated",content:e}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var e=this._$origin,i=this._$origin.is("area");if(i){var n=this._$origin.parent().attr("name");e=t('img[usemap="#'+n+'"]')}var s=e[0].getBoundingClientRect(),r=t(o.window.document),a=t(o.window),l=e,c={available:{document:null,window:null},document:{size:{height:r.height(),width:r.width()}},window:{scroll:{left:o.window.scrollX||o.window.document.documentElement.scrollLeft,top:o.window.scrollY||o.window.document.documentElement.scrollTop},size:{height:a.height(),width:a.width()}},origin:{fixedLineage:!1,offset:{},size:{height:s.bottom-s.top,width:s.right-s.left},usemapImage:i?e[0]:null,windowOffset:{bottom:s.bottom,left:s.left,right:s.right,top:s.top}}};if(i){var p=this._$origin.attr("shape"),u=this._$origin.attr("coords");if(u&&(u=u.split(","),t.map(u,function(t,e){u[e]=parseInt(t)})),"default"!=p)switch(p){case"circle":var d=u[0],_=u[1],f=u[2],h=_-f,m=d-f;c.origin.size.height=2*f,c.origin.size.width=c.origin.size.height,c.origin.windowOffset.left+=m,c.origin.windowOffset.top+=h;break;case"rect":var g=u[0],b=u[1],w=u[2],v=u[3];c.origin.size.height=v-b,c.origin.size.width=w-g,c.origin.windowOffset.left+=g,c.origin.windowOffset.top+=b;break;case"poly":for(var y=0,k=0,x=0,C=0,$="even",T=0;T<u.length;T++){var I=u[T];"even"==$?(I>x&&(x=I,0===T&&(y=x)),I<y&&(y=I),$="odd"):(I>C&&(C=I,1==T&&(k=C)),I<k&&(k=I),$="even")}c.origin.size.height=C-k,c.origin.size.width=x-y,c.origin.windowOffset.left+=y,c.origin.windowOffset.top+=k}}for(this._trigger({type:"geometry",edit:function(t){c.origin.size.height=t.height,c.origin.windowOffset.left=t.left,c.origin.windowOffset.top=t.top,c.origin.size.width=t.width},geometry:{height:c.origin.size.height,left:c.origin.windowOffset.left,top:c.origin.windowOffset.top,width:c.origin.size.width}}),c.origin.windowOffset.right=c.origin.windowOffset.left+c.origin.size.width,c.origin.windowOffset.bottom=c.origin.windowOffset.top+c.origin.size.height,c.origin.offset.left=c.origin.windowOffset.left+c.window.scroll.left,c.origin.offset.top=c.origin.windowOffset.top+c.window.scroll.top,c.origin.offset.bottom=c.origin.offset.top+c.origin.size.height,c.origin.offset.right=c.origin.offset.left+c.origin.size.width,c.available.document={bottom:{height:c.document.size.height-c.origin.offset.bottom,width:c.document.size.width},left:{height:c.document.size.height,width:c.origin.offset.left},right:{height:c.document.size.height,width:c.document.size.width-c.origin.offset.right},top:{height:c.origin.offset.top,width:c.document.size.width}},c.available.window={bottom:{height:Math.max(c.window.size.height-Math.max(c.origin.windowOffset.bottom,0),0),width:c.window.size.width},left:{height:c.window.size.height,width:Math.max(c.origin.windowOffset.left,0)},right:{height:c.window.size.height,width:Math.max(c.window.size.width-Math.max(c.origin.windowOffset.right,0),0)},top:{height:Math.max(c.origin.windowOffset.top,0),width:c.window.size.width}};"html"!=l[0].tagName.toLowerCase();){if("fixed"==l.css("position")){c.origin.fixedLineage=!0;break}l=l.parent()}return c},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=t(o.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=t(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var e=this;return e.__options.selfDestruction?e.__garbageCollector=setInterval(function(){var i=(new Date).getTime();e.__touchEvents=t.grep(e.__touchEvents,function(t,e){return i-t.time>6e4}),a(e._$origin)||e.close(function(){e.destroy()})},2e4):clearInterval(e.__garbageCollector),e},__prepareOrigin:function(){var t=this;if(t._$origin.off("."+t.__namespace+"-triggerOpen"),o.hasTouchCapability&&t._$origin.on("touchstart."+t.__namespace+"-triggerOpen touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen",function(e){t._touchRecordEvent(e)}),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&o.hasTouchCapability){var e="";t.__options.triggerOpen.click&&(e+="click."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.tap&&o.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&t._open(e)})}if(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&o.hasTouchCapability){e="";t.__options.triggerOpen.mouseenter&&(e+="mouseenter."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.touchstart&&o.hasTouchCapability&&(e+="touchstart."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){!t._touchIsTouchEvent(e)&&t._touchIsEmulatedEvent(e)||(t.__pointerIsOverOrigin=!0,t._openShortly(e))})}if(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&o.hasTouchCapability){e="";t.__options.triggerClose.mouseleave&&(e+="mouseleave."+t.__namespace+"-triggerOpen "),t.__options.triggerClose.touchleave&&o.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&(t.__pointerIsOverOrigin=!1)})}return t},__prepareTooltip:function(){var e=this,i=e.__options.interactive?"auto":"";return e._$tooltip.attr("id",e.__namespace).css({"pointer-events":i,zIndex:e.__options.zIndex}),t.each(e.__previousThemes,function(t,i){e._$tooltip.removeClass(i)}),t.each(e.__options.theme,function(t,i){e._$tooltip.addClass(i)}),e.__previousThemes=t.merge([],e.__options.theme),e},__scrollHandler:function(e){if(this.__options.triggerClose.scroll)this._close(e);else if(a(this._$origin)&&a(this._$tooltip)){var i=null;if(e.target===o.window.document)this.__Geometry.origin.fixedLineage||this.__options.repositionOnScroll&&this.reposition(e);else{i=this.__geometry();var n=!1;if("fixed"!=this._$origin.css("position")&&this.__$originParents.each(function(e,o){var s=t(o),r=s.css("overflow-x"),a=s.css("overflow-y");if("visible"!=r||"visible"!=a){var l=o.getBoundingClientRect();if("visible"!=r&&(i.origin.windowOffset.left<l.left||i.origin.windowOffset.right>l.right))return n=!0,!1;if("visible"!=a&&(i.origin.windowOffset.top<l.top||i.origin.windowOffset.bottom>l.bottom))return n=!0,!1}if("fixed"==s.css("position"))return!1}),n)this._$tooltip.css("visibility","hidden");else if(this._$tooltip.css("visibility","visible"),this.__options.repositionOnScroll)this.reposition(e);else{var s=i.origin.offset.left-this.__Geometry.origin.offset.left,r=i.origin.offset.top-this.__Geometry.origin.offset.top;this._$tooltip.css({left:this.__lastPosition.coord.left+s,top:this.__lastPosition.coord.top+r})}}this._trigger({type:"scroll",event:e,geo:i})}return this},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,t.each(this.__timeouts.close,function(t,e){clearTimeout(e)}),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,e=t._$tooltip.find(".tooltipster-content");return t.__options.trackTooltip&&(t.__contentBcr=e[0].getBoundingClientRect()),t.__tracker=setInterval(function(){if(a(t._$origin)&&a(t._$tooltip)){if(t.__options.trackOrigin){var i=t.__geometry(),o=!1;r(i.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?r(i.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(o=!0):r(i.origin.offset,t.__Geometry.origin.offset)&&(o=!0)),o||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var n=e[0].getBoundingClientRect();n.height===t.__contentBcr.height&&n.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=n)}}else t._close()},t.__options.trackerInterval),t},_close:function(e,i,n){var s=this,r=!0;if(s._trigger({type:"close",event:e,stop:function(){r=!1}}),r||n){i&&s.__callbacks.close.push(i),s.__callbacks.open=[],s.__timeoutsClear();var a=function(){t.each(s.__callbacks.close,function(t,i){i.call(s,s,{event:e,origin:s._$origin[0]})}),s.__callbacks.close=[]};if("closed"!=s.__state){var l=!0,c=(new Date).getTime()+s.__options.animationDuration[1];if("disappearing"==s.__state&&c>s.__closingTime&&s.__options.animationDuration[1]>0&&(l=!1),l){s.__closingTime=c,"disappearing"!=s.__state&&s.__stateSet("disappearing");var p=function(){clearInterval(s.__tracker),s._trigger({type:"closing",event:e}),s._$tooltip.off("."+s.__namespace+"-triggerClose").removeClass("tooltipster-dying"),t(o.window).off("."+s.__namespace+"-triggerClose"),s.__$originParents.each(function(e,i){t(i).off("scroll."+s.__namespace+"-triggerClose")}),s.__$originParents=null,t(o.window.document.body).off("."+s.__namespace+"-triggerClose"),s._$origin.off("."+s.__namespace+"-triggerClose"),s._off("dismissable"),s.__stateSet("closed"),s._trigger({type:"after",event:e}),s.__options.functionAfter&&s.__options.functionAfter.call(s,s,{event:e,origin:s._$origin[0]}),a()};o.hasTransitions?(s._$tooltip.css({"-moz-animation-duration":s.__options.animationDuration[1]+"ms","-ms-animation-duration":s.__options.animationDuration[1]+"ms","-o-animation-duration":s.__options.animationDuration[1]+"ms","-webkit-animation-duration":s.__options.animationDuration[1]+"ms","animation-duration":s.__options.animationDuration[1]+"ms","transition-duration":s.__options.animationDuration[1]+"ms"}),s._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),s.__options.animationDuration[1]>0&&s._$tooltip.delay(s.__options.animationDuration[1]),s._$tooltip.queue(p)):s._$tooltip.stop().fadeOut(s.__options.animationDuration[1],p)}}else a()}return s},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(e,i){var n=this;if(!n.__destroying&&a(n._$origin)&&n.__enabled){var s=!0;if("closed"==n.__state&&(n._trigger({type:"before",event:e,stop:function(){s=!1}}),s&&n.__options.functionBefore&&(s=n.__options.functionBefore.call(n,n,{event:e,origin:n._$origin[0]}))),!1!==s&&null!==n.__Content){i&&n.__callbacks.open.push(i),n.__callbacks.close=[],n.__timeoutsClear();var r,l=function(){"stable"!=n.__state&&n.__stateSet("stable"),t.each(n.__callbacks.open,function(t,e){e.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}),n.__callbacks.open=[]};if("closed"!==n.__state)r=0,"disappearing"===n.__state?(n.__stateSet("appearing"),o.hasTransitions?(n._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(l)):n._$tooltip.stop().fadeIn(l)):"stable"==n.__state&&l();else{if(n.__stateSet("appearing"),r=n.__options.animationDuration[0],n.__contentInsert(),n.reposition(e,!0),o.hasTransitions?(n._$tooltip.addClass("tooltipster-"+n.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":n.__options.animationDuration[0]+"ms","-ms-animation-duration":n.__options.animationDuration[0]+"ms","-o-animation-duration":n.__options.animationDuration[0]+"ms","-webkit-animation-duration":n.__options.animationDuration[0]+"ms","animation-duration":n.__options.animationDuration[0]+"ms","transition-duration":n.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=n.__state&&(n._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),n.__options.animationDuration[0]>0&&n._$tooltip.delay(n.__options.animationDuration[0]),n._$tooltip.queue(l))},0)):n._$tooltip.css("display","none").fadeIn(n.__options.animationDuration[0],l),n.__trackerStart(),t(o.window).on("resize."+n.__namespace+"-triggerClose",function(e){var i=t(document.activeElement);(i.is("input")||i.is("textarea"))&&t.contains(n._$tooltip[0],i[0])||n.reposition(e)}).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)}),n.__$originParents=n._$origin.parents(),n.__$originParents.each(function(e,i){t(i).on("scroll."+n.__namespace+"-triggerClose",function(t){n.__scrollHandler(t)})}),n.__options.triggerClose.mouseleave||n.__options.triggerClose.touchleave&&o.hasTouchCapability){n._on("dismissable",function(t){t.dismissable?t.delay?(d=setTimeout(function(){n._close(t.event)},t.delay),n.__timeouts.close.push(d)):n._close(t):clearTimeout(d)});var c=n._$origin,p="",u="",d=null;n.__options.interactive&&(c=c.add(n._$tooltip)),n.__options.triggerClose.mouseleave&&(p+="mouseenter."+n.__namespace+"-triggerClose ",u+="mouseleave."+n.__namespace+"-triggerClose "),n.__options.triggerClose.touchleave&&o.hasTouchCapability&&(p+="touchstart."+n.__namespace+"-triggerClose",u+="touchend."+n.__namespace+"-triggerClose touchcancel."+n.__namespace+"-triggerClose"),c.on(u,function(t){if(n._touchIsTouchEvent(t)||!n._touchIsEmulatedEvent(t)){var e="mouseleave"==t.type?n.__options.delay:n.__options.delayTouch;n._trigger({delay:e[1],dismissable:!0,event:t,type:"dismissable"})}}).on(p,function(t){!n._touchIsTouchEvent(t)&&n._touchIsEmulatedEvent(t)||n._trigger({dismissable:!1,event:t,type:"dismissable"})})}n.__options.triggerClose.originClick&&n._$origin.on("click."+n.__namespace+"-triggerClose",function(t){n._touchIsTouchEvent(t)||n._touchIsEmulatedEvent(t)||n._close(t)}),(n.__options.triggerClose.click||n.__options.triggerClose.tap&&o.hasTouchCapability)&&setTimeout(function(){if("closed"!=n.__state){var e="",i=t(o.window.document.body);n.__options.triggerClose.click&&(e+="click."+n.__namespace+"-triggerClose "),n.__options.triggerClose.tap&&o.hasTouchCapability&&(e+="touchend."+n.__namespace+"-triggerClose"),i.on(e,function(e){n._touchIsMeaningfulEvent(e)&&(n._touchRecordEvent(e),n.__options.interactive&&t.contains(n._$tooltip[0],e.target)||n._close(e))}),n.__options.triggerClose.tap&&o.hasTouchCapability&&i.on("touchstart."+n.__namespace+"-triggerClose",function(t){n._touchRecordEvent(t)})}},0),n._trigger("ready"),n.__options.functionReady&&n.__options.functionReady.call(n,n,{origin:n._$origin[0],tooltip:n._$tooltip[0]})}if(n.__options.timer>0){d=setTimeout(function(){n._close()},n.__options.timer+r);n.__timeouts.close.push(d)}}}return n},_openShortly:function(t){var e=this,i=!0;if("stable"!=e.__state&&"appearing"!=e.__state&&!e.__timeouts.open&&(e._trigger({type:"start",event:t,stop:function(){i=!1}}),i)){var o=0==t.type.indexOf("touch")?e.__options.delayTouch:e.__options.delay;o[0]?e.__timeouts.open=setTimeout(function(){e.__timeouts.open=null,e.__pointerIsOverOrigin&&e._touchIsMeaningfulEvent(t)?(e._trigger("startend"),e._open(t)):e._trigger("startcancel")},o[0]):(e._trigger("startend"),e._open(t))}return e},_optionsExtract:function(e,i){var o=this,n=t.extend(!0,{},i),s=o.__options[e];return s||(s={},t.each(i,function(t,e){var i=o.__options[t];void 0!==i&&(s[t]=i)})),t.each(n,function(e,i){void 0!==s[e]&&("object"!=typeof i||i instanceof Array||null==i||"object"!=typeof s[e]||s[e]instanceof Array||null==s[e]?n[e]=s[e]:t.extend(n[e],s[e]))}),n},_plug:function(e){var i=t.tooltipster._plugin(e);if(!i)throw new Error('The "'+e+'" plugin is not defined');return i.instance&&t.tooltipster.__bridge(i.instance,this,i.name),this},_touchIsEmulatedEvent:function(t){for(var e=!1,i=(new Date).getTime(),o=this.__touchEvents.length-1;o>=0;o--){var n=this.__touchEvents[o];if(!(i-n.time<500))break;n.target===t.target&&(e=!0)}return e},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var e=!1,i=this.__touchEvents.length-1;i>=0;i--){var o=this.__touchEvents[i];if("touchmove"==o.type){e=!0;break}if("touchstart"==o.type&&t===o.target)break}return e},_trigger:function(){var e=Array.prototype.slice.apply(arguments);return"string"==typeof e[0]&&(e[0]={type:e[0]}),e[0].instance=this,e[0].origin=this._$origin?this._$origin[0]:null,e[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,e),t.tooltipster._trigger.apply(t.tooltipster,e),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,e),this},_unplug:function(e){var i=this;if(i[e]){var o=t.tooltipster._plugin(e);o.instance&&t.each(o.instance,function(t,o){i[t]&&i[t].bridged===i[e]&&delete i[t]}),i[e].__destroy&&i[e].__destroy(),delete i[e]}return i},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var e=this;if(void 0===t)return e.__Content;if(e.__destroyed)e.__destroyError();else if(e.__contentSet(t),null!==e.__Content){if("closed"!==e.__state&&(e.__contentInsert(),e.reposition(),e.__options.updateAnimation))if(o.hasTransitions){var i=e.__options.updateAnimation;e._$tooltip.addClass("tooltipster-update-"+i),setTimeout(function(){"closed"!=e.__state&&e._$tooltip.removeClass("tooltipster-update-"+i)},1e3)}else e._$tooltip.fadeTo(200,.5,function(){"closed"!=e.__state&&e._$tooltip.fadeTo(200,1)})}else e._close();return e},destroy:function(){var e=this;if(e.__destroyed)e.__destroyError();else{"closed"!=e.__state?e.option("animationDuration",0)._close(null,null,!0):e.__timeoutsClear(),e._trigger("destroy"),e.__destroyed=!0,e._$origin.removeData(e.__namespace).off("."+e.__namespace+"-triggerOpen"),t(o.window.document.body).off("."+e.__namespace+"-triggerOpen");var i=e._$origin.data("tooltipster-ns");if(i)if(1===i.length){var n=null;"previous"==e.__options.restoration?n=e._$origin.data("tooltipster-initialTitle"):"current"==e.__options.restoration&&(n="string"==typeof e.__Content?e.__Content:t("<div></div>").append(e.__Content).html()),n&&e._$origin.attr("title",n),e._$origin.removeClass("tooltipstered"),e._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else i=t.grep(i,function(t,i){return t!==e.__namespace}),e._$origin.data("tooltipster-ns",i);e._trigger("destroyed"),e._off(),e.off(),e.__Content=null,e.__$emitterPrivate=null,e.__$emitterPublic=null,e.__options.parent=null,e._$origin=null,e._$tooltip=null,t.tooltipster.__instancesLatestArr=t.grep(t.tooltipster.__instancesLatestArr,function(t,i){return e!==t}),clearInterval(e.__garbageCollector)}return e},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(e,i){return void 0===i?this.__options[e]:(this.__destroyed?this.__destroyError():(this.__options[e]=i,this.__optionsFormat(),t.inArray(e,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===e&&this.__prepareGC()),this)},reposition:function(t,e){return this.__destroyed?this.__destroyError():"closed"!=this.__state&&a(this._$origin)&&(e||a(this._$tooltip))&&(e||this._$tooltip.detach(),this.__Geometry=this.__geometry(),this._trigger({type:"reposition",event:t,helper:{geo:this.__Geometry}})),this},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.fn.tooltipster=function(){var i=Array.prototype.slice.apply(arguments);if(0===this.length)return this;if("string"==typeof i[0]){var o="#*$~&";return this.each(function(){var e=t(this).data("tooltipster-ns"),n=e?t(this).data(e[0]):null;if(!n)throw new Error("You called Tooltipster's \""+i[0]+'" method on an uninitialized element');if("function"!=typeof n[i[0]])throw new Error('Unknown method "'+i[0]+'"');this.length>1&&"content"==i[0]&&(i[1]instanceof t||"object"==typeof i[1]&&null!=i[1]&&i[1].tagName)&&!n.__options.contentCloning&&n.__options.debug;var s=n[i[0]](i[1],i[2]);if(s!==n||"instance"===i[0])return o=s,!1}),"#*$~&"!==o?o:this}t.tooltipster.__instancesLatestArr=[];var n=i[0]&&void 0!==i[0].multiple,s=n&&i[0].multiple||!n&&e.multiple,r=i[0]&&void 0!==i[0].content,a=r&&i[0].content||!r&&e.content,l=i[0]&&void 0!==i[0].contentCloning,c=(l&&i[0].contentCloning,i[0]&&void 0!==i[0].debug);c&&i[0].debug;return this.length>1&&(a instanceof t||"object"==typeof a&&null!=a&&a.tagName),this.each(function(){var e=!1,o=t(this),n=o.data("tooltipster-ns"),r=null;n?s&&(e=!0):e=!0,e&&(r=new t.Tooltipster(this,i[0]),n||(n=[]),n.push(r.__namespace),o.data("tooltipster-ns",n),o.data(r.__namespace,r),r.__options.functionInit&&r.__options.functionInit.call(r,r,{origin:this}),r._trigger("init")),t.tooltipster.__instancesLatestArr.push(r)}),this},s.prototype={__init:function(e){this.__$tooltip=e,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=t('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(o.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t=this.__$tooltip[0].getBoundingClientRect(),e={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var i=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),s=i[0].getBoundingClientRect(),r={height:n<=this.constraints.height,width:t.width<=this.constraints.width&&s.width>=i[0].scrollWidth-1};e.fits=r.height&&r.width}return o.IE&&o.IE<=11&&e.size.width!==o.window.document.documentElement.clientWidth&&(e.size.width=Math.ceil(e.size.width)+1),e}};var l=navigator.userAgent.toLowerCase();-1!=l.indexOf("msie")?o.IE=parseInt(l.split("msie")[1]):-1!==l.toLowerCase().indexOf("trident")&&-1!==l.indexOf(" rv:11")?o.IE=11:-1!=l.toLowerCase().indexOf("edge/")&&(o.IE=parseInt(l.toLowerCase().split("edge/")[1])),t.tooltipster._plugin({name:"tooltipster.sideTip",instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof t&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var e=t('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||e.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&e.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&e.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=e,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){if(this.__options=this.__instance._optionsExtract("tooltipster.sideTip",this.__defaults()),this.__options.position&&(this.__options.side=this.__options.position),"object"!=typeof this.__options.distance&&(this.__options.distance=[this.__options.distance]),this.__options.distance.length<4&&(void 0===this.__options.distance[1]&&(this.__options.distance[1]=this.__options.distance[0]),void 0===this.__options.distance[2]&&(this.__options.distance[2]=this.__options.distance[0]),void 0===this.__options.distance[3]&&(this.__options.distance[3]=this.__options.distance[1])),this.__options.distance={top:this.__options.distance[0],right:this.__options.distance[1],bottom:this.__options.distance[2],left:this.__options.distance[3]},"string"==typeof this.__options.side){this.__options.side=[this.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[this.__options.side]],"left"==this.__options.side[0]||"right"==this.__options.side[0]?this.__options.side.push("top","bottom"):this.__options.side.push("right","left")}6===t.tooltipster._env.IE&&!0!==this.__options.arrow&&(this.__options.arrow=!1)},__reposition:function(e,i){var o,n=this,s=n.__targetFind(i),r=[];n.__instance._$tooltip.detach();var a=n.__instance._$tooltip.clone(),l=t.tooltipster._getRuler(a),c=!1,p=n.__instance.option("animation");switch(p&&a.removeClass("tooltipster-"+p),t.each(["window","document"],function(o,p){var u=null;if(n.__instance._trigger({container:p,helper:i,satisfied:c,takeTest:function(t){u=t},results:r,type:"positionTest"}),1==u||0!=u&&0==c&&("window"!=p||n.__options.viewportAware))for(o=0;o<n.__options.side.length;o++){var d={horizontal:0,vertical:0},_=n.__options.side[o];"top"==_||"bottom"==_?d.vertical=n.__options.distance[_]:d.horizontal=n.__options.distance[_],n.__sideChange(a,_),t.each(["natural","constrained"],function(t,o){if(u=null,n.__instance._trigger({container:p,event:e,helper:i,mode:o,results:r,satisfied:c,side:_,takeTest:function(t){u=t},type:"positionTest"}),1==u||0!=u&&0==c){var a={container:p,distance:d,fits:null,mode:o,outerSize:null,side:_,size:null,target:s[_],whole:null},f=("natural"==o?l.free():l.constrain(i.geo.available[p][_].width-d.horizontal,i.geo.available[p][_].height-d.vertical)).measure();if(a.size=f.size,a.outerSize={height:f.size.height+d.vertical,width:f.size.width+d.horizontal},"natural"==o?i.geo.available[p][_].width>=a.outerSize.width&&i.geo.available[p][_].height>=a.outerSize.height?a.fits=!0:a.fits=!1:a.fits=f.fits,"window"==p&&(a.fits?a.whole="top"==_||"bottom"==_?i.geo.origin.windowOffset.right>=n.__options.minIntersection&&i.geo.window.size.width-i.geo.origin.windowOffset.left>=n.__options.minIntersection:i.geo.origin.windowOffset.bottom>=n.__options.minIntersection&&i.geo.window.size.height-i.geo.origin.windowOffset.top>=n.__options.minIntersection:a.whole=!1),r.push(a),a.whole)c=!0;else if("natural"==a.mode&&(a.fits||a.size.width<=i.geo.available[p][_].width))return!1}})}}),n.__instance._trigger({edit:function(t){r=t},event:e,helper:i,results:r,type:"positionTested"}),r.sort(function(t,e){return t.whole&&!e.whole?-1:!t.whole&&e.whole?1:t.whole&&e.whole?(i=n.__options.side.indexOf(t.side))<(o=n.__options.side.indexOf(e.side))?-1:i>o?1:"natural"==t.mode?-1:1:t.fits&&!e.fits?-1:!t.fits&&e.fits?1:t.fits&&e.fits?(i=n.__options.side.indexOf(t.side))<(o=n.__options.side.indexOf(e.side))?-1:i>o?1:"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1;var i,o}),(o=r[0]).coord={},o.side){case"left":case"right":o.coord.top=Math.floor(o.target-o.size.height/2);break;case"bottom":case"top":o.coord.left=Math.floor(o.target-o.size.width/2)}switch(o.side){case"left":o.coord.left=i.geo.origin.windowOffset.left-o.outerSize.width;break;case"right":o.coord.left=i.geo.origin.windowOffset.right+o.distance.horizontal;break;case"top":o.coord.top=i.geo.origin.windowOffset.top-o.outerSize.height;break;case"bottom":o.coord.top=i.geo.origin.windowOffset.bottom+o.distance.vertical}"window"==o.container?"top"==o.side||"bottom"==o.side?o.coord.left<0?i.geo.origin.windowOffset.right-this.__options.minIntersection>=0?o.coord.left=0:o.coord.left=i.geo.origin.windowOffset.right-this.__options.minIntersection-1:o.coord.left>i.geo.window.size.width-o.size.width&&(i.geo.origin.windowOffset.left+this.__options.minIntersection<=i.geo.window.size.width?o.coord.left=i.geo.window.size.width-o.size.width:o.coord.left=i.geo.origin.windowOffset.left+this.__options.minIntersection+1-o.size.width):o.coord.top<0?i.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?o.coord.top=0:o.coord.top=i.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:o.coord.top>i.geo.window.size.height-o.size.height&&(i.geo.origin.windowOffset.top+this.__options.minIntersection<=i.geo.window.size.height?o.coord.top=i.geo.window.size.height-o.size.height:o.coord.top=i.geo.origin.windowOffset.top+this.__options.minIntersection+1-o.size.height):(o.coord.left>i.geo.window.size.width-o.size.width&&(o.coord.left=i.geo.window.size.width-o.size.width),o.coord.left<0&&(o.coord.left=0)),n.__sideChange(a,o.side),i.tooltipClone=a[0],i.tooltipParent=n.__instance.option("parent").parent[0],i.mode=o.mode,i.whole=o.whole,i.origin=n.__instance._$origin[0],i.tooltip=n.__instance._$tooltip[0],delete o.container,delete o.fits,delete o.mode,delete o.outerSize,delete o.whole,o.distance=o.distance.horizontal||o.distance.vertical;var u,d,_,f=t.extend(!0,{},o);if(n.__instance._trigger({edit:function(t){o=t},event:e,helper:i,position:f,type:"position"}),n.__options.functionPosition){var h=n.__options.functionPosition.call(n,n.__instance,i,f);h&&(o=h)}l.destroy(),"top"==o.side||"bottom"==o.side?(u={prop:"left",val:o.target-o.coord.left},d=o.size.width-this.__options.minIntersection):(u={prop:"top",val:o.target-o.coord.top},d=o.size.height-this.__options.minIntersection),u.val<this.__options.minIntersection?u.val=this.__options.minIntersection:u.val>d&&(u.val=d),_=i.geo.origin.fixedLineage?i.geo.origin.windowOffset:{left:i.geo.origin.windowOffset.left+i.geo.window.scroll.left,top:i.geo.origin.windowOffset.top+i.geo.window.scroll.top},o.coord={left:_.left+(o.coord.left-i.geo.origin.windowOffset.left),top:_.top+(o.coord.top-i.geo.origin.windowOffset.top)},n.__sideChange(n.__instance._$tooltip,o.side),i.geo.origin.fixedLineage?n.__instance._$tooltip.css("position","fixed"):n.__instance._$tooltip.css("position",""),n.__instance._$tooltip.css({left:o.coord.left,top:o.coord.top,height:o.size.height,width:o.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(u.prop,u.val),n.__instance._$tooltip.appendTo(n.__instance.option("parent")),n.__instance._trigger({type:"repositioned",event:e,position:o})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},i=this.__instance._$origin[0].getClientRects();i.length>1&&(1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),i=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)));if(i.length<2)e.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),e.bottom=e.top,e.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),e.right=e.left;else{var o=i[0];e.top=Math.floor(o.left+(o.right-o.left)/2),o=i.length>2?i[Math.ceil(i.length/2)-1]:i[0],e.right=Math.floor(o.top+(o.bottom-o.top)/2),o=i[i.length-1],e.bottom=Math.floor(o.left+(o.right-o.left)/2),o=i.length>2?i[Math.ceil((i.length+1)/2)-1]:i[i.length-1],e.left=Math.floor(o.top+(o.bottom-o.top)/2)}return e}}})}),jQuery(document).ready(function($){var fchunker_upload={fchunker:function(t){$.extend(t),$.upId&&$.upUrl&&($.domHtml=$("#"+$.upId).html(),$.upInputId=$.upId+"_input")},fchunker_limitFileSize:function(t,e){for(var i=["KB","MB","GB"],o=e.toUpperCase(),n=0,s=0;s<i.length;s++){var r=o.indexOf(i[s]);if(r>-1){n=parseInt(o.substr(0,r))*Math.pow(1024,s+1);break}}return!(t.size>n)},upErrorMsg:function(t){$.upError=t},upStop:function(t){$.upError=t},upStatus:function(){return!$.upError||("function"==typeof $.upStop&&$.upStop($.upError),!1)},fchunker_getPercent:function(t,e){if(t=parseFloat(t),e=parseFloat(e),isNaN(t)||isNaN(e))return"-";return e<=0?0:Math.round(t/e*1e4)/100},fchunker_upload:function(t,e){$.upError="",$.tempFile=$("#"+$.upInputId)[0].files[0],"file"==t&&($.tempFile=e);var i=$.tempFile;if(!i)return!1;"function"==typeof $.upStart&&$.upStart();var o=i.name,n=o.lastIndexOf("."),s=o.length,r=o.substring(n+1,s);if($.upType&&(uptype=$.upType.split(","),-1==$.inArray(r,uptype)&&($.upError="Type error: Error-"+r)),$.upMaxSize&&($.fchunker_limitFileSize(i,$.upMaxSize+"MB")||($.upError="Error")),0==$.upStatus())return!1;$.taskStart=+new Date,setTimeout("jQuery.fchunker_upload_core()","100")},fchunker_upload_core:function(){var file=$.tempFile;if(!file)return!1;$.upShardSize||($.upShardSize=2);for(var filename=file.name,size=file.size,index1=filename.lastIndexOf("."),index2=filename.length,suffix=filename.substring(index1+1,index2),shardSize=1024*$.upShardSize*1024,succeed=0,shardCount=Math.ceil(size/shardSize),re=[],start,end=0,i=0;i<shardCount;++i)re[i]=[],start=i*shardSize,end=Math.min(size,start+shardSize),re[i].file_data=file.slice(start,end),re[i].file_name=filename,re[i].file_size=size;const URL=$.upUrl;var i2=0,i3=1,fcs=Array(),xhr=new XMLHttpRequest;function ajaxStack(stack){if(0!=$.upStatus()){var form=new FormData;stack[i2]&&(fcs=stack[i2],form.append("file_data",fcs.file_data),form.append("file_name",fcs.file_name),form.append("file_size",fcs.file_size),form.append("file_total",shardCount),form.append("file_index",i3),form.append("taskStart",$.taskStart),form.append("action","backup_migration"),form.append("token","bmi"),form.append("f","upload-backup"),xhr.open("POST",URL,!0),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.setRequestHeader("HTTP_X_REQUESTED_WITH","XMLHttpRequest"),xhr.onload=function(){ajaxStack(stack)},xhr.onreadystatechange=function(){if(0!=$.upStatus()&&4==xhr.readyState&&200==xhr.status){var data=xhr.responseText?eval("("+xhr.responseText+")"):"";++succeed;var cent=$.fchunker_getPercent(succeed,shardCount);"function"==typeof $.upEvent&&$.upEvent(cent),100==cent?setTimeout(function(){"function"==typeof $.upCallBack&&$.upCallBack(data)},500):"function"==typeof $.upCallBack&&$.upCallBack(data)}},xhr.send(form),i2++,i3++,form.delete("file_data"),form.delete("file_name"),form.delete("file_size"),form.delete("file_total"),form.delete("taskStart"),form.delete("file_index"),form.delete("action"),form.delete("token"),form.delete("f"))}}ajaxStack(re),re=null,file=null}};$.extend(fchunker_upload)}),jQuery(window).on("load",function(){setTimeout(function(){jQuery("#bmi").css({opacity:0}),jQuery("#bmi-preload").css({opacity:1}),jQuery("#bmi-preload").animate({opacity:0},150,function(){jQuery("#bmi-preload").remove(),jQuery("#bmi").css({display:"block"}),jQuery.bmi.dropdowns.init(),setTimeout(function(){jQuery("#wpfooter").show(200),jQuery("#bmi").animate({opacity:1},350)},100)})},50)}),jQuery(document).ready(function(t){let e=!1;t.extend({bmi:{clipboard:function(e){try{const i=document.createElement("textarea");return i.value=e,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),t.bmi.alert("success",t("#bmi-success-copy").text(),3e3),!0}catch(e){return console.log(e),t.bmi.alert("warning",t("#bmi-failed-copy").text(),3e3),!1}},alert:function(e="default",i="---",o=7e3){t(".bmi-notification-box").length<=0&&t("body").find("#bmi").prepend(t('<div class="bmi-notification-box"></div>')),e="default"==e?"":"success"==e?" is-success":"warning"==e?" is-warning":"error"==e?" is-danger":" is-info";let n=Math.floor(Math.random()*Math.floor(64e3)),s=`<div style="display: none;" id="ntf-${n}" class="bmi-notification${e}">\n <button class="bmi-times-button" onclick="jQuery.bmi.hideAlert(this)">&times;</button>\n <div class="bmi-cf">\n <div class="bmi-left bmi-alert-icon"><div class="bmi-icon-bg"></div></div>\n <div class="bmi-left bmi-alert-msg-title">\n <div class="bmi-title${e}">Backup Migration</div>\n <div>${i}</div>\n </div>\n </div>\n </div>`;t(".bmi-notification-box").prepend(s);let r=t(`#ntf-${n}`);r.css({opacity:0,display:"block"});let a=r.outerWidth();r.outerHeight();r.css({right:"-35vw","font-size":"0px",width:0,padding:0,opacity:"0"}),r.animate({right:"15px",width:a,padding:"1rem 2rem 1rem 1.5rem",opacity:"1"},{duration:200,queue:!1}),r.animate({"font-size":"16px"},{duration:300,queue:!1}),setTimeout(()=>{t(`#ntf-${n}`).css({width:""})},250),setTimeout(()=>{r.animate({"font-size":"0px"},{duration:200,queue:!1}),r.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){r.remove()})},o)},_msg:function(e){"msg"==e.status&&(void 0===e.level&&(e.level="info"),t.bmi.alert(e.level,e.why,3e3),console.log("Backup-migration: ","["+e.level.toUpperCase()+"]",e.why))},hideAlert:function(e){let i=t(e).parents(".bmi-notification");i.animate({"font-size":"0px"},{duration:200,queue:!1}),i.animate({right:"-35vw",height:0,width:0,margin:0,padding:0,opacity:"0"},300,function(){i.remove()})},modal:function(e=!1){let i=!1;return 0!=e&&(i=document.getElementById(e)),{clearModal:function(){i.querySelectorAll(".customselect").forEach(function(t){t.classList.remove("active")}),i.querySelectorAll('input[type="text"]').forEach(function(t){t.value="",t.setAttribute("value","")})},open:function(e=function(){}){i.classList.add("before-open"),setTimeout(function(){i.classList.add("open"),t("html")[0].style.overflowY="hidden",setTimeout(e,410)},10)},close:function(e=function(){}){i.offsetWidth>0&&i.offsetHeight>0?(i.classList.add("before-close"),setTimeout(function(){i.classList.add("closed"),setTimeout(function(){i.classList.remove("before-open"),i.classList.remove("open"),i.classList.remove("before-close"),i.classList.remove("closed"),t.bmi.modal(i.id).clearModal(),e()},410)},10)):(i.classList.remove("before-open"),i.classList.remove("open"),i.classList.remove("before-close"),i.classList.remove("closed"),e()),t("html")[0].style.overflowY="auto"},closeAll:function(){document.querySelectorAll(".modal").forEach(function(e){t.bmi.modal(e.id).close()}),t("html")[0].style.overflowY="auto"}}},json:function(e){return new Promise(function(i,o){try{return i(JSON.parse(e))}catch(n){if("string"!=typeof e)return o(!1);{let n=t.bmi.reverse(e).indexOf("}");n=0==n?e.length:-n,e=e.slice(e.indexOf("{"),n);try{return i(JSON.parse(e))}catch(t){return o(!1)}}}})},reverse:function(e){return"string"==typeof e?""===e?"":t.bmi.reverse(e.substr(1))+e.charAt(0):e},ajax:function(e,i={}){return new Promise(function(o,n){function s(t,i){i||(i=t),console.log("------- BACKUP MIGRATION ERROR START -------"),!1===t?(console.log("Call: ",e),console.log("Status: ",i.status),console.log("Error: ",i.responseText)):console.log(i),console.log("-------- BACKUP MIGRATION ERROR END --------\n\n"),n(t,i.responseText)}i.action="backup_migration",i.token="bmi",i.f=e,t.post(ajaxurl,i).done(e=>{t.bmi.json(e).then(function(t){o(t)}).catch(function(t){s("json")})}).fail(t=>{s(!1,t)})})},tooltips:{init:function(){let e={delay:200,debug:!1,delayTouch:[100,200],interactive:!1,distance:0,side:"top",contentAsHTML:!1,maxWidth:460,triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},theme:["bmi-tooltip","bmi-tt-default","bmi-tt-default-customized"],repositionOnScroll:!0,functionReady:function(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}},i=t(".tooltip"),o=t(".tooltip-html"),n=t(".premium-wrapper"),s=JSON.parse(JSON.stringify(e));s.contentAsHTML=!0,s.interactive=!0;for(let o=0;o<i.length;++o){let n=i[o],s=n.getAttribute("data-top"),r=n.getAttribute("side"),a=JSON.parse(JSON.stringify(e));a.content=n.getAttribute("tooltip"),s&&(a.distance=parseInt(s)),r&&r.trim().length>0&&(a.side=r),t(n).tooltipster(a)}for(let e=0;e<o.length;++e){let i=o[e],n=i.getAttribute("side"),r=JSON.parse(JSON.stringify(s));r.content=i.getAttribute("tooltip"),n&&n.trim().length>0&&(r.side=n),t(i).tooltipster(r)}for(let i=0;i<n.length;++i){let o=n[i],s=JSON.parse(JSON.stringify(e));s.contentAsHTML=!0,s.interactive=!0,s.maxWidth=500,o.getAttribute("tooltip")?s.content=o.getAttribute("tooltip"):s.content=t("#premium-tooltip")[0].innerHTML,o.getAttribute("side")&&(s.side=o.getAttribute("side")),t(o).tooltipster(s)}},hideAll:function(e=!1){function i(){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}e?i():setTimeout(i,10)}},collapsers:{toggle:function(i){if(!0===e)return;e=!0;let o=i.getAttribute("group");i.classList.contains("active")?t.bmi.collapsers.close(i):t.bmi.collapsers.open(i,o)},open:function(i,o){t.bmi.collapsers.closeGroup(o),t(i).addClass("active"),t(i).find(".content").show(300),setTimeout(function(){e=!1},300)},close:function(i){t(i).removeClass("active"),t(i).find(".content").hide(300),setTimeout(function(){e=!1},300)},closeGroup:function(i){t('.collapser[group="'+i+'"]').removeClass("active"),t('.collapser[group="'+i+'"]').find(".content").hide(300),setTimeout(function(){e=!1},300)},closeAll:function(){t(".collapser").removeClass("active"),t(".collapser").find(".content").hide(300),setTimeout(function(){e=!1},300)}},isUrlValid:function(t){return!!new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i").test(t)},bytesToHuman:function(t,e,i,o,n){return(e=Math,i=e.log,o=1024,n=i(t)/i(o)|0,t/e.pow(o,n)).toFixed(2)+" "+(n?"KMGTPEZY"[--n]+"B":"Bytes")},getCurrentBackups:function(e=function(){}){t("#reloading-bm-list").length>0&&"none"==t("#reloading-bm-list")[0].style.display&&(t("#reloading-bm-list").show(),t.bmi.ajax("get-current-backups",{}).then(function(i){t("#reloading-bm-list").hide(),e(i)}).catch(function(t){console.log(t)}))},fillWithNewBackups:function(e,i=function(){}){backups={},t("#bmi_restore_tbody").html("");let o=t("#bmi-manual-locked").text().trim(),n=Object.keys(e).sort(function(t,i){return+new Date(e[t][1].replace(/\-/g,"/"))-+new Date(e[i][1].replace(/\-/g,"/"))}),s=0;for(;s<n.length;++s){let i=n[s],r="locked"===e[i][5];i=(i=i.replace(/ /g,"")).trim();let a="bmi_br_backup_"+s,l=t(".br_tr_template").clone();l.removeClass("br_tr_template"),l[0].style.display="none",l.find(".br_label").attr("for",a),l.find(".br_checkbox").attr("id",a),l.find(".bc-download-btn").attr("href",t("#BMI_BLOG_URL").text().trim()+"/?backup-migration=BMI_BACKUP&backup-id="+i),l.find(".bc-logs-btn").attr("href",t("#BMI_BLOG_URL").text().trim()+"/?backup-migration=BMI_BACKUP_LOGS&backup-id="+i),l.find(".br_date").text(e[i][1]),l.find(".br_name").text(i),l.find(".br_size").text(t.bmi.bytesToHuman(e[i][4])+" ("+e[i][2]+")"),0!=(""+e[i][6]).trim().length&&e[i][6]+""!="false"||(l.find(".bc-locked-btn").addClass("forever"),l.find(".bc-locked-btn").attr("tooltip",o),r=!0),r?l.find(".bc-unlocked-btn").hide():l.find(".bc-locked-btn").hide(),l.prependTo("#bmi_restore_tbody"),e[i].push(i),backups[a]=e[i]}if(0==s){let e=t("#bmi_restore_tbody").data("empty");t("#bmi_restore_tbody").html('<tr><td class="center text-muted" colspan="100%">'+e+"</td></tr>")}t.bmi.tooltips.init(),t.bmi.showMoreBackups(),i()},showMoreBackups:function(e){backups={};let i=t("#bmi_restore_tbody").find("tr:hidden");for(let e=0;e<i.length&&e<10;++e)setTimeout(function(){t(i[e]).show(300)},50*e);i.length-10<=0?t("#load-more-backups-wrp").hide(300):t("#load-more-backups-wrp").show(300)},reloadBackups:function(e=function(){}){t.bmi.getCurrentBackups(function(i){t.bmi.fillWithNewBackups(i.backups,function(){e(),t("#backups-select-all").prop("checked",!1),t(".del-all-btn-wrp").hide(300)})})},hideAllLists:function(){let e=t(".dropdown-open");if(!(e.length<=0))for(let i=0;i<e.length;++i){let o=t(e[i]);o.hasClass("ignored-open")?o.removeClass("ignored-open"):(o.hide(300),o.removeClass("dropdown-open"),t(o[0].closest(".bmi-dropdown")).removeClass("active"))}},setOption:function(e,i=null,o=!1){let n=e.find(".dropdown-options");e.attr("data-optioner")&&(n=t(".optioner-"+e.attr("data-optioner"))),n.find(".active-option").removeClass("active-option"),!1!==o&&(i=n.find('.dropdown-option[data-value="'+o+'"]')),t(i).hasClass("active-option")||(e.find(".dropdown-title").text(i.text()),e.attr("data-selected",i.data("value")),i.addClass("active-option"),!1===o&&e.change(),t.bmi.hideAllLists())},prepareFile:function(e,i){let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(i)),o.setAttribute("download",e),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),t.bmi.alert("success",t("#bmi-download-should-start").text(),3e3)}}})}),jQuery(document).ready(function(t){t(".collapser .header").on("click",function(e){e.preventDefault();let i=t(this).parent(".collapser")[0];t.bmi.collapsers.toggle(i)}),t(".bmi_will_collapse").on("change",function(e){e.preventDefault();let i=!1;"radio"==this.getAttribute("type")&&"false"==this.getAttribute("value")&&(i=!0),$child=t(this).data("if-checked"),!0!==this.checked||i?t("#"+$child).hide(300):t("#"+$child).show(300)}),t(".collapser-openner").on("click",function(e){e.preventDefault();let i="configuration",o=t(this).data("el");t(this).data("group")&&(i=t(this).data("group")),t.bmi.collapsers.open(o,i),setTimeout(function(){t([document.documentElement,document.body]).animate({scrollTop:t(o).offset().top-50+"px"},300)},300)}),function(){let e=t(".bmi_will_collapse");for(let i=0;i<e.length;++i){let o=!1;$trigger=e[i],$child=t($trigger).data("if-checked"),"radio"==$trigger.getAttribute("type")&&"false"==$trigger.getAttribute("value")&&(o=!0),!0===$trigger.checked?t("#"+$child).show():t("#"+$child).hide()}}()}),jQuery(document).ready(function(t){var e=!0,i=!1;t.bmi.crons=function(){function o(){!function(e,i){t.bmi.ajax("calculate-cron",e).then(function(e){"success"==e.status?i(e):(i(!1),t.bmi._msg(e))}).catch(function(t){i(!1),console.log(t)})}({type:t('[data-id="cron-period"]').attr("data-selected"),day:t('[data-id="cron-day"]').attr("data-selected"),week:t('[data-id="cron-week"]').attr("data-selected"),hour:t('[data-id="cron-hour"]').attr("data-selected"),minute:t('[data-id="cron-minute"]').attr("data-selected"),keep:t('[data-id="cron-keep-backups"]').attr("data-selected"),enabled:!0==!t("#cron-btn-toggle")[0].checked},function(i){"success"===i.status&&!1!==i?(t(".cron-time-server").tooltipster("option","interactive",!1),t(".cron-time-server").tooltipster("option","contentAsHTML",!0),!0===t("#cron-btn-toggle")[0].checked&&(i.data="---"),t(".cron-time-server").tooltipster("content","<b>"+t("#bmi-next-cron").text()+"</b>"+i.data+"<br><b>"+t("#bmi-current-time").text()+"</b>"+i.currdata),e?e=!1:t.bmi.alert("success",t("#bmi-cron-updated").text(),1500)):e?e=!1:t.bmi.alert("error",t("#bmi-cron-updated-fail").text(),2500)})}function n(e){"month"==e?(t(".cron-the").show(),t('[data-id="cron-day"]').show(),t('[data-id="cron-week"]').hide(),t("#cron-on-word").show()):"week"==e?(t(".cron-the").hide(),t('[data-id="cron-day"]').hide(),t('[data-id="cron-week"]').show(),t("#cron-on-word").show()):(t(".cron-the").hide(),t('[data-id="cron-day"]').hide(),t('[data-id="cron-week"]').hide(),t("#cron-on-word").hide())}!0!==i&&(i=!0,t("#bmi").on("change",'[data-id="cron-period"]',function(t){o(),n(t.target.getAttribute("data-selected"))}),t("#bmi").on("change",'[data-id="cron-day"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-week"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-hour"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-minute"]',function(t){t.target.getAttribute("data-selected");o()}),t("#bmi").on("change",'[data-id="cron-keep-backups"]',function(t){t.target.getAttribute("data-selected");o()}),t("#i-backup-cron").on("click",function(){t(".cron-backups").find(".turned-off").is(":visible")&&(t("#cron-btn-toggle").prop("checked",!1),t(".cron-backups").removeClass("disabled"),o(),t(".cron-backups").find(".turned-on").css({opacity:0}),t(".cron-backups").find(".turned-off").css({opacity:0}),t(".cron-backups").find(".turned-on").show(),t(".cron-backups").find(".turned-on").css({opacity:1}),setTimeout(function(){t(".cron-backups").find(".turned-off").hide()},300))}),t("#cron-btn-toggle").on("change",function(){this.checked?t(".cron-backups").addClass("disabled"):t(".cron-backups").removeClass("disabled"),o()}),n(t('[data-id="cron-period"]')[0].getAttribute("data-selected")),o())}}),jQuery(document).ready(function(t){t.bmi.dropdowns={init:function(){let e=t("#bmi");function i(e="null",i="---"){let o=t(".option-template").clone();return o.removeClass("option-template"),o.attr("data-value",e),o.text(i),o}function o(o){if("none"!=o.style.display){o.style.display="none";let n=t(o),s=n.find("option"),r=function(e="---"){let i=t(".dropdown-template").clone();return i.removeClass("dropdown-template"),i.find(".dropdown-title").text(e),i}(function(t){let e="";for(let i=0;i<t.length;++i){let o=t[i].innerText;e.length<o.length&&(e=o)}return e}(s));r=function(e,o){let n=t(e).find(".dropdown-options");t(e).attr("data-optioner")&&(n=t(".optioner-"+t(e).attr("data-optioner")));for(let t=0;t<o.length;++t){let e=o[t];n.append(i(e.value,e.innerText))}return e}(r,s);let a=s[0].value,l=o.getAttribute("data-parent"),c=o.getAttribute("data-classes"),p="true"===o.getAttribute("data-hide");if(n.attr("data-def")&&(a=n.attr("data-def")),t(r).attr("data-id",o.id),t(r).attr("class",((null!=c?c:"")+" bmi-dropdown").trim()),t(r).insertBefore(n),null!==l){let e=parseInt(864197532*Math.random()+123456789);t(r).attr("data-optioner",e),t(r).find(".dropdown-options").attr("data-oparent",e),t(r).find(".dropdown-options").addClass("optioner-"+e),t(r).find(".dropdown-options").appendTo(l),t(l).css({position:"relative"})}let u=t(r).clone();if(!u)return;u[0].style.visibility="hidden",e.append(u);let d=u.width();u.remove(),t.bmi.setOption(t(r),null,a),t(r).find(".dropdown-title")[0].style.minWidth=d+10+"px",p&&t(r).hide()}}!function(){let t=e.find("select");for(let e=0;e<t.length;++e)o(t[e])}(),t.bmi.crons(),e.on("click",function(e){t(e.target).hasClass("bmi-dropdown")||e.target.closest(".bmi-dropdown")||t.bmi.hideAllLists()}),e.on("click",".dropdown-title",function(e){$dropdown=t(e.target.closest(".bmi-dropdown")),function(e){let i=e.find(".dropdown-options");if(e.attr("data-optioner")){(i=t(".optioner-"+e.attr("data-optioner"))).css({position:"absolute"});let o=e[0].offsetWidth,n=e[0].offsetLeft+240,s=e[0].offsetTop+e[0].offsetHeight+5;i.css({maxWidth:o+"px",minWidth:o+"px",top:s+"px",left:n+"px"})}i.hasClass("dropdown-open")?(e.removeClass("active"),i.removeClass("dropdown-open"),i.hide(300)):(e.addClass("active"),i.addClass("dropdown-open"),i.addClass("ignored-open"),i.show(300))}($dropdown),t.bmi.hideAllLists()}),e.on("click",".dropdown-option",function(e){t(e.target.closest(".dropdown-options")).attr("data-oparent")?($dropdown=t('.bmi-dropdown[data-optioner="'+t(e.target.closest(".dropdown-options")).attr("data-oparent")+'"]'),$option=t(e.target),t.bmi.setOption($dropdown,$option)):($dropdown=t(e.target.closest(".bmi-dropdown")),$option=t(e.target),t.bmi.setOption($dropdown,$option))})}}}),jQuery(document).ready(function(t){var e,i,o=!1,n=!1,s=0;let r=0,a=0,l=null,c=null,p=null,u=!1,d=!1,_=4500,f=!1,h=!1,m=null,g=!1,b=!1,w=!1,v={};function y(e){return $cb=t("#"+e).is(":checked"),!0===$cb?"true":"false"}function k(){return size=0,t("#files-group-plugins").is(":checked")&&(size+=parseInt(t('label[for="files-group-plugins"]').find(".value").attr("bytes"))),t("#files-group-uploads").is(":checked")&&(size+=parseInt(t('label[for="files-group-uploads"]').find(".value").attr("bytes"))),t("#files-group-themes").is(":checked")&&(size+=parseInt(t('label[for="files-group-themes"]').find(".value").attr("bytes"))),t("#files-group-other-contents").is(":checked")&&(size+=parseInt(t('label[for="files-group-other-contents"]').find(".value").attr("bytes"))),t("#files-group-wp-install").is(":checked")&&(size+=parseInt(t('label[for="files-group-wp-install"]').find(".value").attr("bytes"))),size}function x(e,i){if(a+=1,r+=parseInt(i.bytes),i.bytes<=1e4)t("#bmi-scan-"+e).find(".value").text("(0 MB)");else{let o=(parseInt(i.bytes)/1024/1024).toFixed(2);t("#bmi-scan-"+e).find(".value").text("("+o+" MB)")}t("#bmi-scan-"+e).find(".value").attr("bytes",parseInt(i.bytes)),5==a&&(t("#bmi-scan-total").find(".value").text("("+t.bmi.bytesToHuman(r)+")"),t("#bmi-scan-total").find(".value").attr("bytes",parseInt(r)),T())}function C(e){t.bmi.ajax("scan-directory",{folder:e}).then(function(t){x(e,t)}).catch(function(t){x(t,{bytes:"0",readable:"0 B"})})}function $(e=!1,i=function(){}){t.bmi.ajax("is-running-backup",{}).then(function(o){"success"==o.status?i(!1):1==e?i(!0):t.bmi._msg(o)}).catch(function(t){i(!1),console.log(t)})}function T(){let e=parseInt(t("#bmi-scan-total").find(".value").attr("bytes")),i=parseInt(k());t("#files-group-backup").is(":checked")||(e=0,i=0);let o=((e-i)/1024/1024).toFixed(2),n=(i/1024/1024).toFixed(2);"0.00"==o&&(o="0"),"0.00"==n&&(n="0"),t("#esta-exclude").text(o+" MB"),t("#esta-size-for").text(n+" MB")}function I(){t("#prenotice-modal .prenotice").hide(),t("#prenotice-size").text(t.bmi.bytesToHuman(k())),t(".prenotic-3").show(),"true"!==y("database-group-backup")||"true"!==y("database-group-backup")||"true"===y("files-group-backup")&&("true"!==y("files-group-plugins")&&"true"!==y("files-group-themes")&&"true"!==y("files-group-uploads")&&"true"!==y("files-group-wp-install")&&y("files-group-other-contents"),1)||t(".prenotic-6").show(),"true"===y("database-group-backup")||"true"===y("database-group-backup")||"true"!==y("files-group-backup")||"true"!==y("files-group-plugins")&&"true"!==y("files-group-themes")&&"true"!==y("files-group-uploads")&&"true"!==y("files-group-wp-install")&&"true"!==y("files-group-other-contents")||t(".prenotic-5").show(),"true"===y("database-group-backup")&&"true"===y("files-group-backup")&&"true"===y("files-group-plugins")&&"true"===y("files-group-themes")&&"true"===y("files-group-uploads")&&"true"===y("files-group-other-contents")||t(".prenotic-4").show(),t("#prenotice-modal .prenotice:visible").css({background:""});let e=t("#prenotice-modal .prenotice"),i=[];for(let t=0;t<e.length;++t)"none"!==e[t].style.display&&i.push(e[t]);for(let t=0;t<i.length;t+=2)i[t].style.background="#f8f8f8"}function O(t,e=function(){}){let i=window.location.protocol.includes("https");t=t.includes("https")?t.slice(5):t.slice(4),t=i?"https"+t:"http"+t;try{window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp.onloadend=function(){4==xmlhttp.readyState&&200==xmlhttp.status?e(xmlhttp.responseText):e(!1)},xmlhttp.open("GET",t),xmlhttp.send()}catch(t){e(!1)}}function E(i,r){if(!1===i)return;let a=i.split("\n"),l=s;s=a.length,l>0&&l--;for(let i=l;i<a.length;++i){let l=a[i],c=document.createElement("DIV"),p="";if("[INFO]"==l.substr(0,6))p="blue";else if("[SUCCESS]"==l.substr(0,9))p="green";else if("[WARN]"==l.substr(0,6))p="orange";else if("[ERROR]"==l.substr(0,7))p="red";else if("[END-CODE]"==l.substr(0,10))p="hide_so_much";else if("[STEP]"==l.substr(0,6))c.classList.add("bold"),c.classList.add("step"),t("#restore-progress-modal").hasClass("open")?t("#restore_current_step").text(l.slice(29)):t("#current_step").text(l.slice(29));else if(l&&l.trim().length>0&&"["!=l[0]){s--;continue}p.length>0&&c.classList.add(p),c.style.display="none",c.innerText=l,setTimeout(function(){if(r.appendChild(c),l&&l.trim().includes("[END-CODE]")&&(!0===h||!0===w||!0===b)){let i=l;!0===b?i.includes("205")?(b=!1,t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%",J(!0)):Q():!0===w?(i.includes("001")?setTimeout(function(){W()},1e3):Q(),d=!1,w=!1):(h=!1,i.includes("001")&&(o=!0,n=!0,clearTimeout(e),u=!1,D({filename:m},!0)),i.includes("002")&&P(),i.includes("003")&&(t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3)),i.includes("100")&&(t.bmi.modal("backup-progress-modal").close(),j(),t.bmi.modal("backup-progress-modal").close()))}t(c).show(55),r.scrollTop=r.scrollHeight},55*i)}setTimeout(function(){r.scrollTop=r.scrollHeight},110)}function z(e=0,s=1e3,r=null){if(c==e)return;c=e,clearInterval(i);let a=parseFloat(t(".progress-percentage")[0].style.left)-1;if(t("#restore-progress-modal").hasClass("open")&&(a=parseFloat(t("#restore-progress-modal .progress-percentage")[0].style.left)-1),a>e&&0!=e)return;let l=e-a,p=a,d=Math.abs(Math.floor(s/l));i=setInterval(function(){if(p+=1,t("#restore-progress-modal").hasClass("open")?(t("#restore-progress-modal .progress-active-bar")[0].style.width=p.toFixed(2)+"%",t("#restore-progress-modal .progress-percentage")[0].style.left=p.toFixed(2)+"%",t("#restore-progress-modal .progress-percentage")[0].innerText=p.toFixed(0)+"%"):(t(".progress-active-bar")[0].style.width=p.toFixed(2)+"%",t(".progress-percentage")[0].style.left=p.toFixed(2)+"%",t(".progress-percentage")[0].innerText=p.toFixed(0)+"%"),p>=100&&clearInterval(i),p>=100&&null!=r&&(c=null,t("#backup-progress-modal").hasClass("open"))){o=!0,n=!0,D(r,0==u)}p>e&&clearInterval(i)},d)}t("#live-log-toggle").on("click",function(){t(".expanded-logs").length>0?t(this).text(t(this).data("hide")):t(this).text(t(this).data("show")),t("#live-log-wrapper").toggleClass("expanded-logs")}),t("#backup-stop").on("click",function(){t.bmi.ajax("stop-backup",{}).then(function(e){"success"==e.status?t.bmi.alert("success",t("#bmi-abort-soon").text(),3e3):t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#bmi-force-backup-to-stop").on("click",function(e){e.preventDefault(),t.bmi.alert("info",t("#bmi-force-stop-in-progress").text(),3e3),t.bmi.ajax("force-backup-to-stop").then(function(e){t.bmi.alert("success",t("#bmi-force-stop-success").text(),6e3)}).catch(function(e){t.bmi.alert("error",t("#failed-to-stop").text(),6e3),console.log(e)})}),t("#bmi-force-restore-to-stop").on("click",function(e){e.preventDefault(),t.bmi.alert("info",t("#bmi-force-stop-in-progress").text(),3e3),t.bmi.ajax("force-restore-to-stop").then(function(e){t.bmi.alert("success",t("#bmi-force-stop-success").text(),6e3)}).catch(function(e){t.bmi.alert("error",t("#failed-to-stop").text(),6e3),console.log(e)})}),t("#bmi_restore_tbody").on("click",".bc-unlocked-btn",function(e){e.preventDefault();let i=e.target,o=i.closest("tr").querySelector(".br_name").innerText.trim();t.bmi.ajax("lock-backup",{filename:o}).then(function(e){"success"==e.status?(t.bmi.alert("success",t("#bmi-lock-success").text(),6e3),t(i.closest("tr").querySelector(".bc-unlocked-btn")).hide(),t(i.closest("tr").querySelector(".bc-locked-btn")).show()):(t.bmi.alert("error",t("#bmi-lock-error").text(),8e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#files-group-backup").on("change",T),t(".basic-file-exlusion").on("change",'input[type="checkbox"]',T),t("#bmi_restore_tbody").on("click",".bc-locked-btn",function(e){if(e.preventDefault(),t(e.target).hasClass("forever"))return;let i=e.target,o=i.closest("tr").querySelector(".br_name").innerText.trim();t.bmi.ajax("unlock-backup",{filename:o}).then(function(e){"success"==e.status?(t.bmi.alert("success",t("#bmi-unlock-success").text(),3e3),t(i.closest("tr").querySelector(".bc-locked-btn")).hide(),t(i.closest("tr").querySelector(".bc-unlocked-btn")).show()):(t.bmi.alert("error",t("#bmi-unlock-error").text(),3e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#bmi_restore_tbody").on("click",".bc-url-btn",function(e){let i=e.target.closest("tr").querySelector(".bc-download-btn").getAttribute("href");t.bmi.clipboard(i)}),t("#bmi_restore_tbody").on("click",".bc-remove-btn",function(e){let i=e.target.closest("tr").querySelector(".br_name").innerText.trim();p=[i],t("#delete-confirm-modal").find(".text2").hide(),t("#delete-confirm-modal").find(".text1").show(),t.bmi.modal("delete-confirm-modal").open()}),t("#sure_delete").on("click",function(){t.bmi.ajax("delete-backup",{filenames:p}).then(function(e){p=null,"success"==e.status?(t.bmi.reloadBackups(),t.bmi.modal("delete-confirm-modal").close(),t.bmi.alert("success",t("#bmi-remove-success").text(),3e3)):(t.bmi.alert("warning",t("#bmi-remove-error").text(),3e3),console.error("BMI Backend error: ",e))}).catch(function(t){console.log(t)})}),t("#add-exclusion-rule").on("click",function(e){e.preventDefault();let i=t(".exclusion_template").clone();i[0].classList.remove("exclusion_template"),i[0].style.display="none",t("#bmi_exclusion_rules").append(i),i.show(300)}),t("#bmi_exclusion_rules").on("click",".kill-exclusion-rule",function(e){e.preventDefault(),$el=e.target,$parent=$el.closest(".exclude-row"),$parent&&(t($parent).hide(300),setTimeout(function(){$parent.remove()},320))}),t("#i-backup-creator").on("click",function(){if(!isNaN(k()))return k()/1024/1024>1e3*parseInt(t("#BMI_REV").text().trim())?j():void("true"===y("database-group-backup")||"true"===y("files-group-backup")&&("true"===y("files-group-plugins")||"true"===y("files-group-themes")||"true"===y("files-group-uploads")||"true"===y("files-group-wp-install")||"true"===y("files-group-other-contents"))?(I(),$(!1,function(){t.bmi.modal("prenotice-modal").open()})):t.bmi.alert("warning",t("#bmi-no-selected").text(),3e3));t.bmi.alert("warning",t("#bmi-preb-processing").text(),3e3)}),t("#BFFSIN").on("change",function(t){let e=parseInt(this.value);isNaN(e)?this.value=1:this.value=e>9999?9999:e<=0?1:e}),t(".save-btn").on("click",function(e){e.preventDefault();let i={},o=t(this.closest(".save-action")).data("save");if(o){if("save-storage"==o)i.directory=t("#bmi_path_storage_default").val(),i.access="true"===t('[name="radioAccessViaLink"]:checked').val()?"true":"false";else if("save-file-config"==o){i.database_group=y("database-group-backup"),i.files_group=y("files-group-backup"),i["files-group-plugins"]=y("files-group-plugins"),i["files-group-uploads"]=y("files-group-uploads"),i["files-group-themes"]=y("files-group-themes"),i["files-group-other-contents"]=y("files-group-other-contents"),i["files-group-wp-install"]=y("files-group-wp-install"),i.files_by_filters=y("files_by_filters"),i.ex_b_fs=y("ex_b_fs"),i.BFFSIN=t("#BFFSIN").val()?t("#BFFSIN").val():"1",i.ex_b_names=y("ex_b_names"),i.ex_b_fpaths=y("ex_b_fpaths"),i.ex_b_dpaths=y("ex_b_dpaths");let e=[],o=t("#bmi_exclusion_rules").find(".exclude-row");for(let i=0;i<o.length;++i){let n=t(o[i]),s=n.find(".exclusion_txt").val(),r=n.find(".exclusion_position").find(".bmi-dropdown").data("selected")+"",a=n.find(".exclusion_where").find(".bmi-dropdown").data("selected")+"";e.push({txt:s,pos:r,whr:a})}i["dynamic-names"]=e,i["dynamic-fpaths-names"]=t("#dynamic-fpaths-names").val().split("\n"),i["dynamic-dpaths-names"]=t("#dynamic-dpaths-names").val().split("\n")}else if("store-config"==o)i.name=t("#backup_filename").val().trim();else{if("save-other-options"!=o)return;i.email=t("#email-for-notices").val().trim(),i.email_title=t("#email-title-for-notices").val().trim(),i.schedule_issues=y("scheduled-issues"),i.experiment_timeout=y("experimental-timeout"),i.experimental_hard_timeout=y("experimental-hard-timeout"),i.php_cli_disable_others=y("cli-disable-others"),i.php_cli_manual_path=t("#cli-manual-path").val().trim(),i.download_technique=y("download-technique"),i.uninstall_config=y("uninstalling-configs"),i.uninstall_backups=y("uninstalling-backups"),i.normal_timeout=y("normal-timeout"),i.db_queries_amount=t("#db_queries_amount").val().trim(),i["bmi-restore-splitting"]=y("bmi-restore-splitting")}t.bmi.ajax(o,i).then(function(e){"success"==e.status?e.errors<=0?(t.bmi.alert("success",t("#bmi-save-success").text(),3e3),t.bmi.collapsers.closeAll()):t.bmi.alert("warning",t("#bmi-save-issues").text(),3e3):t.bmi._msg(e)}).catch(function(t){console.log(t)})}}),t(".close-chapters").on("click",function(e){e.preventDefault(),t.bmi.collapsers.closeAll()}),t("#rescan-for-backups").on("click",function(){t.bmi.reloadBackups()}),t(".storage-checkbox").on("click",function(){let e=t(this).attr("data-toggle"),i=t(t(this)[0].closest(".tab2-item"));t(this).is(":checked")?(t("#"+e).show(300),i.addClass("activeList")):(t("#"+e).hide(300),i.removeClass("activeList"))});var S=0;function A(e=function(){}){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_full.log&backup-id=current&t="+ +new Date,function(i){if(!i)return e();let o=i.split("\n").slice(0,1)[0];""===o.trim()?(o=i.split("\n").slice(0,2)[1],i=i.split("\n").slice(2).join("\n")):i=i.split("\n").slice(1).join("\n");let n=t(".log-wrapper").find("pre")[0],s=t("#bmi-making-archive").text().trim();if(o&&0!=o&&void 0!==o&&t("#current_step").text().trim().slice(0,s.length)==s){let e=document.getElementById("bmi_counter_magic");if(e){let i=parseInt(e.innerText);S=parseInt(o.split("/")[0]),isNaN(i)||isNaN(S)||(z(parseInt(o.split("/")[0])/parseInt(o.split("/")[1])*100),async function(t,e,i,o){let n=null,s=function(r){if(S>i)return;n||(n=r);let a=Math.min((r-n)/o,1);t.innerText=Math.floor(a*(i-e)+e),a<1&&window.requestAnimationFrame(s)};window.requestAnimationFrame(s)}(e,i,S,2e3),"---"===t("#bmi_magic_max_count").text()&&100!=parseInt(o.split("/")[1])&&(t("#bmi_magic_max_count").text(parseInt(o.split("/")[1])),t("#entire_magic_counter").is(":hidden")&&t("#entire_magic_counter").show()))}else{let e=parseInt(o.split("/")[1]);100==e&&(e="---"),t("#current_step").html(s+' <span id="entire_magic_counter">(<span id="bmi_counter_magic">0</span>/<span id="bmi_magic_max_count">'+e+"</span>)</span>"),(isNaN(parseInt(e))||"---"==e)&&t("#entire_magic_counter").hide()}}i&&0!=i&&void 0!==i&&E(i,n),e()})}function B(){t(".log-wrapper").find("pre")[0].innerText="",z(0),setTimeout(function(){A(function(){!function t(){A(function(){clearTimeout(e),e=setTimeout(function(){!0===u&&t()},1500)})}()})},300)}function R(i=!0){!0===i&&(t(".log-wrapper").find("pre")[0].innerText="",z(0)),N(function(){clearTimeout(e),function t(){N(function(){e=setTimeout(function(){!0!==d&&!0!==b||t()},800)})}()})}function L(t=function(){}){$(!0,function(e){t(e)})}function M(e=!1,i=function(){}){t.bmi.ajax("reset-latest",{}).then(function(o){!0===e?i():"success"==o.status?(i(),t.bmi.modal("backup-progress-modal").open()):t.bmi._msg(o)}).catch(function(t){console.log(t)})}function D(s,r=!1){(o&&n||r)&&setTimeout(function(){u=!1,t("#backup-progress-modal").hasClass("open")&&(t.bmi.modal("backup-progress-modal").close(),"true"==t('[name="radioAccessViaLink"]:checked').val()?t("#accessible-at-section").show():t("#accessible-at-section").hide(),t.bmi.modal("backup-success-modal").open()),clearInterval(i),clearTimeout(e);let o=t("#BMI_BLOG_URL").text().trim()+"?backup-migration=BMI_BACKUP&backup-id="+s.filename+"&t="+ +new Date,n=t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date;t("#text-input-copy")[0].value=o,t("#download-backup-url").attr("href",o),t("#download-backup-log-url").attr("href",n),t.bmi.reloadBackups(),setTimeout(function(){clearInterval(i),t(".log-wrapper").find("pre")[0].innerText="",t(".progress-active-bar")[0].style.width="0%",t(".progress-percentage")[0].style.left="0%",t(".progress-percentage")[0].innerText="0%"},300)},700)}function P(i=!1){setTimeout(function(){$(!0,function(o){if(!0===o)return;t.bmi.modal("backup-progress-modal").close(),clearTimeout(e),t.bmi.modal("backup-progress-modal").close(),t("#backup-error-pre").text(t("#bmi-loading-translation").text().trim()),t.bmi.modal("backup-error-modal").open(),O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date,function(o){if(clearTimeout(e),0!=o||i){let e=t("#backup-error-pre")[0];t("#backup-error-pre").text(""),s=0,E(o,e)}else P(!0)})})},2e3)}function j(){t.bmi.modal("bfs-modal").open()}function q(e){let i=e.status,o=parseInt(e.errors),n=parseInt(e.iteratio),s=parseInt(e.sf);if(!0===i&&-1===n)return g=!1,window.onbeforeunload=null,t(".backup-minimize").removeClass("disabled"),D({filename:m},!0);if(!isNaN(s)&&s>-1&&(g.filessofar=s),!isNaN(n)&&n>-1&&(g.iteratio+=1),isNaN(o)||o>0||0==i){if(!isNaN(o)&&o>4)return h=!1,m=!1,g=!1,window.onbeforeunload=null,t(".backup-minimize").removeClass("disabled"),P();setTimeout(function(){return F(g,o)},1500)}else F(g,o)}function F(t,e=0){!1===g&&(t.iteratio=0,g=t),function(t,e,i=0){let o=new XMLHttpRequest;o.open("POST",t.url,!0),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Content-Accept","*/*"),o.setRequestHeader("Access-Control-Allow-Origin","*"),o.setRequestHeader("Content-ConfigDir",t.config_dir),o.setRequestHeader("Content-Content",t.content_dir),o.setRequestHeader("Content-Backups",t.backup_dir),o.setRequestHeader("Content-Identy",t.identy),o.setRequestHeader("Content-Url",t.url),o.setRequestHeader("Content-Abs",t.abs_dir),o.setRequestHeader("Content-Dir",t.root_dir),o.setRequestHeader("Content-Manifest",t.manifest),o.setRequestHeader("Content-Name",t.backupname),o.setRequestHeader("Content-Safelimit",t.safelimit),o.setRequestHeader("Content-Start",t.start),o.setRequestHeader("Content-Filessofar",t.filessofar),o.setRequestHeader("Content-Total",t.total_files),o.setRequestHeader("Content-Rev",t.rev),o.setRequestHeader("Content-It",t.iteratio),o.setRequestHeader("Content-Browser",!0),o.onload=function(){if(200===o.status){let t=o.getResponseHeader("Content-Finished");if(void 0!==t&&t&&"true"==t)return e({status:!0,iteratio:-1,sf:-1,errors:i=0});let n=o.getResponseHeader("Content-It"),s=o.getResponseHeader("Content-Filessofar");return e(void 0!==n&&n?{status:!0,iteratio:n,sf:s,errors:i}:{status:!1,iteratio:-1,sf:-1,errors:++i})}return e({status:!1,iteratio:-1,sf:-1,errors:++i})},o.onerror=function(){return e({status:!1,iteratio:-1,sf:-1,errors:++i})},o.send()}(g,q,e)}function H(e=function(){}){L(function(i){!0===i?t("#backup-progress-modal").hasClass("open")||(!1===u&&(o=!1,u=!0,f=!0),t("#bmi-ongoing-backup").show(300)):(t("#bmi-ongoing-backup").is(":visible")&&t("#bmi-ongoing-backup").hide(300),t("#backup-progress-modal").hasClass("open")&&!0===f?(!0===u&&(u=!1),f=!1,t.bmi.getCurrentBackups(function(e){t.bmi.fillWithNewBackups(e.backups,function(){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest.log&backup-id=current&t="+ +new Date,function(e){if(!1===e)t.bmi.modal("backup-progress-modal").close();else{let i="Backup process aborted",o="[ERROR]";if((e=e.split("\n"))[e.length-1].includes(i)||e[e.length-2].includes(i))t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3);else if(e[e.length-1].includes(o)||e[e.length-2].includes(o))P();else{t.bmi.modal("backup-progress-modal").close(),t.bmi.modal("backup-success-modal").open();let e=t(t("#bmi_restore_tbody").find("tr")[0]).find(".bc-download-btn").attr("href");t("#download-backup-url").attr({href:e}),t("#text-input-copy").val(e)}}})})})):!0!==u||t("#backup-progress-modal").hasClass("open")||(u=!1,t.bmi.reloadBackups())),e()})}function N(e=function(){}){O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_migration_full.log&backup-id=current&t="+ +new Date,function(i){if(!i)return e();let o=i.split("\n").slice(0,1)[0];if(i=i.split("\n").slice(1).join("\n"),!1===o||isNaN(parseFloat(o)))return e();let n=t("#restore-live-log-wrapper").find("pre")[0];i.includes("<")||i.includes(">")||i&&0!=i&&void 0!==i&&E(i,n),z(o),e()})}function G(e=function(){}){t.bmi.ajax("htaccess-litespeed",{}).then(function(t){setTimeout(function(){e(!0)},400)}).catch(function(t){e(!1),console.log(t)})}function U(e=function(){},i=!1){t.bmi.ajax("migration-locked",{}).then(function(o){"success"==o.status?e(!0):(i||t.bmi._msg(o),e(!1))}).catch(function(t){console.log(t)})}function Q(e=""){U(function(e){e&&setTimeout(function(){if(!t("#restore-progress-modal").hasClass("open"))return;d=!1,b=!1,t("#restore-error-pre").text(t("#bmi-loading-translation").text().trim()),O(t("#BMI_BLOG_URL").text().trim()+"?backup-migration=PROGRESS_LOGS&progress-id=latest_migration.log&backup-id=current&t="+ +new Date,function(e){if(0==e)setTimeout(function(){Q()},1500);else{let i=t("#restore-error-pre")[0];t("#restore-error-pre").text(""),s=0,E(e,i)}}),t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-error-modal").open()},1e3)},!0)}function W(){t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-success-modal").open(),setTimeout(function(){t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%"},500),w=!1}function J(o=!1,n=null){let r=l;if(!r||r.trim().length<=0)return t.bmi.alert("warning",t("#bmi-no-file").text(),3e3);t("#pre-restore-modal").hasClass("open")&&t.bmi.modal("pre-restore-modal").close(),t("#restore-progress-modal").hasClass("open")||t.bmi.modal("restore-progress-modal").open(),o||(t("#restore-live-log-wrapper").find("pre")[0].innerText=""),null==n&&(s=0,d=!0,clearTimeout(e),M(!0,function(){G(function(){N(function(){!function o(n,s,r,a=!1,l="false",c={}){null==r&&R(!0);t.bmi.ajax("restore-backup",{file:n,remote:s,secret:r,ignoreRunning:l,tmpname:a,options:c}).then(function(r){if("cli"===r.status){v={l:r.login,u:r.url},w=!0;let t=document.querySelector(".hide_so_much");if(t){let e=t.innerText;e.includes("001")?setTimeout(function(){W(),d=!1,w=!1},1e3):Q()}}else"success"===r.status?(v={l:r.login,u:r.url},N(function(){setTimeout(function(){clearInterval(i),clearTimeout(e),d=!1,t.bmi.modal("restore-progress-modal").close(),t.bmi.modal("restore-success-modal").open(),setTimeout(function(){t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%"},500)},1500)})):"secret"===r.status?(r.options.step=parseInt(r.options.step)+1,o(n,s,r.secret,r.tmp,"true",r.options)):"restore_ongoing"===r.status?(void 0!==r.options.firstDB&&(r.options.firstDB=!1),void 0!==r.options.dbFinished?!0!==r.options.dbFinished&&"true"!==r.options.dbFinished&&"1"!==r.options.dbFinished||(r.options.step=parseInt(r.options.step)+1):void 0!==r.options.dbConvertionFinished?"true"!==r.options.dbConvertionFinished&&!0!==r.options.dbConvertionFinished||(r.options.step=parseInt(r.options.step)+1):(r.options.step=parseInt(r.options.step)+1,4!=r.options.step&&"4"!=r.options.step||void 0===r.options.repeat_export||!0!==r.options.repeat_export&&"true"!==r.options.repeat_export&&"1"!==r.options.repeat_export||(r.options.step=3,r.options.firstExtract="false")),o(n,s,r.secret,r.tmp,"true",r.options)):"error"===r.status?setTimeout(function(){clearInterval(i),clearTimeout(e),Q()},1e3):(t.bmi.modal("pre-restore-modal").close(),t.bmi.modal("restore-progress-modal").close(),t.bmi._msg(r))}).catch(function(t,e){Q(e),console.log(t)})}(r,o,n)})})}))}function X(){return t("#bmi_restore_tbody").find('input[type="checkbox"]:checked')}function K(e){e.preventDefault(),t("#format-tip-wrp")[0].style.minWidth="calc(100% - 120px)","none"===t("#format-tip-wrp")[0].style.display?t("#format-tip-wrp").show(300):t("#format-tip-wrp").hide(300)}t("#configuration-reset-absolute").on("click",function(e){e.preventDefault(),t.bmi.ajax("reset-configuration",{}).then(function(e){"success"==e.status?window.location.reload():t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#download-site-infos").on("click",function(e){e.preventDefault(),t.bmi.ajax("get-site-data",{}).then(function(e){"success"==e.status?t.bmi.prepareFile("bmi-site-info.debug",JSON.stringify(e.data)):t.bmi._msg(e)}).catch(function(t){console.log(t)})}),t("#start-entire-backup").on("click",function(){t.bmi.modal("prenotice-modal").close(),t(".backup-minimize").removeClass("disabled"),clearTimeout(e),M(!1,function(){G(function(){f=!1,o=!1,u=!0,t.bmi.ajax("create-backup",{estaminated_size:k()}).then(function(s){if("success"==s.status)o=!0,clearTimeout(e),u=!1,A(function(){setTimeout(function(){D(s,!0)},350)});else if("background"==s.status){h=!0,m=s.filename;let i=document.querySelector(".hide_so_much");if(i){let s=i.innerText;s.includes("001")&&(o=!0,n=!0,clearTimeout(e),u=!1,D({filename:m},!0)),s.includes("002")&&P(),s.includes("003")&&(t.bmi.modal("backup-progress-modal").close(),t.bmi.alert("info",t("#bmi-aborted-al").text(),3e3))}}else"background_hard"==s.status?(h=!0,m=s.filename,s.settings.url=s.url,t.bmi.alert("success",t("#bmi-received-hard").text(),3e3),t(".backup-minimize").addClass("disabled"),t("#backup-progress-modal").hasClass("open")||t.bmi.modal("backup-progress-modal").open(),window.onbeforeunload=function(){return"Backup in progress..."},F(s.settings)):(u=!1,setTimeout(function(){clearInterval(i),t(".log-wrapper").find("pre")[0].innerText="",t(".progress-active-bar")[0].style.width="0%",t(".progress-percentage")[0].style.left="0%",t(".progress-percentage")[0].innerText="0%"},300),t.bmi._msg(s),t("#backup-progress-modal").hasClass("open")&&(t.bmi.modal("backup-progress-modal").close(),void 0!==s.bfs?j():P()))}).catch(function(e){t("#backup-progress-modal").hasClass("open")&&P(),console.log(e)}),s=0,u=!0,B()})})}),t("#open_trouble_extenstion").on("click",function(){t("#trouble_extenstion").hasClass("openned")?(t("#trouble_extenstion").hide(300),t("#trouble_extenstion").removeClass("openned"),t(this).removeClass("active")):(t("#trouble_extenstion").show(300),t("#trouble_extenstion").addClass("openned"),t(this).addClass("active"))}),t("#switch-show-trs").on("click",function(){let e=this.dataset.see,i=this.dataset.hide,o=t(".hide-show-tr");t(this).hasClass("shown")?(o.hide(300),t(this).removeClass("shown"),this.innerText=e):(o.show(300),t(this).addClass("shown"),this.innerText=i)}),t("#ex_b_fs").on("change",function(){t("#ex_b_fs").is(":checked")?t("#bmi__collon").show():t("#bmi__collon").hide()}),t("#show-upload-area").on("click",function(){t(".upload_area").hasClass("hidden")?(t(".upload_area").show(300),t(".upload_area").removeClass("hidden"),t([document.documentElement,document.body]).animate({scrollTop:t(this).offset().top-50+"px"},300)):(t(".upload_area").hide(300),t(".upload_area").addClass("hidden"))}),t(".bmi-copper").on("click",function(e){e.preventDefault();let i=t("#"+this.getAttribute("data-copy"))[0];i.value&&i.value.length>0?t.bmi.clipboard(i.value):t.bmi.clipboard(i.innerText)}),t("#bmi_restore_tbody").on("click",".restore-btn",function(e){U(function(i){if(i){let i=e.target.closest("tr").querySelector(".br_name").innerText;if(l=i,!i||i.trim().length<=0)return t.bmi.alert("warning",t("#bmi-no-file").text(),3e3);t("#restore-ok").prop("checked",!1),t.bmi.modal("pre-restore-modal").open()}})}),t("#quick-download-migration").on("click",function(){let e=t("#bm-d-url").val();t.bmi.isUrlValid(e)?U(function(i){i&&(e.length>0?(l=-100,t("#restore-ok").prop("checked",!1),t.bmi.modal("pre-restore-modal").open()):t.bmi.alert("warning",t("#bmi-invalid-url").text(),5e3))}):t.bmi.alert("warning",t("#bmi-invalid-url").text(),5e3)}),t("#restore-start-sure").on("click",function(){t("#restore-ok").is(":checked")?-100===l?(l=null,t("#restore-live-log-wrapper").find("pre")[0].innerText="",U(function(o){M(!0,function(){G(function(){if(o){let o=t("#bm-d-url").val();t("#restore_current_step").text(t("#bmi-downloading-remote").text()),t.bmi.ajax("download-backup",{url:o}).then(function(o){clearInterval(i),clearTimeout(e),"success"===o.status?(b=!0,R(!1),t.bmi.reloadBackups(),l=o.name,setTimeout(function(){clearInterval(i),t("#restore-progress-modal .progress-active-bar")[0].style.width="0%",t("#restore-progress-modal .progress-percentage")[0].style.left="0%",t("#restore-progress-modal .progress-percentage")[0].innerText="0%",t("#restore_current_step").text(t("#bmi-restoring-prepare").text())},600)):"cli_download"==o.status?(l=".cli_download",b=!0,R(!1)):"error"===o.status?Q():(t.bmi._msg(o),Q())}).catch(function(t,e){Q(e),console.log(t)}),t("#restore-live-log-wrapper").find("pre")[0].innerText="",s=0,d=!0,b=!0,R(),t.bmi.modal("pre-restore-modal").close(),t.bmi.modal("restore-progress-modal").open()}})})})):J():t.bmi.alert("warning",t("#bmi-restore-require-checkmark").text(),3e3)}),t(".backup-minimize").on("click",function(){L(function(e){!0===e?t("#bmi-ongoing-backup").show(300):t("#bmi-ongoing-backup").hide()})}),function t(){H(function(){setTimeout(function(){t()},_)})}(),t("#bmi-ongoing-backup").on("click",function(){L(function(e){!0===e?(s=0,B(),t.bmi.modal("backup-progress-modal").open()):(t.bmi.alert("info",t("#bmi-bc-ended").text(),3e3),t.bmi.reloadBackups()),t("#bmi-ongoing-backup").hide(300)})}),t("#bmi_support_chat").on("click",function(){if(0===t("#support-bmi").length){t("#bmi").append('<script id="support-bmi" src="'+t("#bmi-support-url-translation").val()+'" async><\/script>'),setTimeout(function(){t("#bmi_support_chat").hide()},100);var e=!1;let i=setInterval(function(){1==e&&clearInterval(i),void 0!==window.jivo_api&&(window.jivo_api.open(),e=!0)},30)}}),t("#bmi_restore_tbody").on("change",'input[type="checkbox"]',function(e){let i=X().length;i>0?t(".del-all-btn-wrp").show(300):t(".del-all-btn-wrp").hide(300),i==t("#bmi_restore_tbody").find('input[type="checkbox"]').length?t("#backups-select-all").prop("checked",!0):t("#backups-select-all").prop("checked",!1)}),t("#fix-uname-issues").on("click",function(e){e.preventDefault(),t.bmi.ajax("fix_uname_issues",{}).then(function(e){t.bmi.alert("success",t("#bmi-default-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-default-fail").text(),3e3)})}),t("#revert-uname-issues").on("click",function(e){e.preventDefault(),t.bmi.ajax("revert_uname_issues",{}).then(function(e){t.bmi.alert("success",t("#bmi-default-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-default-fail").text(),3e3)})}),t("#backups-select-all").on("change",function(){!0===this.checked?t("#bmi_restore_tbody").find('input[type="checkbox"]').prop("checked",!0):t("#bmi_restore_tbody").find('input[type="checkbox"]').prop("checked",!1),X().length>0?t(".del-all-btn-wrp").show(300):t(".del-all-btn-wrp").hide(300)}),t(".lrn-mr-btn, .closer-learn-more").on("click",function(){t(".learn_more_about_cron").hasClass("open")?(t(".learn_more_about_cron").removeClass("open"),t(".learn_more_about_cron").hide(300),t(".lrn-mr-btn").show(),t(".lrn-mr-btn").css({opacity:0}),t(".lrn-mr-btn").animate({opacity:1},300)):(t(".learn_more_about_cron").addClass("open"),t(".learn_more_about_cron").show(300),t(".lrn-mr-btn").css({opacity:1}),t(".lrn-mr-btn").animate({opacity:0},300,function(){t(".lrn-mr-btn").hide()}))}),t("#bmi-error-toggle").on("click",function(){t(".error-body").hasClass("open")?(t(".error-body").hide(300),t(".error-body").removeClass("open"),t("#bmi-error-toggle").text(t("#bmi-error-toggle").data("expand"))):(t(".error-body").show(300),t(".error-body").addClass("open"),t("#bmi-error-toggle").text(t("#bmi-error-toggle").data("collapse")))}),t("#bmi_send_test_mail").on("click",function(e){e.preventDefault(),t.bmi.ajax("send-test-mail",{}).then(function(e){t.bmi.alert("success",t("#bmi-email-success").text(),3e3)}).catch(function(e){t.bmi.alert("error",t("#bmi-email-fail").text(),3e3)})}),t("#bmi-error-dismiss").on("click",function(){t(".error-noticer").hide(300),setTimeout(function(){t(".error-noticer").remove()},330),t.bmi.ajax("dismiss-error-notice",{}).then(function(t){}).catch(function(t){})}),t(".deleteAllSelected").on("click",function(){let e=X(),i=[];for(let t=0;t<e.length;++t){let o=e[t].closest("tr");i.push(o.querySelector(".br_name").innerText)}t("#delete-confirm-modal").find(".text1").hide(),t("#delete-confirm-modal").find(".text2").show();let o=i.length;o<=0||(t("#backup-multiple-del-count").text(o),o>1?(t("#del-only-one").hide(),t("#del-more-than-one").show()):(t("#del-more-than-one").hide(),t("#del-only-one").show()),p=i,t.bmi.modal("delete-confirm-modal").open())}),t("#load-more-backups").on("click",function(e){e.preventDefault(),t.bmi.showMoreBackups()}),t("#show-format-tip").on("click",K),t("#hide-format-tip").on("click",K),t(".go-to-marbs").on("click",function(e){e.preventDefault(),document.getElementById("marbs").click(),t.bmi.modal().closeAll()}),t(".site-reloader").on("click",function(){let t=v.u+"?backup-migration=AFTER_RESTORE&backup-id="+v.l+"&progress-id=4u70L051n&t="+ +new Date;window.location=t}),async function(){C("plugins"),C("uploads"),C("themes"),C("contents_others"),C("wordpress")}(),t.bmi.ajax("get-dynamic-names",{}).then(function(e){let i=e.data;if(t("#bmi_exclusion_rules").text(""),void 0!==i&&void 0!==i.length){for(let e=0;e<i.length;++e){let o=t(".exclusion_template").clone();o.removeClass("exclusion_template"),o.find(".exclusion_txt").val(i[e].txt);let n=o.find(".exclusion_position").find("select"),s=o.find(".exclusion_where").find("select");n&&(n[0].setAttribute("data-def",i[e].pos),s&&(s[0].setAttribute("data-def",i[e].whr),t("#bmi_exclusion_rules").append(o),o.find(".exclusion_position").find(".bmi-dropdown").length>0&&t.bmi.setOption(o.find(".exclusion_position").find(".bmi-dropdown"),null,i[e].pos),o.find(".exclusion_where").find(".bmi-dropdown").length>0&&t.bmi.setOption(o.find(".exclusion_where").find(".bmi-dropdown"),null,i[e].whr)))}t("#dynamic-fpaths-names").text(e["dynamic-fpaths-names"].join("\n")),t("#dynamic-dpaths-names").text(e["dynamic-dpaths-names"].join("\n"))}}).catch(function(t){console.log(t)}),t.bmi.reloadBackups(),function(){let e=1e3*parseInt(t("#server-time-auto").attr("data-time")),i=new Date(e);t("#server-time-auto").text(i.toUTCString()),setInterval(function(){e+=1e3,i=new Date(e),t("#server-time-auto").text(i.toUTCString())},1e3),t("#ex_b_fs").is(":checked")?t("#bmi__collon").show():t("#bmi__collon").hide()}()}),jQuery(document).ready(function(t){t(".modal-opener").on("click",function(e){this.getAttribute("data-modal")&&""!=this.getAttribute("data-modal")&&(e.preventDefault(),this.getAttribute("data-close")&&t.bmi.modal(this.getAttribute("data-close")).close(),t.bmi.modal(this.getAttribute("data-modal")).open())}),t(".modal-closer").on("click",function(e){this.getAttribute("data-close")&&""!=this.getAttribute("data-close")?(e.preventDefault(),t.bmi.modal(this.getAttribute("data-close")).close()):this.closest(".modal")&&(e.preventDefault(),t("#"+this.closest(".modal").getAttribute("id")).length>0&&t.bmi.modal(this.closest(".modal").getAttribute("id")).close())}),t(".modal-close").on("click",function(e){this.closest(".modal")&&(e.preventDefault(),t.bmi.modal(this.closest(".modal").id).close())}),t(".modal").on("click",function(e){e.target!=this||t(e.target).hasClass("modal-no-close")||t.bmi.modal(this.id).close()})}),jQuery(document).ready(function(t){t.bmi.tooltips.init();let e,i=-1,o=!1,n="";for(let t=0;t<12;++t)n+="<div></div>";function s(o){clearInterval(e),0==o?(t(".upload-progress-bar").find("span")[0].style.width=o+"%",t(".upload-percentage").text(o+"%")):100==o?(t(".upload-progress-bar").find("span")[0].style.width=o+"%",t(".upload-percentage").text(o+"%")):function(o=0,n=1e3){if(i==o)return;i=o,clearInterval(e);let s=parseInt(t(".upload-percentage").text())-1;if(s>o&&0!=o)return;let r=o-s,a=s,l=Math.abs(Math.floor(n/r));e=setInterval(function(){a+=1,t(".upload-progress-bar").find("span")[0].style.width=a+"%",t(".upload-percentage").text(a+"%"),a>=100&&(clearInterval(e),i=null)},l)}(o,1e3)}t(".spinner-loader").html(n).addClass("lds-spinner"),t.fchunker({upId:"upid",upShardSize:"5",upMaxSize:"2000",upUrl:ajaxurl,upType:"zip",upCallBack:function(e){var i=e.status,n=e.message;e.url,Math.random();2==i&&(setTimeout(function(){t("#drop-area").show(300),t(".upload-progress").hide(300)},100),t.bmi.alert("success",t("#bmi-upload-end").text(),3e3),t.bmi.modal("upload-success-modal").open(),t.bmi.reloadBackups()),1==i&&(o||(t.bmi.alert("success",t("#bmi-upload-start").text(),3e3),o=!0)),0==i&&(t.upErrorMsg(n),t("#drop-area").show(300),t(".upload-progress").hide(300)),5==i&&(t.bmi.modal("upload-invalid-manifest-modal").open(),t("#drop-area").show(300),t(".upload-progress").hide(300)),3==i&&(s(100),t.upErrorMsg(n),t("#drop-area").show(300),t(".upload-progress").hide(300))},upEvent:function(t){s(t)},upStop:function(e){s(0),setTimeout(function(){t("#drop-area").show(300),t(".upload-progress").hide(300)},100),e.includes("Type error")?(t.bmi.modal("upload-wrong-file-modal").open(),t.bmi.alert("warning",t("#bmi-upload-wrong").text(),3e3)):e.includes("File already exists")?(t.bmi.modal("upload-exist-file-modal").open(),t.bmi.alert("warning",t("#bmi-upload-exists").text(),3e3)):(t.bmi.alert("error",t("#bmi-upload-error").text(),3e3),console.error(e))},upStart:function(){o=!1,i=-1,s(0),setTimeout(function(){t("#drop-area").hide(300),t(".upload-progress").show(300)},100)}})}),jQuery(document).ready(function(t){function e(t){for(let e=0;e<t.length;++e){let i=t[e].closest(".container-radio");i&&void 0!=typeof i.classList&&(i.classList.remove("active"),!0===t[e].checked&&i.classList.add("active"))}}t('input[type="radio"]').on("change",function(){let t=this.getAttribute("name");this.closest(".container-radio");e(document.querySelectorAll('[name="'+t+'"]'))}),e(document.getElementById("bmi").querySelectorAll('input[type="radio"]'))}),jQuery(document).ready(function(t){let e=!1;t(".tabs").on("click",".tab",function(i){if(this.classList.contains("active"))return;if(!0===e)return;e=!0,t.bmi.collapsers.closeAll();let o=this.getAttribute("data-point");"manage-restore-wrapper"==o?(t("#create-backup-wrapper").hide(300),t('[data-point="create-backup-wrapper"]').removeClass("active")):"create-backup-wrapper"==o&&(t("#manage-restore-wrapper").hide(300),t('[data-point="manage-restore-wrapper"]').removeClass("active")),t("#"+o).show(300),t(this).addClass("active"),setTimeout(function(){e=!1},320)})}),jQuery(document).ready(function(t){let e=document.getElementById("drop-area");function i(t){t.preventDefault(),t.stopPropagation()}function o(t){e.classList.add("highlight")}function n(t){e.classList.remove("highlight")}e&&(["dragenter","dragover","dragleave","drop"].forEach(t=>{e.addEventListener(t,i,!1)}),["dragenter","dragover"].forEach(t=>{e.addEventListener(t,o,!1),document.querySelector("body").addEventListener(t,o,!1)}),["dragleave","drop","mouseleave"].forEach(t=>{e.addEventListener(t,n,!1)}),t("body, #drop-area").on("mouseleave dragleave drop",function(){n()}),e.addEventListener("drop",function(t){!function(t){t=[...t],jQuery.fchunker_upload("file",t[0])}(t.dataTransfer.files)},!1))});
analyst/src/Core/AbstractFactory.php CHANGED
@@ -12,7 +12,7 @@ abstract class AbstractFactory
12
  */
13
  protected static function unserialize($raw)
14
  {
15
- $instance = @unserialize($raw);
16
 
17
  $isProperObject = is_object($instance) && $instance instanceof static;
18
 
12
  */
13
  protected static function unserialize($raw)
14
  {
15
+ $instance = maybe_unserialize($raw);
16
 
17
  $isProperObject = is_object($instance) && $instance instanceof static;
18
 
analyst/src/Mutator.php CHANGED
@@ -60,10 +60,10 @@ class Mutator
60
 
61
  analyst_require_template('optin.php');
62
 
63
- analyst_require_template('forms/deactivate.php', [
64
- 'pencilImage' => analyst_assets_url('img/pencil.png'),
65
- 'smileImage' => analyst_assets_url('img/smile.png'),
66
- ]);
67
 
68
  analyst_require_template('forms/install.php', [
69
  'pluginToInstall' => $this->cache->get('plugin_to_install'),
60
 
61
  analyst_require_template('optin.php');
62
 
63
+ // analyst_require_template('forms/deactivate.php', [
64
+ // 'pencilImage' => analyst_assets_url('img/pencil.png'),
65
+ // 'smileImage' => analyst_assets_url('img/smile.png'),
66
+ // ]);
67
 
68
  analyst_require_template('forms/install.php', [
69
  'pluginToInstall' => $this->cache->get('plugin_to_install'),
backup-backup.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://backupbliss.com/
8
  * Plugin URI: https://backupbliss.com
9
  * Text Domain: backup-backup
10
- * Version: 1.1.6
11
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
 
13
  // Exit on direct access
@@ -21,7 +21,7 @@
21
  define('BMI_DEBUG', false);
22
  }
23
  if (!defined('BMI_VERSION')) {
24
- define('BMI_VERSION', '1.1.6');
25
  }
26
  if (!defined('BMI_ROOT_DIR')) {
27
  define('BMI_ROOT_DIR', __DIR__);
@@ -32,30 +32,33 @@
32
  if (!defined('BMI_INCLUDES')) {
33
  define('BMI_INCLUDES', BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'includes');
34
  }
 
 
 
35
 
36
  // Activation hook
37
  register_activation_hook(BMI_ROOT_FILE, function () {
38
- require_once BMI_INCLUDES . '/activation.php';
39
  BMI\bmi_activate_plugin();
40
  });
41
 
42
  // Fixes for some cases
43
- require_once BMI_INCLUDES . '/compatibility.php';
44
 
45
  // Opt-in sub plugin
46
- require_once BMI_INCLUDES . '/analyst.php';
47
 
48
  // Load plugin after all
49
  add_action('plugins_loaded', function () {
50
 
51
  // Global plugin variables
52
- require_once BMI_ROOT_DIR . '/includes/constants.php';
53
 
54
  // Initialize backup-migration
55
  if (!class_exists('Backup_Migration_Plugin')) {
56
 
57
  // Require initializator
58
- require_once BMI_ROOT_DIR . '/includes/initializer.php';
59
 
60
  // Initialize entire plugin
61
  $bmi_instance = new BMI\Backup_Migration_Plugin();
7
  * Author URI: https://backupbliss.com/
8
  * Plugin URI: https://backupbliss.com
9
  * Text Domain: backup-backup
10
+ * Version: 1.1.7
11
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
 
13
  // Exit on direct access
21
  define('BMI_DEBUG', false);
22
  }
23
  if (!defined('BMI_VERSION')) {
24
+ define('BMI_VERSION', '1.1.7');
25
  }
26
  if (!defined('BMI_ROOT_DIR')) {
27
  define('BMI_ROOT_DIR', __DIR__);
32
  if (!defined('BMI_INCLUDES')) {
33
  define('BMI_INCLUDES', BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'includes');
34
  }
35
+ if (!defined('BMI_MODULES_DIR')) {
36
+ define('BMI_MODULES_DIR', BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR);
37
+ }
38
 
39
  // Activation hook
40
  register_activation_hook(BMI_ROOT_FILE, function () {
41
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'activation.php';
42
  BMI\bmi_activate_plugin();
43
  });
44
 
45
  // Fixes for some cases
46
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'compatibility.php';
47
 
48
  // Opt-in sub plugin
49
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'analyst.php';
50
 
51
  // Load plugin after all
52
  add_action('plugins_loaded', function () {
53
 
54
  // Global plugin variables
55
+ require_once BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'constants.php';
56
 
57
  // Initialize backup-migration
58
  if (!class_exists('Backup_Migration_Plugin')) {
59
 
60
  // Require initializator
61
+ require_once BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'initializer.php';
62
 
63
  // Initialize entire plugin
64
  $bmi_instance = new BMI\Backup_Migration_Plugin();
includes/ajax.php CHANGED
@@ -635,7 +635,7 @@
635
  if ($isCLI === true && file_exists($cli_lock)) @unlink($cli_lock);
636
 
637
  // Log and close log
638
- $zip_progress->log('#002', 'END-CODE');
639
  $zip_progress->end();
640
 
641
  // Return error
@@ -1309,7 +1309,7 @@
1309
  $migration->progress(0);
1310
  file_put_contents(BMI_BACKUPS . '/' . '.cli_download_last', $prepared_name);
1311
 
1312
- $migration->log('#001', 'END-CODE');
1313
  return ['status' => 'success', 'name' => $prepared_name];
1314
  } catch (\Exception $e) {
1315
  $migration->log(__('Error: ', 'backup-backup') . $e, 'ERROR');
@@ -1459,7 +1459,7 @@
1459
  $php_cli_disable_others = $this->post['php_cli_disable_others'] === 'true' ? true : false; // OTHER:CLI:DISABLE
1460
  $normal_timeout = $this->post['normal_timeout'] === 'true' ? true : false; // OTHER:USE:TIMEOUT:NORMAL
1461
  $insecure_download = $this->post['download_technique'] === 'true' ? true : false; // OTHER:DOWNLOAD:DIRECT
1462
- $db_query_size = isset($this->post['db_queries_amount']) ? trim($this->post['db_queries_amount']) : '1000'; // OTHER:DB:QUERIES
1463
  $db_restore_splitting = $this->post['bmi-restore-splitting'] === 'true' ? true : false; // OTHER:RESTORE:SPLITTING
1464
  $uninstall_config = $this->post['uninstall_config'] === 'true' ? true : false; // OTHER:UNINSTALL:CONFIGS
1465
  $uninstall_backups = $this->post['uninstall_backups'] === 'true' ? true : false; // OTHER:UNINSTALL:BACKUPS
@@ -1986,7 +1986,7 @@
1986
  }
1987
 
1988
  if ($legacy === false && (!defined('BMI_USING_CLI_FUNCTIONALITY') || BMI_USING_CLI_FUNCTIONALITY === false)) {
1989
- $list_file = BMI_INCLUDES . '/htaccess/files_latest.list';
1990
  if (file_exists($list_file)) @unlink($list_file);
1991
  $files_list = fopen($list_file, 'a');
1992
  if ($first_big === false) fwrite($files_list, sizeof($files) . "_-1\r\n");
@@ -2007,7 +2007,7 @@
2007
  public function toggleBackupLock($unlock = false) {
2008
 
2009
  // Require lib
2010
- require_once BMI_INCLUDES . '/zipper/zipping.php';
2011
 
2012
  // Backup name
2013
  $filename = $this->post['filename'];
@@ -2066,7 +2066,7 @@
2066
  }
2067
 
2068
  public function getSiteData() {
2069
- require_once BMI_INCLUDES . '/check/system_info.php';
2070
  $bmi = new SI();
2071
  $bmi = $bmi->to_array();
2072
 
@@ -2074,7 +2074,7 @@
2074
  }
2075
 
2076
  public function calculateCron() {
2077
- require_once BMI_INCLUDES . '/cron/handler.php';
2078
 
2079
  $minutes = [];
2080
  $keeps = [];
@@ -2149,7 +2149,7 @@
2149
  'minute' => $this->post['minute']
2150
  ], time());
2151
 
2152
- $file = BMI_INCLUDES . '/htaccess/.plan';
2153
  if (file_exists($file)) {
2154
  $earlier = intval(file_get_contents($file));
2155
  } else {
@@ -2220,7 +2220,10 @@
2220
 
2221
  $filesToBeRemoved = [];
2222
 
2223
- foreach (scandir(BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'tmp') as $filename) {
 
 
 
2224
 
2225
  if (in_array($filename, ['.', '..'])) continue;
2226
  $path = BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $filename;
@@ -2262,10 +2265,10 @@
2262
 
2263
  }
2264
 
2265
- $filesToBeRemoved[] = BMI_BACKUPS . '/.backup_cli_lock';
2266
- $filesToBeRemoved[] = BMI_BACKUPS . '/.backup_cli_lock_ended';
2267
- $filesToBeRemoved[] = BMI_BACKUPS . '/.backup_cli_lock_end';
2268
- $filesToBeRemoved[] = BMI_BACKUPS . '/.running';
2269
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'db_tables';
2270
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'bmi_backup_manifest.json';
2271
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'files_latest.list';
@@ -2334,13 +2337,13 @@
2334
 
2335
  }
2336
 
2337
- $filesToBeRemoved[] = BMI_BACKUPS . '/.autologin';
2338
- $filesToBeRemoved[] = BMI_BACKUPS . '/.migration_lock';
2339
- $filesToBeRemoved[] = BMI_BACKUPS . '/.migration_lock_cli';
2340
- $filesToBeRemoved[] = BMI_BACKUPS . '/.migration_lock_cli_end';
2341
- $filesToBeRemoved[] = BMI_BACKUPS . '/.migration_lock_ended';
2342
- $filesToBeRemoved[] = BMI_BACKUPS . '/.cli_download_last';
2343
- $filesToBeRemoved[] = BMI_BACKUPS . '/.running';
2344
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.restore_secret';
2345
 
2346
  foreach ($filesToBeRemoved as $file) {
635
  if ($isCLI === true && file_exists($cli_lock)) @unlink($cli_lock);
636
 
637
  // Log and close log
638
+ $zip_progress->log('#100', 'END-CODE');
639
  $zip_progress->end();
640
 
641
  // Return error
1309
  $migration->progress(0);
1310
  file_put_contents(BMI_BACKUPS . '/' . '.cli_download_last', $prepared_name);
1311
 
1312
+ $migration->log('#205', 'END-CODE');
1313
  return ['status' => 'success', 'name' => $prepared_name];
1314
  } catch (\Exception $e) {
1315
  $migration->log(__('Error: ', 'backup-backup') . $e, 'ERROR');
1459
  $php_cli_disable_others = $this->post['php_cli_disable_others'] === 'true' ? true : false; // OTHER:CLI:DISABLE
1460
  $normal_timeout = $this->post['normal_timeout'] === 'true' ? true : false; // OTHER:USE:TIMEOUT:NORMAL
1461
  $insecure_download = $this->post['download_technique'] === 'true' ? true : false; // OTHER:DOWNLOAD:DIRECT
1462
+ $db_query_size = isset($this->post['db_queries_amount']) ? trim($this->post['db_queries_amount']) : '300'; // OTHER:DB:QUERIES
1463
  $db_restore_splitting = $this->post['bmi-restore-splitting'] === 'true' ? true : false; // OTHER:RESTORE:SPLITTING
1464
  $uninstall_config = $this->post['uninstall_config'] === 'true' ? true : false; // OTHER:UNINSTALL:CONFIGS
1465
  $uninstall_backups = $this->post['uninstall_backups'] === 'true' ? true : false; // OTHER:UNINSTALL:BACKUPS
1986
  }
1987
 
1988
  if ($legacy === false && (!defined('BMI_USING_CLI_FUNCTIONALITY') || BMI_USING_CLI_FUNCTIONALITY === false)) {
1989
+ $list_file = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'files_latest.list';
1990
  if (file_exists($list_file)) @unlink($list_file);
1991
  $files_list = fopen($list_file, 'a');
1992
  if ($first_big === false) fwrite($files_list, sizeof($files) . "_-1\r\n");
2007
  public function toggleBackupLock($unlock = false) {
2008
 
2009
  // Require lib
2010
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'zipper' . DIRECTORY_SEPARATOR . 'zipping.php';
2011
 
2012
  // Backup name
2013
  $filename = $this->post['filename'];
2066
  }
2067
 
2068
  public function getSiteData() {
2069
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'check' . DIRECTORY_SEPARATOR . 'system_info.php';
2070
  $bmi = new SI();
2071
  $bmi = $bmi->to_array();
2072
 
2074
  }
2075
 
2076
  public function calculateCron() {
2077
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'cron' . DIRECTORY_SEPARATOR . 'handler.php';
2078
 
2079
  $minutes = [];
2080
  $keeps = [];
2149
  'minute' => $this->post['minute']
2150
  ], time());
2151
 
2152
+ $file = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.plan';
2153
  if (file_exists($file)) {
2154
  $earlier = intval(file_get_contents($file));
2155
  } else {
2220
 
2221
  $filesToBeRemoved = [];
2222
 
2223
+ $tmp_dir = BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'tmp';
2224
+ if (!is_dir($tmp_dir)) @mkdir($tmp_dir, 0755, true);
2225
+
2226
+ foreach (scandir($tmp_dir) as $filename) {
2227
 
2228
  if (in_array($filename, ['.', '..'])) continue;
2229
  $path = BMI_ROOT_DIR . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $filename;
2265
 
2266
  }
2267
 
2268
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.backup_cli_lock';
2269
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.backup_cli_lock_ended';
2270
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.backup_cli_lock_end';
2271
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.running';
2272
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'db_tables';
2273
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'bmi_backup_manifest.json';
2274
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . 'files_latest.list';
2337
 
2338
  }
2339
 
2340
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.autologin';
2341
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.migration_lock';
2342
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.migration_lock_cli';
2343
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.migration_lock_cli_end';
2344
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.migration_lock_ended';
2345
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.cli_download_last';
2346
+ $filesToBeRemoved[] = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.running';
2347
  $filesToBeRemoved[] = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.restore_secret';
2348
 
2349
  foreach ($filesToBeRemoved as $file) {
includes/constants.php CHANGED
@@ -38,12 +38,12 @@
38
  $db_queries = intval($db_queries);
39
 
40
  if ($db_queries > 15000 || $db_queries < 15) {
41
- $db_queries = 1000;
42
  }
43
  }
44
 
45
  if (!isset($db_queries) || is_null($db_queries) || !is_numeric($db_queries)) {
46
- $db_queries = 1000;
47
  }
48
 
49
  define('BMI_DB_MAX_ROWS_PER_QUERY', $db_queries);
38
  $db_queries = intval($db_queries);
39
 
40
  if ($db_queries > 15000 || $db_queries < 15) {
41
+ $db_queries = 300;
42
  }
43
  }
44
 
45
  if (!isset($db_queries) || is_null($db_queries) || !is_numeric($db_queries)) {
46
+ $db_queries = 300;
47
  }
48
 
49
  define('BMI_DB_MAX_ROWS_PER_QUERY', $db_queries);
includes/dashboard/chapter/other_config.php CHANGED
@@ -379,7 +379,7 @@
379
  <div class="left">
380
  <?php $query_amount = sanitize_text_field(bmi_get_config('OTHER:DB:QUERIES')); ?>
381
  <label for="db_queries_amount">
382
- <input type="number" id="db_queries_amount" class="bmi-text-input small" value="<?php echo $query_amount; ?>" placeholder="500" min="15" max="15000" />
383
  </label>
384
  </div>
385
  </div>
379
  <div class="left">
380
  <?php $query_amount = sanitize_text_field(bmi_get_config('OTHER:DB:QUERIES')); ?>
381
  <label for="db_queries_amount">
382
+ <input type="number" id="db_queries_amount" class="bmi-text-input small" value="<?php echo $query_amount; ?>" placeholder="300" min="15" max="15000" />
383
  </label>
384
  </div>
385
  </div>
includes/database/better-restore.php CHANGED
@@ -176,6 +176,7 @@ class BMI_Database_Importer {
176
  public function restore_by_file($path, $last_seek = 0) {
177
 
178
  if (!file_exists($path)) {
 
179
  $this->logger->log("Database file does not exist anymore (" . basename($path) . ")? – Omitting.", 'INFO');
180
  return true;
181
  }
@@ -267,7 +268,11 @@ class BMI_Database_Importer {
267
  }
268
 
269
  if ($query_exist === false) {
270
- if (file_exists($path)) @unlink($path);
 
 
 
 
271
  return true;
272
  } else {
273
  $file = null;
@@ -746,7 +751,7 @@ class BMI_Database_Importer {
746
 
747
  } else {
748
 
749
- $this->logger->log("Finished " . $queries_so_far . "/" . $queries_total . " (" . $queries_progress . "%)" . " for " . $filename . " table (part: 1/1)", 'INFO');
750
 
751
  }
752
  }
@@ -767,7 +772,7 @@ class BMI_Database_Importer {
767
 
768
  if (in_array($filename, ['.', '..'])) continue;
769
 
770
- $filePath = trailingslashit($this->storage) . $filename;
771
  if (is_dir($filePath)) {
772
 
773
  $splitedFiles = scandir($filePath);
@@ -776,7 +781,7 @@ class BMI_Database_Importer {
776
  if (in_array($splitedFilename, ['.', '..', 'bmi_converted_completed_tables'])) continue;
777
  if (substr($splitedFilename, -4) != '.sql') continue;
778
 
779
- $this->files[] = trailingslashit($this->storage) . trailingslashit($filename) . $splitedFilename;
780
 
781
  }
782
 
@@ -785,7 +790,7 @@ class BMI_Database_Importer {
785
  }
786
 
787
  if (substr($filename, -4) != '.sql') continue;
788
- $this->files[] = trailingslashit($this->storage) . $filename;
789
 
790
  }
791
 
176
  public function restore_by_file($path, $last_seek = 0) {
177
 
178
  if (!file_exists($path)) {
179
+ if (file_exists($path)) @unlink($path);
180
  $this->logger->log("Database file does not exist anymore (" . basename($path) . ")? – Omitting.", 'INFO');
181
  return true;
182
  }
268
  }
269
 
270
  if ($query_exist === false) {
271
+ if (file_exists($path)) {
272
+ gc_collect_cycles();
273
+ $file = null;
274
+ @unlink($path);
275
+ }
276
  return true;
277
  } else {
278
  $file = null;
751
 
752
  } else {
753
 
754
+ $this->logger->log("Finished " . $queries_so_far . "/" . $queries_total . " (" . $queries_progress . "%)" . " for " . $filename . " table (part: dynamic)", 'INFO');
755
 
756
  }
757
  }
772
 
773
  if (in_array($filename, ['.', '..'])) continue;
774
 
775
+ $filePath = $this->storage . DIRECTORY_SEPARATOR . $filename;
776
  if (is_dir($filePath)) {
777
 
778
  $splitedFiles = scandir($filePath);
781
  if (in_array($splitedFilename, ['.', '..', 'bmi_converted_completed_tables'])) continue;
782
  if (substr($splitedFilename, -4) != '.sql') continue;
783
 
784
+ $this->files[] = $this->storage . DIRECTORY_SEPARATOR . $filename . DIRECTORY_SEPARATOR . $splitedFilename;
785
 
786
  }
787
 
790
  }
791
 
792
  if (substr($filename, -4) != '.sql') continue;
793
+ $this->files[] = $this->storage . DIRECTORY_SEPARATOR . $filename;
794
 
795
  }
796
 
includes/database/smart-sort.php CHANGED
@@ -32,6 +32,27 @@ class BMI_Database_Sorting {
32
  private $name_of_finished_tables_dir = 'bmi_converted_completed_tables';
33
  private $progress;
34
  private $isCLI;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  /**
37
  * __construct - description
@@ -542,7 +563,7 @@ class BMI_Database_Sorting {
542
  $last_seek = 0;
543
 
544
  // Resolve not finished process
545
- if (!$isCLI && is_array($processData) && !empty($processData)) {
546
 
547
  // Should be file path $file_path & $file (check if the file exist)
548
  if (array_key_exists('file', $processData) && file_exists($processData['file'])) {
@@ -685,7 +706,9 @@ class BMI_Database_Sorting {
685
  $this->insertIntoOutputFile($line, $table_name);
686
 
687
  // Close the file as we split per query, we will need new one for new query
688
- fclose($this->output_file_stream);
 
 
689
 
690
  // Check if it's end of the file add 4 lines offset for empty lines
691
  // If it's not the end make new heading, otherwise remove new output file
@@ -695,27 +718,63 @@ class BMI_Database_Sorting {
695
  $destinationFile = $this->makeDestinationFilename($dir, $table_name);
696
  $destinationFile = $destinationFile['file'];
697
 
698
- // Log partial progress
699
- $this->logPartial($dir, $table_name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
700
 
701
- // Open new stream for new output file
702
- $this->output_file_stream = fopen($destinationFile, 'a+');
703
 
704
- // Generate new heading
705
- $heading = $this->generateNewHeading($table_unique, $table_name);
706
 
707
- // Put the heading into new file
708
- $this->insertIntoOutputFile($heading, $table_name);
 
709
 
710
- // Technically only few bytes but with 200 tables it may be few MBs :)
711
- // Always unset variables if you don't need them anymore
712
- unset($heading);
713
 
714
  if (!$this->isCLI) {
715
 
716
  // Check if the output file is open and close it if it is
717
  $file = null;
718
- if (get_resource_type($this->output_file_stream) === 'file') {
719
  fclose($this->output_file_stream);
720
  }
721
 
@@ -861,7 +920,7 @@ class BMI_Database_Sorting {
861
  // File size: $file->getSize() / 1024 / 1024
862
 
863
  // Check if the output file is open and close it if it is
864
- if (get_resource_type($this->output_file_stream) === 'file') {
865
  fclose($this->output_file_stream);
866
  }
867
 
@@ -945,7 +1004,9 @@ class BMI_Database_Sorting {
945
  */
946
  private function insertIntoOutputFile(&$line, $table_name) {
947
 
948
- fwrite($this->output_file_stream, $line);
 
 
949
 
950
  }
951
 
@@ -1013,6 +1074,29 @@ class BMI_Database_Sorting {
1013
 
1014
  }
1015
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1016
  /**
1017
  * moveAllConvertedTables - Moves all completed tables outside
1018
  *
32
  private $name_of_finished_tables_dir = 'bmi_converted_completed_tables';
33
  private $progress;
34
  private $isCLI;
35
+ private $unwantedTables = [
36
+ 'wfblockediplog',
37
+ 'wfblocks7',
38
+ 'wfcrawlers',
39
+ 'wffilechanges',
40
+ 'wffilemods',
41
+ 'wfhits',
42
+ 'wfhoover',
43
+ 'wfissues',
44
+ 'wfknownfilelist',
45
+ 'wflivetraffichuman',
46
+ 'wflocs',
47
+ 'wflogins',
48
+ 'wfnotifications',
49
+ 'wfpendingissues',
50
+ 'wfreversecache',
51
+ 'wfsnipcache',
52
+ 'wfstatus',
53
+ 'wftrafficrate',
54
+ 'actionscheduler_logs',
55
+ ];
56
 
57
  /**
58
  * __construct - description
563
  $last_seek = 0;
564
 
565
  // Resolve not finished process
566
+ if (!$this->isCLI && is_array($processData) && !empty($processData)) {
567
 
568
  // Should be file path $file_path & $file (check if the file exist)
569
  if (array_key_exists('file', $processData) && file_exists($processData['file'])) {
706
  $this->insertIntoOutputFile($line, $table_name);
707
 
708
  // Close the file as we split per query, we will need new one for new query
709
+ if (is_resource($this->output_file_stream) || get_resource_type($this->output_file_stream) === 'file') {
710
+ fclose($this->output_file_stream);
711
+ }
712
 
713
  // Check if it's end of the file add 4 lines offset for empty lines
714
  // If it's not the end make new heading, otherwise remove new output file
718
  $destinationFile = $this->makeDestinationFilename($dir, $table_name);
719
  $destinationFile = $destinationFile['file'];
720
 
721
+ // Check if we really need that table contents
722
+ if ($this->checkIfContainName($table_name, $this->unwantedTables)) {
723
+
724
+ $this->progress->log(str_replace('%s', $table_name, __('Cleaning up contents of %s table.', 'backup-backup')), 'INFO');
725
+
726
+ $insert_next = false;
727
+
728
+ if (!$this->isCLI) {
729
+
730
+ $file = null;
731
+
732
+ if (is_resource($this->output_file_stream) || get_resource_type($this->output_file_stream) === 'file') {
733
+ fclose($this->output_file_stream);
734
+ }
735
+
736
+ if (file_exists($destinationFile)) {
737
+ @unlink($destinationFile);
738
+ }
739
+
740
+ if (file_exists($file_path)) {
741
+ @unlink($file_path);
742
+ }
743
+
744
+ // Return empty for new file
745
+ return [
746
+ 'index' => 0,
747
+ 'insert' => 'no',
748
+ 'completed' => 'yes'
749
+ ];
750
+
751
+ }
752
+
753
+ } else {
754
+
755
+ // Log partial progress
756
+ $this->logPartial($dir, $table_name);
757
+
758
+ // Open new stream for new output file
759
+ $this->output_file_stream = fopen($destinationFile, 'a+');
760
 
761
+ // Generate new heading
762
+ $heading = $this->generateNewHeading($table_unique, $table_name);
763
 
764
+ // Put the heading into new file
765
+ $this->insertIntoOutputFile($heading, $table_name);
766
 
767
+ // Technically only few bytes but with 200 tables it may be few MBs :)
768
+ // Always unset variables if you don't need them anymore
769
+ unset($heading);
770
 
771
+ }
 
 
772
 
773
  if (!$this->isCLI) {
774
 
775
  // Check if the output file is open and close it if it is
776
  $file = null;
777
+ if (is_resource($this->output_file_stream) || get_resource_type($this->output_file_stream) === 'file') {
778
  fclose($this->output_file_stream);
779
  }
780
 
920
  // File size: $file->getSize() / 1024 / 1024
921
 
922
  // Check if the output file is open and close it if it is
923
+ if (is_resource($this->output_file_stream) || get_resource_type($this->output_file_stream) === 'file') {
924
  fclose($this->output_file_stream);
925
  }
926
 
1004
  */
1005
  private function insertIntoOutputFile(&$line, $table_name) {
1006
 
1007
+ if (is_resource($this->output_file_stream) || get_resource_type($this->output_file_stream) === 'file') {
1008
+ fwrite($this->output_file_stream, $line);
1009
+ }
1010
 
1011
  }
1012
 
1074
 
1075
  }
1076
 
1077
+ /**
1078
+ * checkIfContainName - Checks if A (string) is part of B array
1079
+ *
1080
+ * @return bool
1081
+ */
1082
+ private function checkIfContainName($tableName, $unwantedTables) {
1083
+
1084
+ $found = false;
1085
+
1086
+ for ($i = 0; $i < sizeof($unwantedTables); ++$i) {
1087
+
1088
+ $name = $unwantedTables[$i];
1089
+ if (strpos($tableName, $name) !== false) {
1090
+ $found = true;
1091
+ break;
1092
+ }
1093
+
1094
+ }
1095
+
1096
+ return $found;
1097
+
1098
+ }
1099
+
1100
  /**
1101
  * moveAllConvertedTables - Moves all completed tables outside
1102
  *
includes/extracter/extract.php CHANGED
@@ -30,9 +30,9 @@
30
  global $table_prefix;
31
 
32
  // Requirements
33
- require_once BMI_INCLUDES . '/database/manager.php';
34
- require_once BMI_INCLUDES . '/database/better-restore.php';
35
- require_once BMI_INCLUDES . '/database/smart-sort.php';
36
 
37
  // IsCLI?
38
  $this->isCLI = $isCLI;
@@ -117,12 +117,12 @@
117
  }
118
 
119
  // Name
120
- $this->tmp = untrailingslashit(ABSPATH) . '/backup-migration_' . $this->tmptime;
121
  $GLOBALS['bmi_current_tmp_restore'] = $this->tmp;
122
  $GLOBALS['bmi_current_tmp_restore_unique'] = $this->tmptime;
123
 
124
  // Scan file
125
- $this->scanFile = untrailingslashit(BMI_INCLUDES) . '/htaccess/.restore_scan_' . $this->tmptime;
126
 
127
  // Prepare database connection
128
  $this->db = new Database(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
@@ -157,7 +157,7 @@
157
  $this->siteurl = get_option('siteurl');
158
  $this->home = get_option('home');
159
 
160
- $this->src = BMI_BACKUPS . '/' . $this->backup_name;
161
 
162
  }
163
 
@@ -244,6 +244,7 @@
244
  if ($file->isDir()) {
245
  @rmdir($file->getRealPath());
246
  } else {
 
247
  @unlink($file->getRealPath());
248
  }
249
  }
@@ -256,7 +257,7 @@
256
  @unlink($this->scanFile);
257
  }
258
 
259
- $sc = BMI_INCLUDES . '/htaccess/.restore_secret';
260
  if (file_exists($sc)) {
261
  @unlink($sc);
262
  }
@@ -385,7 +386,7 @@
385
 
386
  $abs = untrailingslashit(ABSPATH);
387
  $this->migration->log(__('Saving wp-config file...', 'backup-backup'), 'STEP');
388
- copy($abs . '/wp-config.php', $abs . '/wp-config.' . $this->tmptime . '.php');
389
  $this->migration->log(__('File wp-config saved', 'backup-backup'), 'SUCCESS');
390
 
391
  }
@@ -396,7 +397,7 @@
396
  $this->migration->log(__('Getting backup manifest...', 'backup-backup'), 'STEP');
397
  }
398
 
399
- $manifest = json_decode(file_get_contents($this->tmp . '/bmi_backup_manifest.json'));
400
 
401
  if ($first == true) {
402
  $this->migration->log(__('Manifest loaded', 'backup-backup'), 'SUCCESS');
@@ -432,13 +433,13 @@
432
  public function restoreDatabaseV1(&$manifest) {
433
 
434
  $this->migration->log(__('Older backup detected, using V1 engine to restore database...', 'backup-backup'), 'WARN');
435
- $this->migration->log(__('Database size: ' . BMP::humanSize(filesize($this->tmp . '/bmi_database_backup.sql')), 'backup-backup'), 'INFO');
436
  $old_domain = $manifest->dbdomain;
437
  $new_domain = $this->siteurl; // parse_url(home_url())['host'];
438
 
439
  $abs = BMP::fixSlashes($manifest->config->ABSPATH);
440
  $newabs = BMP::fixSlashes(ABSPATH);
441
- $file = $this->tmp . '/bmi_database_backup.sql';
442
  $this->db->importDatabase($file, $old_domain, $new_domain, $abs, $newabs, $manifest->config->table_prefix, $this->siteurl, $this->home);
443
  $this->migration->log(__('Database restored', 'backup-backup'), 'SUCCESS');
444
 
@@ -566,7 +567,7 @@
566
 
567
  }
568
 
569
- } elseif (file_exists($this->tmp . '/bmi_database_backup.sql')) {
570
 
571
  $this->restoreDatabaseV1($manifest);
572
 
@@ -587,16 +588,16 @@
587
  $curr_prefix = $this->table_prefix;
588
  $new_prefix = $manifest->config->table_prefix;
589
  $this->migration->log(__('Restoring wp-config file...', 'backup-backup'), 'STEP');
590
- $file = file($abs . '/wp-config.' . $this->tmptime . '.php');
591
- rename($abs . '/wp-config.' . $this->tmptime . '.php', $abs . '/wp-config.php');
592
- $wpconfig = file_get_contents($abs . '/wp-config.php');
593
  if (strpos($wpconfig, '"' . $curr_prefix . '";') !== false) {
594
  $wpconfig = str_replace('"' . $curr_prefix . '";', '"' . $new_prefix . '";', $wpconfig);
595
  } elseif (strpos($wpconfig, "'" . $curr_prefix . "';") !== false) {
596
  $wpconfig = str_replace("'" . $curr_prefix . "';", "'" . $new_prefix . "';", $wpconfig);
597
  }
598
 
599
- file_put_contents($abs . '/wp-config.php', $wpconfig);
600
  $this->migration->log(__('WP-Config restored', 'backup-backup'), 'SUCCESS');
601
 
602
  }
@@ -604,9 +605,9 @@
604
  public function restoreOriginalWPConfig($remove = true) {
605
 
606
  $abs = untrailingslashit(ABSPATH);
607
- $tmp_file_f = $abs . '/wp-config.' . $this->tmptime . '.php';
608
  if (file_exists($tmp_file_f)) {
609
- copy($tmp_file_f, $abs . '/wp-config.php');
610
  if ($remove === true) @unlink($tmp_file_f);
611
  }
612
 
@@ -662,7 +663,7 @@
662
  $file = trailingslashit(wp_upload_dir()['basedir']) . 'elementor';
663
  if (file_exists($file) && is_dir($file)) {
664
  $this->migration->log(__('Clearing elementor template cache...', 'backup-backup'), 'STEP');
665
- $path = $file . '/*';
666
  foreach (glob($path) as $file_path) if (!is_dir($file_path)) @unlink($file_path);
667
  $this->migration->log(__('Elementor cache cleared!', 'backup-backup'), 'SUCCESS');
668
  }
@@ -697,9 +698,9 @@
697
  }
698
 
699
  // Deny read of this folder
700
- copy(BMI_INCLUDES . '/htaccess/.htaccess', $this->tmp . '/.htaccess');
701
- touch($this->tmp . '/index.html');
702
- touch($this->tmp . '/index.php');
703
 
704
  }
705
 
@@ -707,7 +708,7 @@
707
 
708
  $this->migration->log(__('Making new secret key for current restore process.', 'backup-backup'), 'STEP');
709
  $secret = $this->randomString();
710
- file_put_contents(BMI_INCLUDES . '/htaccess/.restore_secret', $secret);
711
  $this->migration->log(__('Secret key generated, it will be returned to you (ping).', 'backup-backup'), 'SUCCESS');
712
 
713
  return $secret;
@@ -732,7 +733,7 @@
732
  try {
733
 
734
  // Require Universal Zip Library
735
- require_once BMI_INCLUDES . '/zipper/src/zip.php';
736
 
737
  // Make restore secret
738
  if (!$this->isCLI && $this->batchStep == 0) {
@@ -876,6 +877,12 @@
876
  // Get manifest
877
  $manifest = $this->getCurrentManifest(true);
878
 
 
 
 
 
 
 
879
  // Restore files
880
  $this->restoreBackupFromFiles($manifest);
881
 
@@ -949,8 +956,14 @@
949
  if (defined('BMI_DB_MAX_ROWS_PER_QUERY')) {
950
  $this->migration->log(__('Max rows per query (this site): ', 'backup-backup') . BMI_DB_MAX_ROWS_PER_QUERY, 'INFO');
951
  }
 
 
 
 
 
952
  }
953
 
 
954
  $dbsort = new SmartDatabaseSort($db_tables, $this->migration, $this->isCLI);
955
  $process = $dbsort->sortUnsorted($this->processData);
956
 
@@ -977,7 +990,7 @@
977
 
978
  } else {
979
 
980
- if (file_exists($this->tmp . '/bmi_database_backup.sql')) {
981
 
982
  $this->migration->log(__('Ommiting database convert step as the database backup included was not made with V2 engine.', 'backup-backup'), 'WARN');
983
  $this->migration->log(__('The process may be less stable if the database is larger than usual.', 'backup-backup'), 'WARN');
@@ -1123,7 +1136,7 @@
1123
  $this->finalCleanUP();
1124
 
1125
  // Touch autologin file
1126
- $autologin_file = BMI_BACKUPS . '/.autologin';
1127
  touch($autologin_file);
1128
 
1129
  // Final verbose
30
  global $table_prefix;
31
 
32
  // Requirements
33
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'manager.php';
34
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'better-restore.php';
35
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'smart-sort.php';
36
 
37
  // IsCLI?
38
  $this->isCLI = $isCLI;
117
  }
118
 
119
  // Name
120
+ $this->tmp = untrailingslashit(ABSPATH) . DIRECTORY_SEPARATOR . 'backup-migration_' . $this->tmptime;
121
  $GLOBALS['bmi_current_tmp_restore'] = $this->tmp;
122
  $GLOBALS['bmi_current_tmp_restore_unique'] = $this->tmptime;
123
 
124
  // Scan file
125
+ $this->scanFile = untrailingslashit(BMI_INCLUDES) . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.restore_scan_' . $this->tmptime;
126
 
127
  // Prepare database connection
128
  $this->db = new Database(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
157
  $this->siteurl = get_option('siteurl');
158
  $this->home = get_option('home');
159
 
160
+ $this->src = BMI_BACKUPS . DIRECTORY_SEPARATOR . $this->backup_name;
161
 
162
  }
163
 
244
  if ($file->isDir()) {
245
  @rmdir($file->getRealPath());
246
  } else {
247
+ gc_collect_cycles();
248
  @unlink($file->getRealPath());
249
  }
250
  }
257
  @unlink($this->scanFile);
258
  }
259
 
260
+ $sc = BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.restore_secret';
261
  if (file_exists($sc)) {
262
  @unlink($sc);
263
  }
386
 
387
  $abs = untrailingslashit(ABSPATH);
388
  $this->migration->log(__('Saving wp-config file...', 'backup-backup'), 'STEP');
389
+ copy($abs . DIRECTORY_SEPARATOR . 'wp-config.php', $abs . DIRECTORY_SEPARATOR . 'wp-config.' . $this->tmptime . '.php');
390
  $this->migration->log(__('File wp-config saved', 'backup-backup'), 'SUCCESS');
391
 
392
  }
397
  $this->migration->log(__('Getting backup manifest...', 'backup-backup'), 'STEP');
398
  }
399
 
400
+ $manifest = json_decode(file_get_contents($this->tmp . DIRECTORY_SEPARATOR . 'bmi_backup_manifest.json'));
401
 
402
  if ($first == true) {
403
  $this->migration->log(__('Manifest loaded', 'backup-backup'), 'SUCCESS');
433
  public function restoreDatabaseV1(&$manifest) {
434
 
435
  $this->migration->log(__('Older backup detected, using V1 engine to restore database...', 'backup-backup'), 'WARN');
436
+ $this->migration->log(__('Database size: ' . BMP::humanSize(filesize($this->tmp . DIRECTORY_SEPARATOR . 'bmi_database_backup.sql')), 'backup-backup'), 'INFO');
437
  $old_domain = $manifest->dbdomain;
438
  $new_domain = $this->siteurl; // parse_url(home_url())['host'];
439
 
440
  $abs = BMP::fixSlashes($manifest->config->ABSPATH);
441
  $newabs = BMP::fixSlashes(ABSPATH);
442
+ $file = $this->tmp . DIRECTORY_SEPARATOR . 'bmi_database_backup.sql';
443
  $this->db->importDatabase($file, $old_domain, $new_domain, $abs, $newabs, $manifest->config->table_prefix, $this->siteurl, $this->home);
444
  $this->migration->log(__('Database restored', 'backup-backup'), 'SUCCESS');
445
 
567
 
568
  }
569
 
570
+ } elseif (file_exists($this->tmp . DIRECTORY_SEPARATOR . 'bmi_database_backup.sql')) {
571
 
572
  $this->restoreDatabaseV1($manifest);
573
 
588
  $curr_prefix = $this->table_prefix;
589
  $new_prefix = $manifest->config->table_prefix;
590
  $this->migration->log(__('Restoring wp-config file...', 'backup-backup'), 'STEP');
591
+ $file = file($abs . DIRECTORY_SEPARATOR . 'wp-config.' . $this->tmptime . '.php');
592
+ rename($abs . DIRECTORY_SEPARATOR . 'wp-config.' . $this->tmptime . '.php', $abs . DIRECTORY_SEPARATOR . 'wp-config.php');
593
+ $wpconfig = file_get_contents($abs . DIRECTORY_SEPARATOR . 'wp-config.php');
594
  if (strpos($wpconfig, '"' . $curr_prefix . '";') !== false) {
595
  $wpconfig = str_replace('"' . $curr_prefix . '";', '"' . $new_prefix . '";', $wpconfig);
596
  } elseif (strpos($wpconfig, "'" . $curr_prefix . "';") !== false) {
597
  $wpconfig = str_replace("'" . $curr_prefix . "';", "'" . $new_prefix . "';", $wpconfig);
598
  }
599
 
600
+ file_put_contents($abs . DIRECTORY_SEPARATOR . 'wp-config.php', $wpconfig);
601
  $this->migration->log(__('WP-Config restored', 'backup-backup'), 'SUCCESS');
602
 
603
  }
605
  public function restoreOriginalWPConfig($remove = true) {
606
 
607
  $abs = untrailingslashit(ABSPATH);
608
+ $tmp_file_f = $abs . DIRECTORY_SEPARATOR . 'wp-config.' . $this->tmptime . '.php';
609
  if (file_exists($tmp_file_f)) {
610
+ copy($tmp_file_f, $abs . DIRECTORY_SEPARATOR . 'wp-config.php');
611
  if ($remove === true) @unlink($tmp_file_f);
612
  }
613
 
663
  $file = trailingslashit(wp_upload_dir()['basedir']) . 'elementor';
664
  if (file_exists($file) && is_dir($file)) {
665
  $this->migration->log(__('Clearing elementor template cache...', 'backup-backup'), 'STEP');
666
+ $path = $file . DIRECTORY_SEPARATOR . '*';
667
  foreach (glob($path) as $file_path) if (!is_dir($file_path)) @unlink($file_path);
668
  $this->migration->log(__('Elementor cache cleared!', 'backup-backup'), 'SUCCESS');
669
  }
698
  }
699
 
700
  // Deny read of this folder
701
+ copy(BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.htaccess', $this->tmp . DIRECTORY_SEPARATOR . '.htaccess');
702
+ touch($this->tmp . DIRECTORY_SEPARATOR . 'index.html');
703
+ touch($this->tmp . DIRECTORY_SEPARATOR . 'index.php');
704
 
705
  }
706
 
708
 
709
  $this->migration->log(__('Making new secret key for current restore process.', 'backup-backup'), 'STEP');
710
  $secret = $this->randomString();
711
+ file_put_contents(BMI_INCLUDES . DIRECTORY_SEPARATOR . 'htaccess' . DIRECTORY_SEPARATOR . '.restore_secret', $secret);
712
  $this->migration->log(__('Secret key generated, it will be returned to you (ping).', 'backup-backup'), 'SUCCESS');
713
 
714
  return $secret;
733
  try {
734
 
735
  // Require Universal Zip Library
736
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'zipper' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'zip.php';
737
 
738
  // Make restore secret
739
  if (!$this->isCLI && $this->batchStep == 0) {
877
  // Get manifest
878
  $manifest = $this->getCurrentManifest(true);
879
 
880
+ if (isset($manifest->version) && array_key_exists('version', $manifest)) {
881
+ $this->migration->log(__('Backup Migration version used for that backup: ', 'backup-backup') . $manifest->version, 'INFO');
882
+ } else {
883
+ $this->migration->log(__('Backup was made with unknown version of Backup Migration plugin.', 'backup-backup'), 'INFO');
884
+ }
885
+
886
  // Restore files
887
  $this->restoreBackupFromFiles($manifest);
888
 
956
  if (defined('BMI_DB_MAX_ROWS_PER_QUERY')) {
957
  $this->migration->log(__('Max rows per query (this site): ', 'backup-backup') . BMI_DB_MAX_ROWS_PER_QUERY, 'INFO');
958
  }
959
+ if (isset($manifest->source_query_output) && array_key_exists('source_query_output', $manifest)) {
960
+ $this->migration->log(__('Max rows per query (source site): ', 'backup-backup') . $manifest->source_query_output, 'INFO');
961
+ } else {
962
+ $this->migration->log(__('Unknown query output value of backup file, maybe it was made before v1.1.7', 'backup-backup'), 'INFO');
963
+ }
964
  }
965
 
966
+
967
  $dbsort = new SmartDatabaseSort($db_tables, $this->migration, $this->isCLI);
968
  $process = $dbsort->sortUnsorted($this->processData);
969
 
990
 
991
  } else {
992
 
993
+ if (file_exists($this->tmp . DIRECTORY_SEPARATOR . 'bmi_database_backup.sql')) {
994
 
995
  $this->migration->log(__('Ommiting database convert step as the database backup included was not made with V2 engine.', 'backup-backup'), 'WARN');
996
  $this->migration->log(__('The process may be less stable if the database is larger than usual.', 'backup-backup'), 'WARN');
1136
  $this->finalCleanUP();
1137
 
1138
  // Touch autologin file
1139
+ $autologin_file = BMI_BACKUPS . DIRECTORY_SEPARATOR . '.autologin';
1140
  touch($autologin_file);
1141
 
1142
  // Final verbose
includes/htaccess/default.json CHANGED
@@ -16,6 +16,7 @@
16
  "BACKUP:FILES::FILTER:DPATHS": "false",
17
  "BACKUP:FILES::FILTER:NAMES:IN": [
18
  {"txt": "wp-clone", "pos": "1", "whr": "1" },
 
19
  {"txt": ".git", "pos": "2", "whr": "2" },
20
  {"txt": "node_modules", "pos": "2", "whr": "2" },
21
  {"txt": "mysql.sql", "pos": "3", "whr": "1" },
@@ -34,8 +35,8 @@
34
  "OTHER:DOWNLOAD:DIRECT": false,
35
  "OTHER:CLI:DISABLE": false,
36
  "OTHER:CLI:PATH": "",
37
- "OTHER:DB:QUERIES": "500",
38
- "OTHER:RESTORE:SPLITTING": false,
39
  "CRON:ENABLED": false,
40
  "CRON:TYPE": "month",
41
  "CRON:DAY": "1",
16
  "BACKUP:FILES::FILTER:DPATHS": "false",
17
  "BACKUP:FILES::FILTER:NAMES:IN": [
18
  {"txt": "wp-clone", "pos": "1", "whr": "1" },
19
+ {"txt": "wp-clone", "pos": "1", "whr": "2" },
20
  {"txt": ".git", "pos": "2", "whr": "2" },
21
  {"txt": "node_modules", "pos": "2", "whr": "2" },
22
  {"txt": "mysql.sql", "pos": "3", "whr": "1" },
35
  "OTHER:DOWNLOAD:DIRECT": false,
36
  "OTHER:CLI:DISABLE": false,
37
  "OTHER:CLI:PATH": "",
38
+ "OTHER:DB:QUERIES": "300",
39
+ "OTHER:RESTORE:SPLITTING": true,
40
  "CRON:ENABLED": false,
41
  "CRON:TYPE": "month",
42
  "CRON:DAY": "1",
includes/initializer.php CHANGED
@@ -111,10 +111,23 @@
111
 
112
  // Review banner
113
  if (!is_dir(WP_PLUGIN_DIR . '/backup-backup-pro')) {
114
- if (!(class_exists('Inisev\Subs\Inisev_Review') || class_exists('Inisev_Review'))) require_once BMI_ROOT_DIR . '/modules/review/review.php';
 
 
115
  $review_banner = new \Inisev\Subs\Inisev_Review(BMI_ROOT_FILE, BMI_ROOT_DIR, 'backup-backup', 'Backup & Migration', 'http://bit.ly/3vdk45L', 'backup-migration');
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
118
  // POST Logic
119
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
120
 
@@ -179,13 +192,13 @@
179
  if (basename($current_directory) == 'backup-migration') {
180
 
181
  require_once BMI_INCLUDES . '/ajax.php';
182
- $handler = new BMI_Ajax();
183
 
184
- $handler->post['directory'] = dirname($current_directory) . DIRECTORY_SEPARATOR . 'backup-migration-' . $this->randomString(10);
185
- $handler->post['access'] = Dashboard\bmi_get_config('STORAGE::DIRECT::URL');
186
 
187
- $res = $handler->saveStorageConfig();
188
- if (isset($res['status']) && $res['status'] == 'success') {
189
 
190
  $current_patch[] = 'BMI_D20_M07_01';
191
 
@@ -199,6 +212,45 @@
199
 
200
  }
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  update_option('bmi_hotfixes', $current_patch);
203
 
204
  }
@@ -461,6 +513,7 @@
461
  }
462
 
463
  public function handle_cron_check() {
 
464
  if (Dashboard\bmi_get_config('CRON:ENABLED') !== true) return;
465
 
466
  $now = time();
@@ -473,15 +526,18 @@
473
  $last_status = 0;
474
  }
475
 
476
- $plan = intval(@file_get_contents(BMI_INCLUDES . '/htaccess/.plan'));
477
- if ($last_time < $plan && ((time() - $plan) > 3600)) {
478
- if ($last_status !== '0') {
479
- $this->backup_inproper_time($plan);
480
- if (!wp_next_scheduled('bmi_do_backup_right_now')) {
481
- wp_schedule_single_event(time(), 'bmi_do_backup_right_now');
 
 
482
  }
483
  }
484
  }
 
485
  }
486
 
487
  public function get_next_cron($curr = false) {
@@ -524,12 +580,21 @@
524
  }
525
 
526
  public function send_notification_mail($email, $subject, $message) {
 
 
 
 
 
 
 
 
 
527
  $email_fail = __("Could not send the email notification about that fail", 'backup-backup');
528
 
529
  try {
530
 
531
  if (wp_mail($email, $subject, $message)) {
532
- Logger::info(__("Sent email notification to: ", 'backup-backup') . $email);
533
 
534
  return true;
535
  } else {
@@ -553,7 +618,7 @@
553
  }
554
 
555
  public function handle_after_cron() {
556
- require_once BMI_INCLUDES . '/scanner/backups.php';
557
  $backups = new Backups();
558
  $list = $backups->getAvailableBackups();
559
 
@@ -650,7 +715,7 @@
650
  $plan = intval(@file_get_contents(BMI_INCLUDES . '/htaccess/.plan'));
651
 
652
  // Check difference
653
- if ((time() - $plan) > 45) {
654
  Logger::log('Backup failed to run on proper time, but running now.');
655
  Logger::log('Planned time: ' . date('Y-m-d H:i:s', $plan));
656
  $this->backup_inproper_time($plan);
@@ -708,7 +773,9 @@
708
  $this->set_last_cron('5', $now);
709
  }
710
 
711
- @unlink(BMI_BACKUPS . '/.cron');
 
 
712
  require_once BMI_INCLUDES . '/cron/handler.php';
713
  $time = $this->get_next_cron();
714
 
111
 
112
  // Review banner
113
  if (!is_dir(WP_PLUGIN_DIR . '/backup-backup-pro')) {
114
+ if (!(class_exists('\Inisev\Subs\Inisev_Review') || class_exists('Inisev\Subs\Inisev_Review') || class_exists('Inisev_Review'))) {
115
+ require_once BMI_MODULES_DIR . 'review' . DIRECTORY_SEPARATOR . 'review.php';
116
+ }
117
  $review_banner = new \Inisev\Subs\Inisev_Review(BMI_ROOT_FILE, BMI_ROOT_DIR, 'backup-backup', 'Backup & Migration', 'http://bit.ly/3vdk45L', 'backup-migration');
118
  }
119
 
120
+ // Deactivation module
121
+ // $bmi_plugin_path = trailingslashit(basename(BMI_ROOT_DIR)) . basename(BMI_ROOT_FILE);
122
+ // if (isset($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
123
+ // if (is_array($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) $GLOBALS['IIEV_PLUGINS_DEACTIVATION'][] = $bmi_plugin_path;
124
+ // } else {
125
+ // if (!(class_exists('\Inisev\Subs\Inisev_Deactivation') || class_exists('Inisev\Subs\Inisev_Deactivation') || class_exists('Inisev_Deactivation'))) {
126
+ // require_once BMI_MODULES_DIR . 'deactivation' . DIRECTORY_SEPARATOR . 'deactivation.php';
127
+ // }
128
+ // $deactivation_module = new \Inisev\Subs\Inisev_Deactivation($bmi_plugin_path, BMI_ROOT_DIR, BMI_ROOT_FILE);
129
+ // }
130
+
131
  // POST Logic
132
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
133
 
192
  if (basename($current_directory) == 'backup-migration') {
193
 
194
  require_once BMI_INCLUDES . '/ajax.php';
195
+ $handler_a = new BMI_Ajax();
196
 
197
+ $handler_a->post['directory'] = dirname($current_directory) . DIRECTORY_SEPARATOR . 'backup-migration-' . $this->randomString(10);
198
+ $handler_a->post['access'] = Dashboard\bmi_get_config('STORAGE::DIRECT::URL');
199
 
200
+ $res_a = $handler_a->saveStorageConfig();
201
+ if (isset($res_a['status']) && $res_a['status'] == 'success') {
202
 
203
  $current_patch[] = 'BMI_D20_M07_01';
204
 
212
 
213
  }
214
 
215
+ if (!in_array('BMI_D17_M12_Y21_02', $current_patch)) {
216
+
217
+ $current_splitting_value = Dashboard\bmi_get_config('OTHER:RESTORE:SPLITTING');
218
+ $current_query_size = Dashboard\bmi_get_config('OTHER:DB:QUERIES');
219
+
220
+ $current_query_size = intval($current_query_size);
221
+ if ($current_splitting_value == 'true' || $current_splitting_value === true) {
222
+ $current_splitting_value = true;
223
+ } else {
224
+ $current_splitting_value = false;
225
+ }
226
+
227
+ if ($current_splitting_value === false || $current_query_size != 300) {
228
+
229
+ $b_db_restore_splitting = true;
230
+ $b_db_query_size = '300';
231
+
232
+ $error_b = 0;
233
+ if (!Dashboard\bmi_set_config('OTHER:RESTORE:SPLITTING', $b_db_restore_splitting)) {
234
+ $error_b++;
235
+ }
236
+ if (!Dashboard\bmi_set_config('OTHER:DB:QUERIES', $b_db_query_size)) {
237
+ $error_b++;
238
+ }
239
+
240
+ if ($error_b <= 0) {
241
+
242
+ $current_patch[] = 'BMI_D17_M12_Y21_02';
243
+
244
+ }
245
+
246
+ } else {
247
+
248
+ $current_patch[] = 'BMI_D17_M12_Y21_02';
249
+
250
+ }
251
+
252
+ }
253
+
254
  update_option('bmi_hotfixes', $current_patch);
255
 
256
  }
513
  }
514
 
515
  public function handle_cron_check() {
516
+
517
  if (Dashboard\bmi_get_config('CRON:ENABLED') !== true) return;
518
 
519
  $now = time();
526
  $last_status = 0;
527
  }
528
 
529
+ if (file_exists(BMI_INCLUDES . '/htaccess/.plan')) {
530
+ $plan = intval(@file_get_contents(BMI_INCLUDES . '/htaccess/.plan'));
531
+ if ($last_time < $plan && ((time() - $plan) > 3600)) {
532
+ if ($last_status !== '0') {
533
+ $this->backup_inproper_time($plan);
534
+ if (!wp_next_scheduled('bmi_do_backup_right_now')) {
535
+ wp_schedule_single_event(time(), 'bmi_do_backup_right_now');
536
+ }
537
  }
538
  }
539
  }
540
+
541
  }
542
 
543
  public function get_next_cron($curr = false) {
580
  }
581
 
582
  public function send_notification_mail($email, $subject, $message) {
583
+
584
+ $currentDate = date('Y-m-d');
585
+ if (get_option('bmi_last_email_notification', false) == $currentDate) {
586
+ Logger::log(__("Disallowing to send mail as today we already sent one.", 'backup-backup'));
587
+ return;
588
+ }
589
+
590
+ update_option('bmi_last_email_notification', $currentDate);
591
+
592
  $email_fail = __("Could not send the email notification about that fail", 'backup-backup');
593
 
594
  try {
595
 
596
  if (wp_mail($email, $subject, $message)) {
597
+ Logger::log(__("Sent email notification to: ", 'backup-backup') . $email);
598
 
599
  return true;
600
  } else {
618
  }
619
 
620
  public function handle_after_cron() {
621
+ require_once BMI_INCLUDES . DIRECTORY_SEPARATOR . 'scanner' . DIRECTORY_SEPARATOR . 'backups.php';
622
  $backups = new Backups();
623
  $list = $backups->getAvailableBackups();
624
 
715
  $plan = intval(@file_get_contents(BMI_INCLUDES . '/htaccess/.plan'));
716
 
717
  // Check difference
718
+ if ((time() - $plan) > 3600) {
719
  Logger::log('Backup failed to run on proper time, but running now.');
720
  Logger::log('Planned time: ' . date('Y-m-d H:i:s', $plan));
721
  $this->backup_inproper_time($plan);
773
  $this->set_last_cron('5', $now);
774
  }
775
 
776
+ if (file_exists(BMI_BACKUPS . '/.cron')) {
777
+ @unlink(BMI_BACKUPS . '/.cron');
778
+ }
779
  require_once BMI_INCLUDES . '/cron/handler.php';
780
  $time = $this->get_next_cron();
781
 
includes/progress/zip.php CHANGED
@@ -55,6 +55,7 @@
55
  'domain' => parse_url(home_url())['host'],
56
  'dbdomain' => get_option('siteurl'),
57
  'uid' => get_current_user_id(),
 
58
  'config' => array(
59
  'ABSPATH' => ABSPATH,
60
  'DB_NAME' => DB_NAME,
55
  'domain' => parse_url(home_url())['host'],
56
  'dbdomain' => get_option('siteurl'),
57
  'uid' => get_current_user_id(),
58
+ 'source_query_output' => BMI_DB_MAX_ROWS_PER_QUERY,
59
  'config' => array(
60
  'ABSPATH' => ABSPATH,
61
  'DB_NAME' => DB_NAME,
includes/scanner/files.php CHANGED
@@ -221,10 +221,10 @@
221
  }
222
 
223
  } catch (\Exception $e) {
224
- Logger::info($e->getMessage());
225
  return $files;
226
  } catch (\Throwable $e) {
227
- Logger::info($e->getMessage());
228
  return $files;
229
  }
230
 
221
  }
222
 
223
  } catch (\Exception $e) {
224
+ Logger::log($e->getMessage());
225
  return $files;
226
  } catch (\Throwable $e) {
227
+ Logger::log($e->getMessage());
228
  return $files;
229
  }
230
 
modules/deactivation/assets/script.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Always close the code, cause you can make conflicts (same for css use prefixes)
2
+ (function ($) {
3
+
4
+ let deactivation_urls = {};
5
+
6
+ function getUrl(plugin_dir) {
7
+
8
+ let plugin_slug = plugin_dir.split('/')[0];
9
+ return 'https://wordpress.org/support/plugin/' + plugin_slug + '/#wporg-footer';
10
+
11
+ }
12
+
13
+ function closeModal() {
14
+
15
+ setTimeout(function () {
16
+ $('#iiev-modal-leave').animate({'opacity': 0}, 400);
17
+ }, 200);
18
+
19
+ $('.iiev-modal-leave__body').animate({'opacity': 0, 'top': '-50px'}, 300, function () {
20
+ setTimeout(function () {
21
+ $('#iiev-modal-leave').hide();
22
+ }, 100);
23
+ });
24
+
25
+ }
26
+
27
+ function openModal(e) {
28
+
29
+ e.preventDefault();
30
+
31
+ let plugin_dist = $(e.target).attr('data-plugin-dist');
32
+
33
+ $('.iiev-modal-leave__away-link').attr('href', getUrl(plugin_dist));
34
+ $('.iiev-modal-leave__deactivated-link').attr('href', deactivation_urls[plugin_dist]);
35
+
36
+ $('#iiev-modal-leave').show();
37
+ $('#iiev-modal-leave').animate({'opacity': 1}, 300);
38
+ $('.iiev-modal-leave__body').animate({'opacity': 1, 'top': '0px'}, 300);
39
+
40
+ }
41
+
42
+ function addHook($tr) {
43
+
44
+ $tr.find('.deactivate').find('a').on('click', openModal);
45
+
46
+ }
47
+
48
+ function tryToFindItAndAddEvent(plugin) {
49
+
50
+ let $tr = $('#the-list').find('tr[data-plugin="' + plugin + '"]');
51
+ let deactivate_btn = $tr.find('.deactivate')
52
+ if (typeof deactivate_btn != 'undefined' && deactivate_btn.length > 0) {
53
+ deactivate_url = deactivate_btn.find('a')[0].getAttribute('href');
54
+ if (typeof deactivate_url != 'undefined' && deactivate_url.length > 0) {
55
+ deactivation_urls[plugin] = deactivate_url;
56
+ deactivate_btn.find('a').attr('href', '#');
57
+ deactivate_btn.find('a').attr('data-plugin-dist', plugin);
58
+ addHook($tr);
59
+ }
60
+ }
61
+
62
+ }
63
+
64
+ $('.iiev-modal-leave__btn-close').on('click', closeModal);
65
+
66
+ for (let i = 0; i < IIEV_DEACTIV_PLUG_LIST.length; ++i) {
67
+
68
+ let plugin = IIEV_DEACTIV_PLUG_LIST[i];
69
+ tryToFindItAndAddEvent(plugin);
70
+
71
+ }
72
+
73
+
74
+ })(jQuery);
modules/deactivation/assets/style.css ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Version 1.0.1 */
2
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
3
+
4
+ .iiev-modal-leave {
5
+ font-family: "Montserrat", "Arial", sans-serif;
6
+ color: #393939; }
7
+
8
+ .iiev-modal-leave__body {
9
+ opacity: 0;
10
+ top: -50px;
11
+ max-width: 600px;
12
+ position: relative;
13
+ background: #f0fbfe;
14
+ border-radius: 20px;
15
+ display: grid;
16
+ grid-template-columns: 1fr;
17
+ -webkit-box-align: start;
18
+ -ms-flex-align: start;
19
+ align-items: start;
20
+ justify-items: center;
21
+ -webkit-transform: translateY(50px);
22
+ transform: translateY(50px);
23
+ -webkit-transition: 0.5s all;
24
+ transition: 0.5s all;
25
+ margin: 115px auto 0; }
26
+
27
+ .iiev-modal-leave__btn-close {
28
+ display: -webkit-box;
29
+ display: -ms-flexbox;
30
+ display: flex;
31
+ -webkit-box-align: center;
32
+ -ms-flex-align: center;
33
+ align-items: center;
34
+ -webkit-box-pack: center;
35
+ -ms-flex-pack: center;
36
+ justify-content: center;
37
+ width: 26px;
38
+ height: 26px;
39
+ border: 0;
40
+ padding: 0;
41
+ background: transparent;
42
+ position: absolute;
43
+ z-index: 10;
44
+ right: 15px;
45
+ top: 15px;
46
+ cursor: pointer;
47
+ fill: #adadad;
48
+ -webkit-transition: fill 0.3s ease 0s;
49
+ transition: fill 0.3s ease 0s; }
50
+ @media (hover: hover), screen and (min-width: 0\0) {
51
+ .iiev-modal-leave__btn-close:hover {
52
+ fill: #000; } }
53
+
54
+ .iiev-modal-leave__content {
55
+ padding: 0 27px;
56
+ display: grid;
57
+ padding-bottom: 12px; }
58
+ @media (min-width: 600px) {
59
+ .iiev-modal-leave__content {
60
+ grid-template-columns: 247px 1fr;
61
+ gap: 42px 22px; } }
62
+
63
+ .iiev-modal-leave__title-wrap {
64
+ position: relative;
65
+ z-index: 3;
66
+ margin-top: -21px;
67
+ margin-bottom: 40px;
68
+ grid-column: 1/-1; }
69
+ @media (min-width: 600px) {
70
+ .iiev-modal-leave__title-wrap {
71
+ margin-bottom: 0; } }
72
+
73
+ .iiev-modal-leave__title {
74
+ font-weight: 500;
75
+ font-size: 28px;
76
+ line-height: 34px;
77
+ max-width: 255px;
78
+ text-align: center;
79
+ margin: 0 auto;
80
+ position: relative; }
81
+ .iiev-modal-leave__title::after {
82
+ pointer-events: none;
83
+ content: "";
84
+ position: absolute;
85
+ top: 50%;
86
+ left: 50%;
87
+ -webkit-transform: translate(-50%, -50%);
88
+ transform: translate(-50%, -50%);
89
+ width: 230px;
90
+ height: 221px;
91
+ z-index: -1;
92
+ background: url("../img/message.svg") no-repeat;
93
+ background-size: cover; }
94
+ @media (min-width: 600px) {
95
+ .iiev-modal-leave__title::after {
96
+ width: 273px;
97
+ height: 268px; } }
98
+
99
+ .iiev-modal-leave-text-primary {
100
+ color: #2885c0; }
101
+
102
+ .iiev-modal-leave__img-wrap {
103
+ position: relative;
104
+ z-index: 1; }
105
+
106
+ @media (min-width: 600px) {
107
+ .iiev-modal-leave__text-content {
108
+ padding-top: 47px;
109
+ padding-right: 20px; } }
110
+
111
+ .iiev-modal-leave__text-content-title {
112
+ font-weight: normal;
113
+ font-size: 18px;
114
+ line-height: 27px;
115
+ margin: 0 0 19px; }
116
+
117
+ .iiev-modal-leave__away-link {
118
+ padding: 15px 26px 13px 27px;
119
+ text-decoration: none;
120
+ background: #2885c0;
121
+ border-radius: 10px;
122
+ display: -webkit-inline-box;
123
+ display: -ms-inline-flexbox;
124
+ display: inline-flex;
125
+ -webkit-box-align: center;
126
+ -ms-flex-align: center;
127
+ align-items: center;
128
+ -webkit-box-pack: center;
129
+ -ms-flex-pack: center;
130
+ justify-content: center;
131
+ font-weight: 600;
132
+ font-size: 18px;
133
+ line-height: 22px;
134
+ color: #ffffff;
135
+ opacity: 1;
136
+ transition: .3s all;
137
+ margin: 0 auto 15px; }
138
+ .iiev-modal-leave__away-link svg {
139
+ -webkit-transition: -webkit-transform 0.3s ease 0s;
140
+ transition: -webkit-transform 0.3s ease 0s;
141
+ transition: transform 0.3s ease 0s;
142
+ transition: transform 0.3s ease 0s, -webkit-transform 0.3s ease 0s; }
143
+ @media (hover: hover), screen and (min-width: 0\0) {
144
+ .iiev-modal-leave__away-link:hover svg {
145
+ -webkit-transform: translateX(5px);
146
+ transform: translateX(5px); } }
147
+
148
+ .iiev-modal-leave__away-link-text {
149
+ margin-right: 10px; }
150
+
151
+ .iiev-modal-leave__away-link:hover, .iiev-modal-leave__away-link:active {
152
+ color: white !important;
153
+ opacity: 0.9;
154
+ }
155
+
156
+ .iiev-modal-leave__loggin-trouble {
157
+ display: -webkit-inline-box;
158
+ display: -ms-inline-flexbox;
159
+ display: inline-flex;
160
+ -webkit-box-align: center;
161
+ -ms-flex-align: center;
162
+ align-items: center;
163
+ margin: 0 0 8px 38px; }
164
+ .iiev-modal-leave__loggin-trouble span {
165
+ font-weight: normal;
166
+ font-size: 15px;
167
+ line-height: 18px;
168
+ color: #808080; }
169
+
170
+ .iiev-modal-leave__info {
171
+ display: -webkit-box;
172
+ display: -ms-flexbox;
173
+ display: flex;
174
+ -webkit-box-align: center;
175
+ -ms-flex-align: center;
176
+ align-items: center;
177
+ position: relative;
178
+ margin-left: 5px;
179
+ cursor: pointer; }
180
+ .iiev-modal-leave__info::after {
181
+ display: none;
182
+ content: "";
183
+ position: absolute;
184
+ z-index: 6;
185
+ bottom: calc(100% + 4px);
186
+ left: calc(50% + 75px);
187
+ -webkit-transform: translateX(-50%);
188
+ transform: translateX(-50%);
189
+ width: 0;
190
+ height: 0;
191
+ border-width: 21px 17.5px 0 17.5px;
192
+ border-color: #2885c0 transparent transparent transparent;
193
+ border-style: solid; }
194
+ .iiev-modal-leave__info::before {
195
+ content: "";
196
+ position: absolute;
197
+ width: 100px;
198
+ height: 40px;
199
+ background: transparent;
200
+ top: -30px;
201
+ left: 50%;
202
+ -webkit-transform: translateX(-50%);
203
+ transform: translateX(-50%);
204
+ pointer-events: none; }
205
+ @media (hover: hover), screen and (min-width: 0\0) {
206
+ .iiev-modal-leave__info:hover::before {
207
+ pointer-events: all; }
208
+ .iiev-modal-leave__info:hover::after {
209
+ -webkit-animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
210
+ animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
211
+ display: block }
212
+ .iiev-modal-leave__info:hover .iiev-modal-leave__info-popup {
213
+ -webkit-animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
214
+ animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
215
+ display: block;
216
+ z-index: 6; } }
217
+
218
+ @keyframes iiev_fadein {
219
+ 0% { opacity:0; }
220
+ 66% { opacity:0; }
221
+ 100% { opacity:1; }
222
+ }
223
+
224
+ @-webkit-keyframes iiev_fadein {
225
+ 0% { opacity:0; }
226
+ 66% { opacity:0; }
227
+ 100% { opacity:1; }
228
+ }
229
+
230
+ @keyframes iiev_fadeout {
231
+ 0% { opacity:0; }
232
+ 66% { opacity:0; }
233
+ 100% { opacity:1; display: none; }
234
+ }
235
+
236
+ @-webkit-keyframes iiev_fadeout {
237
+ 0% { opacity:0; }
238
+ 66% { opacity:0; }
239
+ 100% { opacity:1; display: none; }
240
+ }
241
+
242
+ .iiev-modal-leave__info-icon {
243
+ position: relative; }
244
+
245
+ .iiev-modal-leave__info-popup {
246
+ display: none;
247
+ position: absolute;
248
+ bottom: calc(100% + 4px);
249
+ left: -70px;
250
+ width: 200px;
251
+ padding: 20px 28px 19px;
252
+ background: #2885c0;
253
+ -webkit-box-shadow: 0px 0px 17px rgba(0, 0, 0, 0.3);
254
+ box-shadow: 0px 0px 17px rgba(0, 0, 0, 0.3);
255
+ border-radius: 5px;
256
+ font-weight: 500;
257
+ font-size: 15px;
258
+ line-height: 18px;
259
+ text-align: center;
260
+ color: #ffffff;
261
+ opacity: 0;
262
+ transition: .3s all;
263
+ margin-bottom: 11px; }
264
+ @media (min-width: 600px) {
265
+ .iiev-modal-leave__info-popup {
266
+ left: -267px;
267
+ width: 400px; } }
268
+
269
+ .iiev-modal-leave__text-hint {
270
+ font-weight: normal;
271
+ font-size: 13px;
272
+ line-height: 19px;
273
+ color: #2885c0;
274
+ position: relative;
275
+ padding-left: 12px; }
276
+ .iiev-modal-leave__text-hint::before {
277
+ content: "";
278
+ position: absolute;
279
+ left: 0;
280
+ top: 0;
281
+ width: 2px;
282
+ height: 100%;
283
+ border-radius: 2px;
284
+ background: currentColor; }
285
+
286
+ .iiev-modal-leave__footer {
287
+ width: 100%;
288
+ background: #d7f0f7;
289
+ text-align: center;
290
+ border-radius: 0px 0px 20px 20px; }
291
+
292
+ .iiev-modal-leave__deactivated-link {
293
+ text-decoration: none;
294
+ display: -webkit-inline-box;
295
+ display: -ms-inline-flexbox;
296
+ display: inline-flex;
297
+ font-weight: 500;
298
+ font-size: 14px;
299
+ line-height: 17px;
300
+ color: #9fb9bf;
301
+ padding: 16px 5px 17px; }
302
+ @media (hover: hover), screen and (min-width: 0\0) {
303
+ .iiev-modal-leave__deactivated-link:hover {
304
+ color: #3b7887; } }
305
+
306
+ #iiev-modal-leave {
307
+ position: fixed;
308
+ top: 0;
309
+ left: 0;
310
+ width: 100%;
311
+ height: 100%;
312
+ z-index: 99999;
313
+ background: rgba(2, 113, 245, 0.21);
314
+ display: none;
315
+ opacity: 0;
316
+ }
modules/deactivation/deactivation.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deactivation free help offer module
5
+ *
6
+ * @category Child Plugin
7
+ * @version v0.1.0
8
+ * @since v0.1.0
9
+ * @author iClyde <kontakt@iclyde.pl>
10
+ * @author Artem K
11
+ */
12
+
13
+ // Namespace
14
+ namespace Inisev\Subs;
15
+
16
+ // Disallow direct access
17
+ if (!defined('ABSPATH')) exit;
18
+
19
+ /**
20
+ * Main class for handling the Deactivation
21
+ */
22
+ if (!class_exists('Inisev\Subs\Inisev_Deactivation')) {
23
+ class Inisev_Deactivation {
24
+
25
+ // Variables
26
+ private $assets_url;
27
+ private $plugin_dir;
28
+
29
+ /**
30
+ * __construct - Initialization of the module
31
+ * @param string $plugin Name with path to the plugin source file e.g. "backup-backup/backup-backup.php"
32
+ *
33
+ * @return void
34
+ */
35
+ function __construct($plugin, $plugin_dir, $plugin_file) {
36
+
37
+ global $pagenow;
38
+ if ($pagenow != 'plugins.php') return;
39
+
40
+ $this->plugin_file = $plugin_file;
41
+ $this->plugin_dir = $plugin_dir;
42
+ $this->assets_url = plugin_dir_url($this->plugin_dir) . basename($plugin_dir);
43
+
44
+ if (file_exists(trailingslashit(WP_PLUGIN_DIR) . $plugin)) {
45
+ if (!isset($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
46
+ $GLOBALS['IIEV_PLUGINS_DEACTIVATION'] = [];
47
+ }
48
+ if (!in_array($plugin, $GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
49
+ $GLOBALS['IIEV_PLUGINS_DEACTIVATION'][] = $plugin;
50
+ }
51
+ }
52
+
53
+ $this->enableDeactivation();
54
+
55
+ }
56
+
57
+ /**
58
+ * add_assets - Will add assets for that module
59
+ *
60
+ * @return void
61
+ */
62
+ public function add_assets() {
63
+
64
+ wp_enqueue_script('inisev-deactivation-script', $this->__asset('assets/script.js'), [], filemtime($this->__asset('assets/script.js', true)), true);
65
+ wp_enqueue_style('inisev-deactivation-style', $this->__asset('assets/style.css'), [], filemtime($this->__asset('assets/style.css', true)));
66
+
67
+ add_action('wp_after_admin_bar_render', [&$this, 'render_content']);
68
+
69
+ }
70
+
71
+ /**
72
+ * render_content - Will render content of our deactivation modal
73
+ *
74
+ * @return void
75
+ */
76
+ public function render_content() {
77
+
78
+ require_once trailingslashit(__DIR__) . 'modal.php';
79
+
80
+ }
81
+
82
+ /**
83
+ * __asset - Asset handler will return path
84
+ *
85
+ * @param string $name Relative path to the file
86
+ * @return string Absolute path to that file
87
+ */
88
+ private function __asset($name, $dir = false) {
89
+
90
+ if ($dir == false) {
91
+ return trailingslashit($this->assets_url) . 'modules' . DIRECTORY_SEPARATOR . 'deactivation' . DIRECTORY_SEPARATOR . $name;
92
+ } else {
93
+ return trailingslashit(__DIR__) . $name;
94
+ }
95
+
96
+ }
97
+
98
+ /**
99
+ * add_plugin_list - Will print out script with plugin array
100
+ *
101
+ * @return void
102
+ */
103
+ public function add_plugin_list() {
104
+
105
+ $plugin_list = $GLOBALS['IIEV_PLUGINS_DEACTIVATION'];
106
+ if (is_array($plugin_list) && sizeof($plugin_list) >= 1) {
107
+ echo '<script type="text/javascript"> const IIEV_DEACTIV_PLUG_LIST = ' . json_encode($plugin_list) . ';</script>';
108
+ }
109
+
110
+ }
111
+
112
+ /**
113
+ * enableDeactivation - It will enable deactivation script & style
114
+ *
115
+ * @return void
116
+ */
117
+ private function enableDeactivation() {
118
+
119
+ if (!defined('IIEV_ASSETS_LOADED_DEACTIV')) {
120
+ define('IIEV_ASSETS_LOADED_DEACTIV', true);
121
+ add_action('admin_enqueue_scripts', [&$this, 'add_assets']);
122
+ }
123
+
124
+ if (!defined('IIEV_LIST_MODULE_DEACTIV')) {
125
+ define('IIEV_LIST_MODULE_DEACTIV', true);
126
+ add_action('wp_print_scripts', [&$this, 'add_plugin_list']);
127
+ }
128
+
129
+ }
130
+
131
+ }
132
+ }
modules/deactivation/img/dog.webp ADDED
Binary file
modules/deactivation/img/message.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg width="275" height="260" viewBox="0 0 275 260" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M152.549 17.9273C85.7088 12.3375 27.6767 54.5999 22.8443 112.385C19.2289 155.615 46.4303 195.126 88.2189 214.688C80.8529 241.755 65.0762 243.476 65.0762 243.476C93.7247 250.105 109.631 235.151 117.046 224.373C122.912 225.623 128.914 226.559 135.059 227.073C201.899 232.663 259.931 190.401 264.764 132.616C269.596 74.8313 219.282 23.5081 152.549 17.9273Z" fill="#DBF6FE"/>
3
+ <path d="M142.552 10.2519C121.314 8.4758 99.6793 11.4432 79.795 19.4422C61.8156 26.7321 45.3353 38.1641 33.0046 53.1999C20.9166 67.9304 13.1221 85.8425 11.2119 104.789C9.1845 125.138 14.0838 145.74 24.5632 163.226C35.4106 181.503 51.6406 196.431 70.3337 206.57C72.7231 207.856 75.1215 209.033 77.6277 210.22C77.3584 209.546 76.9813 208.863 76.7119 208.189C74.4547 215.708 71.6584 223.182 66.1764 229.02C64.6216 230.736 62.6356 232.415 60.8025 233.565C60.0028 234.041 59.2031 234.517 58.4124 234.885C58.0709 235.073 57.7385 235.154 57.397 235.343C57.1724 235.433 56.2739 235.792 56.7231 235.612C56.0583 235.774 55.3844 236.043 54.7285 236.097C53.1922 236.294 52.868 238.872 54.4671 239.223C63.9447 241.427 73.908 241.717 83.2794 238.701C90.3056 236.466 96.6137 232.434 101.826 227.225C104.199 224.818 106.364 222.285 108.225 219.51C107.776 219.689 107.21 219.968 106.76 220.147C121.269 223.206 136.173 224.127 150.953 222.649C163.657 221.323 176.181 218.245 188.087 213.487C199.22 208.881 209.823 202.82 219.15 195.132C228.119 187.849 236.018 179.065 242.157 169.265C248.297 159.465 252.567 148.64 254.817 137.321C257.084 125.786 257.213 113.855 255.132 102.39C253.033 91.1417 248.949 80.2697 243.157 70.3405C237.167 60.1777 229.569 51.0745 220.785 43.1748C211.597 34.9157 201.195 28.1835 190.011 23.0144C178.1 17.4587 165.496 13.6906 152.524 11.7372C149.119 10.9097 145.786 10.5224 142.552 10.2519C140.504 10.0806 140.233 13.3148 142.282 13.4861C167.401 15.5868 191.844 24.4703 211.838 39.8211C229.793 53.5901 243.929 72.7934 250.023 94.6895C256.107 116.694 253.594 140.258 243.103 160.55C232.613 180.842 214.775 196.829 194.396 206.849C171.186 218.261 144.709 222.018 119.24 218.911C115.161 218.353 110.984 217.678 106.932 216.796C106.402 216.643 105.719 217.02 105.467 217.433C102.133 222.257 98.0798 226.586 93.2454 229.873C87.0181 234.237 79.6504 236.661 72.1035 237.333C66.5332 237.735 60.8284 237.15 55.3934 235.935C55.3032 237.013 55.2221 237.983 55.1319 239.062C57.3241 238.811 59.5795 237.805 61.4126 236.656C66.5524 233.612 70.6326 228.959 73.5539 223.884C76.2235 219.222 77.932 214.371 79.4428 209.286C79.7305 208.442 79.3624 207.651 78.527 207.256C59.7258 198.41 42.9384 184.955 31.0304 167.675C19.8051 151.321 13.4141 131.68 13.8781 111.852C14.3418 93.3266 20.627 75.2883 31.4393 60.2341C42.4853 44.9822 57.5912 33.1096 74.6454 25.1996C93.2901 16.4455 113.811 12.5165 134.178 13.0256C136.882 13.1431 139.586 13.2607 142.282 13.4861C144.33 13.6574 144.6 10.4232 142.552 10.2519Z" fill="#523823"/>
4
+ </svg>
modules/deactivation/modal.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deactivation free help offer module
5
+ *
6
+ * @category Child Plugin
7
+ * @version v0.1.0
8
+ * @since v0.1.0
9
+ * @author iClyde <kontakt@iclyde.pl>
10
+ * @author Artem K
11
+ */
12
+
13
+ // Namespace
14
+ namespace Inisev\Subs;
15
+
16
+ // Disallow direct access
17
+ if (!defined('ABSPATH')) exit;
18
+
19
+ ?>
20
+ <div id="iiev-modal-leave" class="iiev-modal-leave">
21
+
22
+ <div class="iiev-modal-leave__body">
23
+ <button type="button" class="iiev-modal-leave__btn-close" id="iiev-modal-leave__closebtn" aria-label="close modal">
24
+ <svg width="10" height="10" viewBox="0 0 11 10">
25
+ <path d="M9.70384 1.96966L6.66078 4.99993L9.70384 8.03006C10.1565 8.48093 10.1565 9.21127 9.70384 9.66213C9.47768 9.88732 9.18117 10 8.8848 10C8.58794 10 8.2914 9.88749 8.06541 9.66213L5.02168 6.63165L1.97818 9.6621C1.75204 9.88729 1.4555 9.99997 1.15887 9.99997C0.86233 9.99997 0.565989 9.88746 0.339654 9.6621C-0.112987 9.21144 -0.112987 8.48107 0.339654 8.03004L3.38264 4.9999L0.339481 1.96966C-0.11316 1.51896 -0.11316 0.788452 0.339481 0.33776C0.792036 -0.112587 1.52528 -0.112587 1.978 0.33776L5.02165 3.36804L8.06506 0.33776C8.51788 -0.112587 9.2512 -0.112587 9.70367 0.33776C10.1565 0.788452 10.1565 1.51896 9.70384 1.96966Z"></path>
26
+ </svg>
27
+ </button>
28
+ <div class="iiev-modal-leave__content">
29
+
30
+ <div class="iiev-modal-leave__title-wrap">
31
+ <h1 class="iiev-modal-leave__title">
32
+ <b><span class="iiev-modal-leave-text-primary">Please</span></b> don’t leave us!
33
+ </h1>
34
+ </div>
35
+ <div class="iiev-modal-leave__img-wrap">
36
+ <img src="<?php echo $this->__asset('img/dog.webp') ?>" width="247" height="290" alt="dog with sad eyes">
37
+ </div>
38
+
39
+ <div class="iiev-modal-leave__text-content">
40
+ <h2 class="iiev-modal-leave__text-content-title">
41
+ We’re happy to fix the issue, whatever it is! Quickly, and <b><span class="iiev-modal-leave-text-primary">100%
42
+ for free</span></b> :)
43
+ </h2>
44
+ <a href="#" target="_blank" class="iiev-modal-leave__away-link">
45
+ <span class="iiev-modal-leave__away-link-text">Ok, let me ask you</span>
46
+ <svg width="7" height="12" viewBox="0 0 7 12">
47
+ <path d="M6.53033 6.53033C6.82322 6.23744 6.82322 5.76256 6.53033 5.46967L1.75736 0.696699C1.46447 0.403806 0.989592 0.403806 0.696699 0.696699C0.403806 0.989592 0.403806 1.46447 0.696699 1.75736L4.93934 6L0.696699 10.2426C0.403806 10.5355 0.403806 11.0104 0.696699 11.3033C0.989592 11.5962 1.46447 11.5962 1.75736 11.3033L6.53033 6.53033ZM5 6.75H6V5.25H5V6.75Z" fill="white"></path>
48
+ </svg>
49
+ </a>
50
+ <div class="iiev-modal-leave__loggin-trouble">
51
+
52
+ <div class="iiev-modal-leave__info">
53
+ <span>Trouble logging in?</span>&nbsp;
54
+ <svg class="iiev-modal-leave__info-icon" width="16" height="16" viewBox="0 0 16 16">
55
+ <circle cx="8" cy="8" r="8" fill="#2885C0"></circle>
56
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.44813 5.96124C9.43327 5.95864 9.41823 5.95732 9.40314 5.95735H9.35043C9.19253 5.95266 9.03454 5.96281 8.87853 5.98761C8.70752 6.01975 8.53137 6.04738 8.361 6.07374L8.12249 6.11102L7.22241 6.25761L7.08805 6.2801L7.02376 6.29105L6.92733 6.3071L6.75503 6.84456H7.03598H7.12084C7.17623 6.84374 7.23162 6.84633 7.2867 6.85229C7.33498 6.85765 7.37929 6.88156 7.41025 6.919C7.4412 6.95643 7.45637 7.00445 7.45257 7.05288C7.43727 7.20794 7.40736 7.36118 7.36322 7.51061C7.23464 7.96064 7.10155 8.41068 6.97426 8.85299L6.79682 9.46246C6.77175 9.55054 6.74604 9.6386 6.72032 9.72732C6.63996 10.0044 6.55638 10.2905 6.47602 10.5734C6.4227 10.7466 6.39709 10.9271 6.40015 11.1083C6.40419 11.3387 6.49837 11.5585 6.66246 11.7203C6.82256 11.8768 7.03213 11.9728 7.25521 11.9916C7.3071 11.9973 7.35924 12.0001 7.41143 12C7.61553 11.9994 7.8174 11.9574 8.00483 11.8765C8.2435 11.7715 8.46128 11.6243 8.64772 11.4419C8.8778 11.2198 9.08106 10.9714 9.25335 10.702C9.30542 10.6222 9.35556 10.5399 9.40442 10.4609L9.47321 10.3503L9.56065 10.2108L9.08232 9.92921L8.99811 10.0578C8.99297 10.0649 8.9891 10.0713 8.98524 10.0777L8.96596 10.1054L8.87661 10.2339C8.80718 10.3323 8.73516 10.4339 8.66187 10.5309C8.58028 10.6427 8.4848 10.7436 8.37772 10.8312C8.35185 10.8519 8.32301 10.8686 8.2922 10.8807H8.289C8.28474 10.8775 8.28105 10.8736 8.27807 10.8691C8.27469 10.8652 8.27247 10.8604 8.27167 10.8553C8.27088 10.8502 8.27152 10.845 8.27356 10.8402L8.29477 10.7444C8.31855 10.6325 8.34171 10.5271 8.37128 10.423C8.67537 9.36346 8.9859 8.28661 9.28613 7.24511L9.57929 6.22932C9.58379 6.21389 9.58701 6.19909 9.59086 6.18494C9.59472 6.1708 9.59086 6.17275 9.59536 6.16568L9.64037 5.98824L9.45843 5.96701L9.44813 5.96124ZM9.47385 3.28162C9.34609 3.22768 9.2088 3.19994 9.07012 3.2C8.93297 3.20061 8.79733 3.22879 8.67131 3.28291C8.54528 3.33703 8.43144 3.41598 8.33656 3.51501C8.23998 3.61221 8.16371 3.72764 8.11217 3.85459C8.06062 3.98154 8.03486 4.11747 8.03635 4.25448C8.03785 4.39149 8.06658 4.52684 8.12088 4.65264C8.17518 4.77844 8.25397 4.89217 8.35264 4.98724C8.44609 5.08127 8.55715 5.15598 8.67949 5.20706C8.80183 5.25813 8.93303 5.28458 9.06561 5.28491H9.07526C9.31563 5.28393 9.54827 5.1999 9.73377 5.04704C9.91928 4.89418 10.0462 4.68187 10.0931 4.44612C10.1401 4.21038 10.104 3.96566 9.99117 3.75343C9.8783 3.5412 9.69554 3.37452 9.47385 3.28162Z" fill="white"></path>
57
+ <div class="iiev-modal-leave__info-popup">
58
+ Your account on Wordpress.org (where you open a new support thread) is different to the one you
59
+ login to your WordPress
60
+ dashboard (where you are now). If you don't have a WordPress.org account yet, please sign up at the
61
+ top right on the
62
+ Support Forum page, and then scroll down on that page . It only takes a minute:)
63
+ Thank you!
64
+ </div>
65
+ </svg></div>
66
+
67
+ </div>
68
+ <p class="iiev-modal-leave__text-hint">
69
+ Just open a new ticket, you don't have to browse through existing ones
70
+ </p>
71
+ </div>
72
+
73
+ </div>
74
+ <footer class="iiev-modal-leave__footer">
75
+ <a href="#" class="iiev-modal-leave__deactivated-link">
76
+ I already asked – de-activate it for now
77
+ </a>
78
+ </footer>
79
+ </div>
80
+
81
+ </div>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Migrate
3
  Tags: Backup, Migration, Migrate, Backups, Restore, All In One, Duplicate, Clone, Import, Export, Transfer
4
  Requires at least: 4.6
5
- Tested up to: 5.8.2
6
- Stable tag: 1.1.6
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
@@ -118,6 +118,23 @@ Besides having the most intuitive interface and smoothest user experience, Backu
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  = 1.1.6 =
122
  * Plugin tested with PHP 8.1
123
  * Plugin tested with WP Version 5.8.2
@@ -301,18 +318,20 @@ Besides having the most intuitive interface and smoothest user experience, Backu
301
 
302
  == Upgrade Notice ==
303
 
304
- = 1.1.6 =
305
- What's new in 1.1.6?
306
- * Plugin tested with PHP 8.1
307
- * Plugin tested with WP Version 5.8.2
308
- * Fixed PHP CLI for sites above 2 GB (premium)
309
- * Modified default settings for new users, to solve most common issues
310
- * Modified default query output to 500 per batch, to solve most common database issue
311
- * Fixed undefined variables of zipping module (PHP 7.4+)
312
- * Fixed backups made with PHP CLI when the ZIP wasn't closed correctly
313
- * Visual updates for our cool banner
314
- * Super-Quick Migration now should work with PHP CLI
315
- * Now WordPress version will be displayed in the logs
316
- * Fixed English typo in logs "enginge" => "engine"
317
- * Added additional sanitization for e-mail, e-mail title and directory (Thank you @Vlad Visse (Patchstack))
318
- * Added version tag
 
 
2
  Contributors: Migrate
3
  Tags: Backup, Migration, Migrate, Backups, Restore, All In One, Duplicate, Clone, Import, Export, Transfer
4
  Requires at least: 4.6
5
+ Tested up to: 5.9
6
+ Stable tag: 1.1.7
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
118
 
119
  == Changelog ==
120
 
121
+ = 1.1.7 =
122
+ * Tested up with WP Version 5.9 (up to beta 3)
123
+ * Fixed restoration issues for Windows and Windows Server
124
+ * Fixed notifications via e-mail - now you can receive max 1 e-mail per day
125
+ * Adjusted cleanup of restoration files - GC processing
126
+ * Fixed restore process request, after Super-Quick Migration (sometimes it was hanging)
127
+ * Fixed restoration process via shell due to syntax error
128
+ * Adjusted important parts to be compatible with Windows systems
129
+ * Modified default value of query output to 300
130
+ * By default SQL-Splitting will be enabled since this version (adjusted for all users)
131
+ * Removed/fixed unnecessary notices in error log above PHP 7.4
132
+ * Added new indicators in restore and backup logs
133
+ * Now newly created backups saves WP version of source site
134
+ * Restore and backup logs will display version of current backup
135
+ * PHP CLI will be disabled by default for new users
136
+ * Fixed some JavaScript issues of front-end process manager
137
+
138
  = 1.1.6 =
139
  * Plugin tested with PHP 8.1
140
  * Plugin tested with WP Version 5.8.2
318
 
319
  == Upgrade Notice ==
320
 
321
+ = 1.1.7 =
322
+ What's new in 1.1.7?
323
+ * Tested up with WP Version 5.9 (up to beta 3)
324
+ * Fixed restoration issues for Windows and Windows Server
325
+ * Fixed notifications via e-mail - now you can receive max 1 e-mail per day
326
+ * Adjusted cleanup of restoration files - GC processing
327
+ * Fixed restore process request, after Super-Quick Migration (sometimes it was hanging)
328
+ * Fixed restoration process via shell due to syntax error
329
+ * Adjusted important parts to be compatible with Windows systems
330
+ * Modified default value of query output to 300
331
+ * By default SQL-Splitting will be enabled since this version (adjusted for all users)
332
+ * Removed/fixed unnecessary notices in error log above PHP 7.4
333
+ * Added new indicators in restore and backup logs
334
+ * Now newly created backups saves WP version of source site
335
+ * Restore and backup logs will display version of current backup
336
+ * PHP CLI will be disabled by default for new users
337
+ * Fixed some JavaScript issues of front-end process manager