Version Description
Download this release
Release Info
Developer | WebFactory |
Plugin | WP Reset – Fastest WordPress Reset Plugin |
Version | 1.20 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.20
- css/sweetalert2.min.css +7 -0
- css/wp-reset.css +77 -0
- img/wp-reset-icon.png +0 -0
- img/wp-reset-logo.png +0 -0
- js/sweetalert2.min.js +7 -0
- js/wp-reset.js +84 -0
- readme.txt +37 -12
- wp-reset-cli.php +58 -0
- wp-reset.php +522 -173
css/sweetalert2.min.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
SweetAlert2
|
3 |
+
https://github.com/sweetalert2/sweetalert2
|
4 |
+
MIT License
|
5 |
+
*/
|
6 |
+
|
7 |
+
@-webkit-keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}body.swal2-toast-shown.swal2-has-input>.swal2-container>.swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-shown.swal2-has-input>.swal2-container>.swal2-toast .swal2-actions{flex:1;align-self:stretch;justify-content:flex-end;height:2.2em}body.swal2-toast-shown.swal2-has-input>.swal2-container>.swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-shown.swal2-has-input>.swal2-container>.swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-shown.swal2-has-input>.swal2-container>.swal2-toast .swal2-validationerror{font-size:1em}body.swal2-toast-shown>.swal2-container{position:fixed;background-color:transparent}body.swal2-toast-shown>.swal2-container.swal2-shown{background-color:transparent}body.swal2-toast-shown>.swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown>.swal2-container.swal2-top-end,body.swal2-toast-shown>.swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown>.swal2-container.swal2-top-left,body.swal2-toast-shown>.swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown>.swal2-container.swal2-center-left,body.swal2-toast-shown>.swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown>.swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-toast-shown>.swal2-container.swal2-center-end,body.swal2-toast-shown>.swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown>.swal2-container.swal2-bottom-left,body.swal2-toast-shown>.swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown>.swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown>.swal2-container.swal2-bottom-end,body.swal2-toast-shown>.swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;box-shadow:0 0 .625em #d9d9d9;overflow-y:hidden}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-close{position:initial}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon-text{font-size:2em;font-weight:700;line-height:1em}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 .0625em #fff,0 0 0 .125em rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:2em;height:2.8125em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.25em;left:-.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:2em 2em;transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;-webkit-transform-origin:0 2em;transform-origin:0 2em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:showSweetToast .5s;animation:showSweetToast .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:hideSweetToast .2s forwards;animation:hideSweetToast .2s forwards}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:animate-toast-success-tip .75s;animation:animate-toast-success-tip .75s}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:animate-toast-success-long .75s;animation:animate-toast-success-long .75s}@-webkit-keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@-webkit-keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-shown{top:auto;right:auto;bottom:auto;left:auto;background-color:transparent}body.swal2-no-backdrop .swal2-shown>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}.swal2-container{display:flex;position:fixed;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:10px;background-color:transparent;z-index:1060;overflow-x:hidden;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem;box-sizing:border-box}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-popup .swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-popup .swal2-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-popup .swal2-actions{align-items:center;justify-content:center;margin:1.25em auto 0}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-confirm{width:2.5em;height:2.5em;margin:.46875em;padding:0;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;box-sizing:border-box;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-popup .swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{display:inline-block;width:15px;height:15px;margin-left:5px;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff;content:'';-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal}.swal2-popup .swal2-styled{margin:0 .3125em;padding:.625em 2em;font-weight:500;box-shadow:none}.swal2-popup .swal2-styled:not([disabled]){cursor:pointer}.swal2-popup .swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-popup .swal2-styled::-moz-focus-inner{border:0}.swal2-popup .swal2-footer{justify-content:center;margin:1.25em 0 0;padding-top:1em;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-popup .swal2-image{max-width:100%;margin:1.25em auto}.swal2-popup .swal2-close{position:absolute;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer;overflow:hidden}.swal2-popup .swal2-close:hover{-webkit-transform:none;transform:none;color:#f27474}.swal2-popup>.swal2-checkbox,.swal2-popup>.swal2-file,.swal2-popup>.swal2-input,.swal2-popup>.swal2-radio,.swal2-popup>.swal2-select,.swal2-popup>.swal2-textarea{display:none}.swal2-popup .swal2-content{justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:300;line-height:normal;word-wrap:break-word}.swal2-popup #swal2-content{text-align:center}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-radio,.swal2-popup .swal2-select,.swal2-popup .swal2-textarea{margin:1em auto}.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-textarea{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box}.swal2-popup .swal2-file.swal2-inputerror,.swal2-popup .swal2-input.swal2-inputerror,.swal2-popup .swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-popup .swal2-file:focus,.swal2-popup .swal2-input:focus,.swal2-popup .swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-popup .swal2-file::-webkit-input-placeholder,.swal2-popup .swal2-input::-webkit-input-placeholder,.swal2-popup .swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-popup .swal2-file:-ms-input-placeholder,.swal2-popup .swal2-input:-ms-input-placeholder,.swal2-popup .swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::-ms-input-placeholder,.swal2-popup .swal2-input::-ms-input-placeholder,.swal2-popup .swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::placeholder,.swal2-popup .swal2-input::placeholder,.swal2-popup .swal2-textarea::placeholder{color:#ccc}.swal2-popup .swal2-range input{width:80%}.swal2-popup .swal2-range output{width:20%;font-weight:600;text-align:center}.swal2-popup .swal2-range input,.swal2-popup .swal2-range output{height:2.625em;margin:1em auto;padding:0;font-size:1.125em;line-height:2.625em}.swal2-popup .swal2-input{height:2.625em;padding:.75em}.swal2-popup .swal2-input[type=number]{max-width:10em}.swal2-popup .swal2-file{font-size:1.125em}.swal2-popup .swal2-textarea{height:6.75em;padding:.75em}.swal2-popup .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;color:#545454;font-size:1.125em}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-radio{align-items:center;justify-content:center}.swal2-popup .swal2-checkbox label,.swal2-popup .swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-popup .swal2-checkbox input,.swal2-popup .swal2-radio input{margin:0 .4em}.swal2-popup .swal2-validationerror{display:none;align-items:center;justify-content:center;padding:.625em;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;overflow:hidden}.swal2-popup .swal2-validationerror::before{display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center;content:'!';zoom:normal}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}.swal2-icon{position:relative;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;line-height:5em;cursor:default;box-sizing:content-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;zoom:normal}.swal2-icon-text{font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:3.75em 3.75em;transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 3.75em;transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;top:-.25em;left:-.25em;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%;z-index:2;box-sizing:content-box}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;top:.5em;left:1.625em;width:.4375em;height:5.625em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);z-index:1}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;height:.3125em;border-radius:.125em;background-color:#a5dc86;z-index:2}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progresssteps{align-items:center;margin:0 0 1.25em;padding:0;font-weight:600}.swal2-progresssteps li{display:inline-block;position:relative}.swal2-progresssteps .swal2-progresscircle{width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center;z-index:20}.swal2-progresssteps .swal2-progresscircle:first-child{margin-left:0}.swal2-progresssteps .swal2-progresscircle:last-child{margin-right:0}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep{background:#3085d6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progresscircle{background:#add8e6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progressline{background:#add8e6}.swal2-progresssteps .swal2-progressline{width:2.5em;height:.4em;margin:0 -1px;background:#3085d6;z-index:10}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}[dir=rtl] .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@-webkit-keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}
|
css/wp-reset.css
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WP Reset
|
3 |
+
* https://wpreset.com/
|
4 |
+
* (c) WebFactory Ltd, 2017-2018
|
5 |
+
*/
|
6 |
+
|
7 |
+
.tools_page_wp-reset #wp_reset_form input {
|
8 |
+
vertical-align: middle;
|
9 |
+
}
|
10 |
+
|
11 |
+
.tools_page_wp-reset .plain-list {
|
12 |
+
margin-top: 5px;
|
13 |
+
list-style-type: circle;
|
14 |
+
list-style-position: inside;
|
15 |
+
}
|
16 |
+
|
17 |
+
.tools_page_wp-reset .plain-list li {
|
18 |
+
text-indent: -18px;
|
19 |
+
padding-left: 23px;
|
20 |
+
line-height: 23px;
|
21 |
+
margin: 0;
|
22 |
+
}
|
23 |
+
|
24 |
+
.tools_page_wp-reset .red {
|
25 |
+
color: #dd3036;
|
26 |
+
}
|
27 |
+
|
28 |
+
.tools_page_wp-reset .green {
|
29 |
+
color: #1daf1d;
|
30 |
+
}
|
31 |
+
|
32 |
+
.tools_page_wp-reset #logo-icon {
|
33 |
+
max-height: 30px;
|
34 |
+
width: auto;
|
35 |
+
padding: 0;
|
36 |
+
margin: 0;
|
37 |
+
}
|
38 |
+
|
39 |
+
.tools_page_wp-reset .dismiss-notice-rate {
|
40 |
+
vertical-align: bottom;
|
41 |
+
margin-left: 10px;
|
42 |
+
}
|
43 |
+
|
44 |
+
.tools_page_wp-reset .button {
|
45 |
+
box-shadow: none;
|
46 |
+
text-shadow: none;
|
47 |
+
}
|
48 |
+
|
49 |
+
.tools_page_wp-reset .swal2-container {
|
50 |
+
z-index: 99999;
|
51 |
+
}
|
52 |
+
|
53 |
+
.tools_page_wp-reset .swal2-container.swal2-shown {
|
54 |
+
background-color: rgba(0,0,0,.6);
|
55 |
+
}
|
56 |
+
|
57 |
+
.tools_page_wp-reset .swal2-popup .swal2-title {
|
58 |
+
line-height: 1;
|
59 |
+
}
|
60 |
+
|
61 |
+
.tools_page_wp-reset code {
|
62 |
+
white-space: nowrap;
|
63 |
+
}
|
64 |
+
|
65 |
+
.tools_page_wp-reset p {
|
66 |
+
line-height: 1.7;
|
67 |
+
}
|
68 |
+
|
69 |
+
.tools_page_wp-reset .rotating {
|
70 |
+
-webkit-animation:spin 1.5s linear infinite;
|
71 |
+
-moz-animation:spin 1.5s linear infinite;
|
72 |
+
animation:spin 1.5s linear infinite;
|
73 |
+
}
|
74 |
+
|
75 |
+
@-moz-keyframes spin { 100% { -moz-transform: rotate(-360deg); } }
|
76 |
+
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(-360deg); } }
|
77 |
+
@keyframes spin { 100% { -webkit-transform: rotate(-360deg); transform:rotate(-360deg); } }
|
img/wp-reset-icon.png
ADDED
Binary file
|
img/wp-reset-logo.png
ADDED
Binary file
|
js/sweetalert2.min.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
SweetAlert2
|
3 |
+
https://github.com/sweetalert2/sweetalert2
|
4 |
+
MIT License
|
5 |
+
*/
|
6 |
+
|
7 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";var q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},M=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t="SweetAlert2:",B=function(e){console.warn(t+" "+e)},H=function(e){console.error(t+" "+e)},n=[],l=function(e){-1===n.indexOf(e)&&(n.push(e),B(e))},I=function(e){return"function"==typeof e?e():e},R=function(e){return"object"===(void 0===e?"undefined":q(e))&&"function"==typeof e.then},e=Object.freeze({cancel:"cancel",backdrop:"overlay",close:"close",esc:"esc",timer:"timer"}),c=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},D=c(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","toast","toast-shown","fade","show","hide","noanimation","close","title","header","content","actions","confirm","cancel","footer","icon","icon-text","image","input","has-input","file","range","select","radio","checkbox","textarea","inputerror","validationerror","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen"]),E=c(["success","warning","info","question","error"]),d={previousBodyPadding:null},p=function(e,t){return!!e.classList&&e.classList.contains(t)},N=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},f=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(function(t){e.forEach?e.forEach(function(e){n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},W=function(e,t){f(e,t,!0)},P=function(e,t){f(e,t,!1)},z=function(e,t){for(var n=0;n<e.childNodes.length;n++)if(p(e.childNodes[n],t))return e.childNodes[n]},U=function(e){e.style.opacity="",e.style.display=e.id===D.content?"block":"flex"},F=function(e){e.style.opacity="",e.style.display="none"},S=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},K=function(e){return e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},O=function(e,t){e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(t)},L=function(){return document.body.querySelector("."+D.container)},m=function(e){var t=L();return t?t.querySelector("."+e):null},Z=function(){return m(D.popup)},Q=function(){var e=Z();return Array.prototype.slice.call(e.querySelectorAll("."+D.icon))},Y=function(){return m(D.title)},$=function(){return m(D.content)},J=function(){return m(D.image)},X=function(){return m(D.progresssteps)},G=function(){return m(D.confirm)},ee=function(){return m(D.cancel)},te=function(){return m(D.actions)},ne=function(){return m(D.footer)},oe=function(){return m(D.close)},re=function(){var e=Array.prototype.slice.call(Z().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){return e=parseInt(e.getAttribute("tabindex")),(t=parseInt(t.getAttribute("tabindex")))<e?1:e<t?-1:0}),t=Array.prototype.slice.call(Z().querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls]'));return function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(e.concat(t))},h=function(){return!document.body.classList.contains(D["toast-shown"])},g=function(){return document.body.classList.contains(D["toast-shown"])},v=function(){return"undefined"==typeof window||"undefined"==typeof document},y=('\n <div aria-labelledby="'+D.title+'" aria-describedby="'+D.content+'" class="'+D.popup+'" tabindex="-1">\n <div class="'+D.header+'">\n <ul class="'+D.progresssteps+'"></ul>\n <div class="'+D.icon+" "+E.error+'">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="'+D.icon+" "+E.question+'">\n <span class="'+D["icon-text"]+'">?</span>\n </div>\n <div class="'+D.icon+" "+E.warning+'">\n <span class="'+D["icon-text"]+'">!</span>\n </div>\n <div class="'+D.icon+" "+E.info+'">\n <span class="'+D["icon-text"]+'">i</span>\n </div>\n <div class="'+D.icon+" "+E.success+'">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="'+D.image+'" />\n <h2 class="'+D.title+'" id="'+D.title+'"></h2>\n <button type="button" class="'+D.close+'">×</button>\n </div>\n <div class="'+D.content+'">\n <div id="'+D.content+'"></div>\n <input class="'+D.input+'" />\n <input type="file" class="'+D.file+'" />\n <div class="'+D.range+'">\n <input type="range" />\n <output></output>\n </div>\n <select class="'+D.select+'"></select>\n <div class="'+D.radio+'"></div>\n <label for="'+D.checkbox+'" class="'+D.checkbox+'">\n <input type="checkbox" />\n </label>\n <textarea class="'+D.textarea+'"></textarea>\n <div class="'+D.validationerror+'" id="'+D.validationerror+'"></div>\n </div>\n <div class="'+D.actions+'">\n <button type="button" class="'+D.confirm+'">OK</button>\n <button type="button" class="'+D.cancel+'">Cancel</button>\n </div>\n <div class="'+D.footer+'">\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),ie=function(e){var t=L();if(t&&(t.parentNode.removeChild(t),P([document.documentElement,document.body],[D["no-backdrop"],D["has-input"],D["toast-shown"]])),!v()){var n=document.createElement("div");n.className=D.container,n.innerHTML=y,("string"==typeof e.target?document.querySelector(e.target):e.target).appendChild(n);var o=Z(),r=$(),i=z(r,D.input),a=z(r,D.file),s=r.querySelector("."+D.range+" input"),u=r.querySelector("."+D.range+" output"),l=z(r,D.select),c=r.querySelector("."+D.checkbox+" input"),d=z(r,D.textarea);o.setAttribute("role",e.toast?"alert":"dialog"),o.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||o.setAttribute("aria-modal","true");var p=void 0,f=function(e){Ae.isVisible()&&p!==e.target.value&&Ae.resetValidationError(),p=e.target.value};return i.oninput=f,a.onchange=f,l.onchange=f,c.onchange=f,d.oninput=f,s.oninput=function(e){f(e),u.value=s.value},s.onchange=function(e){f(e),s.nextSibling.value=s.value},o}H("SweetAlert2 requires document to initialize")},ae=function(e,t){if(!e)return F(t);if("object"===(void 0===e?"undefined":q(e)))if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0));else e&&(t.innerHTML=e);U(t)},b=function(){if(v())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in t)if(t.hasOwnProperty(n)&&void 0!==e.style[n])return t[n];return!1}(),w=function(){null===d.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(d.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=d.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}()+"px")},se={},C=function(e,n){var o=L(),t=Z();if(t){null!==e&&"function"==typeof e&&e(t),P(t,D.show),W(t,D.hide);var r=function(){var e,t;g()||(e=window.scrollX,t=window.scrollY,se.restoreFocusTimeout=setTimeout(function(){se.previousActiveElement&&se.previousActiveElement.focus&&(se.previousActiveElement.focus(),se.previousActiveElement=null)},100),void 0!==e&&void 0!==t&&window.scrollTo(e,t),se.keydownTarget.removeEventListener("keydown",se.keydownHandler,{capture:se.keydownListenerCapture}),se.keydownHandlerAdded=!1),o.parentNode&&o.parentNode.removeChild(o),P([document.documentElement,document.body],[D.shown,D["height-auto"],D["no-backdrop"],D["has-input"],D["toast-shown"]]),h()&&(null!==d.previousBodyPadding&&(document.body.style.paddingRight=d.previousBodyPadding,d.previousBodyPadding=null),function(){if(p(document.body,D.iosfix)){var e=parseInt(document.body.style.top,10);P(document.body,D.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}()),null!==n&&"function"==typeof n&&setTimeout(function(){n()})};b&&!p(t,D.noanimation)?t.addEventListener(b,function e(){t.removeEventListener(b,e),p(t,D.hide)&&r()}):r()}};function k(e){var t=function e(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[null].concat(n)));Object.getPrototypeOf(e).apply(this,n)};return t.prototype=r(Object.create(e.prototype),{constructor:t}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var x={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:null,timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null,useRejections:!1,expectRejections:!1},A=["useRejections","expectRejections"],T=function(e){return x.hasOwnProperty(e)||"extraParams"===e},j=function(e){return-1!==A.indexOf(e)},ue=function(e){for(var t in e)T(t)||B('Unknown parameter "'+t+'"'),j(t)&&l('The parameter "'+t+'" is deprecated and will be removed in the next major release.')},_='"setDefaults" & "resetDefaults" methods are deprecated in favor of "mixin" method and will be removed in the next major release. For new projects, use "mixin". For past projects already using "setDefaults", support will be provided through an additional package.',V={};var le=[],ce=function(){var e=Z();e||Ae(""),e=Z();var t=te(),n=G(),o=ee();U(t),U(n),W([e,t],D.loading),n.disabled=!0,o.disabled=!0,e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},de=Object.freeze({isValidParameter:T,isDeprecatedParameter:j,argsToParams:function(n){var o={};switch(q(n[0])){case"string":["title","html","type"].forEach(function(e,t){switch(q(n[t])){case"string":o[e]=n[t];break;case"undefined":break;default:H("Unexpected type of "+e+'! Expected "string", got '+q(n[t]))}});break;case"object":r(o,n[0]);break;default:return H('Unexpected type of argument! Expected "string" or "object", got '+q(n[0])),!1}return o},adaptInputValidator:function(n){return function(e,t){return n.call(this,e,t).then(function(){},function(e){return e})}},close:C,closePopup:C,closeModal:C,closeToast:C,isVisible:function(){return!!Z()},clickConfirm:function(){return G().click()},clickCancel:function(){return ee().click()},getPopup:Z,getTitle:Y,getContent:$,getImage:J,getIcons:Q,getButtonsWrapper:function(){return l("swal.getButtonsWrapper() is deprecated and will be removed in the next major release, use swal.getActions() instead"),m(D.actions)},getActions:te,getConfirmButton:G,getCancelButton:ee,getFooter:ne,isLoading:function(){return Z().hasAttribute("data-loading")},fire:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(this,[null].concat(t)))},mixin:function(n){return k(function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"_main",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_main",this).call(this,r({},n,e))}}]),t}(this))},queue:function(e){var i=this;le=e;var a=function(){le=[],document.body.removeAttribute("data-swal2-queue-step")},s=[];return new Promise(function(r,e){!function t(n,o){n<le.length?(document.body.setAttribute("data-swal2-queue-step",n),i(le[n]).then(function(e){void 0!==e.value?(s.push(e.value),t(n+1,o)):(a(),r({dismiss:e.dismiss}))})):(a(),r({value:s}))}(0)})},getQueueStep:function(){return document.body.getAttribute("data-swal2-queue-step")},insertQueueStep:function(e,t){return t&&t<le.length?le.splice(t,0,e):le.push(e)},deleteQueueStep:function(e){void 0!==le[e]&&le.splice(e,1)},showLoading:ce,enableLoading:ce,getTimerLeft:function(){return se.timeout&&se.timeout.getTimerLeft()}}),pe="function"==typeof Symbol?Symbol:function(){var t=0;function e(e){return"__"+e+"_"+Math.floor(1e9*Math.random())+"_"+ ++t+"__"}return e.iterator=e("Symbol.iterator"),e}(),fe="function"==typeof WeakMap?WeakMap:function(n,o,t){function e(){o(this,n,{value:pe("WeakMap")})}return e.prototype={delete:function(e){delete e[this[n]]},get:function(e){return e[this[n]]},has:function(e){return t.call(e,this[n])},set:function(e,t){o(e,this[n],{configurable:!0,value:t})}},e}(pe("WeakMap"),Object.defineProperty,{}.hasOwnProperty),me={promise:new fe,innerParams:new fe,domCache:new fe};function he(){var e=me.innerParams.get(this),t=me.domCache.get(this);e.showConfirmButton||(F(t.confirmButton),e.showCancelButton||F(t.actions)),P([t.popup,t.actions],D.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.cancelButton.disabled=!1}var ge=function e(t,n){var o,r,i;s(this,e);var a=n;this.start=function(){i=!0,r=new Date,o=setTimeout(t,a)},this.stop=function(){i=!1,clearTimeout(o),a-=new Date-r},this.getTimerLeft=function(){return i&&(this.stop(),this.start()),a},this.getStateRunning=function(){return i},this.start()},ve={email:function(e,t){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid URL")}};var ye=function(e){var t=L(),n=Z();null!==e.onBeforeOpen&&"function"==typeof e.onBeforeOpen&&e.onBeforeOpen(n),e.animation?(W(n,D.show),W(t,D.fade),P(n,D.hide)):P(n,D.fade),U(n),t.style.overflowY="hidden",b&&!p(n,D.noanimation)?n.addEventListener(b,function e(){n.removeEventListener(b,e),t.style.overflowY="auto"}):t.style.overflowY="auto",W([document.documentElement,document.body,t],D.shown),e.heightAuto&&e.backdrop&&!e.toast&&W([document.documentElement,document.body],D["height-auto"]),h()&&(w(),function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!p(document.body,D.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",W(document.body,D.iosfix)}}()),g()||se.previousActiveElement||(se.previousActiveElement=document.activeElement),null!==e.onOpen&&"function"==typeof e.onOpen&&setTimeout(function(){e.onOpen(n)})};var be=Object.freeze({hideLoading:he,disableLoading:he,getInput:function(e){var t=me.innerParams.get(this),n=me.domCache.get(this);if(!(e=e||t.input))return null;switch(e){case"select":case"textarea":case"file":return z(n.content,D[e]);case"checkbox":return n.popup.querySelector("."+D.checkbox+" input");case"radio":return n.popup.querySelector("."+D.radio+" input:checked")||n.popup.querySelector("."+D.radio+" input:first-child");case"range":return n.popup.querySelector("."+D.range+" input");default:return z(n.content,D.input)}},enableButtons:function(){var e=me.domCache.get(this);e.confirmButton.disabled=!1,e.cancelButton.disabled=!1},disableButtons:function(){var e=me.domCache.get(this);e.confirmButton.disabled=!0,e.cancelButton.disabled=!0},enableConfirmButton:function(){me.domCache.get(this).confirmButton.disabled=!1},disableConfirmButton:function(){me.domCache.get(this).confirmButton.disabled=!0},enableInput:function(){var e=this.getInput();if(!e)return!1;if("radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!1;else e.disabled=!1},disableInput:function(){var e=this.getInput();if(!e)return!1;if(e&&"radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!0;else e.disabled=!0},showValidationError:function(e){var t=me.domCache.get(this);t.validationError.innerHTML=e;var n=window.getComputedStyle(t.popup);t.validationError.style.marginLeft="-"+n.getPropertyValue("padding-left"),t.validationError.style.marginRight="-"+n.getPropertyValue("padding-right"),U(t.validationError);var o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedBy",D.validationerror),N(o),W(o,D.inputerror))},resetValidationError:function(){var e=me.domCache.get(this);e.validationError&&F(e.validationError);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedBy"),P(t,D.inputerror))},_main:function(e){var T=this;ue(e);var j=r({},x,e);!function(r){r.inputValidator||Object.keys(ve).forEach(function(e){r.input===e&&(r.inputValidator=r.expectRejections?ve[e]:Ae.adaptInputValidator(ve[e]))}),(!r.target||"string"==typeof r.target&&!document.querySelector(r.target)||"string"!=typeof r.target&&!r.target.appendChild)&&(B('Target parameter is not valid, defaulting to "body"'),r.target="body");var e=void 0,t=Z(),n="string"==typeof r.target?document.querySelector(r.target):r.target;e=t&&n&&t.parentNode!==n.parentNode?ie(r):t||ie(r),r.width&&(e.style.width="number"==typeof r.width?r.width+"px":r.width),r.padding&&(e.style.padding="number"==typeof r.padding?r.padding+"px":r.padding),r.background&&(e.style.background=r.background);for(var o=window.getComputedStyle(e).getPropertyValue("background-color"),i=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),a=0;a<i.length;a++)i[a].style.backgroundColor=o;var s=L(),u=Y(),l=$().querySelector("#"+D.content),c=te(),d=G(),p=ee(),f=oe(),m=ne();if(r.titleText?u.innerText=r.titleText:r.title&&(u.innerHTML=r.title.split("\n").join("<br />")),"string"==typeof r.backdrop?L().style.background=r.backdrop:r.backdrop||W([document.documentElement,document.body],D["no-backdrop"]),r.html?ae(r.html,l):r.text?(l.textContent=r.text,U(l)):F(l),r.position in D?W(s,D[r.position]):(B('The "position" parameter is not valid, defaulting to "center"'),W(s,D.center)),r.grow&&"string"==typeof r.grow){var h="grow-"+r.grow;h in D&&W(s,D[h])}"function"==typeof r.animation&&(r.animation=r.animation.call()),r.showCloseButton?(f.setAttribute("aria-label",r.closeButtonAriaLabel),U(f)):F(f),e.className=D.popup,r.toast?(W([document.documentElement,document.body],D["toast-shown"]),W(e,D.toast)):W(e,D.modal),r.customClass&&W(e,r.customClass);var g=X(),v=parseInt(null===r.currentProgressStep?Ae.getQueueStep():r.currentProgressStep,10);r.progressSteps&&r.progressSteps.length?(U(g),S(g),v>=r.progressSteps.length&&B("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),r.progressSteps.forEach(function(e,t){var n=document.createElement("li");if(W(n,D.progresscircle),n.innerHTML=e,t===v&&W(n,D.activeprogressstep),g.appendChild(n),t!==r.progressSteps.length-1){var o=document.createElement("li");W(o,D.progressline),r.progressStepsDistance&&(o.style.width=r.progressStepsDistance),g.appendChild(o)}})):F(g);for(var y=Q(),b=0;b<y.length;b++)F(y[b]);if(r.type){var w=!1;for(var C in E)if(r.type===C){w=!0;break}if(!w)return H("Unknown alert type: "+r.type);var k=e.querySelector("."+D.icon+"."+E[r.type]);U(k),r.animation&&W(k,"swal2-animate-"+r.type+"-icon")}var x=J();if(r.imageUrl?(x.setAttribute("src",r.imageUrl),x.setAttribute("alt",r.imageAlt),U(x),r.imageWidth?x.setAttribute("width",r.imageWidth):x.removeAttribute("width"),r.imageHeight?x.setAttribute("height",r.imageHeight):x.removeAttribute("height"),x.className=D.image,r.imageClass&&W(x,r.imageClass)):F(x),r.showCancelButton?p.style.display="inline-block":F(p),r.showConfirmButton?O(d,"display"):F(d),r.showConfirmButton||r.showCancelButton?U(c):F(c),d.innerHTML=r.confirmButtonText,p.innerHTML=r.cancelButtonText,d.setAttribute("aria-label",r.confirmButtonAriaLabel),p.setAttribute("aria-label",r.cancelButtonAriaLabel),d.className=D.confirm,W(d,r.confirmButtonClass),p.className=D.cancel,W(p,r.cancelButtonClass),r.buttonsStyling){W([d,p],D.styled),r.confirmButtonColor&&(d.style.backgroundColor=r.confirmButtonColor),r.cancelButtonColor&&(p.style.backgroundColor=r.cancelButtonColor);var A=window.getComputedStyle(d).getPropertyValue("background-color");d.style.borderLeftColor=A,d.style.borderRightColor=A}else P([d,p],D.styled),d.style.backgroundColor=d.style.borderLeftColor=d.style.borderRightColor="",p.style.backgroundColor=p.style.borderLeftColor=p.style.borderRightColor="";ae(r.footer,m),!0===r.animation?P(e,D.noanimation):W(e,D.noanimation),r.showLoaderOnConfirm&&!r.preConfirm&&B("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request")}(j),Object.freeze(j),me.innerParams.set(this,j),se.timeout&&(se.timeout.stop(),delete se.timeout),clearTimeout(se.restoreFocusTimeout);var _={popup:Z(),container:L(),content:$(),actions:te(),confirmButton:G(),cancelButton:ee(),closeButton:oe(),validationError:m(D.validationerror),progressSteps:X()};me.domCache.set(this,_);var V=this.constructor;return new Promise(function(t,n){var o=function(e){V.closePopup(j.onClose,j.onAfterClose),j.useRejections?t(e):t({value:e})},l=function(e){V.closePopup(j.onClose,j.onAfterClose),j.useRejections?n(e):t({dismiss:e})},c=function(e){V.closePopup(j.onClose,j.onAfterClose),n(e)};j.timer&&(se.timeout=new ge(function(){l("timer"),delete se.timeout},j.timer)),j.input&&setTimeout(function(){var e=T.getInput();e&&N(e)},0);for(var d=function(t){if(j.showLoaderOnConfirm&&V.showLoading(),j.preConfirm){T.resetValidationError();var e=Promise.resolve().then(function(){return j.preConfirm(t,j.extraParams)});j.expectRejections?e.then(function(e){return o(e||t)},function(e){T.hideLoading(),e&&T.showValidationError(e)}):e.then(function(e){K(_.validationError)||!1===e?T.hideLoading():o(e||t)},function(e){return c(e)})}else o(t)},e=function(e){var t=e||window.event,n=t.target||t.srcElement,o=_.confirmButton,r=_.cancelButton,i=o&&(o===n||o.contains(n)),a=r&&(r===n||r.contains(n));switch(t.type){case"click":if(i&&V.isVisible())if(T.disableButtons(),j.input){var s=function(){var e=T.getInput();if(!e)return null;switch(j.input){case"checkbox":return e.checked?1:0;case"radio":return e.checked?e.value:null;case"file":return e.files.length?e.files[0]:null;default:return j.inputAutoTrim?e.value.trim():e.value}}();if(j.inputValidator){T.disableInput();var u=Promise.resolve().then(function(){return j.inputValidator(s,j.extraParams)});j.expectRejections?u.then(function(){T.enableButtons(),T.enableInput(),d(s)},function(e){T.enableButtons(),T.enableInput(),e&&T.showValidationError(e)}):u.then(function(e){T.enableButtons(),T.enableInput(),e?T.showValidationError(e):d(s)},function(e){return c(e)})}else d(s)}else d(!0);else a&&V.isVisible()&&(T.disableButtons(),l(V.DismissReason.cancel))}},r=_.popup.querySelectorAll("button"),i=0;i<r.length;i++)r[i].onclick=e,r[i].onmouseover=e,r[i].onmouseout=e,r[i].onmousedown=e;if(_.closeButton.onclick=function(){l(V.DismissReason.close)},j.toast)_.popup.onclick=function(e){j.showConfirmButton||j.showCancelButton||j.showCloseButton||j.input||(V.closePopup(j.onClose,j.onAfterClose),l(V.DismissReason.close))};else{var a=!1;_.popup.onmousedown=function(){_.container.onmouseup=function(e){_.container.onmouseup=void 0,e.target===_.container&&(a=!0)}},_.container.onmousedown=function(){_.popup.onmouseup=function(e){_.popup.onmouseup=void 0,(e.target===_.popup||_.popup.contains(e.target))&&(a=!0)}},_.container.onclick=function(e){a?a=!1:e.target===_.container&&I(j.allowOutsideClick)&&l(V.DismissReason.backdrop)}}j.reverseButtons?_.confirmButton.parentNode.insertBefore(_.cancelButton,_.confirmButton):_.confirmButton.parentNode.insertBefore(_.confirmButton,_.cancelButton);var s=function(e,t){for(var n=re(j.focusCancel),o=0;o<n.length;o++){(e+=t)===n.length?e=0:-1===e&&(e=n.length-1);var r=n[e];if(K(r))return r.focus()}_.popup.focus()};se.keydownHandlerAdded&&(se.keydownTarget.removeEventListener("keydown",se.keydownHandler,{capture:se.keydownListenerCapture}),se.keydownHandlerAdded=!1),j.toast||(se.keydownHandler=function(e){return function(e,t){if(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"!==e.key||e.isComposing)if("Tab"===e.key){for(var n=e.target||e.srcElement,o=re(t.focusCancel),r=-1,i=0;i<o.length;i++)if(n===o[i]){r=i;break}e.shiftKey?s(r,-1):s(r,1),e.stopPropagation(),e.preventDefault()}else-1!==["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"].indexOf(e.key)?document.activeElement===_.confirmButton&&K(_.cancelButton)?_.cancelButton.focus():document.activeElement===_.cancelButton&&K(_.confirmButton)&&_.confirmButton.focus():"Escape"!==e.key&&"Esc"!==e.key||!0!==I(t.allowEscapeKey)||l(V.DismissReason.esc);else if(e.target&&T.getInput()&&e.target.outerHTML===T.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(t.input))return;V.clickConfirm(),e.preventDefault()}}(e,j)},se.keydownTarget=j.keydownListenerCapture?window:_.popup,se.keydownListenerCapture=j.keydownListenerCapture,se.keydownTarget.addEventListener("keydown",se.keydownHandler,{capture:se.keydownListenerCapture}),se.keydownHandlerAdded=!0),T.enableButtons(),T.hideLoading(),T.resetValidationError(),j.input&&W(document.body,D["has-input"]);for(var u=["input","file","range","select","radio","checkbox","textarea"],p=void 0,f=0;f<u.length;f++){var m=D[u[f]],h=z(_.content,m);if(p=T.getInput(u[f])){for(var g in p.attributes)if(p.attributes.hasOwnProperty(g)){var v=p.attributes[g].name;"type"!==v&&"value"!==v&&p.removeAttribute(v)}for(var y in j.inputAttributes)p.setAttribute(y,j.inputAttributes[y])}h.className=m,j.inputClass&&W(h,j.inputClass),F(h)}var b=void 0;switch(j.input){case"text":case"email":case"password":case"number":case"tel":case"url":(p=z(_.content,D.input)).value=j.inputValue,p.placeholder=j.inputPlaceholder,p.type=j.input,U(p);break;case"file":(p=z(_.content,D.file)).placeholder=j.inputPlaceholder,p.type=j.input,U(p);break;case"range":var w=z(_.content,D.range),C=w.querySelector("input"),k=w.querySelector("output");C.value=j.inputValue,C.type=j.input,k.value=j.inputValue,U(w);break;case"select":var x=z(_.content,D.select);if(x.innerHTML="",j.inputPlaceholder){var A=document.createElement("option");A.innerHTML=j.inputPlaceholder,A.value="",A.disabled=!0,A.selected=!0,x.appendChild(A)}b=function(e){e.forEach(function(e){var t=M(e,2),n=t[0],o=t[1],r=document.createElement("option");r.value=n,r.innerHTML=o,j.inputValue.toString()===n.toString()&&(r.selected=!0),x.appendChild(r)}),U(x),x.focus()};break;case"radio":var B=z(_.content,D.radio);B.innerHTML="",b=function(e){e.forEach(function(e){var t=M(e,2),n=t[0],o=t[1],r=document.createElement("input"),i=document.createElement("label");r.type="radio",r.name=D.radio,r.value=n,j.inputValue.toString()===n.toString()&&(r.checked=!0),i.innerHTML=o,i.insertBefore(r,i.firstChild),B.appendChild(i)}),U(B);var t=B.querySelectorAll("input");t.length&&t[0].focus()};break;case"checkbox":var E=z(_.content,D.checkbox),P=T.getInput("checkbox");P.type="checkbox",P.value=1,P.id=D.checkbox,P.checked=Boolean(j.inputValue);var S=E.getElementsByTagName("span");S.length&&E.removeChild(S[0]),(S=document.createElement("span")).innerHTML=j.inputPlaceholder,E.appendChild(S),U(E);break;case"textarea":var O=z(_.content,D.textarea);O.value=j.inputValue,O.placeholder=j.inputPlaceholder,U(O);break;case null:break;default:H('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'+j.input+'"')}if("select"===j.input||"radio"===j.input){var L=function(e){return b((t=e,n=[],"undefined"!=typeof Map&&t instanceof Map?t.forEach(function(e,t){n.push([t,e])}):Object.keys(t).forEach(function(e){n.push([e,t[e]])}),n));var t,n};R(j.inputOptions)?(V.showLoading(),j.inputOptions.then(function(e){T.hideLoading(),L(e)})):"object"===q(j.inputOptions)?L(j.inputOptions):H("Unexpected type of inputOptions! Expected object, Map or Promise, got "+q(j.inputOptions))}else-1!==["text","email","number","tel","textarea"].indexOf(j.input)&&R(j.inputValue)&&(V.showLoading(),F(p),j.inputValue.then(function(e){p.value="number"===j.input?parseFloat(e)||0:e+"",U(p),T.hideLoading()}).catch(function(e){H("Error in inputValue promise: "+e),p.value="",U(p),T.hideLoading()}));ye(j),j.toast||(I(j.allowEnterKey)?j.focusCancel&&K(_.cancelButton)?_.cancelButton.focus():j.focusConfirm&&K(_.confirmButton)?_.confirmButton.focus():s(-1,1):document.activeElement&&document.activeElement.blur()),_.container.scrollTop=0})}}),we=void 0;function Ce(){if("undefined"!=typeof window){"undefined"==typeof Promise&&H("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)");for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(void 0===t[0])return H("SweetAlert2 expects at least 1 attribute!"),!1;we=this;var o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0}});var r=this._main(this.params);me.promise.set(this,r)}}Ce.prototype.then=function(e,t){return me.promise.get(this).then(e,t)},Ce.prototype.catch=function(e){return me.promise.get(this).catch(e)},Ce.prototype.finally=function(e){return me.promise.get(this).finally(e)},r(Ce.prototype,be),r(Ce,de),Object.keys(be).forEach(function(t){Ce[t]=function(){var e;if(we)return(e=we)[t].apply(e,arguments)}}),Ce.DismissReason=e,Ce.noop=function(){},Ce.version="7.25.0";var ke,xe,Ae=k((ke=Ce,xe=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,ke),o(t,[{key:"_main",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_main",this).call(this,r({},V,e))}}],[{key:"setDefaults",value:function(t){if(l(_),!t||"object"!==(void 0===t?"undefined":q(t)))throw new TypeError("SweetAlert2: The argument for setDefaults() is required and has to be a object");ue(t),Object.keys(t).forEach(function(e){ke.isValidParameter(e)&&(V[e]=t[e])})}},{key:"resetDefaults",value:function(){l(_),V={}}}]),t}(),"undefined"!=typeof window&&"object"===q(window._swalDefaults)&&xe.setDefaults(window._swalDefaults),xe));return Ae.default=Ae}),"undefined"!=typeof window&&window.Sweetalert2&&(window.swal=window.sweetAlert=window.Swal=window.SweetAlert=window.Sweetalert2);
|
js/wp-reset.js
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WP Reset
|
3 |
+
* https://wpreset.com/
|
4 |
+
* (c) WebFactory Ltd, 2017-2018
|
5 |
+
*/
|
6 |
+
|
7 |
+
|
8 |
+
jQuery(document).ready(function($) {
|
9 |
+
$('#wp_reset_form').on('submit', function(e, confirmed) {
|
10 |
+
if (!confirmed) {
|
11 |
+
$('#wp_reset_submit').trigger('click');
|
12 |
+
e.preventDefault();
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
|
16 |
+
$(this).off('submit').submit();
|
17 |
+
return true;
|
18 |
+
}); // bypass default submit behaviour
|
19 |
+
|
20 |
+
|
21 |
+
$('#wp_reset_submit').click(function(e) {
|
22 |
+
if ($('#wp_reset_confirm').val() !== 'reset') {
|
23 |
+
swal({ title: wp_reset.invalid_confirmation_title,
|
24 |
+
text: wp_reset.invalid_confirmation,
|
25 |
+
type: 'error',
|
26 |
+
confirmButtonText: wp_reset.ok_button,
|
27 |
+
});
|
28 |
+
|
29 |
+
e.preventDefault();
|
30 |
+
return false;
|
31 |
+
} // wrong confirmation code
|
32 |
+
|
33 |
+
message = wp_reset.confirm1 + '<br>' + wp_reset.confirm2;
|
34 |
+
swal({ title: wp_reset.confirm_title,
|
35 |
+
type: 'question',
|
36 |
+
html: message,
|
37 |
+
showCancelButton: true,
|
38 |
+
focusConfirm: false,
|
39 |
+
confirmButtonText: wp_reset.confirm_button,
|
40 |
+
cancelButtonText: wp_reset.cancel_button,
|
41 |
+
confirmButtonColor: '#dd3036',
|
42 |
+
width: 600
|
43 |
+
}).then((result) => {
|
44 |
+
if (result.value === true) {
|
45 |
+
swal({ text: wp_reset.doing_reset,
|
46 |
+
type: false,
|
47 |
+
imageUrl: wp_reset.icon_url,
|
48 |
+
onOpen: () => { $(swal.getImage()).addClass('rotating'); },
|
49 |
+
imageWidth: 100,
|
50 |
+
imageHeight: 100,
|
51 |
+
imageAlt: wp_reset.doing_reset,
|
52 |
+
allowOutsideClick: false,
|
53 |
+
allowEscapeKey: false,
|
54 |
+
allowEnterKey: false,
|
55 |
+
showConfirmButton: false,
|
56 |
+
});
|
57 |
+
$('#wp_reset_form').trigger('submit', true);
|
58 |
+
}
|
59 |
+
});
|
60 |
+
|
61 |
+
e.preventDefault();
|
62 |
+
return false;
|
63 |
+
}); // reset submit
|
64 |
+
|
65 |
+
|
66 |
+
// dismiss notice / pointer
|
67 |
+
$('.wpr-dismiss-notice').on('click', function(e) {
|
68 |
+
notice_name = $(this).data('notice');
|
69 |
+
if (!notice_name) {
|
70 |
+
return true;
|
71 |
+
}
|
72 |
+
|
73 |
+
$.get(ajaxurl, { notice_name: notice_name,
|
74 |
+
_ajax_nonce: wp_reset.nonce_dismiss_notice,
|
75 |
+
action: 'wp_reset_dismiss_notice'
|
76 |
+
});
|
77 |
+
|
78 |
+
$(this).parents('.notice-wrapper').fadeOut();
|
79 |
+
|
80 |
+
e.preventDefault();
|
81 |
+
return false;
|
82 |
+
}); // dismiss notice
|
83 |
+
}); // onload
|
84 |
+
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== WP Reset - Fastest WordPress Reset Plugin ===
|
2 |
-
Tags: wordpress reset, reset wordpress, reset database, reset wordpress database, reset, restart wordpress, clean wordpress, default wp, default wordpress, reset wp, wp reset, developer
|
3 |
-
Contributors: WebFactory
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,23 +12,26 @@ WordPress Reset resets any WordPress site to the default values without modifyin
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
WP Reset quickly resets the site's database to the default installation values without modifying any files. It deletes all customizations and content. WP Reset is fast and safe to use. It has multiple fail-safe mechanisms so you can never
|
|
|
16 |
|
|
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
#### Resetting will delete:
|
21 |
|
22 |
* all posts, pages, custom post types, comments, media entries, users
|
23 |
* all default WP database tables
|
24 |
-
* all custom database tables that have the same prefix
|
25 |
|
26 |
#### Resetting will not delete or modify:
|
27 |
|
28 |
-
* media files - they
|
29 |
* no files are touched; plugins, themes, uploads - everything stays
|
30 |
* site title, WordPress address, site address, site language and search engine visibility settings
|
31 |
-
* currently logged in user will be restored with the current password
|
32 |
|
33 |
#### What happens when I click the Reset button?
|
34 |
|
@@ -38,6 +41,9 @@ WP Reset quickly resets the site's database to the default installation values w
|
|
38 |
* you will be logged out, automatically logged in and taken to the admin dashboard
|
39 |
* WP Reset plugin will be reactivated
|
40 |
|
|
|
|
|
|
|
41 |
|
42 |
== Installation ==
|
43 |
|
@@ -45,24 +51,35 @@ Follow the usual routine;
|
|
45 |
|
46 |
1. Open WordPress admin, go to Plugins, click Add New
|
47 |
2. Enter "wp reset" in search and hit Enter
|
48 |
-
3. Plugin will show up as the first on the list, click "Install Now"
|
49 |
4. Activate & open plugin's settings page located under the Tools menu
|
50 |
|
51 |
Or if needed, upload manually;
|
52 |
|
53 |
-
1. Download the plugin.
|
54 |
2. Unzip it and upload to _/wp-content/plugins/_
|
55 |
-
3. Open WordPress admin - Plugins and click "Activate" next to
|
56 |
-
4.
|
57 |
|
58 |
|
59 |
== Screenshots ==
|
60 |
|
61 |
1. WP Reset admin page
|
|
|
62 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 1.1 =
|
67 |
* 2018/05/09
|
68 |
* WebFactory took over development
|
@@ -86,3 +103,11 @@ No. All files are left untouched.
|
|
86 |
= Will I have to reconfigure wp-config.php? =
|
87 |
|
88 |
Absolutely not. No reconfiguration is needed. No files are modified.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== WP Reset - Fastest WordPress Reset Plugin ===
|
2 |
+
Tags: wordpress reset, reset wordpress, reset database, reset wordpress database, reset, restart wordpress, clean wordpress, default wp, default wordpress, reset wp, wp reset, developer, wp-cli
|
3 |
+
Contributors: WebFactory, wpreset
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
<a href="https://wpreset.com/?utm_source=wordpressorg&utm_medium=content&utm_campaign=wp-reset&utm_term=wp-reset-top">WP Reset</a> quickly resets the site's database to the default installation values without modifying any files. It deletes all customizations and content. WP Reset is fast and safe to use. It has multiple fail-safe mechanisms so you can never accidentally lose data. WP Reset is extremely helpful for plugin and theme developers. It **speeds up testing and debugging** by providing a quick way to reset settings and re-test code. It was developed by developers for developers.
|
16 |
+
For support please use the <a href="https://wordpress.org/support/plugin/wp-reset">forums</a>, and if you need more information visit <a href="https://wpreset.com/?utm_source=wordpressorg&utm_medium=content&utm_campaign=wp-reset&utm_term=wpreset.com">wpreset.com</a> and be sure to check out the <a href="https://wpreset.com/roadmap/?utm_source=wordpressorg&utm_medium=content&utm_campaign=wp-reset&utm_term=roadmap">roadmap</a> for the list of upcoming features.
|
17 |
|
18 |
+
Access WP Reset admin page via the "Tools" menu.
|
19 |
|
20 |
+
|
21 |
+
**Please read carefully before proceeding to understand what WP Reset does**
|
22 |
|
23 |
#### Resetting will delete:
|
24 |
|
25 |
* all posts, pages, custom post types, comments, media entries, users
|
26 |
* all default WP database tables
|
27 |
+
* all custom database tables that have the same prefix table prefix as the one defined in _wp-config.php_ and used by default tables
|
28 |
|
29 |
#### Resetting will not delete or modify:
|
30 |
|
31 |
+
* media files - they remain in the _wp-uploads_ folder untouched but will no longer be listed under Media in admin
|
32 |
* no files are touched; plugins, themes, uploads - everything stays
|
33 |
* site title, WordPress address, site address, site language and search engine visibility settings
|
34 |
+
* currently logged in user will be restored with the current username and password
|
35 |
|
36 |
#### What happens when I click the Reset button?
|
37 |
|
41 |
* you will be logged out, automatically logged in and taken to the admin dashboard
|
42 |
* WP Reset plugin will be reactivated
|
43 |
|
44 |
+
#### WP-CLI support
|
45 |
+
|
46 |
+
WP Reset comes with full WP-CLI support. Help on our WP-CLI commands is available via _wp help reset_. By default the commands have to be confirmed but you can use the `--yes` option to skip confirmation. Instead of the active user, the first user with admin privileges found in the database will be restored after reset. Please be careful when using WP Reset with WP-CLI - as with using the GUI there is no undo.
|
47 |
|
48 |
== Installation ==
|
49 |
|
51 |
|
52 |
1. Open WordPress admin, go to Plugins, click Add New
|
53 |
2. Enter "wp reset" in search and hit Enter
|
54 |
+
3. Plugin will show up as the first on the list (look for our black&red round logo), click "Install Now"
|
55 |
4. Activate & open plugin's settings page located under the Tools menu
|
56 |
|
57 |
Or if needed, upload manually;
|
58 |
|
59 |
+
1. Download the latest stable version from from <a href="https://downloads.wordpress.org/plugin/wp-reset.latest-stable.zip">downloads.wordpress.org/plugin/wp-reset.latest-stable.zip</a>
|
60 |
2. Unzip it and upload to _/wp-content/plugins/_
|
61 |
+
3. Open WordPress admin - Plugins and click "Activate" next to "WP Reset"
|
62 |
+
4. Open plugin's admin page located under the Tools menu
|
63 |
|
64 |
|
65 |
== Screenshots ==
|
66 |
|
67 |
1. WP Reset admin page
|
68 |
+
2. Reset action has to be double-confirmed
|
69 |
|
70 |
|
71 |
== Changelog ==
|
72 |
|
73 |
+
= 1.2 =
|
74 |
+
* 2018/07/09
|
75 |
+
* we hit 40k installations on 2018/06/26
|
76 |
+
* WP-CLI support via "wp reset" command
|
77 |
+
* new logo
|
78 |
+
* ask for rating notice
|
79 |
+
* GUI improvements
|
80 |
+
* code clean up
|
81 |
+
* preparations for further development and new features
|
82 |
+
|
83 |
= 1.1 =
|
84 |
* 2018/05/09
|
85 |
* WebFactory took over development
|
103 |
= Will I have to reconfigure wp-config.php? =
|
104 |
|
105 |
Absolutely not. No reconfiguration is needed. No files are modified.
|
106 |
+
|
107 |
+
= Do you support WP-CLI? =
|
108 |
+
|
109 |
+
We sure do! Just type "wp reset" in your shell to see the list of available commands and options.
|
110 |
+
|
111 |
+
= How long does it take for the reset operation to complete? =
|
112 |
+
|
113 |
+
On most installations a second or two. If you have a huge amounts of data in tables then up to ten seconds.
|
wp-reset-cli.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WP Reset
|
4 |
+
* https://wpreset.com/
|
5 |
+
* (c) WebFactory Ltd, 2017-2018
|
6 |
+
*/
|
7 |
+
|
8 |
+
|
9 |
+
// include only file
|
10 |
+
if (!defined('ABSPATH')) {
|
11 |
+
wp_die(__('Do not open this file directly.', 'wp-error'));
|
12 |
+
}
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Resets the site to the default values without modifying any files.
|
17 |
+
*/
|
18 |
+
class WP_Reset_CLI extends WP_CLI_Command {
|
19 |
+
/**
|
20 |
+
* Reset the site database to default values. No files are modified.
|
21 |
+
*
|
22 |
+
* ## OPTIONS
|
23 |
+
*
|
24 |
+
* [--yes]
|
25 |
+
* : Answer yes to the confirmation message.
|
26 |
+
*
|
27 |
+
* ## EXAMPLES
|
28 |
+
*
|
29 |
+
* $ wp reset reset --yes
|
30 |
+
* Success: Database has been reset.
|
31 |
+
*
|
32 |
+
* @when after_wp_load
|
33 |
+
*/
|
34 |
+
function reset( $_, $assoc_args ) {
|
35 |
+
WP_CLI::confirm( 'Are you sure you want to do this?', $assoc_args );
|
36 |
+
|
37 |
+
global $wp_reset;
|
38 |
+
$result = $wp_reset->do_reinstall();
|
39 |
+
if (is_wp_error($result)) {
|
40 |
+
WP_CLI::error( $result->get_error_message );
|
41 |
+
} else {
|
42 |
+
WP_CLI::success( 'Database has been reset.' );
|
43 |
+
}
|
44 |
+
} // reset
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Display WP Reset version.
|
49 |
+
* @when after_wp_load
|
50 |
+
*/
|
51 |
+
function version( $_, $assoc_args ) {
|
52 |
+
global $wp_reset;
|
53 |
+
|
54 |
+
WP_CLI::line( 'WP Reset ' . $wp_reset->version );
|
55 |
+
} // version
|
56 |
+
} // WP_Reset_CLI
|
57 |
+
|
58 |
+
WP_CLI::add_command( 'reset', 'WP_Reset_CLI' );
|
wp-reset.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Reset
|
4 |
-
Plugin URI: https://
|
5 |
Description: Reset the site to default installation values without modifying any files. Deletes all customizations and content.
|
6 |
-
Version: 1.
|
7 |
Author: WebFactory Ltd
|
8 |
Author URI: https://www.webfactoryltd.com/
|
9 |
Text Domain: wp-reset
|
@@ -24,99 +24,432 @@
|
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
-
|
28 |
-
if (
|
29 |
-
|
30 |
}
|
31 |
|
32 |
|
33 |
-
|
|
|
|
|
|
|
34 |
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
class WPReset {
|
39 |
-
static $version = 1.11;
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
function __construct() {
|
43 |
-
add_action( 'admin_menu', array( &$this, 'add_tools_page' ) );
|
44 |
-
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
45 |
-
add_action( 'wp_before_admin_bar_render', array( &$this, 'link_admin_bar' ) );
|
46 |
-
add_filter( 'admin_footer_text', array( &$this, 'admin_footer_text') );
|
47 |
-
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'plugin_action_links') );
|
48 |
-
} // WPReset
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
// Checks wp_reset post value and performs an installation.
|
52 |
-
function admin_init() {
|
53 |
-
global $current_user, $wpdb;
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
return;
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
$wp_reset_confirm = ( isset( $_POST['wp_reset_confirm'] ) && $_POST['wp_reset_confirm'] == 'reset' ) ? true : false;
|
60 |
-
$valid_nonce = ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wp_reset' ) ) ? true : false;
|
61 |
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
81 |
-
|
|
|
|
|
82 |
|
83 |
-
|
84 |
-
|
|
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
88 |
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
91 |
|
|
|
|
|
|
|
92 |
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
95 |
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
$settings_link = '<a href="' . admin_url('tools.php?page=wp-reset') . '" title="' . __('Reset WordPress', 'wp-reset') . '">' . __('Reset WordPress', 'wp-reset') . '</a>';
|
112 |
|
113 |
array_unshift($links, $settings_link);
|
114 |
|
115 |
return $links;
|
116 |
} // plugin_action_links
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
function is_plugin_page() {
|
121 |
$current_screen = get_current_screen();
|
122 |
|
@@ -128,127 +461,81 @@ class WPReset {
|
|
128 |
} // is_plugin_page
|
129 |
|
130 |
|
131 |
-
|
|
|
|
|
|
|
|
|
132 |
function admin_footer_text($text) {
|
133 |
if (!$this->is_plugin_page()) {
|
134 |
return $text;
|
135 |
}
|
136 |
|
137 |
-
$text = '<i><a href="
|
138 |
|
139 |
return $text;
|
140 |
} // admin_footer_text
|
141 |
|
142 |
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
} // add_tools_page
|
149 |
-
|
150 |
-
|
151 |
function load_textdomain() {
|
152 |
-
load_plugin_textdomain(
|
153 |
} // load_textdomain
|
154 |
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
$wp_admin_bar->add_menu(
|
164 |
-
array(
|
165 |
-
'parent' => 'site-name',
|
166 |
-
'id' => 'wp-reset',
|
167 |
-
'title' => 'WP Reset',
|
168 |
-
'href' => admin_url( 'tools.php?page=wp-reset' )
|
169 |
-
)
|
170 |
-
);
|
171 |
-
} // link_admin_bar
|
172 |
-
|
173 |
-
|
174 |
-
// Inform the user that WordPress has been successfully reset
|
175 |
-
function successfully_reset() {
|
176 |
-
global $current_user;
|
177 |
-
|
178 |
-
echo '<div id="message" class="updated fade"><p>' . sprintf( __( '<b>Site has been reset</b> to default settings. User "%s" was restored with the password unchanged.', 'wp-reset' ), $current_user->user_login ) . '</p></div>';
|
179 |
-
|
180 |
-
} // successfully_reset
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
'confirm1' => __('Clicking "OK" will reset your site to default values. All content will be lost. There is NO UNDO.', 'wp-reset'),
|
186 |
-
'confirm2' => __('Click "Cancel" to abort.', 'wp-reset'));
|
187 |
|
188 |
-
wp_enqueue_script( 'jquery' );
|
189 |
-
wp_localize_script('jquery', 'wp_reset', $localize);
|
190 |
-
} // admin_script
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
-
|
194 |
-
?>
|
195 |
-
<script type="text/javascript">
|
196 |
-
jQuery('#wp_reset_submit').click(function(e) {
|
197 |
-
if ( jQuery('#wp_reset_confirm').val() == 'reset' ) {
|
198 |
-
message = wp_reset.confirm1 + '\n' + wp_reset.confirm2;
|
199 |
-
reset = confirm(message);
|
200 |
-
if ( reset ) {
|
201 |
-
jQuery('#wp_reset_form').submit();
|
202 |
-
} else {
|
203 |
-
return false;
|
204 |
-
}
|
205 |
-
} else {
|
206 |
-
alert(wp_reset.invalid_confirmation);
|
207 |
-
return false;
|
208 |
-
}
|
209 |
-
});
|
210 |
-
</script>
|
211 |
-
<?php
|
212 |
-
} // footer_script
|
213 |
-
|
214 |
-
|
215 |
-
// add_option_page callback operations
|
216 |
-
function admin_page() {
|
217 |
-
global $current_user, $wpdb;
|
218 |
-
|
219 |
if (!current_user_can('administrator')) {
|
220 |
-
|
221 |
}
|
222 |
|
223 |
-
|
224 |
-
echo '<div class="error fade"><p>' . __('<b>Invalid confirmation code.</b> Please type "reset" in the confirmation field.', 'wp-reset') . '</p></div>';
|
225 |
-
} elseif ( isset( $_POST['_wpnonce'] ) && !wp_verify_nonce( $_POST['_wpnonce'], 'wp_reset' ) ) {
|
226 |
-
echo '<div class="error fade"><p>' . __('Something went wrong. Please refresh the page and try again.', 'wp-reset') . '</strong></p></div>';
|
227 |
-
}
|
228 |
-
|
229 |
-
?>
|
230 |
-
<style type="text/css">
|
231 |
-
.plain-list {
|
232 |
-
margin-top: 5px;
|
233 |
-
list-style-type: circle;
|
234 |
-
list-style-position: inside;
|
235 |
-
}
|
236 |
-
.plain-list li {
|
237 |
-
text-indent: -18px;
|
238 |
-
padding-left: 23px;
|
239 |
-
line-height: 23px;
|
240 |
-
margin: 0;
|
241 |
-
}
|
242 |
-
.red {
|
243 |
-
color: red;
|
244 |
-
}
|
245 |
-
.green {
|
246 |
-
color: green;
|
247 |
-
}
|
248 |
-
</style>
|
249 |
-
<?php
|
250 |
echo '<div class="wrap">';
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
echo '<div class="card">';
|
254 |
echo '<h2>' . __('Please read carefully before proceeding. There is NO UNDO!', 'wp-reset') . '</h2>';
|
@@ -275,29 +562,91 @@ class WPReset {
|
|
275 |
echo '<li>' . __('you will be logged out, automatically logged in and taken to the admin dashboard', 'wp-reset') . '</li>';
|
276 |
echo '<li>' . __('WP Reset plugin will be reactivated', 'wp-reset') . '</li>';
|
277 |
echo '</ul>';
|
|
|
|
|
|
|
|
|
278 |
echo '</div>';
|
279 |
|
280 |
echo '<div class="card">';
|
281 |
-
|
282 |
-
|
283 |
echo '<p>' . sprintf(__('While doing work on your site we recommend installing the free <a href="%s" target="_blank">UnderConstructionPage</a> plugin. It helps with SEO and builds trust with visitors.', 'wp-reset'), 'https://wordpress.org/plugins/under-construction-page/') . '</p>';
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
echo '</div>';
|
290 |
|
291 |
-
echo '
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
|
299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
|
301 |
-
add_action( 'plugins_loaded', array(&$WPReset, 'load_textdomain' ) );
|
302 |
|
303 |
-
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Reset
|
4 |
+
Plugin URI: https://wpreset.com/
|
5 |
Description: Reset the site to default installation values without modifying any files. Deletes all customizations and content.
|
6 |
+
Version: 1.20
|
7 |
Author: WebFactory Ltd
|
8 |
Author URI: https://www.webfactoryltd.com/
|
9 |
Text Domain: wp-reset
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
+
// include only file
|
28 |
+
if (!defined('ABSPATH')) {
|
29 |
+
wp_die(__('Do not open this file directly.', 'wp-error'));
|
30 |
}
|
31 |
|
32 |
|
33 |
+
// load WP-CLI commands, if needed
|
34 |
+
if (defined('WP_CLI') && WP_CLI) {
|
35 |
+
require_once dirname( __FILE__ ) . '/wp-reset-cli.php';
|
36 |
+
}
|
37 |
|
38 |
|
39 |
+
class WP_Reset {
|
40 |
+
protected static $instance = null;
|
41 |
+
public $version = 0;
|
42 |
+
public $plugin_url = '';
|
43 |
+
public $plugin_dir = '';
|
44 |
+
protected $options = array();
|
45 |
|
|
|
|
|
46 |
|
47 |
+
/**
|
48 |
+
* Creates a new WP_Reset object and implements singleton
|
49 |
+
*
|
50 |
+
* @return WP_Reset
|
51 |
+
*/
|
52 |
+
static function getInstance() {
|
53 |
+
if (!is_a(self::$instance, 'WP_Reset')) {
|
54 |
+
self::$instance = new WP_Reset();
|
55 |
+
}
|
56 |
+
|
57 |
+
return self::$instance;
|
58 |
+
} // getInstance
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Initialize properties, hook to filters and actions
|
63 |
+
*
|
64 |
+
* @return null
|
65 |
+
*/
|
66 |
+
private function __construct() {
|
67 |
+
$this->version = $this->get_plugin_version();
|
68 |
+
$this->plugin_dir = plugin_dir_path(__FILE__);
|
69 |
+
$this->plugin_url = plugin_dir_url(__FILE__);
|
70 |
+
$this->load_options();
|
71 |
+
|
72 |
+
add_action('admin_menu', array($this, 'admin_menu'));
|
73 |
+
add_action('admin_init', array($this, 'do_all_actions'));
|
74 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
75 |
+
add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
76 |
+
|
77 |
+
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
|
78 |
+
add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2);
|
79 |
+
add_filter('admin_footer_text', array($this, 'admin_footer_text'));
|
80 |
+
} // __construct
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Get plugin version from file header
|
85 |
+
*
|
86 |
+
* @return string
|
87 |
+
*/
|
88 |
+
function get_plugin_version() {
|
89 |
+
$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');
|
90 |
+
|
91 |
+
return $plugin_data['version'];
|
92 |
+
} // get_plugin_version
|
93 |
+
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Load and prepare the options array
|
97 |
+
* If needed create a new DB entry
|
98 |
+
*
|
99 |
+
* @return array
|
100 |
+
*/
|
101 |
+
private function load_options() {
|
102 |
+
$options = get_option('wp-reset', array());
|
103 |
+
$change = false;
|
104 |
+
|
105 |
+
if (!isset($options['meta'])) {
|
106 |
+
$options['meta'] = array('first_version' => $this->version, 'first_install' => current_time('timestamp', true), 'reset_count' => 0);
|
107 |
+
$change = true;
|
108 |
+
}
|
109 |
+
if (!isset($options['dismissed_notices'])) {
|
110 |
+
$options['dismissed_notices'] = array();
|
111 |
+
$change = true;
|
112 |
+
}
|
113 |
+
if (!isset($options['last_run'])) {
|
114 |
+
$options['last_run'] = array();
|
115 |
+
$change = true;
|
116 |
+
}
|
117 |
+
if (!isset($options['options'])) {
|
118 |
+
$options['options'] = array();
|
119 |
+
$change = true;
|
120 |
+
}
|
121 |
+
if ($change) {
|
122 |
+
update_option('wp-reset', $options, true);
|
123 |
+
}
|
124 |
+
|
125 |
+
$this->options = $options;
|
126 |
+
return $options;
|
127 |
+
} // load_options
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Get meta part of plugin options
|
132 |
+
*
|
133 |
+
* @return array
|
134 |
+
*/
|
135 |
+
function get_meta() {
|
136 |
+
return $this->options['meta'];
|
137 |
+
} // get_meta
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Get all dismissed notices, or check for one specific notice
|
142 |
+
*
|
143 |
+
* @return bool|array
|
144 |
+
*/
|
145 |
+
function get_dismissed_notices($notice_name = '') {
|
146 |
+
$notices = $this->options['dismissed_notices'];
|
147 |
+
|
148 |
+
if (empty($notice_name)) {
|
149 |
+
return $notices;
|
150 |
+
} else {
|
151 |
+
if (empty($notices[$notice_name])) {
|
152 |
+
return false;
|
153 |
+
} else {
|
154 |
+
return true;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
} // get_dismissed_notices
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Get options part of plugin options
|
162 |
+
*
|
163 |
+
* todo: not completed
|
164 |
+
*
|
165 |
+
* @return array
|
166 |
+
*/
|
167 |
+
function get_options($key = '') {
|
168 |
+
return $this->options['options'];
|
169 |
+
} // get_options
|
170 |
+
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Update plugin options, currently entire array
|
174 |
+
*
|
175 |
+
* todo: this handles the entire options array although it should only do the options part - it's confusing
|
176 |
+
*
|
177 |
+
* @return bool
|
178 |
+
*/
|
179 |
+
function update_options($key, $data) {
|
180 |
+
$this->options[$key] = $data;
|
181 |
+
$tmp = update_option('wp-reset', $this->options);
|
182 |
+
|
183 |
+
return $tmp;
|
184 |
+
} // set_options
|
185 |
+
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Add plugin menu entry under Tools menu
|
189 |
+
*
|
190 |
+
* @return null
|
191 |
+
*/
|
192 |
+
function admin_menu() {
|
193 |
+
add_management_page(__('WP Reset', 'wp-reset'), __('WP Reset', 'wp-reset'), 'administrator', 'wp-reset', array($this, 'plugin_page'));
|
194 |
+
} // admin_menu
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Dismiss notice via AJAX call
|
199 |
+
*
|
200 |
+
* @return null
|
201 |
+
*/
|
202 |
+
function ajax_dismiss_notice() {
|
203 |
+
check_ajax_referer('wp-reset_dismiss_notice');
|
204 |
+
|
205 |
+
$notice_name = trim(@$_GET['notice_name']);
|
206 |
+
if (!$this->dismiss_notice($notice_name)) {
|
207 |
+
wp_send_json_error('Notice is already dismissed.');
|
208 |
+
} else {
|
209 |
+
wp_send_json_success();
|
210 |
+
}
|
211 |
+
} // ajax_dismiss_notice
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
+
/**
|
215 |
+
* Dismiss notice by adding it to dismissed_notices options array
|
216 |
+
*
|
217 |
+
* @return bool
|
218 |
+
*/
|
219 |
+
function dismiss_notice($notice_name) {
|
220 |
+
if ($this->get_dismissed_notices($notice_name)) {
|
221 |
+
return false;
|
222 |
+
} else {
|
223 |
+
$notices = $this->get_dismissed_notices();
|
224 |
+
$notices[$notice_name] = true;
|
225 |
+
$this->update_options('dismissed_notices', $notices);
|
226 |
+
return true;
|
227 |
+
}
|
228 |
+
} // dismiss_notice
|
229 |
|
|
|
|
|
|
|
230 |
|
231 |
+
/**
|
232 |
+
* Enqueue CSS and JS files
|
233 |
+
*
|
234 |
+
* @return null
|
235 |
+
*/
|
236 |
+
function admin_enqueue_scripts($hook) {
|
237 |
+
// exit early if not on WP Reset page
|
238 |
+
if ('tools_page_wp-reset' != $hook) {
|
239 |
return;
|
240 |
}
|
241 |
+
|
242 |
+
$options = $this->get_options();
|
243 |
+
|
244 |
+
$js_localize = array('undocumented_error' => __('An undocumented error has occured. Please refresh the page and try again.', 'wp-reset'),
|
245 |
+
'plugin_name' => __('WP Reset', 'wp-reset'),
|
246 |
+
'settings_url' => admin_url('tools.php?page=wp-reset'),
|
247 |
+
'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png',
|
248 |
+
'invalid_confirmation' => __('Please type "reset" in the confirmation field.', 'wp-reset'),
|
249 |
+
'invalid_confirmation_title' => __('Invalid confirmation', 'wp-reset'),
|
250 |
+
'cancel_button' => __('Cancel', 'wp-reset'),
|
251 |
+
'ok_button' => __('OK', 'wp-reset'),
|
252 |
+
'confirm_button' => __('Reset WordPress', 'wp-reset'),
|
253 |
+
'confirm_title' => __('Are you sure you want to proceed?', 'wp-reset'),
|
254 |
+
'confirm1' => __('Clicking "Reset WordPress" will reset your site to default values. All content will be lost. There is NO UNDO.', 'wp-reset'),
|
255 |
+
'confirm2' => __('Click "Cancel" to abort.', 'wp-reset'),
|
256 |
+
'doing_reset' => __('Resetting in progress. Please wait.', 'wp-reset'),
|
257 |
+
'nonce_dismiss_notice' => wp_create_nonce('wp-reset_dismiss_notice'),
|
258 |
+
'nonce_do_reset' => wp_create_nonce('wp-reset_do_reset'));
|
259 |
+
|
260 |
+
wp_enqueue_style('wp-reset', $this->plugin_url . 'css/wp-reset.css', array(), $this->version);
|
261 |
+
wp_enqueue_style('wp-reset-sweetalert2', $this->plugin_url . 'css/sweetalert2.min.css', array(), $this->version);
|
262 |
+
|
263 |
+
wp_enqueue_script('wp-reset-sweetalert2', $this->plugin_url . 'js/sweetalert2.min.js', array('jquery'), $this->version, true);
|
264 |
+
wp_enqueue_script('wp-reset', $this->plugin_url . 'js/wp-reset.js', array('jquery'), $this->version, true);
|
265 |
+
wp_localize_script('wp-reset', 'wp_reset', $js_localize);
|
266 |
+
|
267 |
+
// fix for agressive plugins that include their CSS on all pages
|
268 |
+
wp_dequeue_style('uiStyleSheet');
|
269 |
+
wp_dequeue_style('wpcufpnAdmin' );
|
270 |
+
wp_dequeue_style('unifStyleSheet' );
|
271 |
+
wp_dequeue_style('wpcufpn_codemirror');
|
272 |
+
wp_dequeue_style('wpcufpn_codemirrorTheme');
|
273 |
+
wp_dequeue_style('collapse-admin-css');
|
274 |
+
wp_dequeue_style('jquery-ui-css');
|
275 |
+
wp_dequeue_style('tribe-common-admin');
|
276 |
+
wp_dequeue_style('file-manager__jquery-ui-css');
|
277 |
+
wp_dequeue_style('file-manager__jquery-ui-css-theme');
|
278 |
+
wp_dequeue_style('wpmegmaps-jqueryui');
|
279 |
+
wp_dequeue_style('wp-botwatch-css');
|
280 |
+
} // admin_enqueue_scripts
|
281 |
+
|
282 |
+
|
283 |
+
function is_cli_running() {
|
284 |
+
if (defined('WP_CLI') && WP_CLI) {
|
285 |
+
return true;
|
286 |
+
} else {
|
287 |
+
return false;
|
288 |
+
}
|
289 |
+
} // is_cli_running
|
290 |
|
|
|
|
|
291 |
|
292 |
+
/**
|
293 |
+
* Reinstall / reset the WP site
|
294 |
+
* There are no failsafes in the function - it reinstalls when called
|
295 |
+
* Redirects when done
|
296 |
+
*
|
297 |
+
* @return null
|
298 |
+
*/
|
299 |
+
function do_reinstall($params = array()) {
|
300 |
+
global $current_user, $wpdb;
|
301 |
|
302 |
+
// only admins can reset; double-check
|
303 |
+
if (!$this->is_cli_running() && !current_user_can('administrator')) {
|
304 |
+
return false;
|
305 |
+
}
|
306 |
+
|
307 |
+
// make sure the function is available to us
|
308 |
+
if (!function_exists('wp_install')) {
|
309 |
+
require ABSPATH . '/wp-admin/includes/upgrade.php';
|
310 |
+
}
|
311 |
|
312 |
+
// save values that need to be restored after reset
|
313 |
+
// todo: use params to determine what gets restored after reset
|
314 |
+
$blogname = get_option('blogname');
|
315 |
+
$blog_public = get_option('blog_public');
|
316 |
+
$wplang = get_option('wplang');
|
317 |
+
$siteurl = get_option('siteurl');
|
318 |
+
$home = get_option('home');
|
319 |
+
|
320 |
+
// for WP-CLI
|
321 |
+
if (!$current_user->ID) {
|
322 |
+
$tmp = get_users(array('role' => 'administrator', 'order' => 'ASC', 'order_by' => 'ID'));
|
323 |
+
if (empty($tmp[0]->user_login)) {
|
324 |
+
return new WP_Error('no_user', 'Reset failed. Unable to find any admin users in database.');
|
325 |
+
}
|
326 |
+
$current_user = $tmp[0];
|
327 |
+
}
|
328 |
|
329 |
+
// delete custom tables with WP's prefix
|
330 |
+
$prefix = str_replace('_', '\_', $wpdb->prefix);
|
331 |
+
$tables = $wpdb->get_col("SHOW TABLES LIKE '{$prefix}%'");
|
332 |
+
foreach ($tables as $table) {
|
333 |
+
$wpdb->query("DROP TABLE $table");
|
334 |
+
}
|
335 |
|
336 |
+
// supress errors for WP_CLI
|
337 |
+
// todo: do something better
|
338 |
+
$result = @wp_install($blogname, $current_user->user_login, $current_user->user_email, $blog_public, '', md5(rand()), $wplang);
|
339 |
+
$user_id = $result['user_id'];
|
340 |
|
341 |
+
// restore user pass
|
342 |
+
$query = $wpdb->prepare("UPDATE {$wpdb->users} SET user_pass = %s, user_activation_key = '' WHERE ID = %d LIMIT 1", array($current_user->user_pass, $user_id));
|
343 |
+
$wpdb->query($query);
|
344 |
|
345 |
+
// restore rest of the settings including WP Reset's
|
346 |
+
update_option('siteurl', $siteurl);
|
347 |
+
update_option('home', $home);
|
348 |
+
update_option('wp-reset', $this->options);
|
349 |
|
350 |
+
// remove password nag
|
351 |
+
if (get_user_meta($user_id, 'default_password_nag')) {
|
352 |
+
update_user_meta($user_id, 'default_password_nag', false);
|
353 |
+
}
|
354 |
+
if (get_user_meta($user_id, $wpdb->prefix . 'default_password_nag')) {
|
355 |
+
update_user_meta($user_id, $wpdb->prefix . 'default_password_nag', false );
|
356 |
+
}
|
357 |
|
358 |
+
$meta = $this->get_meta();
|
359 |
+
$meta['reset_count']++;
|
360 |
+
$this->update_options('meta', $meta);
|
361 |
|
362 |
+
// reactivate WP Reset
|
363 |
+
// todo: legacy constant - if nobody complains the constant will be replaced by options
|
364 |
+
if (!defined('REACTIVATE_THE_WP_RESET') || REACTIVATE_THE_WP_RESET !== false) {
|
365 |
+
activate_plugin(plugin_basename( __FILE__ ));
|
366 |
+
}
|
367 |
|
368 |
+
if (!$this->is_cli_running()) {
|
369 |
+
// log out and log in the old/new user
|
370 |
+
// since the password doesn't change this is potentially unnecessary
|
371 |
+
wp_clear_auth_cookie();
|
372 |
+
wp_set_auth_cookie($user_id);
|
373 |
|
374 |
+
wp_redirect(admin_url() . '?wp-reset=success');
|
375 |
+
exit;
|
376 |
+
}
|
377 |
+
} // do_reinstall
|
378 |
+
|
379 |
+
|
380 |
+
/**
|
381 |
+
* checks wp_reset post value and performs all actions
|
382 |
+
* todo: handle messages for various actions
|
383 |
+
*/
|
384 |
+
function do_all_actions() {
|
385 |
+
// only admins can perform actions
|
386 |
+
if (!current_user_can('administrator')) {
|
387 |
+
return;
|
388 |
+
}
|
389 |
|
390 |
+
if (!empty($_GET['wp-reset']) && stristr($_SERVER['HTTP_REFERER'], 'wp-reset')) {
|
391 |
+
add_action('admin_notices', array($this, 'notice_successfull_reset'));
|
392 |
+
}
|
393 |
|
394 |
+
// check nonce
|
395 |
+
if (true === isset($_POST['wp_reset_confirm']) && false === wp_verify_nonce(@$_POST['_wpnonce'], 'wp-reset')) {
|
396 |
+
add_settings_error('wp-reset', 'bad-nonce', __('Something went wrong. Please refresh the page and try again.', 'wp-reset'), 'error');
|
397 |
+
return false;
|
398 |
+
}
|
399 |
+
|
400 |
+
// check confirmation code
|
401 |
+
if (true === isset($_POST['wp_reset_confirm']) && 'reset' !== $_POST['wp_reset_confirm']) {
|
402 |
+
add_settings_error('wp-reset', 'bad-confirm', __('<b>Invalid confirmation code.</b> Please type "reset" in the confirmation field.', 'wp-reset'), 'error');
|
403 |
+
return false;
|
404 |
+
}
|
405 |
|
406 |
+
// only one action at the moment
|
407 |
+
// todo: check action name
|
408 |
+
if (true === isset($_POST['wp_reset_confirm']) && 'reset' === $_POST['wp_reset_confirm']) {
|
409 |
+
$this->do_reinstall();
|
410 |
+
}
|
411 |
+
} // do_reset
|
412 |
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Add "Reset WordPress" action link to plugins table, left part
|
416 |
+
*
|
417 |
+
* @return array
|
418 |
+
*/
|
419 |
+
function plugin_action_links($links) {
|
420 |
$settings_link = '<a href="' . admin_url('tools.php?page=wp-reset') . '" title="' . __('Reset WordPress', 'wp-reset') . '">' . __('Reset WordPress', 'wp-reset') . '</a>';
|
421 |
|
422 |
array_unshift($links, $settings_link);
|
423 |
|
424 |
return $links;
|
425 |
} // plugin_action_links
|
426 |
+
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Add links to plugin's description in plugins table
|
430 |
+
*
|
431 |
+
* @return array
|
432 |
+
*/
|
433 |
+
function plugin_meta_links($links, $file) {
|
434 |
+
if ($file !== plugin_basename(__FILE__)) {
|
435 |
+
return $links;
|
436 |
+
}
|
437 |
+
|
438 |
+
$support_link = '<a target="_blank" href="https://wordpress.org/support/plugin/wp-reset" title="' . __('Get help', 'wp-reset') . '">' . __('Support', 'wp-reset') . '</a>';
|
439 |
+
$home_link = '<a target="_blank" href="' . $this->generate_web_link('plugins-table-right') . '" title="' . __('Plugin Homepage', 'wp-reset') . '">' . __('Plugin Homepage', 'wp-reset') . '</a>';
|
440 |
+
|
441 |
+
$links[] = $support_link;
|
442 |
+
$links[] = $home_link;
|
443 |
+
|
444 |
+
return $links;
|
445 |
+
} // plugin_meta_links
|
446 |
|
447 |
|
448 |
+
/**
|
449 |
+
* Test if we're on plugin's admin page
|
450 |
+
*
|
451 |
+
* @return bool
|
452 |
+
*/
|
453 |
function is_plugin_page() {
|
454 |
$current_screen = get_current_screen();
|
455 |
|
461 |
} // is_plugin_page
|
462 |
|
463 |
|
464 |
+
/**
|
465 |
+
* Add powered by text in admin footer
|
466 |
+
*
|
467 |
+
* @return bool
|
468 |
+
*/
|
469 |
function admin_footer_text($text) {
|
470 |
if (!$this->is_plugin_page()) {
|
471 |
return $text;
|
472 |
}
|
473 |
|
474 |
+
$text = '<i><a href="' . $this->generate_web_link('admin_footer') . '" title="' . __('Visit WP Reset page for more info', 'wp-reset') . '" target="_blank">WP Reset</a> v' . $this->version . ' by <a href="https://www.webfactoryltd.com/" title="' . __('Visit our site to get more great plugins', 'wp-reset'). '" target="_blank">WebFactory Ltd</a>.</i> '. $text;
|
475 |
|
476 |
return $text;
|
477 |
} // admin_footer_text
|
478 |
|
479 |
|
480 |
+
/**
|
481 |
+
* Loads a plugin's translated strings
|
482 |
+
*
|
483 |
+
* @return null
|
484 |
+
*/
|
|
|
|
|
|
|
485 |
function load_textdomain() {
|
486 |
+
load_plugin_textdomain('wp-reset');
|
487 |
} // load_textdomain
|
488 |
|
489 |
|
490 |
+
/**
|
491 |
+
* Inform the user that WordPress has been successfully reset
|
492 |
+
*
|
493 |
+
* @return null
|
494 |
+
*/
|
495 |
+
function notice_successfull_reset() {
|
496 |
+
global $current_user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
|
498 |
+
echo '<div id="message" class="updated fade"><p>' . sprintf(__( '<b>Site has been reset</b> to default settings. User "%s" was restored with the password unchanged. Open <a href="%s">WP Reset</a> to do another reset.', 'wp-reset'), $current_user->user_login, admin_url('tools.php?page=wp-reset')) . '</p></div>';
|
499 |
+
} // notice_successfull_reset
|
|
|
|
|
500 |
|
|
|
|
|
|
|
501 |
|
502 |
+
/**
|
503 |
+
* Outputs complete plugin's admin page
|
504 |
+
*
|
505 |
+
* @return null
|
506 |
+
*/
|
507 |
+
function plugin_page() {
|
508 |
+
global $current_user, $wpdb;
|
509 |
+
$notice_shown = false;
|
510 |
+
$meta = $this->get_meta();
|
511 |
|
512 |
+
// double check for admin priv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
if (!current_user_can('administrator')) {
|
514 |
+
wp_die(__('Sorry, you are not allowed to access this page.', 'wp-reset'));
|
515 |
}
|
516 |
|
517 |
+
settings_errors();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
echo '<div class="wrap">';
|
519 |
+
echo '<h1><img id="logo-icon" src="' . $this->plugin_url . 'img/wp-reset-logo.png" title="' . __('WP Reset', 'wp-reset') . '" alt="' . __('WP Reset', 'wp-reset') . '"></h1>';
|
520 |
+
|
521 |
+
if (!empty($meta['reset_count']) && false === $notice_shown && false == $this->get_dismissed_notices('rate')) {
|
522 |
+
echo '<div class="card notice-wrapper">';
|
523 |
+
echo '<h2>' . __('Please help us keep the plugin maintained, free & supported', 'wp-reset') . '</h2>';
|
524 |
+
echo '<p>' . __('If you use & enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin free and maintained. Thank you!', 'wp-reset') . '</p>';
|
525 |
+
echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post">' . __('Help keep the plugin free - rate it!', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="rate">' . __('I\'ve already rated it', 'wp-reset') . '</a></p>';
|
526 |
+
echo '</div>';
|
527 |
+
$notice_shown = true;
|
528 |
+
}
|
529 |
+
|
530 |
+
// todo: finish up
|
531 |
+
if (false && false === $notice_shown && false == $this->get_dismissed_notices('tidy')) {
|
532 |
+
echo '<div class="card notice-wrapper">';
|
533 |
+
echo '<h2>' . __('Are you a plugin author? Get your plugin reviewed on Tiny Repo', 'wp-reset') . '</h2>';
|
534 |
+
echo '<p>' . __('If you use & enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin free and maintained. Thank you!', 'wp-reset') . '</p>';
|
535 |
+
echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://tidyrepo.com/suggest-plugin/?utm-campaing=wp-reset&utm-medium=banner">' . __('Let Tidy Repo know you have a great plugin', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="tidy">' . __('Thanks, I\'m not interested', 'wp-reset') . '</a></p>';
|
536 |
+
echo '</div>';
|
537 |
+
$notice_shown = true;
|
538 |
+
}
|
539 |
|
540 |
echo '<div class="card">';
|
541 |
echo '<h2>' . __('Please read carefully before proceeding. There is NO UNDO!', 'wp-reset') . '</h2>';
|
562 |
echo '<li>' . __('you will be logged out, automatically logged in and taken to the admin dashboard', 'wp-reset') . '</li>';
|
563 |
echo '<li>' . __('WP Reset plugin will be reactivated', 'wp-reset') . '</li>';
|
564 |
echo '</ul>';
|
565 |
+
|
566 |
+
echo '<b>' . __('WP-CLI Support', 'wp-reset') . '</b>';
|
567 |
+
echo '<p>' . sprintf(__('All features available via GUI are available in WP-CLI as well. To get the list of commands run %s. Instead of the active user, the first user with admin privileges found in the database will be restored.', 'wp-reset'), '<code>wp help reset</code>');
|
568 |
+
echo sprintf(__('All actions have to be confirmed. If you want to skip confirmation use the standard %s option. Please be carefull - there is NO UNDO.', 'wp-reset'), '<code>--yes</code>') . '</p>';
|
569 |
echo '</div>';
|
570 |
|
571 |
echo '<div class="card">';
|
572 |
+
echo '<h2>' . __('Reset', 'wp-reset') . '</h2>';
|
573 |
+
echo '<p>' . __('Type <b>reset</b> in the confirmation field to confirm the reset and then click the "Reset WordPress" button. <b>There is NO UNDO. No backups are made by this plugin.</b>', 'wp-reset') . '</p>';
|
574 |
echo '<p>' . sprintf(__('While doing work on your site we recommend installing the free <a href="%s" target="_blank">UnderConstructionPage</a> plugin. It helps with SEO and builds trust with visitors.', 'wp-reset'), 'https://wordpress.org/plugins/under-construction-page/') . '</p>';
|
575 |
+
echo '<form id="wp_reset_form" action="' . admin_url('tools.php?page=wp-reset') . '" method="post" autocomplete="off">';
|
576 |
+
wp_nonce_field('wp-reset');
|
577 |
+
echo '<input id="wp_reset_confirm" type="text" name="wp_reset_confirm" placeholder="' . esc_attr__('Type in "reset"', 'wp-reset'). '" value="" autocomplete="off"> ';
|
578 |
+
echo '<input id="wp_reset_submit" type="button" class="button-primary" value="' . __('Reset WordPress', 'wp-reset') . '">';
|
579 |
+
echo '</form>';
|
580 |
echo '</div>';
|
581 |
|
582 |
+
echo '</div>'; // wrap
|
583 |
+
} // plugin_page
|
584 |
+
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Helper function for generating UTM tagged links
|
588 |
+
*
|
589 |
+
* @return string
|
590 |
+
*/
|
591 |
+
function generate_web_link($placement = '', $page = '/', $params = array(), $anchor = '') {
|
592 |
+
$base_url = 'https://wpreset.com';
|
593 |
+
|
594 |
+
if ('/' != $page) {
|
595 |
+
$page = '/' . trim($page, '/') . '/';
|
596 |
+
}
|
597 |
+
if ($page == '//') {
|
598 |
+
$page = '/';
|
599 |
+
}
|
600 |
+
|
601 |
+
$parts = array_merge(array('utm_source' => 'wp-reset-free', 'utm_medium' => 'plugin', 'utm_content' => $placement, 'utm_campaign' => 'wp-reset-free-v' . $this->version), $params);
|
602 |
+
|
603 |
+
if (!empty($anchor)) {
|
604 |
+
$anchor = '#' . trim($anchor, '#');
|
605 |
+
}
|
606 |
+
|
607 |
+
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
|
608 |
+
|
609 |
+
return $out;
|
610 |
+
} // generate_web_link
|
611 |
+
|
612 |
+
|
613 |
+
/**
|
614 |
+
* Clean up on uninstall; no action on deactive at the moment
|
615 |
+
*
|
616 |
+
* @return null
|
617 |
+
*/
|
618 |
+
static function uninstall() {
|
619 |
+
delete_option('wp-reset');
|
620 |
+
} // uninstall
|
621 |
+
|
622 |
+
|
623 |
+
/**
|
624 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled
|
625 |
+
*
|
626 |
+
* @return null
|
627 |
+
*/
|
628 |
+
private function __clone() {}
|
629 |
+
|
630 |
+
|
631 |
+
/**
|
632 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled
|
633 |
+
*
|
634 |
+
* @return null
|
635 |
+
*/
|
636 |
+
private function __sleep() {}
|
637 |
+
|
638 |
|
639 |
+
/**
|
640 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled
|
641 |
+
*
|
642 |
+
* @return null
|
643 |
+
*/
|
644 |
+
private function __wakeup() {}
|
645 |
+
} // WP_Reset class
|
646 |
|
|
|
647 |
|
648 |
+
// Create plugin instance and hook things up
|
649 |
+
global $wp_reset;
|
650 |
+
$wp_reset = WP_Reset::getInstance();
|
651 |
+
add_action('plugins_loaded', array($wp_reset, 'load_textdomain'));
|
652 |
+
register_uninstall_hook(__FILE__, array('WP_Reset', 'uninstall'));
|