diff --git a/assets/css/main.css b/assets/css/main.css index 16899e7f..bd032907 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,2 +1 @@ -.backwpup-max-width{max-width:800px}@font-face{font-family:'backwpup';src:url("../fonts/backwpup.eot");src:url("../fonts/backwpup.eot?#iefix") format("embedded-opentype"),url("../fonts/backwpup.ttf") format("truetype"),url("../fonts/backwpup.woff") format("woff"),url("../fonts/backwpup.svg#backwpup") format("svg");font-weight:normal;font-style:normal}.error{color:red}.warning{color:#ffba00}.success{color:#86cf6f}#wp-admin-bar-backwpup .ab-icon{font:normal 20px/1 'backwpup' !important}#wp-admin-bar-backwpup .ab-icon::before{content:"\e600";top:2px}@media screen and (max-width: 48.875em){#wp-admin-bar-backwpup .ab-icon{font:normal 32px/1 'backwpup' !important;display:block;text-indent:0;speak:none;top:7px;width:50px;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wp-admin-bar-backwpup::before{top:0}}#adminmenu #toplevel_page_backwpup div.wp-menu-image:before{font:normal 20px/1 'backwpup' !important;content:"\e600"}#adminmenu #toplevel_page_backwpup a[href$="backwpuprestore"]::after{content:'New';font-size:.55rem;color:#fff;padding:.18rem .33rem;background:#97c24f;border-radius:.23rem;line-height:1;position:relative;bottom:5px;left:1em}#backwpup-page hr{border:0;border-top:none;border-bottom:1px solid #eee}#backwpup-page .backwpup-floated-postbox{margin:25px 0 0;max-width:100%;overflow:hidden;padding:15px;position:relative}#backwpup-page .backwpup-floated-postbox h3 a{font-size:14px;text-decoration:none;font-weight:600}#backwpup-page .backwpup-cleared-postbox{clear:both;margin:25px 0 0;padding:10px}#backwpup-page .postbox ul{padding-left:10px}#backwpup-page .postbox table{caption-side:top;margin-bottom:25px}#backwpup-page .postbox table caption{color:#222;font-size:14px;font-weight:600;padding:8px 12px;margin:0;line-height:1.4;text-align:left}#backwpup-page .postbox .hndle{cursor:auto}#backwpup-page .postbox .backwpup-bullet-list{list-style:disc;padding-left:16px}#backwpup-page .postbox ol.backwpup-bullet-list{list-style:decimal}#backwpup-page .wizardbox{color:#fff;background:#1d94cf url("../images/hgbox.png") no-repeat right bottom;min-height:20em}#backwpup-page .wizardbox:hover{background-color:#0f79ae}#backwpup-page .wizardbox .wizardbox_name{color:#fff;margin-top:0}#backwpup-page .wizardbox .wizardbox_start{position:absolute;bottom:10px;left:10px}#backwpup-page .wizardbox select{max-width:100%;width:100%}#backwpup-page .button-bwp,#backwpup-page .button-primary-bwp{border-radius:0;-webkit-box-shadow:none;box-shadow:none}#backwpup-page .button-primary-bwp{border:none;background:#38b0eb;color:#fff;min-width:8em}#backwpup-page .button-primary-bwp:hover{background:#064565}#backwpup-page .backwpup-table-wrap{overflow-x:auto}#backwpup-page .backwpup-banner-img{display:block;height:auto;margin:26px auto;max-width:100%}#backwpup-page .backwpup-text-center{text-align:center}#backwpup-page ul.backwpup-text-center{padding-left:0}#backwpup-page .backwpup-message{background-color:#fff;border:none;border-left:4px solid #ccc;box-shadow:0px 1px 1px 0px rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px;-webkit-box-shadow:0px 1px 1px 0px rgba(0,0,0,0.1)}#backwpup-page .backwpup-message p{margin:0.5em 0;padding:2px}#backwpup-page .backwpup-info{border-left:4px solid #38b0eb}#backwpup-page .backwpup-warning{border-left:4px solid #ffba00}#backwpup-page .backwpup-full-width{max-width:100%}#backwpup-page .backwpup-full-width.action{margin-bottom:20px}#backwpup-page .notice ul{list-style-type:disc;margin-left:2em}@media screen and (min-width: 45em){#backwpup-page .backwpup-floated-postbox{float:left;margin:25px 25px 25px 0;width:290px}#backwpup-page #backwpup-one-click-backup,#backwpup-page #wizard-jobimport,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{margin-right:0}#backwpup-page #backwpup-one-click-backup+.backwpup-floated-postbox,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{clear:left}}@media screen and (min-width: 64em){#backwpup-page .backwpup-floated-postbox{width:362px}#backwpup-page .wizardbox{width:225px;min-height:225px}#backwpup-page .backwpup-max-width{max-width:800px}body[class*="_backwpupabout"] #backwpup-page .backwpup-welcome{max-width:none}}.progressbar{margin-top:20px;height:auto;background:#f6f6f6 url("../../assets/images/progressbarhg.jpg")}.progressbar #progresssteps{background-color:#007fb6}.progressbar .bwpu-progress{background-color:#1d94cf;color:#fff;padding:5px 0;text-align:center}#documentation_content p{font-size:14px;line-height:20px;color:#333}#documentation_content h3{padding:7px 0;font-size:22px}#documentation_content h4{padding:7px 0;font-size:18px}#documentation_content img.size-full{border:10px #f6f6f6 solid}#wpfooter #footer-left,#wpfooter #footer-right{overflow:hidden}#wpfooter #footer-left #footer-thankyou{clear:both;display:block;padding-top:.5em}#wpfooter #footer-left .backwpup-get-pro{display:inline-block;line-height:25px}#wpfooter #footer-upgrade .backwpup-update-footer{display:block;line-height:25px}#wpfooter .inpsyde_logo{background:url("../images/inpsyde.png") no-repeat;display:inline-block;margin-right:15px;margin-top:5px;line-height:25px;height:25px;width:80px;text-indent:-9999em;text-decoration:none} -/*# sourceMappingURL=main.css.map */ +@charset "UTF-8";.backwpup-max-width{max-width:800px}@font-face{font-family:'backwpup';src:url('../fonts/backwpup.eot');src:url('../fonts/backwpup.eot?#iefix') format('embedded-opentype'), url('../fonts/backwpup.ttf') format('truetype'), url('../fonts/backwpup.woff') format('woff'), url('../fonts/backwpup.svg#backwpup') format('svg');font-weight:normal;font-style:normal;}.error{color:#f00}.warning{color:#ffba00}.success{color:#86cf6f}#wp-admin-bar-backwpup .ab-icon{font:normal 20px/1 'backwpup' !important}#wp-admin-bar-backwpup .ab-icon::before{content:"\e600";top:2px}@media screen and (max-width:48.875em){#wp-admin-bar-backwpup .ab-icon{font:normal 32px/1 'backwpup' !important;display:block;text-indent:0;speak:none;top:7px;width:50px;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wp-admin-bar-backwpup::before{top:0}}#adminmenu #toplevel_page_backwpup div.wp-menu-image:before{font:normal 20px/1 'backwpup' !important;content:"\e600"}#adminmenu #toplevel_page_backwpup a[href$="backwpuprestore"]::after{content:'New';font-size:0.55rem;color:#fff;padding:0.18rem 0.33rem;background:#97c24f;border-radius:0.23rem;line-height:1;position:relative;bottom:5px;left:1em}#backwpup-page hr{border:0;border-top:none;border-bottom:1px solid #eee}#backwpup-page .backwpup-floated-postbox{margin:25px 0 0;max-width:100%;overflow:hidden;padding:15px;position:relative}#backwpup-page .backwpup-floated-postbox h3 a{font-size:14px;text-decoration:none;font-weight:600}#backwpup-page .backwpup-cleared-postbox{clear:both;margin:25px 0 0;padding:10px}#backwpup-page .postbox ul{padding-left:10px}#backwpup-page .postbox table{caption-side:top;margin-bottom:25px}#backwpup-page .postbox table caption{color:#222;font-size:14px;font-weight:600;padding:8px 12px;margin:0;line-height:1.4;text-align:left}#backwpup-page .postbox .hndle{cursor:auto}#backwpup-page .postbox .backwpup-bullet-list{list-style:disc;padding-left:16px}#backwpup-page .postbox ol.backwpup-bullet-list{list-style:decimal}#backwpup-page .wizardbox{color:#fff;background:#1d94cf url('../images/hgbox.png') no-repeat right bottom;min-height:20em}#backwpup-page .wizardbox:hover{background-color:#0f79ae}#backwpup-page .wizardbox .wizardbox_name{color:#fff;margin-top:0}#backwpup-page .wizardbox .wizardbox_start{position:absolute;bottom:10px;left:10px}#backwpup-page .wizardbox select{max-width:100%;width:100%}#backwpup-page .button-bwp,#backwpup-page .button-primary-bwp{border-radius:0;-webkit-box-shadow:none;box-shadow:none}#backwpup-page .button-primary-bwp{border:none;background:#38b0eb;color:#fff;min-width:8em}#backwpup-page .button-primary-bwp:hover{background:#064565}#backwpup-page .backwpup-table-wrap{overflow-x:auto}#backwpup-page .backwpup-banner-img{display:block;height:auto;margin:26px auto;max-width:100%}#backwpup-page .backwpup-text-center{text-align:center}#backwpup-page ul.backwpup-text-center{padding-left:0}#backwpup-page .backwpup-message{background-color:#fff;border:none;border-left:4px solid #ccc;box-shadow:0px 1px 1px 0px rgba(0, 0, 0, 0.1);margin:5px 0 15px;padding:1px 12px;-webkit-box-shadow:0px 1px 1px 0px rgba(0, 0, 0, 0.1)}#backwpup-page .backwpup-message p{margin:0.5em 0;padding:2px}#backwpup-page .backwpup-info{border-left:4px solid #38b0eb;}#backwpup-page .backwpup-warning{border-left:4px solid #ffba00;}#backwpup-page .backwpup-full-width{max-width:100%}#backwpup-page .backwpup-full-width.action{margin-bottom:20px}#backwpup-page .notice ul{list-style-type:disc;margin-left:2em}@media screen and (min-width:45em){#backwpup-page .backwpup-floated-postbox{float:left;margin:25px 25px 25px 0;width:290px}#backwpup-page #backwpup-one-click-backup,#backwpup-page #wizard-jobimport,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{margin-right:0}#backwpup-page #backwpup-one-click-backup + .backwpup-floated-postbox,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{clear:left}}@media screen and (min-width:64em){#backwpup-page .backwpup-floated-postbox{width:362px}#backwpup-page .wizardbox{width:225px;min-height:225px}#backwpup-page .backwpup-max-width{max-width:800px}body[class*="_backwpupabout"] #backwpup-page .backwpup-welcome{max-width:none}}.progressbar{margin-top:20px;height:auto;background:#f6f6f6 url('../../assets/images/progressbarhg.jpg')}.progressbar #progresssteps{background-color:#007fb6}.progressbar .bwpu-progress{background-color:#1d94cf;color:#fff;padding:5px 0;text-align:center}#documentation_content p{font-size:14px;line-height:20px;color:#333}#documentation_content h3{padding:7px 0;font-size:22px}#documentation_content h4{padding:7px 0;font-size:18px}#documentation_content img.size-full{border:10px #f6f6f6 solid}#wpfooter #footer-left,#wpfooter #footer-right{overflow:hidden}#wpfooter #footer-left #footer-thankyou{clear:both;display:block;padding-top:0.5em}#wpfooter #footer-left .backwpup-get-pro{display:inline-block;line-height:25px}#wpfooter #footer-upgrade .backwpup-update-footer{display:block;line-height:25px}#wpfooter .inpsyde_logo{background:url('../images/inpsyde.png') no-repeat;display:inline-block;margin-right:15px;margin-top:5px;line-height:25px;height:25px;width:80px;text-indent:-9999em;text-decoration:none} \ No newline at end of file diff --git a/assets/css/main.css.map b/assets/css/main.css.map deleted file mode 100644 index 648df1f9..00000000 --- a/assets/css/main.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ -"version": 3, -"mappings": "AAIA,mBAAoB,CAClB,SAAS,CAAE,KAAK,CCDlB,UASC,CARC,WAAW,CAAE,UAAU,CACvB,GAAG,CAAC,4BAA4B,CAChC,GAAG,CAAC,gNAG4D,CAChE,WAAW,CAAE,MAAM,CACnB,UAAU,CAAE,MAAM,CAGpB,MAAO,CACL,KAAK,CCRK,GAAI,CDWhB,QAAS,CACP,KAAK,CCbQ,OAAO,CDgBtB,QAAS,CACP,KAAK,CCfO,OAAO,CCJnB,+BAAS,CACP,IAAI,CAAE,mCAAmC,CAEzC,uCAAU,CACR,OAAO,CAAE,OAAO,CAChB,GAAG,CAAE,GAAG,CAUd,uCAAwC,CAGpC,+BAAS,CACP,IAAI,CAAE,mCAAmC,CACzC,OAAO,CAAE,KAAK,CACd,WAAW,CAAE,CAAC,CACd,KAAK,CAAE,IAAI,CACX,GAAG,CAAE,GAAG,CACR,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,MAAM,CAClB,sBAAsB,CAAE,WAAW,CACnC,uBAAuB,CAAE,SAAS,CAGpC,8BAAU,CACR,GAAG,CAAE,CAAC,EC/BV,2DAAiD,CAC/C,IAAI,CAAK,mCAAmC,CAC5C,OAAO,CAAE,OAAO,CAGlB,oEAA0D,CACxD,OAAO,CAAQ,KAAK,CACpB,SAAS,CAAM,MAAM,CACrB,KAAK,CFPK,IAAI,CEQd,OAAO,CAAQ,aAAa,CAC5B,UAAU,CAAK,OAAyB,CACxC,aAAa,CAAE,MAAM,CACrB,WAAW,CAAI,CAAC,CAChB,QAAQ,CAAO,QAAQ,CACvB,MAAM,CAAS,GAAG,CAClB,IAAI,CAAW,GAAG,CCdpB,iBAAG,CACD,MAAM,CAAS,CAAC,CAChB,UAAU,CAAK,IAAI,CACnB,aAAa,CAAE,cAAc,CAI/B,wCAA0B,CACxB,MAAM,CAAK,QAAQ,CACnB,SAAS,CAAE,IAAI,CACf,QAAQ,CAAG,MAAM,CACjB,OAAO,CAAI,IAAI,CACf,QAAQ,CAAG,QAAQ,CAEnB,6CAAK,CACH,SAAS,CAAQ,IAAI,CACrB,eAAe,CAAE,IAAI,CACrB,WAAW,CAAM,GAAG,CAIxB,wCAA0B,CACxB,KAAK,CAAI,IAAI,CACb,MAAM,CAAG,QAAQ,CACjB,OAAO,CAAE,IAAI,CAKb,0BAAG,CACD,YAAY,CAAE,IAAI,CAGpB,6BAAM,CACJ,YAAY,CAAG,GAAG,CAClB,aAAa,CAAE,IAAI,CAEnB,qCAAQ,CACN,KAAK,CAAQ,IAAI,CACjB,SAAS,CAAI,IAAI,CACjB,WAAW,CAAE,GAAG,CAChB,OAAO,CAAM,QAAQ,CACrB,MAAM,CAAO,CAAC,CACd,WAAW,CAAE,GAAG,CAChB,UAAU,CAAG,IAAI,CAIrB,8BAAO,CACL,MAAM,CAAE,IAAI,CAGd,6CAAsB,CACpB,UAAU,CAAI,IAAI,CAClB,YAAY,CAAE,IAAI,CAGpB,+CAAwB,CACtB,UAAU,CAAE,OAAO,CAKvB,yBAAW,CACT,KAAK,CAAO,IAAI,CAChB,UAAU,CAAE,yDAAyD,CACrE,UAAU,CAAE,IAAI,CAEhB,+BAAQ,CACN,gBAAgB,CAAE,OAAO,CAG3B,yCAAgB,CACd,KAAK,CAAO,IAAI,CAChB,UAAU,CAAE,CAAC,CAGf,0CAAiB,CACf,QAAQ,CAAE,QAAQ,CAClB,MAAM,CAAI,IAAI,CACd,IAAI,CAAM,IAAI,CAGhB,gCAAO,CACL,SAAS,CAAE,IAAI,CACf,KAAK,CAAM,IAAI,CAKnB,6DACoB,CAClB,aAAa,CAAO,CAAC,CACrB,kBAAkB,CAAE,IAAI,CACxB,UAAU,CAAU,IAAI,CAG1B,kCAAoB,CAClB,MAAM,CAAM,IAAI,CAChB,UAAU,CAAE,OAAO,CACnB,KAAK,CAAO,IAAI,CAChB,SAAS,CAAG,GAAG,CAEf,wCAAQ,CACN,UAAU,CAAE,OAAO,CAIvB,mCAAqB,CACnB,UAAU,CAAE,IAAI,CAGlB,mCAAqB,CACnB,OAAO,CAAI,KAAK,CAChB,MAAM,CAAK,IAAI,CACf,MAAM,CAAK,SAAS,CACpB,SAAS,CAAE,IAAI,CAGjB,oCAAsB,CACpB,UAAU,CAAE,MAAM,CAEpB,sCAAwB,CACtB,YAAY,CAAE,CAAC,CAKjB,gCAAkB,CAChB,gBAAgB,CAAI,IAAI,CACxB,MAAM,CAAc,IAAI,CACxB,WAAW,CAAS,cAAc,CAClC,UAAU,CAAU,+BAAkC,CACtD,MAAM,CAAc,UAAU,CAC9B,OAAO,CAAa,QAAQ,CAC5B,kBAAkB,CAAE,+BAAkC,CAEtD,kCAAE,CACA,MAAM,CAAG,OAAO,CAChB,OAAO,CAAE,GAAG,CAIhB,6BAAe,CACb,WAAW,CAAE,iBAAiB,CAGhC,gCAAkB,CAChB,WAAW,CAAE,iBAAiB,CAGhC,mCAAqB,CACnB,SAAS,CAAE,IAAI,CAEf,0CAAS,CACP,aAAa,CAAE,IAAI,CAMrB,yBAAG,CACD,eAAe,CAAE,IAAI,CACrB,WAAW,CAAM,GAAG,CAU1B,mCAAoC,CAIhC,wCAA0B,CACxB,KAAK,CAAG,IAAI,CACZ,MAAM,CAAE,gBAAgB,CACxB,KAAK,CAAG,KAAK,CAIf,4IAGgB,CACd,YAAY,CAAE,CAAC,CAGjB,qIAEgB,CACd,KAAK,CAAE,IAAI,EAOjB,mCAAoC,CAIhC,wCAA0B,CACxB,KAAK,CAAE,KAAK,CAId,yBAAW,CACT,KAAK,CAAO,KAAK,CACjB,UAAU,CAAE,KAAK,CAGnB,kCAAoB,CAClB,SAAS,CAAE,KAAK,CAGlB,8DAAkD,CAChD,SAAS,CAAE,IAAI,EC9NrB,YAAa,CACX,UAAU,CAAE,IAAI,CAChB,MAAM,CAAE,IAAI,CACZ,UAAU,CAAE,oDAAoD,CAEhE,2BAAe,CACb,gBAAgB,CAAE,OAAO,CAG3B,2BAAe,CACb,gBAAgB,CAAE,OAAO,CACzB,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,KAAK,CACd,UAAU,CAAE,MAAM,CCbpB,wBAAE,CACA,SAAS,CAAI,IAAI,CACjB,WAAW,CAAE,IAAI,CACjB,KAAK,CAAQ,IAAI,CAEnB,yBAAG,CACD,OAAO,CAAI,KAAK,CAChB,SAAS,CAAE,IAAI,CAEjB,yBAAG,CACD,OAAO,CAAI,KAAK,CAChB,SAAS,CAAE,IAAI,CAEjB,oCAAc,CACZ,MAAM,CAAE,kBAAkB,CCb5B,8CACc,CACZ,QAAQ,CAAE,MAAM,CAIhB,uCAAiB,CACf,KAAK,CAAQ,IAAI,CACjB,OAAO,CAAM,KAAK,CAClB,WAAW,CAAE,IAAI,CAGnB,wCAAkB,CAChB,OAAO,CAAM,YAAY,CACzB,WAAW,CAAE,IAAI,CAKnB,iDAAwB,CACtB,OAAO,CAAM,KAAK,CAClB,WAAW,CAAE,IAAI,CAIrB,uBAAc,CACZ,UAAU,CAAO,sCAAsC,CACvD,OAAO,CAAU,YAAY,CAC7B,YAAY,CAAK,IAAI,CACrB,UAAU,CAAO,GAAG,CACpB,WAAW,CAAM,IAAI,CACrB,MAAM,CAAW,IAAI,CACrB,KAAK,CAAY,IAAI,CACrB,WAAW,CAAM,OAAO,CACxB,eAAe,CAAE,IAAI", -"sources": ["../sass/utils/_classes.scss","../sass/core/_typography.scss","../sass/settings/_colors.scss","../sass/components/_admin-bar.scss","../sass/components/_admin-menu.scss","../sass/components/_backwpup-page.scss","../sass/components/_progress-bar.scss","../sass/components/_documentation.scss","../sass/components/_footer.scss"], -"names": [], -"file": "main.css" -} diff --git a/assets/css/main.min.css b/assets/css/main.min.css index 5fb1ad05..440e55ae 100644 --- a/assets/css/main.min.css +++ b/assets/css/main.min.css @@ -1 +1 @@ -.backwpup-max-width{max-width:800px}@font-face{font-family:backwpup;src:url(../fonts/backwpup.eot);src:url(../fonts/backwpup.eot?#iefix) format("embedded-opentype"),url(../fonts/backwpup.ttf) format("truetype"),url(../fonts/backwpup.woff) format("woff"),url(../fonts/backwpup.svg#backwpup) format("svg");font-weight:400;font-style:normal}.error{color:red}.warning{color:#ffba00}.success{color:#86cf6f}#wp-admin-bar-backwpup .ab-icon{font:400 20px/1 backwpup!important}#wp-admin-bar-backwpup .ab-icon::before{content:"\e600";top:2px}@media screen and (max-width:48.875em){#wp-admin-bar-backwpup .ab-icon{font:400 32px/1 backwpup!important;display:block;text-indent:0;speak:none;top:7px;width:50px;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wp-admin-bar-backwpup::before{top:0}}#adminmenu #toplevel_page_backwpup div.wp-menu-image:before{font:400 20px/1 backwpup!important;content:"\e600"}#adminmenu #toplevel_page_backwpup a[href$=backwpuprestore]::after{content:'New';font-size:.55rem;color:#fff;padding:.18rem .33rem;background:#97c24f;border-radius:.23rem;line-height:1;position:relative;bottom:5px;left:1em}#backwpup-page hr{border:0;border-top:none;border-bottom:1px solid #eee}#backwpup-page .backwpup-floated-postbox{margin:25px 0 0;max-width:100%;overflow:hidden;padding:15px;position:relative}#backwpup-page .backwpup-floated-postbox h3 a{font-size:14px;text-decoration:none;font-weight:600}#backwpup-page .backwpup-cleared-postbox{clear:both;margin:25px 0 0;padding:10px}#backwpup-page .postbox ul{padding-left:10px}#backwpup-page .postbox table{caption-side:top;margin-bottom:25px}#backwpup-page .postbox table caption{color:#222;font-size:14px;font-weight:600;padding:8px 12px;margin:0;line-height:1.4;text-align:left}#backwpup-page .postbox .hndle{cursor:auto}#backwpup-page .postbox .backwpup-bullet-list{list-style:disc;padding-left:16px}#backwpup-page .postbox ol.backwpup-bullet-list{list-style:decimal}#backwpup-page .wizardbox{color:#fff;background:url(../images/hgbox.png) right bottom no-repeat #1d94cf;min-height:20em}#backwpup-page .wizardbox:hover{background-color:#0f79ae}#backwpup-page .wizardbox .wizardbox_name{color:#fff;margin-top:0}#backwpup-page .wizardbox .wizardbox_start{position:absolute;bottom:10px;left:10px}#backwpup-page .wizardbox select{max-width:100%;width:100%}#backwpup-page .button-bwp,#backwpup-page .button-primary-bwp{border-radius:0;-webkit-box-shadow:none;box-shadow:none}#backwpup-page .button-primary-bwp{border:none;background:#38b0eb;color:#fff;min-width:8em}#backwpup-page .button-primary-bwp:hover{background:#064565}#backwpup-page .backwpup-table-wrap{overflow-x:auto}#backwpup-page .backwpup-banner-img{display:block;height:auto;margin:26px auto;max-width:100%}#backwpup-page .backwpup-text-center{text-align:center}#backwpup-page ul.backwpup-text-center{padding-left:0}#backwpup-page .backwpup-message{background-color:#fff;border:none;border-left:4px solid #ccc;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 15px;padding:1px 12px;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}#backwpup-page .backwpup-message p{margin:.5em 0;padding:2px}#backwpup-page .backwpup-info{border-left:4px solid #38b0eb}#backwpup-page .backwpup-warning{border-left:4px solid #ffba00}#backwpup-page .backwpup-full-width{max-width:100%}#backwpup-page .backwpup-full-width.action{margin-bottom:20px}#backwpup-page .notice ul{list-style-type:disc;margin-left:2em}@media screen and (min-width:45em){#backwpup-page .backwpup-floated-postbox{float:left;margin:25px 25px 25px 0;width:290px}#backwpup-page #backwpup-one-click-backup,#backwpup-page #backwpup-stats,#backwpup-page #backwpup-thank-you,#backwpup-page #wizard-jobimport{margin-right:0}#backwpup-page #backwpup-one-click-backup+.backwpup-floated-postbox,#backwpup-page #backwpup-stats,#backwpup-page #backwpup-thank-you{clear:left}}@media screen and (min-width:64em){#backwpup-page .backwpup-floated-postbox{width:362px}#backwpup-page .wizardbox{width:225px;min-height:225px}#backwpup-page .backwpup-max-width{max-width:800px}body[class*="_backwpupabout"] #backwpup-page .backwpup-welcome{max-width:none}}.progressbar{margin-top:20px;height:auto;background:url(../../assets/images/progressbarhg.jpg) #f6f6f6}.progressbar #progresssteps{background-color:#007fb6}.progressbar .bwpu-progress{background-color:#1d94cf;color:#fff;padding:5px 0;text-align:center}#documentation_content p{font-size:14px;line-height:20px;color:#333}#documentation_content h3{padding:7px 0;font-size:22px}#documentation_content h4{padding:7px 0;font-size:18px}#documentation_content img.size-full{border:10px solid #f6f6f6}#wpfooter #footer-left,#wpfooter #footer-right{overflow:hidden}#wpfooter #footer-left #footer-thankyou{clear:both;display:block;padding-top:.5em}#wpfooter #footer-left .backwpup-get-pro{display:inline-block;line-height:25px}#wpfooter #footer-upgrade .backwpup-update-footer{display:block;line-height:25px}#wpfooter .inpsyde_logo{background:url(../images/inpsyde.png) no-repeat;display:inline-block;margin-right:15px;margin-top:5px;line-height:25px;height:25px;width:80px;text-indent:-9999em;text-decoration:none} \ No newline at end of file +@charset "UTF-8";.backwpup-max-width{max-width:800px}@font-face{font-family:'backwpup';src:url('../fonts/backwpup.eot');src:url('../fonts/backwpup.eot?#iefix') format('embedded-opentype'), url('../fonts/backwpup.ttf') format('truetype'), url('../fonts/backwpup.woff') format('woff'), url('../fonts/backwpup.svg#backwpup') format('svg');font-weight:normal;font-style:normal}.error{color:#f00}.warning{color:#ffba00}.success{color:#86cf6f}#wp-admin-bar-backwpup .ab-icon{font:normal 20px/1 'backwpup' !important}#wp-admin-bar-backwpup .ab-icon::before{content:"\e600";top:2px}@media screen and (max-width:48.875em){#wp-admin-bar-backwpup .ab-icon{font:normal 32px/1 'backwpup' !important;display:block;text-indent:0;speak:none;top:7px;width:50px;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wp-admin-bar-backwpup::before{top:0}}#adminmenu #toplevel_page_backwpup div.wp-menu-image:before{font:normal 20px/1 'backwpup' !important;content:"\e600"}#adminmenu #toplevel_page_backwpup a[href$="backwpuprestore"]::after{content:'New';font-size:0.55rem;color:#fff;padding:0.18rem 0.33rem;background:#97c24f;border-radius:0.23rem;line-height:1;position:relative;bottom:5px;left:1em}#backwpup-page hr{border:0;border-top:none;border-bottom:1px solid #eee}#backwpup-page .backwpup-floated-postbox{margin:25px 0 0;max-width:100%;overflow:hidden;padding:15px;position:relative}#backwpup-page .backwpup-floated-postbox h3 a{font-size:14px;text-decoration:none;font-weight:600}#backwpup-page .backwpup-cleared-postbox{clear:both;margin:25px 0 0;padding:10px}#backwpup-page .postbox ul{padding-left:10px}#backwpup-page .postbox table{caption-side:top;margin-bottom:25px}#backwpup-page .postbox table caption{color:#222;font-size:14px;font-weight:600;padding:8px 12px;margin:0;line-height:1.4;text-align:left}#backwpup-page .postbox .hndle{cursor:auto}#backwpup-page .postbox .backwpup-bullet-list{list-style:disc;padding-left:16px}#backwpup-page .postbox ol.backwpup-bullet-list{list-style:decimal}#backwpup-page .wizardbox{color:#fff;background:#1d94cf url('../images/hgbox.png') no-repeat right bottom;min-height:20em}#backwpup-page .wizardbox:hover{background-color:#0f79ae}#backwpup-page .wizardbox .wizardbox_name{color:#fff;margin-top:0}#backwpup-page .wizardbox .wizardbox_start{position:absolute;bottom:10px;left:10px}#backwpup-page .wizardbox select{max-width:100%;width:100%}#backwpup-page .button-bwp,#backwpup-page .button-primary-bwp{border-radius:0;-webkit-box-shadow:none;box-shadow:none}#backwpup-page .button-primary-bwp{border:none;background:#38b0eb;color:#fff;min-width:8em}#backwpup-page .button-primary-bwp:hover{background:#064565}#backwpup-page .backwpup-table-wrap{overflow-x:auto}#backwpup-page .backwpup-banner-img{display:block;height:auto;margin:26px auto;max-width:100%}#backwpup-page .backwpup-text-center{text-align:center}#backwpup-page ul.backwpup-text-center{padding-left:0}#backwpup-page .backwpup-message{background-color:#fff;border:none;border-left:4px solid #ccc;box-shadow:0px 1px 1px 0px rgba(0, 0, 0, 0.1);margin:5px 0 15px;padding:1px 12px;-webkit-box-shadow:0px 1px 1px 0px rgba(0, 0, 0, 0.1)}#backwpup-page .backwpup-message p{margin:0.5em 0;padding:2px}#backwpup-page .backwpup-info{border-left:4px solid #38b0eb}#backwpup-page .backwpup-warning{border-left:4px solid #ffba00}#backwpup-page .backwpup-full-width{max-width:100%}#backwpup-page .backwpup-full-width.action{margin-bottom:20px}#backwpup-page .notice ul{list-style-type:disc;margin-left:2em}@media screen and (min-width:45em){#backwpup-page .backwpup-floated-postbox{float:left;margin:25px 25px 25px 0;width:290px}#backwpup-page #backwpup-one-click-backup,#backwpup-page #wizard-jobimport,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{margin-right:0}#backwpup-page #backwpup-one-click-backup + .backwpup-floated-postbox,#backwpup-page #backwpup-thank-you,#backwpup-page #backwpup-stats{clear:left}}@media screen and (min-width:64em){#backwpup-page .backwpup-floated-postbox{width:362px}#backwpup-page .wizardbox{width:225px;min-height:225px}#backwpup-page .backwpup-max-width{max-width:800px}body[class*="_backwpupabout"] #backwpup-page .backwpup-welcome{max-width:none}}.progressbar{margin-top:20px;height:auto;background:#f6f6f6 url('../../assets/images/progressbarhg.jpg')}.progressbar #progresssteps{background-color:#007fb6}.progressbar .bwpu-progress{background-color:#1d94cf;color:#fff;padding:5px 0;text-align:center}#documentation_content p{font-size:14px;line-height:20px;color:#333}#documentation_content h3{padding:7px 0;font-size:22px}#documentation_content h4{padding:7px 0;font-size:18px}#documentation_content img.size-full{border:10px #f6f6f6 solid}#wpfooter #footer-left,#wpfooter #footer-right{overflow:hidden}#wpfooter #footer-left #footer-thankyou{clear:both;display:block;padding-top:0.5em}#wpfooter #footer-left .backwpup-get-pro{display:inline-block;line-height:25px}#wpfooter #footer-upgrade .backwpup-update-footer{display:block;line-height:25px}#wpfooter .inpsyde_logo{background:url('../images/inpsyde.png') no-repeat;display:inline-block;margin-right:15px;margin-top:5px;line-height:25px;height:25px;width:80px;text-indent:-9999em;text-decoration:none} \ No newline at end of file diff --git a/assets/images/current.png b/assets/images/current.png old mode 100755 new mode 100644 diff --git a/assets/images/erroreven.png b/assets/images/erroreven.png old mode 100755 new mode 100644 diff --git a/assets/images/errorhover.png b/assets/images/errorhover.png old mode 100755 new mode 100644 diff --git a/assets/images/errorodd.png b/assets/images/errorodd.png old mode 100755 new mode 100644 diff --git a/assets/images/even.png b/assets/images/even.png old mode 100755 new mode 100644 diff --git a/assets/images/execute.png b/assets/images/execute.png old mode 100755 new mode 100644 diff --git a/assets/images/help.png b/assets/images/help.png old mode 100755 new mode 100644 diff --git a/assets/images/hgbox.png b/assets/images/hgbox.png old mode 100755 new mode 100644 diff --git a/assets/images/hgboxleft.png b/assets/images/hgboxleft.png old mode 100755 new mode 100644 diff --git a/assets/images/hgbtgreen.png b/assets/images/hgbtgreen.png old mode 100755 new mode 100644 diff --git a/assets/images/hgbtgreenhover.png b/assets/images/hgbtgreenhover.png old mode 100755 new mode 100644 diff --git a/assets/images/hgbtred.png b/assets/images/hgbtred.png old mode 100755 new mode 100644 diff --git a/assets/images/hgbtredhover.png b/assets/images/hgbtredhover.png old mode 100755 new mode 100644 diff --git a/assets/images/hgtopgreen.png b/assets/images/hgtopgreen.png old mode 100755 new mode 100644 diff --git a/assets/images/hover.png b/assets/images/hover.png old mode 100755 new mode 100644 diff --git a/assets/images/imagecloud.png b/assets/images/imagecloud.png old mode 100755 new mode 100644 diff --git a/assets/images/imagedata.png b/assets/images/imagedata.png old mode 100755 new mode 100644 diff --git a/assets/images/imagesave.png b/assets/images/imagesave.png old mode 100755 new mode 100644 diff --git a/assets/images/imagesec.png b/assets/images/imagesec.png old mode 100755 new mode 100644 diff --git a/assets/images/imagexml.png b/assets/images/imagexml.png old mode 100755 new mode 100644 diff --git a/assets/images/inpsyde.png b/assets/images/inpsyde.png old mode 100755 new mode 100644 diff --git a/assets/images/odd.png b/assets/images/odd.png old mode 100755 new mode 100644 diff --git a/assets/images/tickeven.png b/assets/images/tickeven.png old mode 100755 new mode 100644 diff --git a/assets/images/tickhover.png b/assets/images/tickhover.png old mode 100755 new mode 100644 diff --git a/assets/images/tickodd.png b/assets/images/tickodd.png old mode 100755 new mode 100644 diff --git a/assets/js/general.min.js b/assets/js/general.min.js index fcea9106..f8c35bd3 100644 --- a/assets/js/general.min.js +++ b/assets/js/general.min.js @@ -1 +1 @@ -jQuery(document).ready(function(a){backwpup_htmlspecialchars=function(a){return jQuery("").text(a).html()},a.fn.backwpupDelayKeyup=function(b){var c=0;return a(this).keyup(function(){clearTimeout(c),c=setTimeout(b,200)}),a(this)},backwpup_tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=720').text(t).html()};t.fn.backwpupDelayKeyup=function(i){var e=0;t(this).keyup(function(){clearTimeout(e);e=setTimeout(i,200)});return t(this)};backwpup_tb_position=function(){var e=t('#TB_window'),o=t(window).width(),r=t(window).height(),n=(7200&&d.change(function(){d.prop("checked")?a("#dbconnection").hide():a("#dbconnection").show()});var e=a("#trdbdumpmysqlfolder");e.length>0&&(a('input[name="dbdumptype"]').change(function(){a("#iddbdumptype-syssql").prop("checked")?e.show():e.hide()}),a("#iddbdumptype-syssql").prop("checked")?e.show():e.hide()),a("#dbdumpdbname").change(function(){b()}),a("#dbdumpwpdbsettings").change(function(){b(),c()}),a("#dbdumpdbhost").change(function(){c()}),a("#dbdumpdbuser").change(function(){c()}),a("#dbdumpdbpassword").change(function(){c()})}); \ No newline at end of file +;jQuery(document).ready(function(d){d('#dball').click(function(){d('input[name="tabledb[]"]').prop('checked',!0).change()});d('#dbnone').click(function(){d('input[name="tabledb[]"]').prop('checked',!1).change()});d('#dbwp').click(function(){d('input[name="tabledb[]"]').prop('checked',!1).change();d('input[name="tabledb[]"][value^="'+d('#dbwp').val()+'"]').prop('checked',!0).change()});var b=d('input[name="dbdumpwpdbsettings"]');if(b.length>0){b.change(function(){if(b.prop('checked')){d('#dbconnection').hide()} +else{d('#dbconnection').show()}})};var e=d('#trdbdumpmysqlfolder');if(e.length>0){d('input[name="dbdumptype"]').change(function(){if(d('#iddbdumptype-syssql').prop('checked')){e.show()} +else{e.hide()}});if(d('#iddbdumptype-syssql').prop('checked')){e.show()} +else{e.hide()}};function n(){var e={action:'backwpup_jobtype_dbdump',action2:'tables',dbname:d('#dbdumpdbname').val(),dbhost:d('#dbdumpdbhost').val(),dbuser:d('#dbdumpdbuser').val(),dbpassword:d('#dbdumpdbpassword').val(),wpdbsettings:d('#dbdumpwpdbsettings:checked').val(),jobid:d('#jobid').val(),_ajax_nonce:d('#backwpupajaxnonce').val()};d.post(ajaxurl,e,function(e){d('#dbtables').replaceWith(e)})};d('#dbdumpdbname').change(function(){n()});d('#dbdumpwpdbsettings').change(function(){n();a()});function a(){var e={action:'backwpup_jobtype_dbdump',action2:'databases',dbhost:d('#dbdumpdbhost').val(),dbuser:d('#dbdumpdbuser').val(),dbpassword:d('#dbdumpdbpassword').val(),dbname:d('input[name="dbselected"]').val(),wpdbsettings:d('#dbdumpwpdbsettings:checked').val(),_ajax_nonce:d('#backwpupajaxnonce').val()};d.post(ajaxurl,e,function(e){d('#dbdumpdbname').replaceWith(e);n();d('#dbdumpdbname').change(function(){n()})})};d('#dbdumpdbhost').change(function(){a()});d('#dbdumpdbuser').change(function(){a()});d('#dbdumpdbpassword').change(function(){a()})}); \ No newline at end of file diff --git a/assets/js/page_edit_jobtype_file.min.js b/assets/js/page_edit_jobtype_file.min.js index eed4ff83..4f6ba4f2 100644 --- a/assets/js/page_edit_jobtype_file.min.js +++ b/assets/js/page_edit_jobtype_file.min.js @@ -1 +1,11 @@ -jQuery(document).ready(function(a){a('input[name="backuproot"]').change(function(){a('input[name="backuproot"]').prop("checked")?a("#backuprootexcludedirs").show():a("#backuprootexcludedirs").hide()}),a('input[name="backuproot"]').prop("checked")?a("#backuprootexcludedirs").show():a("#backuprootexcludedirs").hide(),a('input[name="backupcontent"]').change(function(){a('input[name="backupcontent"]').prop("checked")?a("#backupcontentexcludedirs").show():a("#backupcontentexcludedirs").hide()}),a('input[name="backupcontent"]').prop("checked")?a("#backupcontentexcludedirs").show():a("#backupcontentexcludedirs").hide(),a('input[name="backupplugins"]').change(function(){a('input[name="backupplugins"]').prop("checked")?a("#backuppluginsexcludedirs").show():a("#backuppluginsexcludedirs").hide()}),a('input[name="backupplugins"]').prop("checked")?a("#backuppluginsexcludedirs").show():a("#backuppluginsexcludedirs").hide(),a('input[name="backupthemes"]').change(function(){a('input[name="backupthemes"]').prop("checked")?a("#backupthemesexcludedirs").show():a("#backupthemesexcludedirs").hide()}),a('input[name="backupthemes"]').prop("checked")?a("#backupthemesexcludedirs").show():a("#backupthemesexcludedirs").hide(),a('input[name="backupuploads"]').change(function(){a('input[name="backupuploads"]').prop("checked")?a("#backupuploadsexcludedirs").show():a("#backupuploadsexcludedirs").hide()}),a('input[name="backupuploads"]').prop("checked")?a("#backupuploadsexcludedirs").show():a("#backupuploadsexcludedirs").hide()}); \ No newline at end of file +;jQuery(document).ready(function(e){e('input[name="backuproot"]').change(function(){if(e('input[name="backuproot"]').prop('checked')){e('#backuprootexcludedirs').show()} +else{e('#backuprootexcludedirs').hide()}});if(e('input[name="backuproot"]').prop('checked')){e('#backuprootexcludedirs').show()} +else{e('#backuprootexcludedirs').hide()};e('input[name="backupcontent"]').change(function(){if(e('input[name="backupcontent"]').prop('checked')){e('#backupcontentexcludedirs').show()} +else{e('#backupcontentexcludedirs').hide()}});if(e('input[name="backupcontent"]').prop('checked')){e('#backupcontentexcludedirs').show()} +else{e('#backupcontentexcludedirs').hide()};e('input[name="backupplugins"]').change(function(){if(e('input[name="backupplugins"]').prop('checked')){e('#backuppluginsexcludedirs').show()} +else{e('#backuppluginsexcludedirs').hide()}});if(e('input[name="backupplugins"]').prop('checked')){e('#backuppluginsexcludedirs').show()} +else{e('#backuppluginsexcludedirs').hide()};e('input[name="backupthemes"]').change(function(){if(e('input[name="backupthemes"]').prop('checked')){e('#backupthemesexcludedirs').show()} +else{e('#backupthemesexcludedirs').hide()}});if(e('input[name="backupthemes"]').prop('checked')){e('#backupthemesexcludedirs').show()} +else{e('#backupthemesexcludedirs').hide()};e('input[name="backupuploads"]').change(function(){if(e('input[name="backupuploads"]').prop('checked')){e('#backupuploadsexcludedirs').show()} +else{e('#backupuploadsexcludedirs').hide()}});if(e('input[name="backupuploads"]').prop('checked')){e('#backupuploadsexcludedirs').show()} +else{e('#backupuploadsexcludedirs').hide()}}); \ No newline at end of file diff --git a/assets/js/page_edit_tab_cron.min.js b/assets/js/page_edit_tab_cron.min.js index b987be42..7b0eefd7 100644 --- a/assets/js/page_edit_tab_cron.min.js +++ b/assets/js/page_edit_tab_cron.min.js @@ -1 +1,4 @@ -jQuery(document).ready(function(a){function b(){var b=[],c=[],d=[],e=[],f=[];a('input[name="cronminutes[]"]:checked').each(function(){b.push(a(this).val())}),a('input[name="cronhours[]"]:checked').each(function(){c.push(a(this).val())}),a('input[name="cronmday[]"]:checked').each(function(){d.push(a(this).val())}),a('input[name="cronmon[]"]:checked').each(function(){e.push(a(this).val())}),a('input[name="cronwday[]"]:checked').each(function(){f.push(a(this).val())});var g={action:"backwpup_cron_text",cronminutes:b,cronhours:c,cronmday:d,cronmon:e,cronwday:f,crontype:"advanced",_ajax_nonce:a("#backwpupajaxnonce").val()};a.post(ajaxurl,g,function(b){a("#schedulecron").replaceWith(b)})}function c(){var b=[],c=[],d=[],e=[],f=[];"mon"==a('input[name="cronbtype"]:checked').val()&&(b.push(a('select[name="moncronminutes"]').val()),c.push(a('select[name="moncronhours"]').val()),d.push(a('select[name="moncronmday"]').val()),e.push("*"),f.push("*")),"week"==a('input[name="cronbtype"]:checked').val()&&(b.push(a('select[name="weekcronminutes"]').val()),c.push(a('select[name="weekcronhours"]').val()),d.push("*"),e.push("*"),f.push(a('select[name="weekcronwday"]').val())),"day"==a('input[name="cronbtype"]:checked').val()&&(b.push(a('select[name="daycronminutes"]').val()),c.push(a('select[name="daycronhours"]').val()),d.push("*"),e.push("*"),f.push("*")),"hour"==a('input[name="cronbtype"]:checked').val()&&(b.push(a('select[name="hourcronminutes"]').val()),c.push("*"),d.push("*"),e.push("*"),f.push("*"));var g={action:"backwpup_cron_text",cronminutes:b,cronhours:c,cronmday:d,cronmon:e,cronwday:f,crontype:"basic",_ajax_nonce:a("#backwpupajaxnonce").val()};a.post(ajaxurl,g,function(b){a("#schedulecron").replaceWith(b)})}a('input[name="activetype"]').change(function(){"wpcron"==a(this).val()||"easycron"==a(this).val()?a(".wpcron").show():a(".wpcron").hide()}),"wpcron"==a('input[name="activetype"]:checked').val()||"easycron"==a('input[name="activetype"]:checked').val()?a(".wpcron").show():a(".wpcron").hide(),a('input[name="cronselect"]').change(function(){"basic"==a('input[name="cronselect"]:checked').val()?(a(".wpcronadvanced").hide(),a(".wpcronbasic").show(),c()):(a(".wpcronadvanced").show(),a(".wpcronbasic").hide(),b())}),a('input[name="cronminutes[]"]').change(function(){b()}),a('input[name="cronhours[]"]').change(function(){b()}),a('input[name="cronmday[]"]').change(function(){b()}),a('input[name="cronmon[]"]').change(function(){b()}),a('input[name="cronwday[]"]').change(function(){b()}),a('input[name="cronbtype"]').change(function(){c()}),a('select[name="moncronmday"]').change(function(){c()}),a('select[name="moncronhours"]').change(function(){c()}),a('select[name="moncronminutes"]').change(function(){c()}),a('select[name="weekcronwday"]').change(function(){c()}),a('select[name="weekcronhours"]').change(function(){c()}),a('select[name="weekcronminutes"]').change(function(){c()}),a('select[name="daycronhours"]').change(function(){c()}),a('select[name="daycronminutes"]').change(function(){c()}),a('select[name="hourcronminutes"]').change(function(){c()})}); \ No newline at end of file +;jQuery(document).ready(function(n){n('input[name="activetype"]').change(function(){if(n(this).val()=='wpcron'||n(this).val()=='easycron'){n('.wpcron').show()} +else{n('.wpcron').hide()}});if(n('input[name="activetype"]:checked').val()=='wpcron'||n('input[name="activetype"]:checked').val()=='easycron'){n('.wpcron').show()} +else{n('.wpcron').hide()};n('input[name="cronselect"]').change(function(){if('basic'==n('input[name="cronselect"]:checked').val()){n('.wpcronadvanced').hide();n('.wpcronbasic').show();e()} +else{n('.wpcronadvanced').show();n('.wpcronbasic').hide();c()}});function c(){var e=[],c=[],a=[],o=[],t=[];n('input[name="cronminutes[]"]:checked').each(function(){e.push(n(this).val())});n('input[name="cronhours[]"]:checked').each(function(){c.push(n(this).val())});n('input[name="cronmday[]"]:checked').each(function(){a.push(n(this).val())});n('input[name="cronmon[]"]:checked').each(function(){o.push(n(this).val())});n('input[name="cronwday[]"]:checked').each(function(){t.push(n(this).val())});var u={action:'backwpup_cron_text',cronminutes:e,cronhours:c,cronmday:a,cronmon:o,cronwday:t,crontype:'advanced',_ajax_nonce:n('#backwpupajaxnonce').val()};n.post(ajaxurl,u,function(e){n('#schedulecron').replaceWith(e)})};n('input[name="cronminutes[]"]').change(function(){c()});n('input[name="cronhours[]"]').change(function(){c()});n('input[name="cronmday[]"]').change(function(){c()});n('input[name="cronmon[]"]').change(function(){c()});n('input[name="cronwday[]"]').change(function(){c()});function e(){var e=[],c=[],a=[],o=[],t=[];if('mon'==n('input[name="cronbtype"]:checked').val()){e.push(n('select[name="moncronminutes"]').val());c.push(n('select[name="moncronhours"]').val());a.push(n('select[name="moncronmday"]').val());o.push('*');t.push('*')};if('week'==n('input[name="cronbtype"]:checked').val()){e.push(n('select[name="weekcronminutes"]').val());c.push(n('select[name="weekcronhours"]').val());a.push('*');o.push('*');t.push(n('select[name="weekcronwday"]').val())};if('day'==n('input[name="cronbtype"]:checked').val()){e.push(n('select[name="daycronminutes"]').val());c.push(n('select[name="daycronhours"]').val());a.push('*');o.push('*');t.push('*')};if('hour'==n('input[name="cronbtype"]:checked').val()){e.push(n('select[name="hourcronminutes"]').val());c.push('*');a.push('*');o.push('*');t.push('*')};var u={action:'backwpup_cron_text',cronminutes:e,cronhours:c,cronmday:a,cronmon:o,cronwday:t,crontype:'basic',_ajax_nonce:n('#backwpupajaxnonce').val()};n.post(ajaxurl,u,function(e){n('#schedulecron').replaceWith(e)})};n('input[name="cronbtype"]').change(function(){e()});n('select[name="moncronmday"]').change(function(){e()});n('select[name="moncronhours"]').change(function(){e()});n('select[name="moncronminutes"]').change(function(){e()});n('select[name="weekcronwday"]').change(function(){e()});n('select[name="weekcronhours"]').change(function(){e()});n('select[name="weekcronminutes"]').change(function(){e()});n('select[name="daycronhours"]').change(function(){e()});n('select[name="daycronminutes"]').change(function(){e()});n('select[name="hourcronminutes"]').change(function(){e()})}); \ No newline at end of file diff --git a/assets/js/page_edit_tab_job.min.js b/assets/js/page_edit_tab_job.min.js index d01dbe51..29b95b98 100644 --- a/assets/js/page_edit_tab_job.min.js +++ b/assets/js/page_edit_tab_job.min.js @@ -1 +1,5 @@ -function date(a,b){var c,d,e,f=this,g=/\\?([a-z])/gi,h=function(a,b){return a=a.toString(),a.length9?-1:0)},Y:function(){return c.getFullYear()},y:function(){return d.Y().toString().slice(-2)},a:function(){return c.getHours()>11?"pm":"am"},A:function(){return d.a().toUpperCase()},B:function(){var a=3600*c.getUTCHours(),b=60*c.getUTCMinutes(),d=c.getUTCSeconds();return h(Math.floor((a+b+d+3600)/86.4)%1e3,3)},g:function(){return d.G()%12||12},G:function(){return c.getHours()},h:function(){return h(d.g(),2)},H:function(){return h(d.G(),2)},i:function(){return h(c.getMinutes(),2)},s:function(){return h(c.getSeconds(),2)},u:function(){return h(1e3*c.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(d.Y(),0),b=Date.UTC(d.Y(),0),c=new Date(d.Y(),6),e=Date.UTC(d.Y(),6);return a-b!==c-e?1:0},O:function(){var a=c.getTimezoneOffset(),b=Math.abs(a);return(a>0?"-":"+")+h(100*Math.floor(b/60)+b%60,4)},P:function(){var a=d.O();return a.substr(0,3)+":"+a.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-c.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(g,e)},r:function(){return"D, d M Y H:i:s O".replace(g,e)},U:function(){return c/1e3|0}},this.date=function(a,b){return f=this,c=void 0===b?new Date:b instanceof Date?new Date(b):new Date(1e3*b),a.replace(g,e)},this.date(a,b)}jQuery(document).ready(function(a){a('input[name="type[]"]').change(function(){a('input[name="type[]"]:checked').hasClass("filetype")?a(".hasdests").show():a(".hasdests").hide(),a("#tab-jobtype-"+a(this).val().toLowerCase()).toggle()}),a('input[name="type[]"]:checked').hasClass("filetype")?a(".hasdests").show():a(".hasdests").hide(),a('input[name="destinations[]"]').change(function(){a("#tab-dest-"+a(this).val().toLowerCase()).toggle()}),a('input[name="name"]').keyup(function(){a("#h2jobtitle").replaceWith(''+backwpup_htmlspecialchars(a(this).val())+"")}),a('input[name="name"]').focus(function(){a(this).val()==a(this).data("empty")&&a(this).val("")}),a('input[name="name"]').blur(function(){""===a(this).val()&&a(this).val(a(this).data("empty"))}),a('input[name="backuptype"]').change(function(){"sync"==a(this).val()?(a(".nosync").hide(),a(".sync").show()):(a(".nosync").show(),a(".sync").hide())}),"sync"==a('input[name="backuptype"]:checked').val()?(a(".nosync").hide(),a(".sync").show()):(a(".nosync").show(),a(".sync").hide()),a('input[name="archivename"]').keyup(function(){var b=a(this).val();b=b.replace("%hash%","[hash]"),b=b.replace("%d",date("d")),b=b.replace("%j",date("j")),b=b.replace("%m",date("m")),b=b.replace("%n",date("n")),b=b.replace("%Y",date("Y")),b=b.replace("%y",date("y")),b=b.replace("%a",date("a")),b=b.replace("%A",date("A")),b=b.replace("%B",date("B")),b=b.replace("%g",date("g")),b=b.replace("%G",date("G")),b=b.replace("%h",date("h")),b=b.replace("%H",date("H")),b=b.replace("%i",date("i")),b=b.replace("%s",date("s")),b=b.replace("[hash]","%hash%"),a("#archivefilename").replaceWith(''+backwpup_htmlspecialchars(b)+"")}),a('input[name="archiveformart"]').change(function(){a("#archiveformart").replaceWith(''+a(this).val()+"")})}); \ No newline at end of file +;function date(a,r){var o=this,n,e,i=/\\?([a-z])/gi,u,t=function(e,n){e=e.toString();return e.length9?-1:0)},Y:function(){return n.getFullYear()},y:function(){return e.Y().toString().slice(-2)},a:function(){return n.getHours()>11?'pm':'am'},A:function(){return e.a().toUpperCase()},B:function(){var e=n.getUTCHours()*36e2,a=n.getUTCMinutes()*60,r=n.getUTCSeconds();return t(Math.floor((e+a+r+36e2)/86.4)%1e3,3)},g:function(){return e.G()%12||12},G:function(){return n.getHours()},h:function(){return t(e.g(),2)},H:function(){return t(e.G(),2)},i:function(){return t(n.getMinutes(),2)},s:function(){return t(n.getSeconds(),2)},u:function(){return t(n.getMilliseconds()*1000,6)},e:function(){throw'Not supported (see source code of date() for timezone on how to add support)'},I:function(){var n=new Date(e.Y(),0),t=Date.UTC(e.Y(),0),a=new Date(e.Y(),6),r=Date.UTC(e.Y(),6);return((n-t)!==(a-r))?1:0},O:function(){var e=n.getTimezoneOffset(),a=Math.abs(e);return(e>0?'-':'+')+t(Math.floor(a/60)*100+a%60,4)},P:function(){var n=e.O();return(n.substr(0,3)+':'+n.substr(3,2))},T:function(){return'UTC'},Z:function(){return-n.getTimezoneOffset()*60},c:function(){return'Y-m-d\\TH:i:sP'.replace(i,u)},r:function(){return'D, d M Y H:i:s O'.replace(i,u)},U:function(){return n/1000|0}};this.date=function(t,e){o=this;n=(e===undefined?new Date():(e instanceof Date)?new Date(e):new Date(e*1000));return t.replace(i,u)};return this.date(a,r)};jQuery(document).ready(function(e){e('input[name="type[]"]').change(function(){if(e('input[name="type[]"]:checked').hasClass('filetype')){e('.hasdests').show()} +else{e('.hasdests').hide()};e('#tab-jobtype-'+e(this).val().toLowerCase()).toggle()});if(e('input[name="type[]"]:checked').hasClass('filetype')){e('.hasdests').show()} +else{e('.hasdests').hide()};e('input[name="destinations[]"]').change(function(){e('#tab-dest-'+e(this).val().toLowerCase()).toggle()});e('input[name="name"]').keyup(function(){e('#h2jobtitle').replaceWith(''+backwpup_htmlspecialchars(e(this).val())+'')});e('input[name="name"]').focus(function(){if(e(this).val()==e(this).data('empty')){e(this).val('')}});e('input[name="name"]').blur(function(){if(e(this).val()===''){e(this).val(e(this).data('empty'))}});e('input[name="backuptype"]').change(function(){if(e(this).val()=='sync'){e('.nosync').hide();e('.sync').show()} +else{e('.nosync').show();e('.sync').hide()}});if(e('input[name="backuptype"]:checked').val()=='sync'){e('.nosync').hide();e('.sync').show()} +else{e('.nosync').show();e('.sync').hide()};e('input[name="archivename"]').keyup(function(){var n=e(this).val();n=n.replace('%hash%','[hash]');n=n.replace('%d',date('d'));n=n.replace('%j',date('j'));n=n.replace('%m',date('m'));n=n.replace('%n',date('n'));n=n.replace('%Y',date('Y'));n=n.replace('%y',date('y'));n=n.replace('%a',date('a'));n=n.replace('%A',date('A'));n=n.replace('%B',date('B'));n=n.replace('%g',date('g'));n=n.replace('%G',date('G'));n=n.replace('%h',date('h'));n=n.replace('%H',date('H'));n=n.replace('%i',date('i'));n=n.replace('%s',date('s'));n=n.replace('[hash]','%hash%');e('#archivefilename').replaceWith(''+backwpup_htmlspecialchars(n)+'')});e('input[name="archiveformart"]').change(function(){e('#archiveformart').replaceWith(''+e(this).val()+'')})}); \ No newline at end of file diff --git a/assets/js/page_settings.min.js b/assets/js/page_settings.min.js index 1cf21320..e65b712f 100644 --- a/assets/js/page_settings.min.js +++ b/assets/js/page_settings.min.js @@ -1 +1,8 @@ -jQuery(document).ready(function(a){var b=a('input[name="anchor"]'),c=a(".nav-tab-wrapper>a"),d=window.location.hash;""!==d&&(d="#"+d.replace("#","")),""!==d&&b.val(d),a(".table").addClass("ui-tabs-hide"),a(b.val()).removeClass("ui-tabs-hide"),"#backwpup-tab-information"===b.val()&&(a("#submit").hide(),a("#default_settings").hide()),c.removeClass("nav-tab-active"),c.each(function(){a(this).attr("href")===b.val()&&a(this).addClass("nav-tab-active")}),c.on("click",function(){var d=a(this).attr("href");return c.removeClass("nav-tab-active"),a(this).addClass("nav-tab-active"),a(".table").addClass("ui-tabs-hide"),a(d).removeClass("ui-tabs-hide"),a("#message").hide(),b.val(d),"#backwpup-tab-information"===d?(a("#submit").hide(),a("#default_settings").hide()):(a("#submit").show(),a("#default_settings").show()),window.location.hash=d,window.scrollTo(0,0),!1}),a("#authentication_method").change(function(){var b=a("#authentication_method").val();""===b?(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"basic"===b?(a(".authentication_basic").show(),a(".authentication_query_arg").hide(),a(".authentication_user").hide()):"query_arg"===b?(a(".authentication_basic").hide(),a(".authentication_query_arg").show(),a(".authentication_user").hide()):"user"===b&&(a(".authentication_basic").hide(),a(".authentication_query_arg").hide(),a(".authentication_user").show())}),a("#encryption-symmetric").is(":checked")?(a("#encryption-key-row").show(),a("#public-key-row").hide()):a("#encryption-asymmetric").is(":checked")&&(a("#encryption-key-row").hide(),a("#public-key-row").show()),a('input:radio[name="encryption"]').change(function(){"symmetric"===a(this).val()?(a("#encryption-key-row").show(),a("#public-key-row").hide()):"asymmetric"===a(this).val()&&(a("#encryption-key-row").hide(),a("#public-key-row").show())}),a("#generate-key-button").click(function(b){if(b.preventDefault(),b.stopPropagation(),""===a("#encryptionkey").val()){a("#generate-key-button").attr("disabled","disabled");var c={action:"generate_key",_ajax_nonce:a("#backwpupajaxnonce").val()};a.post(ajaxurl,c,function(b){a("#encryptionkey").val(b),a("#encryptionkey").focus(),a("#key-generation").hide()})}}),a("#validate-key-button").click(function(b){return""===a("#publickey").val()?(b.preventDefault(),alert(backwpup_vars.no_public_key),a("#publickey").focus(),!1):void setTimeout(function(){a("#privatekey").focus()},100)}),a("#do-validate").click(function(){if(""===a("#privatekey").val())return alert(backwpup_vars.no_private_key),a("#privatekey").focus(),!1;var b={action:"validate_key",publickey:a("#publickey").val(),privatekey:a("#privatekey").val(),_ajax_nonce:a("#backwpupajaxnonce").val()};a.post(ajaxurl,b,function(b){"valid"===b?(alert(backwpup_vars.public_key_valid),tb_remove(),a("#publickey").focus()):alert(backwpup_vars.public_key_invalid),a("#privatekey").val("")}).fail(function(a,b,c){alert(c)})}),a("#generate-key-pair-button").click(function(){a("#key-pair-generating-progress").show(),a("#key-pair-generating-done").hide();var b={action:"generate_key_pair",_ajax_nonce:a("#backwpupajaxnonce").val()};a.post(ajaxurl,b,function(b){a("#generated-public-key").val(b.public_key),a("#generated-public-key-link").attr("href","data:text/plain;base64,"+btoa(b.public_key)),a("#generated-private-key").val(b.private_key),a("#generated-private-key-link").attr("href","data:text/plain;base64,"+btoa(b.private_key)),a("#key-pair-generating-progress").hide(),a("#key-pair-generating-done").show(),a("#generated-public-key").focus()})});var e=!1;a("#generated-private-key-link").click(function(){e=!0}),a("#use-key-pair-button").click(function(){return e===!1?(alert(backwpup_vars.must_download_private_key),!1):(a("#publickey").val(a("#generated-public-key").val()),tb_remove(),void a("#publickey").focus())}),setTimeout(function(){window.scrollTo(0,0)},1)}); \ No newline at end of file +;jQuery(document).ready(function(e){var a=e('input[name="anchor"]'),t=e('.nav-tab-wrapper>a'),i=window.location.hash;if(i!==''){i='#'+i.replace('#','')};if(i!==''){a.val(i)};e('.table').addClass('ui-tabs-hide');e(a.val()).removeClass('ui-tabs-hide');if(a.val()==='#backwpup-tab-information'){e('#submit').hide();e('#default_settings').hide()};t.removeClass('nav-tab-active');t.each(function(){if(e(this).attr('href')===a.val()){e(this).addClass('nav-tab-active')}});t.on('click',function(){var i=e(this).attr('href');t.removeClass('nav-tab-active');e(this).addClass('nav-tab-active');e('.table').addClass('ui-tabs-hide');e(i).removeClass('ui-tabs-hide');e('#message').hide();a.val(i);if(i==='#backwpup-tab-information'){e('#submit').hide();e('#default_settings').hide()} +else{e('#submit').show();e('#default_settings').show()};window.location.hash=i;window.scrollTo(0,0);return!1});e('#authentication_method').change(function(){var a=e('#authentication_method').val();if(''===a){e('.authentication_basic').hide();e('.authentication_query_arg').hide();e('.authentication_user').hide()} +else if('basic'===a){e('.authentication_basic').show();e('.authentication_query_arg').hide();e('.authentication_user').hide()} +else if('query_arg'===a){e('.authentication_basic').hide();e('.authentication_query_arg').show();e('.authentication_user').hide()} +else if('user'===a){e('.authentication_basic').hide();e('.authentication_query_arg').hide();e('.authentication_user').show()}});if(e('#encryption-symmetric').is(':checked')){e('#encryption-key-row').show();e('#public-key-row').hide()} +else if(e('#encryption-asymmetric').is(':checked')){e('#encryption-key-row').hide();e('#public-key-row').show()};e('input:radio[name="encryption"]').change(function(){if(e(this).val()==='symmetric'){e('#encryption-key-row').show();e('#public-key-row').hide()} +else if(e(this).val()==='asymmetric'){e('#encryption-key-row').hide();e('#public-key-row').show()}});e('#generate-key-button').click(function(a){a.preventDefault();a.stopPropagation();if(e('#encryptionkey').val()!==''){return};e('#generate-key-button').attr('disabled','disabled');var i={action:'generate_key',_ajax_nonce:e('#backwpupajaxnonce').val(),};e.post(ajaxurl,i,function(a){e('#encryptionkey').val(a);e('#encryptionkey').focus();e('#key-generation').hide()})});e('#validate-key-button').click(function(a){if(e('#publickey').val()===''){a.preventDefault();alert(backwpup_vars.no_public_key);e('#publickey').focus();return!1};setTimeout(function(){e('#privatekey').focus()},100)});e('#do-validate').click(function(){if(e('#privatekey').val()===''){alert(backwpup_vars.no_private_key);e('#privatekey').focus();return!1};var a={action:'validate_key',publickey:e('#publickey').val(),privatekey:e('#privatekey').val(),_ajax_nonce:e('#backwpupajaxnonce').val(),};e.post(ajaxurl,a,function(a){if(a==='valid'){alert(backwpup_vars.public_key_valid);tb_remove();e('#publickey').focus()} +else{alert(backwpup_vars.public_key_invalid)};e('#privatekey').val('')}).fail(function(e,i,a){alert(a)})});e('#generate-key-pair-button').click(function(){e('#key-pair-generating-progress').show();e('#key-pair-generating-done').hide();var a={action:'generate_key_pair',_ajax_nonce:e('#backwpupajaxnonce').val()};e.post(ajaxurl,a,function(a){e('#generated-public-key').val(a.public_key);e('#generated-public-key-link').attr('href','data:text/plain;base64,'+btoa(a.public_key));e('#generated-private-key').val(a.private_key);e('#generated-private-key-link').attr('href','data:text/plain;base64,'+btoa(a.private_key));e('#key-pair-generating-progress').hide();e('#key-pair-generating-done').show();e('#generated-public-key').focus()})});var n=!1;e('#generated-private-key-link').click(function(){n=!0});e('#use-key-pair-button').click(function(){if(n===!1){alert(backwpup_vars.must_download_private_key);return!1};e('#publickey').val(e('#generated-public-key').val());tb_remove();e('#publickey').focus()});setTimeout(function(){window.scrollTo(0,0)},1)}); \ No newline at end of file diff --git a/assets/sass/components/_admin-bar.scss b/assets/sass/components/_admin-bar.scss deleted file mode 100644 index fb887214..00000000 --- a/assets/sass/components/_admin-bar.scss +++ /dev/null @@ -1,40 +0,0 @@ -// -// Components Admin Bar -// - -#wp-admin-bar-backwpup { - .ab-icon { - font: normal 20px/1 'backwpup' !important; - - &::before { - content: "\e600"; - top: 2px; - } - } -} - -// -// MEDIA QUERIES -// - -// 782px -@media screen and (max-width: 48.875em) { - - #wp-admin-bar-backwpup { - .ab-icon { - font: normal 32px/1 'backwpup' !important; - display: block; - text-indent: 0; - speak: none; - top: 7px; - width: 50px; - text-align: center; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - - &::before { - top: 0; - } - } -} diff --git a/assets/sass/components/_admin-menu.scss b/assets/sass/components/_admin-menu.scss deleted file mode 100644 index 06df20c2..00000000 --- a/assets/sass/components/_admin-menu.scss +++ /dev/null @@ -1,23 +0,0 @@ -// -// Admin Menu -// - -#adminmenu { - #toplevel_page_backwpup div.wp-menu-image:before { - font: normal 20px/1 'backwpup' !important; - content: "\e600"; - } - - #toplevel_page_backwpup a[href$="backwpuprestore"]::after { - content: 'New'; - font-size: .55rem; - color: $color-white; - padding: .18rem .33rem; - background: darken($color-brand, 10%); - border-radius: .23rem; - line-height: 1; - position: relative; - bottom: 5px; - left: 1em; - } -} diff --git a/assets/sass/components/_backwpup-page.scss b/assets/sass/components/_backwpup-page.scss deleted file mode 100644 index 9834b418..00000000 --- a/assets/sass/components/_backwpup-page.scss +++ /dev/null @@ -1,230 +0,0 @@ -// -// Components Backwpup Page -// @todo Split in separated components. -// -#backwpup-page { - // Default Tags - hr { - border: 0; - border-top: none; - border-bottom: 1px solid #eee; - } - - // Positioned Boxes. - .backwpup-floated-postbox { - margin: 25px 0 0; - max-width: 100%; - overflow: hidden; - padding: 15px; - position: relative; - - h3 a { - font-size: 14px; - text-decoration: none; - font-weight: 600; - } - } - - .backwpup-cleared-postbox { - clear: both; - margin: 25px 0 0; - padding: 10px; - } - - // Post Box - .postbox { - ul { - padding-left: 10px; - } - - table { - caption-side: top; - margin-bottom: 25px; - - caption { - color: #222; - font-size: 14px; - font-weight: 600; - padding: 8px 12px; - margin: 0; - line-height: 1.4; - text-align: left; - } - } - - .hndle { - cursor: auto; - } - - .backwpup-bullet-list { - list-style: disc; - padding-left: 16px; - } - - ol.backwpup-bullet-list { - list-style: decimal; - } - } - - // Wizard Box - .wizardbox { - color: #fff; - background: #1d94cf url('../images/hgbox.png') no-repeat right bottom; - min-height: 20em; - - &:hover { - background-color: #0f79ae; - } - - .wizardbox_name { - color: #fff; - margin-top: 0; - } - - .wizardbox_start { - position: absolute; - bottom: 10px; - left: 10px; - } - - select { - max-width: 100%; - width: 100%; - } - } - - // Buttons - .button-bwp, - .button-primary-bwp { - border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - - .button-primary-bwp { - border: none; - background: #38b0eb; - color: #fff; - min-width: 8em; - - &:hover { - background: #064565; - } - } - - .backwpup-table-wrap { - overflow-x: auto; - } - - .backwpup-banner-img { - display: block; - height: auto; - margin: 26px auto; - max-width: 100%; - } - - .backwpup-text-center { - text-align: center; - } - ul.backwpup-text-center { - padding-left: 0; - } - - // Messages - // copied from WP 3.8 CSS - .backwpup-message { - background-color: #fff; - border: none; - border-left: 4px solid #ccc; - box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1); - margin: 5px 0 15px; - padding: 1px 12px; - -webkit-box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1); - - p { - margin: 0.5em 0; - padding: 2px; - } - } - - .backwpup-info { - border-left: 4px solid #38b0eb; /* BackWPup button-primary color */ - } - - .backwpup-warning { - border-left: 4px solid #ffba00; /* UI color .update-nag */ - } - - .backwpup-full-width { - max-width: 100%; - - &.action { - margin-bottom: 20px; - } - } - - // Notices - .notice { - ul { - list-style-type: disc; - margin-left: 2em; - } - } -} - -// -// MEDIA QUERIES -// - -// 720px -@media screen and (min-width: 45em) { - - #backwpup-page { - // Positioned Boxes - .backwpup-floated-postbox { - float: left; - margin: 25px 25px 25px 0; - width: 290px; - } - - // Grouped - #backwpup-one-click-backup, - #wizard-jobimport, - #backwpup-thank-you, - #backwpup-stats { - margin-right: 0; - } - - #backwpup-one-click-backup + .backwpup-floated-postbox, - #backwpup-thank-you, - #backwpup-stats { - clear: left; - } - } - -} - -// 1024px -@media screen and (min-width: 64em) { - - #backwpup-page { - // Positioned Boxes - .backwpup-floated-postbox { - width: 362px; - } - - // Wizard Box - .wizardbox { - width: 225px; - min-height: 225px; - } - - .backwpup-max-width { - max-width: 800px; - } - - body[class*="_backwpupabout"] & .backwpup-welcome { - max-width: none; - } - } -} \ No newline at end of file diff --git a/assets/sass/components/_documentation.scss b/assets/sass/components/_documentation.scss deleted file mode 100644 index 440f8b28..00000000 --- a/assets/sass/components/_documentation.scss +++ /dev/null @@ -1,21 +0,0 @@ -// -// Components Documentation -// -#documentation_content { - p { - font-size: 14px; - line-height: 20px; - color: #333; - } - h3 { - padding: 7px 0; - font-size: 22px; - } - h4 { - padding: 7px 0; - font-size: 18px; - } - img.size-full { - border: 10px #f6f6f6 solid; - } -} diff --git a/assets/sass/components/_footer.scss b/assets/sass/components/_footer.scss deleted file mode 100644 index 60fb49c9..00000000 --- a/assets/sass/components/_footer.scss +++ /dev/null @@ -1,42 +0,0 @@ -// -// Components Footer -// - -#wpfooter { - #footer-left, - #footer-right { - overflow: hidden; - } - - #footer-left { - #footer-thankyou { - clear: both; - display: block; - padding-top: .5em; - } - - .backwpup-get-pro { - display: inline-block; - line-height: 25px; - } - } - - #footer-upgrade { - .backwpup-update-footer { - display: block; - line-height: 25px; - } - } - - .inpsyde_logo { - background: url('../images/inpsyde.png') no-repeat; - display: inline-block; - margin-right: 15px; - margin-top: 5px; - line-height: 25px; - height: 25px; - width: 80px; - text-indent: -9999em; - text-decoration: none; - } -} diff --git a/assets/sass/components/_pro-wizard.scss b/assets/sass/components/_pro-wizard.scss deleted file mode 100644 index abe72cfd..00000000 --- a/assets/sass/components/_pro-wizard.scss +++ /dev/null @@ -1,90 +0,0 @@ -// -// Wizard -// - -#wizard, -#wizard_description { - max-width: 850px; - width: 100%; -} - -#wizard_navigation { - overflow: hidden; - - ul { - list-style: none; - margin: 0; - - li { - display: inline-block; - float: left; - padding: 0 30px 0 0; - position: relative; - } - - li::after { - content: '\203A'; - display: inline-block; - font-size: 20px; - line-height: 18px; - margin: 0 0 0 12px; - position: absolute; - top: 0; - } - - li:last-child::after { - content: ''; - display: none; - } - - .current { - font-weight: bold; - } - - li a { - text-decoration: none; - } - } -} - -#wizard_settings { - float: left; - max-width: 620px; - - h3 { - margin-top: 0; - } -} - -#wizard_settings_area { - // Table - .table_planung { - #wpcronbasic { - max-width: 540px; - } - - th { - border-bottom: 1px dotted #ccc; - text-align: left; - } - - td { - border-bottom: 1px dotted #ccc; - } - - tr { - line-height: 60px; - } - } - - pre { - height: 455px; - overflow: scroll; - } -} - -#wizard_navbuttons { - clear: both; - position: relative; - top: 26px; -} diff --git a/assets/sass/components/_progress-bar.scss b/assets/sass/components/_progress-bar.scss deleted file mode 100644 index 600d42d2..00000000 --- a/assets/sass/components/_progress-bar.scss +++ /dev/null @@ -1,20 +0,0 @@ -// -// Components Progress Bar -// - -.progressbar { - margin-top: 20px; - height: auto; - background: #f6f6f6 url('../../assets/images/progressbarhg.jpg'); - - #progresssteps { - background-color: #007fb6; - } - - .bwpu-progress { - background-color: #1d94cf; - color: #fff; - padding: 5px 0; - text-align: center; - } -} diff --git a/assets/sass/core/_typography.scss b/assets/sass/core/_typography.scss deleted file mode 100644 index 2b8a9ea2..00000000 --- a/assets/sass/core/_typography.scss +++ /dev/null @@ -1,26 +0,0 @@ -// -// Core Typography -// - -@font-face { - font-family: 'backwpup'; - src:url('../fonts/backwpup.eot'); - src:url('../fonts/backwpup.eot?#iefix') format('embedded-opentype'), - url('../fonts/backwpup.ttf') format('truetype'), - url('../fonts/backwpup.woff') format('woff'), - url('../fonts/backwpup.svg#backwpup') format('svg'); - font-weight: normal; - font-style: normal; -} - -.error { - color: $color-red; -} - -.warning { - color: $color-yellow; -} - -.success { - color: $color-green; -} diff --git a/assets/sass/main.scss b/assets/sass/main.scss deleted file mode 100644 index 8e81b662..00000000 --- a/assets/sass/main.scss +++ /dev/null @@ -1,11 +0,0 @@ -@charset "UTF-8"; - -@import 'settings/settings', -'utils/utils', -'core/typography', -'components/admin-bar', -'components/admin-menu', -'components/backwpup-page', -'components/progress-bar', -'components/documentation', -'components/footer'; diff --git a/assets/sass/settings/_colors.scss b/assets/sass/settings/_colors.scss deleted file mode 100644 index b28d94ca..00000000 --- a/assets/sass/settings/_colors.scss +++ /dev/null @@ -1,11 +0,0 @@ -// -// Settings Colors -// - -// Base Colors -$color-black: #000; -$color-white: #fff; -$color-yellow: #ffba00; -$color-red: #f00; -$color-green: #86cf6f; -$color-brand: #adcf75; diff --git a/assets/sass/settings/_settings.scss b/assets/sass/settings/_settings.scss deleted file mode 100644 index d474a598..00000000 --- a/assets/sass/settings/_settings.scss +++ /dev/null @@ -1,5 +0,0 @@ -// -// Settings -// - -@import 'colors'; \ No newline at end of file diff --git a/assets/sass/utils/_classes.scss b/assets/sass/utils/_classes.scss deleted file mode 100644 index 39b4efc0..00000000 --- a/assets/sass/utils/_classes.scss +++ /dev/null @@ -1,7 +0,0 @@ -// -// Utils Classes -// - -.backwpup-max-width { - max-width: 800px; -} diff --git a/assets/sass/utils/_utils.scss b/assets/sass/utils/_utils.scss deleted file mode 100644 index f36ca6af..00000000 --- a/assets/sass/utils/_utils.scss +++ /dev/null @@ -1,5 +0,0 @@ -// -// Utils -// - -@import 'classes'; diff --git a/backwpup.php b/backwpup.php index 4eec5274..77f84ad1 100644 --- a/backwpup.php +++ b/backwpup.php @@ -1,11 +1,11 @@ Tab: Information + += Version 3.3 = +* Improved: Texts removed or rewritten +* Improved: Security +* Improved: Response test +* Changed: Response test to work more as before +* Changed: Remove user roles on deactivation not on uninstall +* Removed: PCLZip selection setting +* Removed: Help tooltips now uses the WordPress way +* Removed: Old AWS SDK for using backups to S3 with PHP Version lower than 5.3 +* Updated: AWS SDK to Version 2.8.28 +* Updated: MSAZURE SDK to Version 0.4.1 +* Updated: RSC SDK to Version 1.12.2 +* Updated: SwiftMailer to Version 5.2.2 +* Pro Updated: Google SDK to Version 1.1.7 +* Pro Fixed: Glacier will be only display 10 Vaults + += Version 3.2.5 = +* Fixed: two stored XSS issues + += Version 3.2.4 = +* Added: Backup database triggers +* Fixed: Charset issues on file names in archives +* Improved: checking on response test +* Changed: Dropbox API URLs + += Version 3.2.3 = +* Added: AWS Region Asien-Pazifik (Seoul) +* Improved: open basedir checking +* Changed: Minimum WordPress version is now 3.8 +* Fixed: get_site_option() deprecated cache parameter in WordPress 4.4 +* Fixed: displaying of inactive on scheduled jobs +* Fixed: saving of adding extra user role +* Removed: Handling of signal SIGPROF +* Removed: Extra role column on user list + += Version 3.2.2 = +* Fixed: Setting of S3 storage class STANDARD | STANDARD_IA | REDUCED_REDUNDANCY +* Fixed: Potential security problems on log view and file download + += Version 3.2.1 = +* Fixed: open basedir check +* Fixed: Change Zip creation back to use lower resources +* Fixed: Deletion of backup files on Dropbrox not refreshes +* Fixed: Delete 'doing_cron' transient before job starts +* Added: Support for new Amazon S3 storage type 'Standard-Infrequent Access' +* Added: Support for MYSQL_CLIENT_FLAGS +* Updated: AWS SDK to Version 2.8.21 (PHP 5.3.3+) +* Removed: SIGCONT,SIGCHLD,SIGALRM form signal handler +* Free Removed: Bundled translations. Will be now come from https://translate.wordpress.org/projects/wp-plugins/backwpup +* Pro Updated: Google SDK to Version 1.1.4 + += Version 3.2.0 = +* Fixed: Sugarsync SSL message +* Fixed: Job hang in some configurations +* Fixed: RSS Feed in Dashboard +* Added: EasyCron API to schedule job starts +* Added: Message if job has not configured destinations +* Added: Setting for log level and minimize log for normal output +* Added: Email logfile to more than one receiver +* Added: Creation of web.config for IIS Webserver +* Added: Allow relative path to WP_CONTENT_DIR for logs and backups +* Added: Prefer plugin translation loading from WP_LANG_DIR +* Added: Option to move WordPress installation folder one folder up +* Added: Ordering options for jobs page +* Added: Added Google storage Bucket regions +* Improved: Archive size check depends on PHP_INT_MAX +* Improved: Excessive transient writes with job start urls +* Improved: Authorisation settings for wp-cron.php +* Improved: Folder checking with open basedir check +* Improved: WP-CLI outputs +* Improved: Role management. Administrators always have BackWPup capabilities +* Improved: Unix Signals handling to caching more +* Improved: fcgi handling to prevent signal 15 errors (thanks to siteground.com) +* Updated: AWS SDK to Version 2.7.7 (PHP 5.3.3+) +* Updated: MSAZURE SDK to Version 0.4.0-dev +* Updated: Translations from http://translate.marketpress.com/ +* Removed: Server script file generation, please use WP-CLI +* Fixed: Notice if BuddyPress is active +* Fixed: VIEW generation on Database backups +* PRO Fixed: Authentication for GDrive +* PRO Fixed: Synchronisation with GDrive + += Version 3.1.4 = +* Fixed: removing of % from filename +* Fixed: Notice in combination with bbPress +* Fixed: Zip Archive "Entry has been deleted" messages +* Improved: WP-CLI output a bit + += Version 3.1.3 = +* Fixed: var_export not working if output buffering active +* Fixed: bug in sending test emails on Backup with email +* Fixed: backup archives not deleted if archive name has spaces +* Fixed: bug in tar file name length detecting +* Fixed: bug in not displaying abort message +* Fixed: abort of S3 uploads from other running backups +* Changed: Maximum backup archive size is now 2GB (some filesystems do not support larger files, split the job if you need more) +* Changed: WordPress Export will now done by a own class +* Changed: Dropbox now uses oAuth 2 Protocol +* Changed: Dropbox change to TLS Protocol +* Changed: Logs have now a br tag on line end for better reading in emails +* Improved: Dropbox chipper list not on NSS cUrl backend +* Improved: Increased performance on Zip File generation massively +* Improved: Backup archives now deleted to if the archive format changed +* Improved: Archive tarring and its compression +* Improved: Loading of Swift Mailer +* Added: GreenQloud to S3 services +* Added: Amazon Germany region to S3 and Glacier services +* Removed: Hosteurope from S3 services (terminated to end of 2014) +* Updated: SwiftMailer to Version 5.2.0 +* Updated: AWS SDK to Version 2.7.3 (PHP 5.3.3+) +* Updated: RSC SDK to Version 1.9.2 +* Updated: MSAZURE SDK to Version 0.4.0 +* Updated: PEAR packeges for MSAZURE +* PRO: Added: Option to use database backup with mysqli/mysqldump (not longer automatic) +* PRO: Added: Option in GDrive destination to delete files permanently +* PRO: Updated: Google SDK to 1.1.1 + += Version 3.1.2 = +* Added: .donotbackup file. Folders and sub folders containing this file in will not be included in backups. +* Fixed: New multisite installs did not save jobs. +* Fixed: New multisite installs did not save installed version. +* Fixed: Fatal error when attempting to clean up inactive jobs from cron +* Fixed: Exclude uploads not working +* Fixed: Message "file not readable" of an excluded folder +* Fixed: WP-CLI deprecated and unknown parameter message +* Fixed: Bugs in pagination on logs and backups page +* Removed: Banner from plugins page +* Improved: Memory usage during XML export +* Improved: Mime type detection +* Improved: Dropbox SSL handling +* Improved: Certificate bundle file can now be filtered +* Improved: Auto-loading vendor classes +* Improved: Performance when saving other database tables than MyISAM +* Updated: AWS SDK to Version 2.5.2 (PHP 5.3.3+) +* Updated: RSC SDK to Version 1.9.1 +* Updated: Guzzle SDK to Version 3.8.1 +* Added: S3 Service: Amazon China (Beijing) region +* Added: Rackspace: Hong Kong (HKG) region +* PRO: Fixed: Duplicating synced files on S3 +* PRO: Update: Google SDK to 0.6.7 +* PRO: Added: Amazon Glacier China (Beijing) region + += Version 3.1.1 = +* Fixed: Plugins will not backup +* Improved: Dropped quota check for Dropbox. Will cancel upload only when Dropbox API sends error 507. +* Improved: Remove special chars from file names in archives +* Improved: Handling off restarts on archive creation + += Version 3.1 = +* Fixed: Message about aborted step did not display correctly +* Fixed: Incorrect rescheduling of jobs +* Improved: Overall performance while generating backup archives +* Improved: Uploads of backup archives to FTP/S3/Dropbox/Azure/GDrive can be continued +* Improved: Script re-starts based upon time while generating archives and uploading +* Improved: Reduced risk of running scripts being stopped via external processes in fcgi mode +* Improved: Backup destinations and their dependencies only being loaded when needed +* Improved: Required dependencies for destinations being displayed now +* Improved: Displaying of error messages as error messages (red, not yellow) +* Improved: Reduced size of vendor/SDK directory by 50% +* Improved: Regex for BackWPup archive file detection +* Improved: Symlink handling for file backup on WordPress folders +* Improved: Use icon font for menu, adminbar and on other places +* Improved: Responsive for WordPress 3.8 +* Updated: AWS SDK to Version 2.4.11 (PHP 5.3.3+) +* Updated: RSC SDK to Version 1.7.3 +* Updated: SwiftMailer to Version 5.0.1 +* Removed: DB Optimization, because locking of tables that can make the site not accessible +* PRO: Wizards using a separate session handling now +* PRO: Hash that BackWPup uses is changeable +* PRO: Added Google Drive Support +* PRO: Added Amazon Glacier Support + += Version 3.0.13 = +* Improved: Redirect when accessing the WordPress backend +* Added: Debug Informations to Logfile +* Added Sydney region for rackspace cloud +* Added London region for rackspace cloud +* Fixed: Cross-site scripting issue. Thanks to High-Tech Bridge for helping us: https://www.htbridge.com/advisory/HTB23161 +* Fixed: Fatal error when uninstalling on WordPress 3.4.2 and older + += Version 3.0.12 = +* Fixed: Redirect when accessing the WordPress backend +* Added: Russian translation +* Added: Simplified chinese translation +* Fixed: German log string typo + += Version 3.0.11 = +* Improved: About page will only be shown after install +* Updated: AWS SDK to Version 2.3.1 (PHP 5.3.3+) +* Fixed: some notices and warnings +* Fixed: Change of BackWPup role for other users +* Added: Message for Pro version to support plugin + += Version 3.0.10 = +* Fixed only Version on WordPress.org because of SVN upload problems with Symfony folder from AWS + += Version 3.0.9 = +* Fixed: Fixed bug in Dropbox temp file fallback +* Fixed: Not working if WP-Cron Control active +* PRO Fixed: Synchronisation of files to Dropbox +* PRO Changed: About page only displays on new installation not on updates +* Added: Sending auth cookie for self requests +* Added: Displaying off last error or waring in execution screen +* Added: Job end message depending on error's or waring's +* Added: Setting of BackWPup role in the user settings +* Improved: Wait time after job start +* Improved: Rights management to work better with Role management Plugins +* Changed: Sessions now only used for wizards in pro version +* Removed: Maintenance Mode support, because to many problems and not really needed +* Updated: RSC SDK to Version 1.5.4 +* Updated: AWS SDK to Version 1.6.2 +* Updated: AWS SDK to Version 2.3.0 (PHP 5.3.3+) + += Version 3.0.8 = +* Fixed: Selected database tables not save on tab change +* Fixed: Database tables selection on new job +* Fixed: adding empty folder names tow archive +* Improved/Fixed: Dropbox Authentication + += Version 3.0.7 = +* Improved: All job requests will done over wp-cron.php now +* Improved: Ajax calls if blog in maintenance mode +* Improved: Getting of DB_CHARSET +* Improved: FTP file deletion +* Improved: Dropbox authentication (If restrict to job settings page not work you can open the settings page manually again to authenticate) +* Fixed: No maintenance mode, if a maintenance mode already active +* Fixed: Archive file deletion +* Updated: AWS SDK to Version 2.2.1 (PHP 5.3.3+) + += Version 3.0.6 = +* Fixed: Massages on empty DB prefix +* Fixed: Bug in cron calculation +* Improved: Dropbox upload so that it can continuing on next try + += Version 3.0.5 = +* Changed: Display only normal messages on progress bars +* Changed: Detection of multisite blog upload folder +* Changed: Backups list for destination file will not cached. +* Changed: Reduced files of AWS SDK to the only needed. +* Fixed: Side load braking if no folder permissions +* Fixed: Multiple backups deletion on backups page not working +* Fixed: DB optimize and check not only use WP tables if selected +* Fixed: File deletion on Dropbox if folder name has a space +* Fixed: False scheduling time in some timezones +* Removed: Option for excluding file, cache, temp folders. Can done with file/folder exclusion too. +* Added: Option to restart the job on archive creation if a size of files reached +* Added: Option to set Zip method (PclZip or ZipArchive) +* Improved: Performance if PclZip used. +* Updated: AWS SDK to Version 1.6.1 +* Updated: AWS SDK to Version 2.2.0 (PHP 5.3.3+) + += Version 3.0.4 = +* Changed: default settings for 'Restart on every main step' and 'Reduce server load' to disabled +* Fixed: Settings not correctly set to default +* Fixed: mysqli::get_charset() undefined method +* Fixed: Settings not saved correctly +* Fixed: Abort on MySQL Functions Backup +* Improved: MySQLi connection +* Added: Server connection test on run now. +* Added: S3 AWS SDK 1.6.0 for PHP lower than 5.3.3 + += Version 3.0.3 = +* Improved: Archive creation performance +* Fixed: Problem with S3 Prefix +* Fixed: warnings on excluded folders +* Fixed: message from putenv +* Fixed: not working downloads +* Changed: removed fancybox and uses thickbox because plugin compatibility +* Added: folder checking on run now + += Version 3.0.2 = +* Fixed: Warnings on job edit tab files +* Fixed: folder name on temp cleanup in cron +* Fixed: Setting charset on sql backup +* Fixed: DB Connection on database backup if hostname has a port +* Fixed: Call undefined function apc_clear_cache() +* Fixed: wp-content selected folders not excluded +* Added: Deactivation off multi part upload for S3 Services +* Added: fallback for mysql_ping() +* Added: Options for email senders name +* Changed: 5 minutes cron steps back +* Removed: Flashing admin bar icon +* Updated: OpenCloud API to Version 1.4.1 + += Version 3.0 = +* Added: Jobs can now be started with an external link or per command line +* Added: Backups can now be compressed with gz or bzip2 +* Added: All file names can now be adjusted +* Added: MySQL dump supports now views +* Added: Settings for access control per capability and role +* Added: Save a list of installed Plugins +* Added: Support for WP-CLI +* Improved: Job edit page with tabs +* Improved: Settings page with tabs +* Improved: Database dump now uses mysqli PHP extension for better performance +* Improved: ZIP archives are now created with PHP Zip if available +* Improved: All passwords are now stored encrypted in database +* Improved: wp-cron job start mechanism +* Improved: Job start mechanism not longer uses URL in plugin directory +* Improved: Use `temp` directory in uploads or set it with `WP_TEMP_DIR` +* Changed: Mailing backup archives now with SwiftMailer +* Changed: Job process now back in the WordPress environment +* Changed: License changed to GPLv3 +* Changed: Rewrote almost the complete code base to use classes with auto-loading +* Changed: Logs are now displayed with fancybox +* Updated: AWS SDK v2.1.2 (PHP 5.3.3) +* Updated: OpenCloud SDK to v1.3 (PHP 5.3) +* Updated: Windows Azure SDK v0.3.1_2011-08 (PHP 5.3.2) +* Removed: serialized job export +* Removed: tools section - not needed anymore +* Removed: Dashboard widgets are now on the BackWPup plugin dashboard +* Fixed: many, many minor bugs + += Version 3.0 Pro = + +* Wizards +* Export jobs and settings as XML +* Synchronization of files to backup with destination (filename and size checked) +* Wizard to import jobs and settings from XML +* Database dump can backup other MySQL databases +* Database dump can use `mysqldump` command on commend line +* Database dump can create XML files (phpMyAdmin schema) +* Use your own API keys for Dropbox and SugarSync +* Premium Support +* Automatic updates diff --git a/inc/class-create-archive.php b/inc/class-create-archive.php index 55549e13..c0c4c321 100644 --- a/inc/class-create-archive.php +++ b/inc/class-create-archive.php @@ -95,7 +95,7 @@ public function __construct( $file ) { $this->file = trim( $file ); // TAR.GZ - if ( ! $this->filehandler && '.tar.gz' === strtolower( substr( $this->file, -7 ) ) ) { + if ( ! $this->filehandler && '.tar.gz' === strtolower( substr( $this->file, - 7 ) ) ) { if ( ! function_exists( 'gzencode' ) ) { throw new BackWPup_Create_Archive_Exception( __( 'Functions for gz compression not available', 'backwpup' ) @@ -108,7 +108,7 @@ public function __construct( $file ) { } // TAR.BZ2 - if ( ! $this->filehandler && '.tar.bz2' === strtolower( substr( $this->file, -8 ) ) ) { + if ( ! $this->filehandler && '.tar.bz2' === strtolower( substr( $this->file, - 8 ) ) ) { if ( ! function_exists( 'bzcompress' ) ) { throw new BackWPup_Create_Archive_Exception( esc_html__( 'Functions for bz2 compression not available.', 'backwpup' ) @@ -121,13 +121,13 @@ public function __construct( $file ) { } // .TAR - if ( ! $this->filehandler && '.tar' === strtolower( substr( $this->file, -4 ) ) ) { + if ( ! $this->filehandler && '.tar' === strtolower( substr( $this->file, - 4 ) ) ) { $this->method = 'Tar'; $this->filehandler = $this->fopen( $this->file, 'ab' ); // phpcs:ignore } // .ZIP - if ( ! $this->filehandler && '.zip' === strtolower( substr( $this->file, -4 ) ) ) { + if ( ! $this->filehandler && '.zip' === strtolower( substr( $this->file, - 4 ) ) ) { $this->method = 'ZipArchive'; // Switch to PclZip if ZipArchive isn't supported. @@ -176,7 +176,7 @@ public function __construct( $file ) { } // .GZ - if ( ! $this->filehandler && '.gz' === strtolower( substr( $this->file, -3 ) ) ) { + if ( ! $this->filehandler && '.gz' === strtolower( substr( $this->file, - 3 ) ) ) { if ( ! function_exists( 'gzencode' ) ) { throw new BackWPup_Create_Archive_Exception( __( 'Functions for gz compression not available', 'backwpup' ) @@ -189,7 +189,7 @@ public function __construct( $file ) { } // .BZ2 - if ( ! $this->filehandler && '.bz2' === strtolower( substr( $this->file, -4 ) ) ) { + if ( ! $this->filehandler && '.bz2' === strtolower( substr( $this->file, - 4 ) ) ) { if ( ! function_exists( 'bzcompress' ) ) { throw new BackWPup_Create_Archive_Exception( __( 'Functions for bz2 compression not available', 'backwpup' ) @@ -337,8 +337,14 @@ public function add_file( $file_name, $name_in_archive = '' ) { } // Remove reserved chars. - $dirname = dirname( $name_in_archive ); - $name_in_archive = trailingslashit( $dirname ) . backwpup_sanitize_file_name( basename( $name_in_archive ) ); + $dirname = dirname( $name_in_archive ); + // Basename without problems with locale. + if ( ! in_array( $dirname, array( '.', '..' ), true ) ) { + $name_in_archive = str_replace( $dirname, '', $name_in_archive ); + } + + $name_in_archive = trim( $name_in_archive, '/' ); + $name_in_archive = trailingslashit( $dirname ) . sanitize_file_name( $name_in_archive ); switch ( $this->method ) { case 'gz': @@ -365,7 +371,7 @@ public function add_file( $file_name, $name_in_archive = '' ) { } fclose( $fd ); // phpcs:ignore - $this->file_count++; + $this->file_count ++; break; case 'bz2': @@ -392,14 +398,14 @@ public function add_file( $file_name, $name_in_archive = '' ) { } fclose( $fd ); // phpcs:ignore - $this->file_count++; + $this->file_count ++; break; case 'Tar': case 'TarGz': case 'TarBz2': // Convert chars for archives file names - if ( function_exists( 'iconv' ) && stristr( PHP_OS, 'win' ) !== false ) { + if ( function_exists( 'iconv' ) && stripos( PHP_OS, 'win' ) === 0 ) { $test = @iconv( 'ISO-8859-1', 'UTF-8', $name_in_archive ); if ( $test ) { $name_in_archive = $test; @@ -411,7 +417,7 @@ public function add_file( $file_name, $name_in_archive = '' ) { case 'ZipArchive': // Convert chars for archives file names. - if ( function_exists( 'iconv' ) && stristr( PHP_OS, 'win' ) === false ) { + if ( function_exists( 'iconv' ) && stripos( PHP_OS, 'win' ) === 0 ) { $test = @iconv( 'UTF-8', 'CP437', $name_in_archive ); if ( $test ) { $name_in_archive = $test; @@ -499,7 +505,7 @@ public function add_file( $file_name, $name_in_archive = '' ) { return false; } else { - $this->file_count++; + $this->file_count ++; } } break; @@ -684,7 +690,7 @@ private function tar_file( $file_name, $name_in_archive ) { $filename_prefix = substr( $name_in_archive, 0, $split_pos ); if ( strlen( $filename ) > 100 ) { - $filename = substr( $filename, -100 ); + $filename = substr( $filename, - 100 ); trigger_error( sprintf( /* translators: $1 is the file name. */ @@ -800,7 +806,7 @@ private function tar_empty_folder( $folder_name, $name_in_archive ) { $tar_filename_prefix = substr( $name_in_archive, 0, $split_pos ); if ( strlen( $tar_filename ) > 100 ) { - $tar_filename = substr( $tar_filename, -100 ); + $tar_filename = substr( $tar_filename, - 100 ); trigger_error( sprintf( /* translators: $1 is the name of the folder. $2 is the archive name.*/ @@ -944,7 +950,7 @@ private function make_tar_headers( $name, $mode, $uid, $gid, $size, $mtime, $typ // Computes the unsigned Checksum of a file's header $checksum = 0; - for ( $i = 0; $i < 512; $i++ ) { + for ( $i = 0; $i < 512; $i ++ ) { $checksum += ord( substr( $chunk, $i, 1 ) ); } diff --git a/inc/class-cron.php b/inc/class-cron.php index 36c2eccb..8fc4205e 100644 --- a/inc/class-cron.php +++ b/inc/class-cron.php @@ -12,8 +12,7 @@ class BackWPup_Cron { */ public static function run( $arg = 'restart' ) { - if (get_current_blog_id() != get_main_site_id()){ - // Don't repeat if on multisite + if ( ! is_main_site( get_current_blog_id() ) ) { return; } diff --git a/inc/class-decrypter.php b/inc/class-decrypter.php index 91383b30..b403427c 100644 --- a/inc/class-decrypter.php +++ b/inc/class-decrypter.php @@ -2,8 +2,8 @@ /** * BackWPup_Decrypter * - * @since 3.6.0 - * @author Brandon Olivares + * @since 3.6.0 + * @author Brandon Olivares * @package Inpsyde\BackWPup */ @@ -15,65 +15,70 @@ * * Decrypt backup archives using AES or RSA. * - * @since 3.6.0 - * @author Brandon Olivares + * @since 3.6.0 + * @author Brandon Olivares * @package Inpsyde\BackWPup */ class BackWPup_Decrypter { + const PRIVATE_KEY_STATUS_OK = 'ok'; + const PRIVATE_KEY_STATUS_INVALID = 'invalid'; + const PRIVATE_KEY_STATUS_NOT_FOUND = 'not-found'; + const PUBLIC_KEY_OPTION = 'backwpup_cfg_publickey'; + const ENCRYPTION_KEY_OPTION = 'backwpup_cfg_encryptionkey'; + const PRIVATE_RSA_ID_FILE = 'id_rsa_backwpup.pri'; + /** - * File Path - * - * @var string The path to the file to decrypt + * @var */ - private $file_path; + private $local_file_path; /** - * Constructor + * BackWPup_Decrypter constructor * - * @param string $file_path Path to the file to decrypt + * @param $local_file_path */ - public function __construct( $file_path ) { + public function __construct( $local_file_path ) { - $this->file_path = $file_path; + $this->local_file_path = $local_file_path; } /** - * Decrypt - * - * Decrypts the archive. + * @return bool + * @throws \Exception */ public function decrypt() { - $aes = new AES( AES::MODE_CBC ); + $aes = new AES( AES::MODE_CBC ); + $source_file_handler = fopen( $this->local_file_path, 'rb' ); - try { - $file_in = new \SplFileObject( $this->file_path, 'rb' ); - } catch ( \RuntimeException $e ) { + if ( ! is_resource( $source_file_handler ) ) { throw new \Exception( __( 'Cannot open the archive for reading.', 'backwpup' ) ); } // Read first byte to know what encryption method was used - $key = null; - $type = $file_in->fread( 1 ); - if ( $type == chr( 0 ) ) { - // Symmetric mode - $key = pack( 'H*', get_site_option( 'backwpup_cfg_encryptionkey' ) ); - } elseif ( $type == chr( 1 ) ) { - // Asymmetric mode - $key = $this->getRSADecryptedKey( $file_in ); - } else { - // Neither, which means it's probably not encrypted + $key = ''; + $type = fread( $source_file_handler, 1 ); + + // Symmetric mode + if ( $type === chr( 0 ) ) { + $key = pack( 'H*', get_site_option( self::ENCRYPTION_KEY_OPTION ) ); + } + // Asymmetric mode + if ( $type === chr( 1 ) ) { + $key = $this->get_rsa_decrypted_key( $source_file_handler ); + } + + if ( $key === '' ) { return false; } - if ( file_exists( $this->file_path . '.encrypted' ) ) { - unlink( $this->file_path . '.encrypted' ); + if ( file_exists( $this->local_file_path . '.encrypted' ) ) { + unlink( $this->local_file_path . '.encrypted' ); } - try { - $file_out = new \SplFileObject( $this->file_path . '.encrypted', 'a+b' ); - } catch ( \RuntimeException $e ) { + $local_file_handler = fopen( $this->local_file_path . '.encrypted', 'a+b' ); + if ( ! is_resource( $local_file_handler ) ) { throw new \Exception( __( 'Cannot write the encrypted archive.', 'backwpup' ) ); } @@ -83,106 +88,111 @@ public function decrypt() { $block_size = 128 * 1024; $bytes_read = 0; - $size = $file_in->getSize(); - // Subtract the number of bytes we've read into $file_in - // This is to make up for the overhead of the data we've stored in the encrypted file - // $size - overhead = the actual encrypted file - $size -= $file_in->ftell(); - - while ( $file_in->valid() ) { - $data = $file_in->fread( $block_size ); - $packet = $aes->decrypt( $data ); + + while ( ! feof( $source_file_handler ) ) { + $data = fread( $source_file_handler, $block_size ); + $packet = $aes->decrypt( $data ); $bytes_read += strlen( $data ); - if ( $file_in->eof() ) { + if ( feof( $source_file_handler ) ) { // This is the last chunk, so strip padding $padding_length = ord( $packet[ strlen( $packet ) - 1 ] ); if ( $padding_length <= 16 ) { - $packet = substr( $packet, 0, -$padding_length ); + $packet = substr( $packet, 0, - $padding_length ); } } - $file_out->fwrite( $packet ); + fwrite( $local_file_handler, $packet ); } - $file_in = null; + $file_in = null; $file_out = null; - unlink( $this->file_path ); - rename( $this->file_path . '.encrypted', $this->file_path ); + unlink( $this->local_file_path ); + rename( $this->local_file_path . '.encrypted', $this->local_file_path ); return true; } /** - * Get RSA Decrypted Key - * - * Reads and decrypts the generated AES key at the start of the archive. + * @param $source_file_handler * - * This key is RSA-encrypted. - * - * @param SplFileObject $file_in The file to read from - * - * @return string The decrypted AES key. + * @return bool|string */ - private function getRSADecryptedKey( \SplFileObject $file_in ) { - - // The next byte is the length of the encrypted key - $length = unpack( 'H*', $file_in->fread( 1 ) ); - $length = hexdec($length[1]); - - // Read $length bytes to get encrypted key - $key = $file_in->fread( $length ); - - // Decrypt - $rsa = new RSA(); - - // Check for private key file - $key_filename = dirname( $this->file_path ) . '/id_rsa_backwpup.pri'; - $status = 'not-found'; - while ( $status != 'ok' ) { - if ( ! file_exists( $key_filename ) ) { - BackWPup_Destination_Downloader::sendMessage( array( - 'state' => 'need-private-key', - 'status' => $status, - ) ); - - // Loop until we see the private key - do { - sleep( 5 ); - } while ( ! file_exists( $key_filename ) ); - } - - $private_key = file_get_contents( $key_filename ); - unlink( $key_filename ); - - // Verify the private key is correct - $rsa->setSignatureMode( RSA::SIGNATURE_PKCS1 ); + private function get_rsa_decrypted_key( $source_file_handler ) { + + $rsa = new RSA(); + $private_key = ''; + $verified = false; + $status = self::PRIVATE_KEY_STATUS_NOT_FOUND; + $length = unpack( 'H*', fread( $source_file_handler, 1 ) ); + $length = hexdec( $length[1] ); + $key = fread( $source_file_handler, $length ); + $private_key_file = dirname( $this->local_file_path ) . '/' . self::PRIVATE_RSA_ID_FILE; + + if ( ! file_exists( $private_key_file ) ) { + self::send_message( array( + 'state' => 'need-private-key', + 'status' => $status, + ) ); + + return ''; + } - // Load private key - $rsa->loadKey( $private_key ); + if ( file_exists( $private_key_file ) ) { + $private_key = file_get_contents( $private_key_file ); + unlink( $private_key_file ); - // Get signature - $signature = $rsa->sign( 'test' ); + $verified = $this->verify_private_key( $rsa, $private_key ); + } - // And verify signature - $rsa->loadKey( get_site_option( 'backwpup_cfg_publickey' ) ); - $verified = $rsa->verify( 'test', $signature ); + if ( ! $verified ) { + self::send_message( array( + 'state' => 'need-private-key', + 'status' => self::PRIVATE_KEY_STATUS_INVALID, + ) ); - if ( $verified) { - $status = 'ok'; - } else { - $status = 'invalid'; - } + return ''; } - $rsa->loadKey( $private_key ); + $private_key and $rsa->loadKey( $private_key ); + $key = $rsa->decrypt( $key ); - if ( ! $key ) { - throw new \Exception( __( 'Private key invalid.', 'backwpup' ) ); + if ( $key === '' ) { + throw new \RuntimeException( __( 'Private key invalid.', 'backwpup' ) ); } return $key; } + /** + * @param \phpseclib\Crypt\RSA $rsa + * @param $private_key + * + * @return bool + */ + private function verify_private_key( RSA $rsa, $private_key ) { + + $rsa->setSignatureMode( RSA::SIGNATURE_PKCS1 ); + + if ( ! $rsa->loadKey( $private_key ) ) { + return false; + } + + $signature = $rsa->sign( 'test' ); + $rsa->loadKey( get_site_option( self::PUBLIC_KEY_OPTION ) ); + + return $rsa->verify( 'test', $signature ); + } + + /** + * @param $data + * @param string $event + */ + private static function send_message( $data, $event = 'message' ) { + + echo "event: {$event}\n"; + echo "data: " . wp_json_encode( $data ) . "\n\n"; + flush(); + } } diff --git a/inc/class-destination-downloader-data.php b/inc/class-destination-downloader-data.php new file mode 100644 index 00000000..bee0a8bc --- /dev/null +++ b/inc/class-destination-downloader-data.php @@ -0,0 +1,64 @@ +job_id = $job_id; + $this->source_file_path = $source_file_path; + $this->local_file_path = $local_file_path; + } + + /** + * @return mixed + */ + public function job_id() { + + return $this->job_id; + } + + /** + * Retrieve the local file path, where the backup have to be downloaded + * + * @return string + */ + public function local_file_path() { + + return $this->local_file_path; + } + + /** + * Retrieve the remote/source file path of the backup + * + * @return string + */ + public function source_file_path() { + + return $this->source_file_path; + } +} diff --git a/inc/class-destination-downloader-factory.php b/inc/class-destination-downloader-factory.php index 52a0aa62..52e29b7d 100644 --- a/inc/class-destination-downloader-factory.php +++ b/inc/class-destination-downloader-factory.php @@ -12,59 +12,32 @@ * @since 3.5.0 * @package Inpsyde\BackWPup */ -final class BackWPup_Destination_Downloader_Factory implements BackWPup_Factory_Interface { +class BackWPup_Destination_Downloader_Factory { - /** - * Destination - * - * @var string The destination identifier - */ - private $destination; + const DESTINATION_S3 = 's3'; - /** - * Class Prefix - * - * @var string The class prefix. The part before the destination - */ - private static $prefix = 'BackWPup_Destination_'; + const CLASS_PREFIX = 'BackWPup_Destination_'; + const CLASS_PRO_PREFIX = 'BackWPup_Pro_Destination_'; + const CLASS_SUFFIX = '_Downloader'; /** - * Class Prefix for Pro Classes - * - * @since 3.5.0 + * @param string $service_name + * @param int $job_id + * @param string $source_file_path + * @param string $local_file_path + * @param string $base_url * - * @var string The class prefix for pro classe + * @return \BackWPup_Destination_Downloader */ - private static $pro_prefix = 'BackWPup_Pro_Destination_'; + public function create( $service_name, $job_id, $source_file_path, $local_file_path, $base_url = '' ) { - /** - * Class Suffix - * - * @var string The class suffix. The part after the destination - */ - private static $suffix = '_Downloader'; - - /** - * BackWPup_Destination_Downloader_Factory constructor - * - * @param string $destination The destination name. - */ - public function __construct( $destination ) { - - $this->destination = $destination; - } - - /** - * @inheritdoc - */ - public function create() { - - // Build the class name. - $class = self::$prefix . $this->destination . self::$suffix; + $destination = null; + $service_name = ucwords( $service_name ); + $class = self::CLASS_PREFIX . $service_name . self::CLASS_SUFFIX; // If class doesn't exists, try within the Pro directory. - if ( ! class_exists( $class ) ) { - $class = str_replace( self::$prefix, self::$pro_prefix, $class ); + if ( BackWPup::is_pro() && ! class_exists( $class ) ) { + $class = str_replace( self::CLASS_PREFIX, self::CLASS_PRO_PREFIX, $class ); } if ( ! class_exists( $class ) ) { @@ -76,6 +49,16 @@ public function create() { ); } - return new $class(); + $data = new BackWpUp_Destination_Downloader_Data( $job_id, $source_file_path, $local_file_path ); + + if ( strtolower( $service_name ) === self::DESTINATION_S3 ) { + /** @var \BackWPup_Destination_Downloader_Interface $destination */ + $destination = new $class( $data, $base_url ); + } + + /** @var \BackWPup_Destination_Downloader_Interface $destination */ + ! $destination and $destination = new $class( $data ); + + return new BackWPup_Destination_Downloader( $data, $destination ); } } diff --git a/inc/class-destination-downloader-interface.php b/inc/class-destination-downloader-interface.php new file mode 100644 index 00000000..851aed95 --- /dev/null +++ b/inc/class-destination-downloader-interface.php @@ -0,0 +1,26 @@ +data = $data; + $this->destination = $destination; + } /** - * Download the File - * - * @since 3.5.0 - * - * @uses wp_die In case the user has not the correct permissions to download the file. - * - * @throws \BackWPup_Destination_Download_Exception In case the file has not be stored correctly in the folder. - * - * @return BackWPup_Destination_Downloader The instance for concatenation + * @return bool */ - public function download() { + public function download_by_chunks() { + + $this->ensure_user_can_download(); + + $decripted = false; + $need_to_be_decripted = BackWPup_Option::get( $this->data->job_id(), self::ARCHIVE_ENCRYPT_OPTION ); + + $source_file_path = $this->data->source_file_path(); + $local_file_path = $this->data->local_file_path(); + + $size = $this->destination->calculate_size(); + $start_byte = 0; + $chunk_size = 2 * 1024 * 1024; + $end_byte = $start_byte + $chunk_size - 1; - if ( ! current_user_can( self::$capability ) ) { - wp_die( 'Cheatin’ huh?' ); + if ( $end_byte >= $size ) { + $end_byte = $size - 1; } try { - $size = $this->getSize(); - $start_byte = 0; - $chunk_size = 2 * 1024 * 1024; - $end_byte = $start_byte + $chunk_size - 1; - if ( $end_byte >= $size ) { - $end_byte = $size - 1; - } - while ( $end_byte <= $size ) { - $this->downloadChunk( $start_byte, $end_byte ); - self::sendMessage( array( - 'state' => 'downloading', - 'start_byte' => $start_byte, - 'end_byte' => $end_byte, - 'size' => $size, - 'download_percent' => round( ( $end_byte + 1 ) / $size * 100 ), - 'filename' => basename( $this->destination ), - ) ); - if ( $end_byte == $size - 1 ) { + $this->destination->download_chunk( $start_byte, $end_byte ); + self::send_message( + array( + 'state' => 'downloading', + 'start_byte' => $start_byte, + 'end_byte' => $end_byte, + 'size' => $size, + 'download_percent' => round( ( $end_byte + 1 ) / $size * 100 ), + 'filename' => basename( $source_file_path ), + ) + ); + + if ( $end_byte === $size - 1 ) { break; } + $start_byte = $end_byte + 1; - $end_byte = $start_byte + $chunk_size - 1; + $end_byte = $start_byte + $chunk_size - 1; + if ( $start_byte < $size && $end_byte >= $size ) { $end_byte = $size - 1; } } // Decrypt - if ( BackWPup_Option::get( $this->job_id, 'archiveencryption' ) ) { - $decrypter = new BackWPup_Decrypter( $this->destination ); - $decrypter->decrypt(); + if ( $need_to_be_decripted ) { + $decrypter = new BackWPup_Decrypter( $local_file_path ); + $decripted = $decrypter->decrypt(); } - self::sendMessage( array( + if ( ! $decripted && $need_to_be_decripted ) { + throw new \BackWPup_Destination_Download_Exception(); + } + + self::send_message( array( 'state' => 'done', ) ); - echo str_repeat( "\n", 4096 ); - flush(); } catch ( \Exception $e ) { - BackWPup_Admin::message( $e->getMessage() ); - } - - if ( ! is_file( $this->destination ) ) { - throw new \BackWPup_Destination_Download_Exception(); + self::send_message( + array( + 'state' => 'error', + 'message' => $e->getMessage(), + ), + 'log' + ); + + return false; } - return $this; + return true; } /** - * Download file in chunks - * - * Given a range of bytes, download that chunk of the file from the destination. - * - * @param int $startByte The start byte of the range - * @param int $endByte The end byte of the range - */ - public function downloadChunk( $startByte, $endByte ) {} - - /** - * Job ID Setter - * - * @since 3.5.0 - * - * @param int $job_id The Job Identifier. - * - * @return BackWPup_Destination_Downloader The instance for concatenation + * Ensure user capability */ - public function for_job( $job_id ) { - - $this->job_id = $job_id; + private function ensure_user_can_download() { - return $this; - } - - /** - * From where Download the File - * - * @since 3.5.0 - * - * @param string $file_path The path/uri of the file to download. - * - * @return BackWPup_Destination_Downloader The instance for concatenation - */ - public function from( $file_path ) { - - $this->file_path = $file_path; - - return $this; - } - - /** - * Local Destination where Store the File - * - * @since 3.5.0 - * - * @param string $destination The path where store the file content. - * - * @return BackWPup_Destination_Downloader The instance for concatenation - */ - public function to( $destination ) { - - $this->destination = $destination; - - return $this; + if ( ! current_user_can( self::CAPABILITY ) ) { + wp_die(); + } } /** - * Set and Initialize the Service - * - * We create the instance of the service and setup it to able to download the content file. - * The service depends on the destination used. - * - * @since 3.5.0 - * - * @return BackWPup_Destination_Downloader The instance for concatenation - */ - public function with_service() {} - - /** - * Get the size of the destination file. - * - * @return int The size of the file. - */ - public function getSize() {} - - /** - * Send Message - * - * Send EventSource message back to client. - * - * @param mixed $data The data to send back - * @param string $event The type of event + * @param $data + * @param string $event */ - public static function sendMessage( $data, $event = 'message' ) { + private static function send_message( $data, $event = 'message' ) { - echo "event: $event\n"; + echo "event: {$event}\n"; echo "data: " . wp_json_encode( $data ) . "\n\n"; - // Send 4096 bytes to force PHP to flush - echo str_repeat( "\n", 4096 ); flush(); } - } diff --git a/inc/class-destination-dropbox-api.php b/inc/class-destination-dropbox-api.php index 720a8dfe..6afaa84d 100644 --- a/inc/class-destination-dropbox-api.php +++ b/inc/class-destination-dropbox-api.php @@ -331,12 +331,12 @@ public function authTokenRevoke() { * * @return mixed Whatever the api request returns. */ - public function download( $args, $startByte = null, $endByte = null ) { + public function download( $args, $start_byte = null, $end_byte = null ) { $args['path'] = $this->formatPath( $args['path'] ); - if ( $startByte !== null && $endByte !== null ) { - return $this->request( 'files/download', $args, 'download', false, "{$startByte}-{$endByte}" ); + if ( $start_byte !== null && $end_byte !== null ) { + return $this->request( 'files/download', $args, 'download', false, "{$start_byte}-{$end_byte}" ); } return $this->request( 'files/download', $args, 'download' ); diff --git a/inc/class-destination-dropbox-downloader.php b/inc/class-destination-dropbox-downloader.php index 7d36b2f0..b9625ffd 100644 --- a/inc/class-destination-dropbox-downloader.php +++ b/inc/class-destination-dropbox-downloader.php @@ -11,68 +11,64 @@ * @since 3.5.0 * @package Inpsyde\BackWPup */ -final class BackWPup_Destination_Dropbox_Downloader extends BackWPup_Destination_Downloader { +final class BackWPup_Destination_Dropbox_Downloader implements BackWPup_Destination_Downloader_Interface { + + const OPTION_ROOT = 'dropboxroot'; + const OPTION_TOKEN = 'dropboxtoken'; /** - * File handle - * - * @var resource A handle to the file being downloaded + * @var \BackWpUp_Destination_Downloader_Data */ - private $file_handle; + private $data; /** - * Destructor - * - * Closes file handle if opened. + * @var resource */ - public function __destruct() { + private $local_file_handler; - if ( $this->file_handle ) { - fclose( $this->file_handle ); - } - } + /** + * @var BackWPup_Destination_Dropbox_API + */ + private $dropbox_api; /** - * @inheritdoc + * BackWPup_Destination_Dropbox_Downloader constructor + * + * @param \BackWpUp_Destination_Downloader_Data $data + * + * @throws \BackWPup_Destination_Dropbox_API_Exception */ - public function with_service() { + public function __construct( BackWpUp_Destination_Downloader_Data $data ) { - $this->service = new \BackWPup_Destination_Dropbox_API( - \BackWPup_Option::get( $this->job_id, 'dropboxroot' ) - ); + $this->data = $data; - $this->service->setOAuthTokens( \BackWPup_Option::get( $this->job_id, 'dropboxtoken' ) ); + $this->dropbox_api(); + } - return $this; + /** + * Clean up things + */ + public function __destruct() { + + fclose( $this->local_file_handler ); } /** * @inheritdoc */ - public function downloadChunk( $startByte, $endByte ) { + public function download_chunk( $start_byte, $end_byte ) { - if ( ! current_user_can( self::$capability ) ) { - wp_die( 'Cheatin’ huh?' ); - } + $this->local_file_handler( $start_byte ); try { - if ( is_null( $this->file_handle ) ) { - // Open file; write mode if $startByte is 0, else append - $this->file_handle = fopen( $this->destination, $startByte == 0 ? 'wb' : 'ab' ); - - if ( $this->file_handle === false ) { - throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); - } - } - - $data = $this->service->download( - array( 'path' => $this->file_path ), - $startByte, - $endByte + $data = $this->dropbox_api->download( + array( 'path' => $this->data->source_file_path() ), + $start_byte, + $end_byte ); - $bytes = fwrite( $this->file_handle, $data ); - if ( $bytes === false ) { + $bytes = (int) fwrite( $this->local_file_handler, $data ); + if ( $bytes === 0 ) { throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); } } catch ( \Exception $e ) { @@ -83,11 +79,44 @@ public function downloadChunk( $startByte, $endByte ) { /** * @inheritdoc */ - public function getSize() { + public function calculate_size() { - $metadata = $this->service->filesGetMetadata( array( 'path' => $this->file_path ) ); + $metadata = $this->dropbox_api->filesGetMetadata( array( 'path' => $this->data->source_file_path() ) ); return $metadata['size']; } + /** + * Set local file hanlder + * + * @param int $start_byte + */ + private function local_file_handler( $start_byte ) { + + if ( is_resource( $this->local_file_handler ) ) { + return; + } + + // Open file; write mode if $start_byte is 0, else append + $this->local_file_handler = fopen( $this->data->local_file_path(), $start_byte == 0 ? 'wb' : 'ab' ); + + if ( ! is_resource( $this->local_file_handler ) ) { + throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); + } + } + + /** + * Set the dropbox api instance + * + * @return $this + * @throws \BackWPup_Destination_Dropbox_API_Exception + */ + private function dropbox_api() { + + $this->dropbox_api = new \BackWPup_Destination_Dropbox_API( + \BackWPup_Option::get( $this->data->job_id(), self::OPTION_ROOT ) + ); + + $this->dropbox_api->setOAuthTokens( \BackWPup_Option::get( $this->data->job_id(), self::OPTION_TOKEN ) ); + } } diff --git a/inc/class-destination-folder-downloader.php b/inc/class-destination-folder-downloader.php index 3786cc46..06162f98 100644 --- a/inc/class-destination-folder-downloader.php +++ b/inc/class-destination-folder-downloader.php @@ -11,114 +11,136 @@ * @since 3.6.0 * @package Inpsyde\BackWPup */ -final class BackWPup_Destination_Folder_Downloader extends BackWPup_Destination_Downloader { +final class BackWPup_Destination_Folder_Downloader implements BackWPup_Destination_Downloader_Interface { + + const OPTION_BACKUP_DIR = 'backupdir'; /** - * File handle - * - * @var resource A handle to the file being downloaded + * @var \BackWpUp_Destination_Downloader_Data */ - private $file; + private $data; /** - * Destructor - * - * Closes file handle if opened. + * @var resource */ - public function __destruct() { + private $source_file_handler; - if ( $this->file ) { - $this->file = null; - } - } + /** + * @var resource + */ + private $local_file_handler; /** - * @inheritdoc + * BackWPup_Destination_Folder_Downloader constructor */ - public function with_service() { + public function __construct( BackWpUp_Destination_Downloader_Data $data ) { - $backup_dir = esc_attr( BackWPup_Option::get( $this->job_id, 'backupdir' ) ); - $backup_dir = BackWPup_File::get_absolute_path( $backup_dir ); - $file = realpath( BackWPup_Sanitize_Path::sanitize_path( - trailingslashit( $backup_dir ) . basename( $this->file_path ) ) - ); + $this->data = $data; - try { - $this->service = new \SplFileObject( $file, 'rb' ); - } catch ( \RuntimeException $e ) { - throw new \RuntimeException( __( 'File could not be opened for reading.', 'backwpup' ) ); - } + $this->source_file_handler(); + $this->local_file_handler(); + } - try { - $this->file = new \SplFileObject( $this->destination, 'wb' ); - } catch ( \RuntimeException $e ) { - throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); - } + /** + * Clean up things + */ + public function __destruct() { - return $this; + fclose( $this->local_file_handler ); + fclose( $this->source_file_handler ); } /** * @inheritdoc */ - public function downloadChunk( $startByte, $endByte ) { + public function download_chunk( $start_byte, $end_byte ) { - if ( ! current_user_can( self::$capability ) ) { - wp_die( 'Cheatin’ huh?' ); + if ( ftell( $this->source_file_handler ) !== $start_byte ) { + fseek( $this->source_file_handler, $start_byte ); } - if ( $this->service->ftell() != $startByte ) { - $this->service->fseek( $startByte ); + $data = fread( $this->source_file_handler, $end_byte - $start_byte + 1 ); + if ( ! $data ) { + throw new Exception( __( 'Could not read data from source file.', 'backwpup' ) ); } - try { - $data = $this->service->fread( $endByte - $startByte + 1 ); - - $bytes = $this->file->fwrite( $data ); - if ( $bytes == 0 ) { - throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); - } - } catch ( \Exception $e ) { - BackWPup_Admin::message( 'Folder: ' . $e->getMessage() ); + $bytes = (int) fwrite( $this->local_file_handler, $data ); + if ( $bytes === 0 ) { + throw new Exception( __( 'Could not write data into target file.', 'backwpup' ) ); } } /** * @inheritdoc */ - public function for_job( $job_id ) { + public function calculate_size() { - $this->job_id = $job_id; - - return $this; + return filesize( $this->source_backup_file() ); } /** - * @inheritdoc + * Retrieve the file handler for the source file + * + * @return void */ - public function from( $file_path ) { + private function source_file_handler() { + + if ( is_resource( $this->source_file_handler ) ) { + return; + } - $this->file_path = $file_path; + $file = $this->source_backup_file(); - return $this; + $this->source_file_handler = @fopen( $file, 'rb' ); + if ( ! is_resource( $this->source_file_handler ) ) { + throw new \RuntimeException( __( 'File could not be opened for reading.', 'backwpup' ) ); + } } /** - * @inheritdoc + * @return string */ - public function to( $destination ) { + private function backup_dir() { - $this->destination = $destination; + $backup_dir = esc_attr( BackWPup_Option::get( $this->data->job_id(), self::OPTION_BACKUP_DIR ) ); + $backup_dir = trailingslashit( BackWPup_File::get_absolute_path( $backup_dir ) ); - return $this; + return (string) $backup_dir; } /** - * @inheritdoc + * @return string */ - public function getSize() { + private function source_backup_file() { - return $this->service->getSize(); + return (string) realpath( + BackWPup_Sanitize_Path::sanitize_path( + $this->backup_dir() . basename( $this->data->source_file_path() ) + ) + ); } + /** + * Retrieve the file handler for the local file + * + * @return void + */ + private function local_file_handler() { + + if ( is_resource( $this->local_file_handler ) ) { + return; + } + + try { + $this->local_file_handler = @fopen( $this->data->local_file_path(), 'wb' ); + } catch ( \RuntimeException $exc ) { + throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); + } catch ( \LogicException $exc ) { + throw new \RuntimeException( sprintf( + /* translators: $1 is the path of the local file where the backup will be stored */ + __( '%s is a directory not a file.', 'backwpup' ), + $this->data->local_file_path() + ) ); + } + } } diff --git a/inc/class-destination-ftp-downloader.php b/inc/class-destination-ftp-downloader.php index a66a9659..9dd09517 100644 --- a/inc/class-destination-ftp-downloader.php +++ b/inc/class-destination-ftp-downloader.php @@ -12,107 +12,134 @@ * @since 3.5.0 * @package Inpsyde\BackWPup */ -final class BackWPup_Destination_Ftp_Downloader extends BackWPup_Destination_Downloader { +final class BackWPup_Destination_Ftp_Downloader implements BackWPup_Destination_Downloader_Interface { /** - * File handle - * - * @var resource A handle to the file being downloaded - */ - private $file_handle; + * @var \BackWpUp_Destination_Downloader_Data + */ + private $data; + + /** + * @var resource + */ + private $source_file_handler; /** - * FTP handle - * - * @var resource The handle to the FTP file. - */ - private $ftp_handle; + * @var resource + */ + private $local_file_handler; + + /** + * @var BackWPup_Destination_Ftp_Connect + */ + private $ftp_resource; /** - * Close the file handle on destruct - */ + * BackWPup_Destination_Ftp_Downloader constructor + */ + public function __construct( BackWpUp_Destination_Downloader_Data $data ) { + + $this->data = $data; + + $this->ftp_resource(); + } + + /** + * Clean up things + */ public function __destruct() { - if ( $this->file_handle ) { - fclose( $this->file_handle ); - } - - if ( $this->ftp_handle ) { - fclose( $this->ftp_handle ); - } + fclose( $this->source_file_handler ); + fclose( $this->local_file_handler ); } - + /** * @inheritdoc */ - public function with_service() { + public function download_chunk( $start_byte, $end_byte ) { - $opts = (object) BackWPup_Option::get_job( $this->job_id ); + $this->source_file_handler( $start_byte ); + $this->local_file_handler( $start_byte ); - $this->service = new BackWPup_Destination_Ftp_Connect( - $opts->ftphost, - $opts->ftpuser, - BackWPup_Encryption::decrypt( $opts->ftppass ), - $opts->ftphostport, - $opts->ftptimeout, - $opts->ftpssl, - $opts->ftppasv + $bytes = (int) stream_copy_to_stream( + $this->source_file_handler, + $this->local_file_handler, + $end_byte - $start_byte + 1, + 0 ); - return $this; + if ( $bytes === 0 ) { + throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); + } + } + + /** + * @inheritdoc + */ + public function calculate_size() { + + $resource = $this->ftp_resource + ->connect() + ->resource(); + + $size = ftp_size( $resource, $this->data->source_file_path() ); + ftp_close( $resource ); + + return $size; } /** - * @inheritdoc - */ - public function downloadChunk( $startByte, $endByte ) { + * Set the source file handler + * + * @param int $start_byte + */ + private function source_file_handler( $start_byte ) { + + $ctx = stream_context_create( array( 'ftp' => array( 'resume_pos' => $start_byte ) ) ); + $url = $this->ftp_resource->getURL( $this->data->source_file_path(), false, $ctx ); + + $this->source_file_handler = fopen( $url, 'r' ); + + if ( ! is_resource( $this->source_file_handler ) ) { + throw new \RuntimeException( __( 'Cannot open FTP file for download.', 'backwpup' ) ); + } + } + + /** + * Set the local file handler + * + * @param int $start_byte + */ + private function local_file_handler( $start_byte ) { - if ( ! current_user_can( self::$capability ) ) { - wp_die( 'Cheatin’ huh?' ); + if ( is_resource( $this->local_file_handler ) ) { + return; } - if ( ! $this->ftp_handle ) { - // Construct FTP file URL - $ctx = stream_context_create(array( 'ftp' => array( 'resume_pos' => $startByte ) ) ); - $url = $this->service->getURL( $this->file_path, false, $ctx ); - - $this->ftp_handle = fopen( $url, 'r' ); - if ( $this->ftp_handle === false ) { - throw new \RuntimeException( __( 'Cannot open FTP file for download.', 'backwpup' ) ); - } - } - - if ( ! $this->file_handle ) { - $this->file_handle = fopen( $this->destination, $startByte == 0 ? 'wb' : 'ab' ); - - if ( $this->file_handle === false ) { - throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); - } - } - - $bytes = stream_copy_to_stream( - $this->ftp_handle, - $this->file_handle, - $endByte - $startByte + 1, - 0 - ); - if ( $bytes === false ) { - throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); - } + $this->local_file_handler = fopen( $this->data->local_file_path(), $start_byte === 0 ? 'wb' : 'ab' ); + + if ( ! is_resource( $this->local_file_handler ) ) { + throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); + } } /** - * @inheritdoc - */ - public function getSize() { - - $resource = $this->service - ->connect() - ->resource(); - - $size = ftp_size( $resource, $this->file_path ); - ftp_close( $resource ); - - return $size; + * Set the Ftp resource + * + * @return void + */ + private function ftp_resource() { + + $opts = (object) BackWPup_Option::get_job( $this->data->job_id() ); + + $this->ftp_resource = new BackWPup_Destination_Ftp_Connect( + $opts->ftphost, + $opts->ftpuser, + BackWPup_Encryption::decrypt( $opts->ftppass ), + $opts->ftphostport, + $opts->ftptimeout, + $opts->ftpssl, + $opts->ftppasv + ); } } diff --git a/inc/class-destination-s3-downloader.php b/inc/class-destination-s3-downloader.php index 523f4679..ee81b51f 100644 --- a/inc/class-destination-s3-downloader.php +++ b/inc/class-destination-s3-downloader.php @@ -12,100 +12,123 @@ * @since 3.5.0 * @package Inpsyde\BackWPup */ -class BackWPup_Destination_S3_Downloader extends BackWPup_Destination_Downloader { +final class BackWPup_Destination_S3_Downloader implements BackWPup_Destination_Downloader_Interface { + + const OPTION_BUCKET = 's3bucket'; + const OPTION_ACCESS_KEY = 's3accesskey'; + const OPTION_SECRET_KEY = 's3secretkey'; + const OPTION_REGION = 's3region'; /** - * File handle - * - * @var resource The file handle for writing. + * @var \BackWpUp_Destination_Downloader_Data */ - private $file_handle; + private $data; + /** + * @var string + */ private $base_url; - public function __construct( $base_url = '' ) { + /** + * @var Aws\S3\S3Client + */ + private $s3_client; + /** + * BackWPup_Destination_S3_Downloader constructor + * + * @param \BackWpUp_Destination_Downloader_Data $data + * @param string $base_url + */ + public function __construct( BackWpUp_Destination_Downloader_Data $data, $base_url ) { + + $this->data = $data; $this->base_url = $base_url; + + $this->s3_client(); } /** - * Closes the file handle + * Clean stuffs */ public function __destruct() { - if ( $this->file_handle ) { - fclose( $this->file_handle ); - } + fclose( $this->local_file_handler ); } /** * @inheritdoc */ - public function downloadChunk( $startByte, $endByte ) { + public function download_chunk( $start_byte, $end_byte ) { + + $file = $this->s3_client->getObject( array( + 'Bucket' => BackWPup_Option::get( $this->data->job_id(), self::OPTION_BUCKET ), + 'Key' => $this->data->source_file_path(), + 'Range' => 'bytes=' . $start_byte . '-' . $end_byte, + ) ); - if ( ! current_user_can( self::$capability ) ) { - wp_die( 'Cheatin’ huh?' ); + if ( empty( $file['ContentType'] ) || $file['ContentLength'] === 0 ) { + throw new \RuntimeException( __( 'Could not write data to file. Empty source file.', 'backwpup' ) ); } - $file = $this->service->getObject( - array( - 'Bucket' => BackWPup_Option::get( $this->job_id, 's3bucket' ), - 'Key' => $this->file_path, - 'Range' => 'bytes=' . $startByte . '-' . $endByte, - ) - ); + $this->local_file_handler( $start_byte ); - if ( $file['ContentLength'] > 0 && ! empty( $file['ContentType'] ) ) { - if ( ! $this->file_handle ) { - $this->file_handle = fopen( $this->destination, $startByte == 0 ? 'wb' : 'ab' ); + $bytes = (int) fwrite( $this->local_file_handler, (string) $file['Body'] ); + if ( $bytes === 0 ) { + throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); + } + } - if ( $this->file_handle === false ) { - throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); - } - } + /** + * @inheritdoc + */ + public function calculate_size() { - $bytes = fwrite( $this->file_handle, (string) $file['Body'] ); - if ( $bytes === false ) { - throw new \RuntimeException( __( 'Could not write data to file.', 'backwpup' ) ); - } - } + $file = $this->s3_client->getObject( array( + 'Bucket' => BackWPup_Option::get( $this->data->job_id(), self::OPTION_BUCKET ), + 'Key' => $this->data->source_file_path(), + ) ); + return (int) ( ! empty( $file['ContentType'] ) ? $file['ContentLength'] : 0 ); } /** - * @inheritdoc + * @param int $start_byte */ - public function with_service() { + private function local_file_handler( $start_byte ) { - $this->service = Aws\S3\S3Client::factory( - array( - 'signature' => 'v4', - 'key' => BackWPup_Option::get( $this->job_id, 's3accesskey' ), - 'secret' => BackWPup_Encryption::decrypt( - BackWPup_Option::get( $this->job_id, 's3secretkey' ) - ), - 'region' => BackWPup_Option::get( $this->job_id, 's3region' ), - 'base_url' => $this->base_url, - 'scheme' => 'https', - 'ssl.certificate_authority' => BackWPup::get_plugin_data( 'cacert' ), - ) - ); + if ( is_resource( $this->local_file_handler ) ) { + return; + } + + $this->local_file_handler = fopen( $this->data->local_file_path(), $start_byte == 0 ? 'wb' : 'ab' ); - return $this; + if ( ! is_resource( $this->local_file_handler ) ) { + throw new \RuntimeException( __( 'File could not be opened for writing.', 'backwpup' ) ); + } } /** - * @inheritdoc + * Build S3 Client */ - public function getSize() { + private function s3_client() { + + if ( $this->s3_client ) { + return; + } + + $secret_key = BackWPup_Option::get( $this->data->job_id(), self::OPTION_SECRET_KEY ); - $object = $this->service->getObject( + $this->s3_client = Aws\S3\S3Client::factory( array( - 'Bucket' => BackWPup_Option::get( $this->job_id, 's3bucket' ), - 'Key' => $this->file_path, + 'signature' => 'v4', + 'key' => BackWPup_Option::get( $this->data->job_id(), self::OPTION_ACCESS_KEY ), + 'secret' => BackWPup_Encryption::decrypt( $secret_key ), + 'region' => BackWPup_Option::get( $this->data->job_id(), self::OPTION_REGION ), + 'base_url' => $this->base_url, + 'scheme' => 'https', + 'ssl.certificate_authority' => BackWPup::get_plugin_data( 'cacert' ), ) ); - - return (int) $object['ContentLength']; } } diff --git a/inc/class-destination-s3.php b/inc/class-destination-s3.php index 377b4b0e..58f458ad 100644 --- a/inc/class-destination-s3.php +++ b/inc/class-destination-s3.php @@ -594,19 +594,19 @@ public function file_download( $jobid, $file_path, $local_file_path = null ) { mime_content_type( $filename ), function ( \BackWPup_Download_File_Interface $obj ) use ( $self, $filename, $file_path, $job_id ) { - // Setup Destination service and download file. - $service = new BackWPup_Destination_S3_Downloader( - $self->get_s3_base_url( - BackWPup_Option::get( $job_id, 's3region' ), - BackWPup_Option::get( $job_id, 's3base_url' ) - ) + $base_url = $self->get_s3_base_url( + BackWPup_Option::get( $job_id, 's3region' ), + BackWPup_Option::get( $job_id, 's3base_url' ) ); - - $service->for_job( $job_id ) - ->from( $file_path ) - ->to( $filename ) - ->with_service() - ->download(); + $factory = new BackWPup_Destination_Downloader_Factory(); + $downloader = $factory->create( + 'S3', + $job_id, + $file_path, + $filename, + $base_url + ); + $downloader->download_by_chunks(); die(); }, diff --git a/inc/class-destinations.php b/inc/class-destinations.php index 99d4efa9..a88d3d6b 100644 --- a/inc/class-destinations.php +++ b/inc/class-destinations.php @@ -1,11 +1,12 @@ create(); - $service->for_job( $job_id ) - ->from( $file_path ) - ->to( $filename ) - ->with_service() - ->download(); - + $factory = new BackWPup_Destination_Downloader_Factory(); + $downloader = $factory->create( + $destination, + $job_id, + $file_path, + $filename + ); + $downloader->download_by_chunks(); die(); }, $capability @@ -190,6 +196,7 @@ public function prepare_restore( $job_id, $file_name ) { /** * @param $job_settings array + * * @return bool */ abstract public function can_run( array $job_settings ); diff --git a/inc/class-download-file.php b/inc/class-download-file.php index cc9707a7..9eb2fed9 100644 --- a/inc/class-download-file.php +++ b/inc/class-download-file.php @@ -128,7 +128,7 @@ public function filepath() { public function check_filename() { // Sanitize filename, avoid wrong files. - $filename = backwpup_sanitize_file_name( basename( $this->filename ) ); + $filename = sanitize_file_name( basename( $this->filename ) ); // Die if filename contains invalid characters. if ( $filename !== $this->filename ) { diff --git a/inc/class-factory-interface.php b/inc/class-factory-interface.php deleted file mode 100644 index 2fd4f71f..00000000 --- a/inc/class-factory-interface.php +++ /dev/null @@ -1,27 +0,0 @@ -substeps_done == 0 ) { if ( ! empty( $this->additional_files_to_backup ) && $this->substeps_done == 0 ) { + $this->log(print_r($this->additional_files_to_backup, true)); if ( $this->is_debug() ) { $this->log( __( 'Adding Extra files to Archive', 'backwpup' ) ); } @@ -1585,6 +1586,17 @@ private function create_archive() { if ( in_array( $this->steps_data[ $this->step_working ]['on_file'], $files_in_folder, true ) ) { continue; } + + // Check if the file matches a filename in $this->additional_files_to_backup + // This prevents .sql files from being overwritten, + // as well as manifest.json, etc. + $alreadyAdded = count( array_filter( $this->additional_files_to_backup, function( $value ) use ( $file ) + { + return strstr( $value, basename( $file ) ); + })) > 0; + if ( $alreadyAdded ) { + continue; + } $this->steps_data[ $this->step_working ]['on_file'] = $file; //restart if needed $restart_time = $this->get_restart_time(); diff --git a/inc/class-page-backups.php b/inc/class-page-backups.php index 28e42aca..671377b0 100644 --- a/inc/class-page-backups.php +++ b/inc/class-page-backups.php @@ -1,26 +1,16 @@ 'backups', @@ -32,18 +22,12 @@ function __construct() { } - /** - * @return bool - */ - function ajax_user_can() { + public function ajax_user_can() { return current_user_can( 'backwpup_backups' ); } - /** - * - */ - function prepare_items() { + public function prepare_items() { $per_page = $this->get_items_per_page( 'backwpupbackups_per_page' ); if ( empty( $per_page ) || $per_page < 1 ) { @@ -83,8 +67,8 @@ function prepare_items() { } // Sorting. - $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING ) ? : 'desc'; - $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING ) ? : 'time'; + $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING ) ?: 'desc'; + $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING ) ?: 'time'; $tmp = array(); if ( $orderby === 'time' ) { @@ -169,18 +153,12 @@ function prepare_items() { } - /** - * - */ - function no_items() { + public function no_items() { _e( 'No files could be found. (List will be generated during next backup.)', 'backwpup' ); } - /** - * @return array - */ - function get_bulk_actions() { + public function get_bulk_actions() { if ( ! $this->has_items() ) { return array(); @@ -192,12 +170,7 @@ function get_bulk_actions() { return $actions; } - /** - * @param $which - * - * @return mixed - */ - function extra_tablenav( $which ) { + public function extra_tablenav( $which ) { $destinations_list = $this->get_destinations_list(); @@ -236,10 +209,7 @@ function extra_tablenav( $which ) { '; @@ -279,10 +246,7 @@ function get_columns() { return $posts_columns; } - /** - * @return array - */ - function get_sortable_columns() { + public function get_sortable_columns() { return array( 'file' => array( 'file', false ), @@ -292,27 +256,12 @@ function get_sortable_columns() { ); } - /** - * The cb Column - * - * @param $item - * - * @return string - */ - function column_cb( $item ) { + public function column_cb( $item ) { return ''; } - - /** - * The file Column - * - * @param $item - * - * @return string - */ - function column_file( $item ) { + public function column_file( $item ) { $r = '' . esc_attr( $item['filename'] ) . '
'; if ( ! empty( $item['info'] ) ) { @@ -327,14 +276,13 @@ function column_file( $item ) { if ( current_user_can( 'backwpup_backups_download' ) && ! empty( $item['downloadurl'] ) ) { // Check if downloader class exists try { - $factory = new BackWPup_Destination_Downloader_Factory( $this->dest ); - $factory->create(); // If we're still here, the downloader exists $actions['download'] = "jobid . "\" data-destination=\"" . esc_attr( $this->dest ) . "\" data-file=\"" . esc_attr( $item['file'] ) . "\" data-local-file=\"" . esc_attr( $item['filename'] ) . "\" data-nonce=\"" . wp_create_nonce( 'download-backup_' . $this->jobid ) . "\" data-url=\"" . wp_nonce_url( $item['downloadurl'], - 'download-backup_' . $this->jobid ) . "\" class=\"backup-download-link thickbox\">" . __( 'Download', 'backwpup' ) . ""; + 'download-backup_' . $this->jobid ) . "\" class=\"backup-download-link thickbox\">" . __( 'Download', + 'backwpup' ) . ""; } catch ( BackWPup_Factory_Exception $e ) { $actions['download'] = "jobid ) . "\">" . __( 'Download', 'backwpup' ) . ""; + 'download-backup_' . $this->jobid ) . "\">" . __( 'Download', 'backwpup' ) . ""; } } @@ -350,26 +298,12 @@ function column_file( $item ) { return $r; } - /** - * The folder Column - * - * @param $item - * - * @return string - */ - function column_folder( $item ) { + public function column_folder( $item ) { return esc_attr( $item['folder'] ); } - /** - * The size Column - * - * @param $item - * - * @return string - */ - function column_size( $item ) { + public function column_size( $item ) { if ( ! empty( $item['filesize'] ) && $item['filesize'] != - 1 ) { return size_format( $item['filesize'], 2 ); @@ -378,24 +312,13 @@ function column_size( $item ) { } } - /** - * The time Column - * - * @param $item - * - * @return string - */ - function column_time( $item ) { + public function column_time( $item ) { return sprintf( __( '%1$s at %2$s', 'backwpup' ), date_i18n( get_option( 'date_format' ), $item['time'], true ), date_i18n( get_option( 'time_format' ), $item['time'], true ) ); } - - /** - * - */ public static function load() { //Create Table @@ -469,8 +392,9 @@ function ( \BackWPup_Download_File_Interface $obj ) use ( $filename ) { } else { // If the file doesn't exist, fallback to old way of downloading // This is for destinations without a downloader class - $dest = strtoupper( str_replace( 'download', '', self::$listtable->current_action() ) ); + $dest = strtoupper( str_replace( 'download', '', self::$listtable->current_action() ) ); if ( ! empty( $dest ) && strstr( self::$listtable->current_action(), 'download' ) ) { + /** @var BackWPup_Destinations $dest_class */ $dest_class = BackWPup::get_destination( $dest ); try { @@ -514,9 +438,6 @@ function ( \BackWPup_Download_File_Interface $obj ) use ( $filename ) { self::$listtable->prepare_items(); } - /** - * Output css - */ public static function admin_print_styles() { ?> @@ -538,12 +459,6 @@ public static function admin_print_styles() { @@ -602,8 +514,9 @@ public static function page() { -
- +
+