Version Description
Download this release
Release Info
Developer | WebFactory |
Plugin | WP Force SSL |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.5
- css/index.php +2 -0
- css/sweetalert2.min.css +7 -0
- css/wpfs-style.css +147 -0
- img/index.php +2 -0
- img/loading-icon.png +0 -0
- index.php +1 -1
- js/index.php +2 -0
- js/sweetalert2.min.js +7 -0
- js/wpfs-script.js +136 -0
- license.txt +339 -0
- php-backwards-compatibility.php +0 -39
- plugin.php +0 -21
- readme.txt +69 -24
- wp-force-ssl.php +669 -109
css/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//Silence is golden.
|
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/wpfs-style.css
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* WP Force SSL
|
3 |
+
* (c) WebFactory Ltd 2019
|
4 |
+
*/
|
5 |
+
|
6 |
+
.settings_page_wpfs-settings .button {
|
7 |
+
box-shadow: none;
|
8 |
+
text-shadow: none;
|
9 |
+
border-radius: 0;
|
10 |
+
margin-right: 15px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.settings_page_wpfs-settings h1 {
|
14 |
+
font-weight: 600;
|
15 |
+
}
|
16 |
+
|
17 |
+
.settings_page_wpfs-settings,
|
18 |
+
.settings_page_wpfs-settings p {
|
19 |
+
font-size: 14px;
|
20 |
+
}
|
21 |
+
|
22 |
+
.settings_page_wpfs-settings .swal2-container {
|
23 |
+
z-index: 99999;
|
24 |
+
}
|
25 |
+
|
26 |
+
.settings_page_wpfs-settings .box {
|
27 |
+
padding: 15px;
|
28 |
+
display: inline-block;
|
29 |
+
border: thin solid black;
|
30 |
+
background: white;
|
31 |
+
margin: 15px 0;
|
32 |
+
}
|
33 |
+
|
34 |
+
.settings_page_wpfs-settings .form-table th {
|
35 |
+
font-weight: 400;
|
36 |
+
}
|
37 |
+
|
38 |
+
.rotating {
|
39 |
+
-webkit-animation: spin 1.5s linear infinite;
|
40 |
+
-moz-animation: spin 1.5s linear infinite;
|
41 |
+
animation: spin 1.5s linear infinite;
|
42 |
+
}
|
43 |
+
|
44 |
+
@-moz-keyframes spin {
|
45 |
+
100% {
|
46 |
+
-moz-transform: rotate(-360deg);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
@-webkit-keyframes spin {
|
51 |
+
100% {
|
52 |
+
-webkit-transform: rotate(-360deg);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
@keyframes spin {
|
57 |
+
100% {
|
58 |
+
-webkit-transform: rotate(-360deg);
|
59 |
+
transform: rotate(-360deg);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
.swal2-popup .swal2-title {
|
64 |
+
line-height: 100%;
|
65 |
+
}
|
66 |
+
|
67 |
+
.toggle-wrapper {
|
68 |
+
position: relative;
|
69 |
+
overflow: hidden;
|
70 |
+
display: inline-block;
|
71 |
+
border: 1px solid #dcdada;
|
72 |
+
background-color: #ffffff;
|
73 |
+
}
|
74 |
+
|
75 |
+
.toggle-wrapper input {
|
76 |
+
position: absolute;
|
77 |
+
left: -99em;
|
78 |
+
}
|
79 |
+
|
80 |
+
.toggle-wrapper .toggle {
|
81 |
+
cursor: pointer;
|
82 |
+
display: inline-block;
|
83 |
+
position: relative;
|
84 |
+
width: 121px;
|
85 |
+
height: 30px;
|
86 |
+
font-weight: 600;
|
87 |
+
background: transparent;
|
88 |
+
border: 2px solid #f1f1f1;
|
89 |
+
-webkit-transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
90 |
+
transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
91 |
+
}
|
92 |
+
|
93 |
+
.toggle-wrapper .toggle:before,
|
94 |
+
.toggle-wrapper .toggle:after {
|
95 |
+
position: absolute;
|
96 |
+
line-height: 30px;
|
97 |
+
font-size: 14px;
|
98 |
+
z-index: 2;
|
99 |
+
-webkit-transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
100 |
+
transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
101 |
+
}
|
102 |
+
|
103 |
+
.toggle-wrapper .toggle:before {
|
104 |
+
content: 'OFF';
|
105 |
+
left: 18px;
|
106 |
+
color: #ffffff;
|
107 |
+
}
|
108 |
+
|
109 |
+
.toggle-wrapper .toggle:after {
|
110 |
+
content: 'ON';
|
111 |
+
right: 20px;
|
112 |
+
color: #23282d;
|
113 |
+
}
|
114 |
+
|
115 |
+
.toggle-wrapper .toggle_handler {
|
116 |
+
display: inline-block;
|
117 |
+
position: relative;
|
118 |
+
z-index: 1;
|
119 |
+
background: #ea1919;
|
120 |
+
width: 55px;
|
121 |
+
height: 24px;
|
122 |
+
top: 3px;
|
123 |
+
left: 3px;
|
124 |
+
-webkit-transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
125 |
+
transition: all 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
126 |
+
-webkit-transform: translateX(0px);
|
127 |
+
transform: translateX(0px);
|
128 |
+
}
|
129 |
+
|
130 |
+
.toggle-wrapper input:checked + .toggle {
|
131 |
+
background: transparent;
|
132 |
+
}
|
133 |
+
|
134 |
+
.toggle-wrapper input:checked + .toggle:before {
|
135 |
+
color: #23282d;
|
136 |
+
}
|
137 |
+
|
138 |
+
.toggle-wrapper input:checked + .toggle:after {
|
139 |
+
color: #fff;
|
140 |
+
}
|
141 |
+
|
142 |
+
.toggle-wrapper input:checked + .toggle .toggle_handler {
|
143 |
+
width: 55px;
|
144 |
+
-webkit-transform: translateX(60px);
|
145 |
+
transform: translateX(60px);
|
146 |
+
background: #66b317;
|
147 |
+
}
|
img/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//Silence is golden.
|
img/loading-icon.png
ADDED
Binary file
|
index.php
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?php
|
2 |
-
//Silence is golden.
|
1 |
<?php
|
2 |
+
//Silence is golden.
|
js/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//Silence is golden.
|
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/wpfs-script.js
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
// display a loading message while an action is performed
|
3 |
+
function block_ui(message) {
|
4 |
+
tmp = swal({
|
5 |
+
text: message,
|
6 |
+
type: false,
|
7 |
+
imageUrl: wpfs.loading_icon_url,
|
8 |
+
onOpen: () => {
|
9 |
+
$(swal.getImage()).addClass('rotating');
|
10 |
+
},
|
11 |
+
heightAuto: false,
|
12 |
+
imageWidth: 100,
|
13 |
+
imageHeight: 100,
|
14 |
+
imageAlt: message,
|
15 |
+
allowOutsideClick: false,
|
16 |
+
allowEscapeKey: false,
|
17 |
+
allowEnterKey: false,
|
18 |
+
showConfirmButton: false,
|
19 |
+
width: 600
|
20 |
+
});
|
21 |
+
|
22 |
+
return tmp;
|
23 |
+
} // block_ui
|
24 |
+
|
25 |
+
// test ssl certficate
|
26 |
+
$('.wpfs_test_ssl').on('click', function(e) {
|
27 |
+
e.preventDefault();
|
28 |
+
|
29 |
+
var _ajax_nonce = wpfs.nonce_test_ssl;
|
30 |
+
var action = 'test_ssl_nonce_action';
|
31 |
+
var form_data = '_ajax_nonce=' + _ajax_nonce + '&action=' + action;
|
32 |
+
|
33 |
+
block_ui(wpfs.testing);
|
34 |
+
|
35 |
+
$.post({
|
36 |
+
url: wpfs.ajaxurl,
|
37 |
+
data: form_data
|
38 |
+
})
|
39 |
+
|
40 |
+
.always(function(data) {
|
41 |
+
swal.close();
|
42 |
+
})
|
43 |
+
|
44 |
+
.done(function(result) {
|
45 |
+
if (typeof result.success != 'undefined' && result.success) {
|
46 |
+
jQuery.get(wpfs.home_url).always(function(data, text, xhr) {
|
47 |
+
status = xhr.status;
|
48 |
+
wphe_changed = false;
|
49 |
+
|
50 |
+
if (status.substr(0, 1) != '2') {
|
51 |
+
swal({ type: 'error', heightAuto: false, title: wpfs.undocumented_error });
|
52 |
+
} else {
|
53 |
+
swal({
|
54 |
+
type: 'success',
|
55 |
+
heightAuto: false,
|
56 |
+
title: wpfs.test_success,
|
57 |
+
html: result.data
|
58 |
+
});
|
59 |
+
}
|
60 |
+
});
|
61 |
+
} else if (typeof result.success != 'undefined' && !result.success) {
|
62 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.test_failed, html: result.data });
|
63 |
+
} else {
|
64 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.undocumented_error });
|
65 |
+
}
|
66 |
+
})
|
67 |
+
|
68 |
+
.fail(function(data) {
|
69 |
+
if (data.data) {
|
70 |
+
swal({
|
71 |
+
type: 'error',
|
72 |
+
heightAuto: false,
|
73 |
+
title: wpfs.documented_error + ' ' + data.data
|
74 |
+
});
|
75 |
+
} else {
|
76 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.undocumented_error });
|
77 |
+
}
|
78 |
+
});
|
79 |
+
|
80 |
+
return false;
|
81 |
+
}); // Test ssl certficate
|
82 |
+
|
83 |
+
// save settings
|
84 |
+
$('#wpfs_save_settings').on('click', function(e) {
|
85 |
+
e.preventDefault();
|
86 |
+
|
87 |
+
var _ajax_nonce = wpfs.nonce_save_settings;
|
88 |
+
var action = 'save_settting_nonce_action';
|
89 |
+
var form_data = $('#wpfs_form').serialize() + '&_ajax_nonce=' + _ajax_nonce + '&action=' + action;
|
90 |
+
|
91 |
+
block_ui(wpfs.saving);
|
92 |
+
|
93 |
+
$.post({
|
94 |
+
url: wpfs.ajaxurl,
|
95 |
+
data: form_data
|
96 |
+
})
|
97 |
+
.always(function(data) {
|
98 |
+
swal.close();
|
99 |
+
})
|
100 |
+
.done(function(result) {
|
101 |
+
if (typeof result.success != 'undefined' && result.success) {
|
102 |
+
jQuery.get(window.location.href).always(function(data, text, xhr) {
|
103 |
+
status = xhr.status;
|
104 |
+
if (status.substr(0, 1) != '2') {
|
105 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.undocumented_error });
|
106 |
+
} else {
|
107 |
+
swal({
|
108 |
+
type: 'success',
|
109 |
+
heightAuto: false,
|
110 |
+
title: wpfs.save_success,
|
111 |
+
showConfirmButton: false,
|
112 |
+
timer: 1400
|
113 |
+
});
|
114 |
+
}
|
115 |
+
});
|
116 |
+
} else if (typeof result.success != 'undefined' && !result.success) {
|
117 |
+
swal({ heightAuto: false, type: 'error', title: result.data });
|
118 |
+
} else {
|
119 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.undocumented_error });
|
120 |
+
}
|
121 |
+
})
|
122 |
+
.fail(function(data) {
|
123 |
+
if (data.data) {
|
124 |
+
swal({
|
125 |
+
type: 'error',
|
126 |
+
heightAuto: false,
|
127 |
+
title: wpfs.documented_error + ' ' + data.data
|
128 |
+
});
|
129 |
+
} else {
|
130 |
+
swal({ heightAuto: false, type: 'error', title: wpfs.undocumented_error });
|
131 |
+
}
|
132 |
+
});
|
133 |
+
|
134 |
+
return false;
|
135 |
+
});
|
136 |
+
})(jQuery);
|
license.txt
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
<one line to give the program's name and a brief idea of what it does.>
|
294 |
+
Copyright (C) <year> <name of author>
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
<signature of Ty Coon>, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
php-backwards-compatibility.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Prevent direct file access
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
header( 'Status: 403 Forbidden' );
|
5 |
-
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
-
exit;
|
7 |
-
}
|
8 |
-
/**
|
9 |
-
* Deactivates the plugin
|
10 |
-
*
|
11 |
-
* @return bool
|
12 |
-
*/
|
13 |
-
function wpfssl_deactivate_self() {
|
14 |
-
if( ! current_user_can( 'activate_plugins' ) ) {
|
15 |
-
return false;
|
16 |
-
}
|
17 |
-
// deactivate self
|
18 |
-
deactivate_plugins( 'wp-force-ssl/wp-force-ssl.php' );
|
19 |
-
// get rid of "Plugin activated" notice
|
20 |
-
if( isset( $_GET['activate'] ) ) {
|
21 |
-
unset( $_GET['activate'] );
|
22 |
-
}
|
23 |
-
// show notice to user
|
24 |
-
add_action( 'admin_notices', 'wpfssl_requirement_notice' );
|
25 |
-
return true;
|
26 |
-
}
|
27 |
-
/**
|
28 |
-
* Outputs a notice telling the user that the plugin deactivated itself
|
29 |
-
*/
|
30 |
-
function wpfssl_requirement_notice() {
|
31 |
-
?>
|
32 |
-
<div class="updated">
|
33 |
-
<p><?php _e( 'WP Force SSL did not activate because it requires your server to run PHP 5.4 or higher. <a href="http://www.wpupdatephp.com/update/" target="_blank">Learn More</a>', 'wp-force-ssl' ); ?></p>
|
34 |
-
</div>
|
35 |
-
<?php
|
36 |
-
}
|
37 |
-
// Hook into `admin_init`
|
38 |
-
add_action( 'admin_init', 'wpfssl_deactivate_self' );
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Prevent direct access to this file.
|
3 |
-
if( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit( 'You are not allowed to access this file directly.' );
|
5 |
-
}
|
6 |
-
|
7 |
-
// "The Core"
|
8 |
-
define('FORCE_SSL' , true);
|
9 |
-
|
10 |
-
if (defined('FORCE_SSL'))
|
11 |
-
add_action('template_redirect', 'wpfssl_core');
|
12 |
-
|
13 |
-
function wpfssl_core(){
|
14 |
-
|
15 |
-
if ( FORCE_SSL && !is_ssl () )
|
16 |
-
{
|
17 |
-
wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 );
|
18 |
-
exit();
|
19 |
-
}
|
20 |
-
}
|
21 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,43 +1,88 @@
|
|
1 |
-
===
|
2 |
-
Contributors:
|
3 |
-
Tags: ssl, force,
|
4 |
-
Requires at least:
|
5 |
-
Tested up to: 5.2
|
6 |
-
|
|
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
|
|
|
|
10 |
== Description ==
|
11 |
-
This plugin helps you redirect HTTP traffic to HTTPS without the need of touching any code.
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
=
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
== Installation ==
|
20 |
-
You need to <strong>add https to the WordPress Address (URL) and Site Address (URL) parameters under General > Settings</strong>. (Required by WordPress itself)
|
21 |
|
22 |
-
1.
|
23 |
-
2. Install
|
24 |
-
3.
|
25 |
-
4.
|
|
|
|
|
26 |
|
27 |
== Changelog ==
|
28 |
-
=
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
- Changed function naming to avoid conflicts reported by users.
|
30 |
|
31 |
-
=
|
32 |
- Dropping support for PHP 5.3: Only 15.9% of the people that use WordPress use PHP 5.3, it reached end of life and you should ask your host to upgrade.
|
33 |
|
34 |
-
=
|
35 |
- Fixed an issue where some users were getting a error message for no valid header when activating the plugin.
|
36 |
|
37 |
-
=
|
38 |
- Dropping support for PHP 5.2: Only 5.7% of the people that use WordPress use PHP 5.2, it's old, buggy, and insecure.
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
In this version, we are dropping support for PHP 5.3. Do not upgrade if your website is running on it just yet, and ask you host to upgrade.
|
1 |
+
=== WP Force SSL ===
|
2 |
+
Contributors: WebFactory, UnderConstructionPage, googlemapswidget, wpreset
|
3 |
+
Tags: ssl, force ssl, add ssl, enable ssl, https, ssl certificate, ssl redirect, redirect, mixed content, hsts
|
4 |
+
Requires at least: 4.6
|
5 |
+
Tested up to: 5.2
|
6 |
+
Requires PHP: 5.2
|
7 |
+
Stable Tag: 1.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Enable SSL with 1 click! Add an SSL certificate & WP Force SSL to redirect site from HTTP to HTTPS.
|
12 |
+
|
13 |
== Description ==
|
|
|
14 |
|
15 |
+
WP Force SSL helps you redirect unsecure HTTP traffic to secure HTTPS one **without the need to touch any code**. Just activate Force SSL and everything will be configured for you. The entire site will move to HTTPS using your SSL certificate.
|
16 |
+
|
17 |
+
To keep things fast & simple WP Force SSL is very lightweight - there are only two settings.
|
18 |
+
Access options via main Settings menu - Force SSL.
|
19 |
+
|
20 |
+
= Three fast steps to get you started: =
|
21 |
+
* Get an SSL certificate (yea, you need one, sorry).
|
22 |
+
* Activate WP Force SSL.
|
23 |
+
* Test certificate & you're done!
|
24 |
+
|
25 |
+
= SSL certificate testing tool =
|
26 |
+
WP Force SSL comes with an SSL certificate testing tool. Simply click "Test SSL certificate" and it'll test if the certificate is valid, properly installed, up-to date, and generally in good shape to be used on your site.
|
27 |
+
|
28 |
+
= Settings =
|
29 |
+
* Force SSL - automatically redirect all traffic from HTTP to HTTPS
|
30 |
+
* Enable HTTP Strict Transport Security (HSTS) - HSTS is a web security policy mechanism that helps to protect your site against protocol downgrade attacks and cookie hijacking. It allows web servers to declare that web browsers should interact with it using only HTTPS connections. It adds additional security to your site.
|
31 |
+
|
32 |
+
= Need support? =
|
33 |
+
We're here for you! Things get frustrating when they don't work so make sure you <a href="https://wordpress.org/support/plugin/wp-force-ssl/">open a support topic</a> in the official Force SSL forum. We answer all questions within a few hours!
|
34 |
+
|
35 |
+
= Wanna say "thank you"? =
|
36 |
+
WP Force SSL is 100% free so the best way to say "thank you" is to <a href="https://wordpress.org/support/plugin/wp-force-ssl/reviews/#new-post">leave a review</a>. Reviews are what keeps the plugin going. Thank you!
|
37 |
+
|
38 |
+
|
39 |
+
== Frequently Asked Questions ==
|
40 |
|
41 |
+
= Who is this plugin for? =
|
42 |
+
For anyone who has an SSL certificate installed on their site and wants to be sure all content is accessed (and redirected if needed) via a secure connection.
|
43 |
+
|
44 |
+
= Do I need an SSL certificate for this to work? =
|
45 |
+
Yes, you do need an SSL certificate regardless of the plugin you're using. If you don't have one try switching to a <a href="https://wordpress.org/hosting/">quality hosting provider</a> that provides and installs free certificates.
|
46 |
+
|
47 |
+
= Where and how can I get an SSL certificate? =
|
48 |
+
You can buy an SSL certificate but we recommend getting one for free from Let's Encrypt. The easiest way to get a free SSL certificate is to use a <a href="https://wordpress.org/hosting/">good hosting provider</a> that will automatically get an SSL certificate for you and install it. There's nothing to configure, it's just one click - they do everything for you.
|
49 |
+
|
50 |
+
= After activating WP Force SSL plugin, do I need to do anything else? =
|
51 |
+
No, nothing. After activating WP Force SSL, the main option "redirect SSL" will already be active. What you can do is use our tool to test your SSL certificate, to make sure it works properly.
|
52 |
+
|
53 |
+
== Screenshots ==
|
54 |
+
|
55 |
+
1. After activation, all traffic is redirected from HTTP to HTTPS.
|
56 |
+
2. Test your SSL certificate with our built-in tool.
|
57 |
|
58 |
== Installation ==
|
|
|
59 |
|
60 |
+
1. Open Plugins - Add New in WP admin and search for "WP Force SSL"
|
61 |
+
2. Install and activate the plugin
|
62 |
+
3. Plugin settings will open automatically (you can also access them via Settings - Force SSL)
|
63 |
+
4. Test you SSL certificate using our tool
|
64 |
+
5. Make sure WP Address and Site Address in Settings - General have an "https" prefix
|
65 |
+
|
66 |
|
67 |
== Changelog ==
|
68 |
+
= v1.5 =
|
69 |
+
- 2019/09/23
|
70 |
+
- complete rewrite of entire WP Force SSL plugin
|
71 |
+
- added support for HSTS
|
72 |
+
- 288,290 downloads; 80,000 installations
|
73 |
+
|
74 |
+
= v1.4 =
|
75 |
- Changed function naming to avoid conflicts reported by users.
|
76 |
|
77 |
+
= v1.3 =
|
78 |
- Dropping support for PHP 5.3: Only 15.9% of the people that use WordPress use PHP 5.3, it reached end of life and you should ask your host to upgrade.
|
79 |
|
80 |
+
= v1.2.1 =
|
81 |
- Fixed an issue where some users were getting a error message for no valid header when activating the plugin.
|
82 |
|
83 |
+
= v1.2 =
|
84 |
- Dropping support for PHP 5.2: Only 5.7% of the people that use WordPress use PHP 5.2, it's old, buggy, and insecure.
|
85 |
|
86 |
+
= v0.1 =
|
87 |
+
- 2015/01/15
|
88 |
+
- initial release
|
|
wp-force-ssl.php
CHANGED
@@ -1,109 +1,669 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
);
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP Force SSL
|
4 |
+
Plugin URI: https://wpforcessl.com/
|
5 |
+
Description: Redirect all traffic from HTTP to HTTPS for your entire site.
|
6 |
+
Author: WebFactory Ltd
|
7 |
+
Author URI: https://www.webfactoryltd.com/
|
8 |
+
Version: 1.5
|
9 |
+
Text Domain: wp-force-ssl
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
// if the file is called directly
|
14 |
+
if (!defined('ABSPATH')) {
|
15 |
+
exit('You are not allowed to access this file directly.');
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
define('WPFSSL_OPTIONS_KEY', 'wpfssl_options');
|
20 |
+
define('WPFSSL_META_KEY', 'wpfssl_meta');
|
21 |
+
|
22 |
+
|
23 |
+
// start up the engine
|
24 |
+
class wpForceSSL
|
25 |
+
{
|
26 |
+
static $instance = false;
|
27 |
+
public $version = 0;
|
28 |
+
private $wpfs_settings = array();
|
29 |
+
public $plugin_url = '';
|
30 |
+
public $meta = array();
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Check if minimum WP and PHP versions are installed
|
35 |
+
* Register all hooks for the plugin
|
36 |
+
*
|
37 |
+
* @since 1.5
|
38 |
+
*
|
39 |
+
* @return array plugin meta
|
40 |
+
*
|
41 |
+
*/
|
42 |
+
private function __construct()
|
43 |
+
{
|
44 |
+
$this->get_plugin_version();
|
45 |
+
|
46 |
+
if (false === $this->check_wp_version(4.6)) {
|
47 |
+
return false;
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->wpfs_settings = get_option(WPFSSL_OPTIONS_KEY, array());
|
51 |
+
|
52 |
+
if (!is_array($this->wpfs_settings) || empty($this->wpfs_settings)) {
|
53 |
+
$this->wpfs_settings['wpfs_ssl'] = 'yes';
|
54 |
+
$this->wpfs_settings['wpfs_hsts'] = 'no';
|
55 |
+
update_option(WPFSSL_OPTIONS_KEY, $this->wpfs_settings);
|
56 |
+
}
|
57 |
+
|
58 |
+
$this->plugin_url = plugin_dir_url(__FILE__);
|
59 |
+
$this->meta = $this->get_meta();
|
60 |
+
|
61 |
+
if ($this->wpfs_settings['wpfs_ssl'] == 'yes') {
|
62 |
+
add_action('template_redirect', array($this, 'wpfs_core'));
|
63 |
+
}
|
64 |
+
if ($this->wpfs_settings['wpfs_hsts'] == 'yes') {
|
65 |
+
add_action('send_headers', array($this, 'to_strict_transport_security'));
|
66 |
+
}
|
67 |
+
|
68 |
+
add_action('admin_menu', array($this, 'add_settings_page'));
|
69 |
+
add_filter('admin_footer_text', array($this, 'admin_footer_text'));
|
70 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
|
71 |
+
add_filter('install_plugins_table_api_args_featured', array($this, 'featured_plugins_tab'));
|
72 |
+
|
73 |
+
// ajax hooks for the settings, and SSL certificate test
|
74 |
+
add_action('wp_ajax_save_settting_nonce_action', array($this, 'ajax_save_setting'));
|
75 |
+
add_action('wp_ajax_test_ssl_nonce_action', array($this, 'ajax_check_ssl'));
|
76 |
+
} // __construct
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Get plugin meta data, create if not existent
|
81 |
+
*
|
82 |
+
* @since 1.5
|
83 |
+
*
|
84 |
+
* @return array plugin meta
|
85 |
+
*
|
86 |
+
*/
|
87 |
+
public function get_meta()
|
88 |
+
{
|
89 |
+
$meta = get_option(WPFSSL_META_KEY, array());
|
90 |
+
|
91 |
+
if (!is_array($meta) || empty($meta)) {
|
92 |
+
$meta['first_version'] = $this->get_plugin_version();
|
93 |
+
$meta['first_install'] = time();
|
94 |
+
update_option(WPFSSL_META_KEY, $meta);
|
95 |
+
}
|
96 |
+
|
97 |
+
return $meta;
|
98 |
+
} // get_meta
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Get plugin version
|
103 |
+
*
|
104 |
+
* @since 1.5
|
105 |
+
*
|
106 |
+
* @return string plugin version
|
107 |
+
*
|
108 |
+
*/
|
109 |
+
public function get_plugin_version()
|
110 |
+
{
|
111 |
+
$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');
|
112 |
+
$this->version = $plugin_data['version'];
|
113 |
+
|
114 |
+
return $plugin_data['version'];
|
115 |
+
} // get_plugin_version
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Return instance, create if not already existing
|
120 |
+
*
|
121 |
+
* @since 1.5
|
122 |
+
*
|
123 |
+
* @return object wpForceSLL instance
|
124 |
+
*
|
125 |
+
*/
|
126 |
+
public static function getInstance()
|
127 |
+
{
|
128 |
+
if (false == is_a(self::$instance, 'wpForceSSL')) {
|
129 |
+
self::$instance = new self;
|
130 |
+
}
|
131 |
+
|
132 |
+
return self::$instance;
|
133 |
+
} // getInstance
|
134 |
+
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Enqueue admin scripts
|
138 |
+
*
|
139 |
+
* @since 1.5
|
140 |
+
*
|
141 |
+
* @return null
|
142 |
+
*
|
143 |
+
*/
|
144 |
+
public function admin_scripts($hook)
|
145 |
+
{
|
146 |
+
if (false == $this->is_plugin_page()) {
|
147 |
+
return;
|
148 |
+
}
|
149 |
+
|
150 |
+
wp_enqueue_style('wpfs-style', $this->plugin_url . 'css/wpfs-style.css', null, $this->version);
|
151 |
+
wp_enqueue_style('wpfs-sweetalert2-style', $this->plugin_url . 'css/sweetalert2.min.css', null, $this->version);
|
152 |
+
|
153 |
+
wp_enqueue_script('wpfs-sweetalert2', $this->plugin_url . 'js/sweetalert2.min.js', array('jquery'), $this->version, true);
|
154 |
+
wp_enqueue_script('wpfs-script', $this->plugin_url . 'js/wpfs-script.js', array('jquery'), $this->version, true);
|
155 |
+
|
156 |
+
wp_localize_script('wpfs-script', 'wpfs', array(
|
157 |
+
'ajaxurl' => admin_url('admin-ajax.php'),
|
158 |
+
'loading_icon_url' => plugins_url('img/loading-icon.png', __FILE__),
|
159 |
+
'testing' => __('Testing. Please wait ...', 'wp-force-ssl'),
|
160 |
+
'saving' => __('Saving. Please wait ...', 'wp-force-ssl'),
|
161 |
+
'test_success' => __('Test Completed Successfully', 'wp-force-ssl'),
|
162 |
+
'test_failed' => __('Test Failed', 'wp-force-ssl'),
|
163 |
+
'home_url' => get_home_url(),
|
164 |
+
'save_success' => __('Settings saved.', 'wp-force-ssl'),
|
165 |
+
'undocumented_error' => __('An undocumented error has occurred. Please refresh the page and try again.', 'wp-force-ssl'),
|
166 |
+
'documented_error' => __('An error has occurred.', 'wp-force-ssl'),
|
167 |
+
'nonce_save_settings' => wp_create_nonce('save_settting_nonce_action'),
|
168 |
+
'nonce_test_ssl' => wp_create_nonce('test_ssl_nonce_action')
|
169 |
+
));
|
170 |
+
} // admin_scripts
|
171 |
+
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Load text domain and plugin version
|
175 |
+
*
|
176 |
+
* @since 1.5
|
177 |
+
*
|
178 |
+
* @return null
|
179 |
+
*
|
180 |
+
*/
|
181 |
+
static function plugins_loaded()
|
182 |
+
{
|
183 |
+
load_plugin_textdomain('wp-force-ssl');
|
184 |
+
} // plugins_loaded
|
185 |
+
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Register menu page
|
189 |
+
*
|
190 |
+
* @since 1.5
|
191 |
+
*
|
192 |
+
* @return null
|
193 |
+
*
|
194 |
+
*/
|
195 |
+
public function add_settings_page()
|
196 |
+
{
|
197 |
+
add_options_page(
|
198 |
+
__('WP Force SSL', 'wp-force-ssl'),
|
199 |
+
__('WP Force SSL', 'wp-force-ssl'),
|
200 |
+
'manage_options',
|
201 |
+
'wpfs-settings',
|
202 |
+
array($this, 'settings_page_content')
|
203 |
+
);
|
204 |
+
} // add_settings_page
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Echo plugin settings page
|
209 |
+
*
|
210 |
+
* @since 1.5
|
211 |
+
*
|
212 |
+
* @return null
|
213 |
+
*
|
214 |
+
*/
|
215 |
+
public function settings_page_content()
|
216 |
+
{
|
217 |
+
?>
|
218 |
+
<div class="wrap">
|
219 |
+
<h1>
|
220 |
+
<?php _e('WP Force SSL', 'wp-force-ssl'); ?>
|
221 |
+
</h1>
|
222 |
+
|
223 |
+
<p>WP Force SSL is a one-click solution that helps redirect visitors from unsecure HTTP connection to a secure HTTPS one without the need to edit any code.<br>There's nothing to configure, just by activating the plugin everything is enabled and configured.</p>
|
224 |
+
|
225 |
+
<p>If you run into any problems <a href="https://wordpress.org/support/plugin/wp-force-ssl/" target="_blank">open a new topic</a> in the official support forum. We answer all questions within a few hours.</p>
|
226 |
+
|
227 |
+
<h2><br>Requirements for running a site on SSL</h2>
|
228 |
+
<ul class="ul-disc">
|
229 |
+
<li>If you already have an SSL certificate installed <a href="#" class="wpfs_test_ssl">test it</a> to make sure it works.
|
230 |
+
If you don't have one get <a href="https://wordpress.org/hosting/" target="_blank">quality hosting</a> that offers free certificates and installation.</li>
|
231 |
+
<li>Make sure "Force SSL" option below is enabled (green).</li>
|
232 |
+
<li>Check that <a href="<?php echo admin_url('options-general.php'); ?>" target="_blank">WP Address & Site Address</a> settings have an <code>https://</code> prefix set.</li>
|
233 |
+
</ul>
|
234 |
+
|
235 |
+
<h2><br><?php _e('Settings', 'wp-force-ssl'); ?></h2>
|
236 |
+
<form id="wpfs_form">
|
237 |
+
<table class="form-table">
|
238 |
+
<tbody>
|
239 |
+
<tr>
|
240 |
+
<th scope="row">
|
241 |
+
<label for="enable_ssl"><?php _e('Force SSL', 'wp-force-ssl'); ?></label>
|
242 |
+
</th>
|
243 |
+
<td>
|
244 |
+
<div class="toggle-wrapper">
|
245 |
+
<input type="checkbox" id="enable_ssl" <?php if ($this->wpfs_settings['wpfs_ssl'] == 'yes') echo 'checked'; ?> name="wpfs_ssl" value="yes">
|
246 |
+
<label for="enable_ssl" class="toggle"><span class="toggle_handler"></span></label>
|
247 |
+
</div>
|
248 |
+
<p class="description">Visitors will be automatically redirected from HTTP to HTTPS for all pages, posts and other WP content.</p>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
<tr>
|
252 |
+
<th scope="row">
|
253 |
+
<label for="enable_hsts"><?php _e('Enable HTTP Strict Transport Security (HSTS)', 'wp-force-ssl'); ?></label>
|
254 |
+
</th>
|
255 |
+
<td>
|
256 |
+
<div class="toggle-wrapper">
|
257 |
+
<input type="checkbox" id="enable_hsts" <?php if ($this->wpfs_settings['wpfs_hsts'] == 'yes') echo 'checked'; ?> name="wpfs_hsts" value="yes">
|
258 |
+
<label for="enable_hsts" class="toggle"><span class="toggle_handler"></span></label>
|
259 |
+
</div>
|
260 |
+
<p class="description">HSTS is a web security policy mechanism that helps to protect your site against protocol downgrade attacks and cookie hijacking.<br>It allows web servers to declare that web browsers should interact with it using only HTTPS connections.</p>
|
261 |
+
</td>
|
262 |
+
</tr>
|
263 |
+
</tbody>
|
264 |
+
</table>
|
265 |
+
<p>
|
266 |
+
<a id="wpfs_save_settings" name="submit" title="Save Changes" class="button button-primary" href="#">Save Changes</a>
|
267 |
+
<a href="#" class="button button-secondary wpfs_test_ssl">Test site's SSL certificate</a>
|
268 |
+
</p>
|
269 |
+
</form>
|
270 |
+
|
271 |
+
<p class="box">Did WP Force SSL help you make your site more secure?<br><a href="https://wordpress.org/support/plugin/wp-force-ssl/reviews/#new-post" target="_blank">Please rate it</a> so that others know too that it's free, simple & it works. <b>Thank you!</b></p>
|
272 |
+
</div>
|
273 |
+
<?php
|
274 |
+
} // settings_page_content
|
275 |
+
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Perform the redirect to HTTPS if loaded over HTTP
|
279 |
+
*
|
280 |
+
* @since 1.5
|
281 |
+
*
|
282 |
+
* @return null
|
283 |
+
*
|
284 |
+
*/
|
285 |
+
public function wpfs_core()
|
286 |
+
{
|
287 |
+
if (!is_ssl()) {
|
288 |
+
wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301);
|
289 |
+
exit();
|
290 |
+
}
|
291 |
+
} // wpfs_core
|
292 |
+
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Check if user has the minimal WP version required by WP Force SSL
|
296 |
+
*
|
297 |
+
* @since 1.5
|
298 |
+
*
|
299 |
+
* @return bool
|
300 |
+
*
|
301 |
+
*/
|
302 |
+
public function check_wp_version($min_version)
|
303 |
+
{
|
304 |
+
if (!version_compare(get_bloginfo('version'), $min_version, '>=')) {
|
305 |
+
add_action('admin_notices', array($this, 'notice_min_wp_version'));
|
306 |
+
return false;
|
307 |
+
} else {
|
308 |
+
return true;
|
309 |
+
}
|
310 |
+
} // check_wp_version
|
311 |
+
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Display error message if WP version is too low
|
315 |
+
*
|
316 |
+
* @since 1.5
|
317 |
+
*
|
318 |
+
* @return null
|
319 |
+
*
|
320 |
+
*/
|
321 |
+
public function notice_min_wp_version()
|
322 |
+
{
|
323 |
+
echo '<div class="error"><p>' . sprintf(__('WP Force SSL plugin <b>requires WordPress version 4.6</b> or higher to function properly. You are using WordPress version %s. Please <a href="%s">update it</a>.', 'wp-force-ssl'), get_bloginfo('version'), admin_url('update-core.php')) . '</p></div>';
|
324 |
+
} // notice_min_wp_version_error
|
325 |
+
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Add hook to filter plugin API result to add recommended addon plugins
|
329 |
+
*
|
330 |
+
* @since 1.5
|
331 |
+
*
|
332 |
+
* @return object args
|
333 |
+
*/
|
334 |
+
public function featured_plugins_tab($args)
|
335 |
+
{
|
336 |
+
add_filter('plugins_api_result', array($this, 'plugins_api_result'), 10);
|
337 |
+
|
338 |
+
return $args;
|
339 |
+
} // featured_plugins_tab
|
340 |
+
|
341 |
+
|
342 |
+
/**
|
343 |
+
* Append plugin favorites list with recommended addon plugins
|
344 |
+
*
|
345 |
+
* @since 1.5
|
346 |
+
*
|
347 |
+
* @return object API response
|
348 |
+
*/
|
349 |
+
public function plugins_api_result($res)
|
350 |
+
{
|
351 |
+
remove_filter('plugins_api_result', array($this, 'plugins_api_result'), 10);
|
352 |
+
$res = $this->add_plugin_favs('wp-reset', $res);
|
353 |
+
$res = $this->add_plugin_favs('eps-301-redirects', $res);
|
354 |
+
return $res;
|
355 |
+
} // plugins_api_result
|
356 |
+
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Create plugin favorites list plugin object
|
360 |
+
*
|
361 |
+
* @since 1.5
|
362 |
+
*
|
363 |
+
* @return object favorite plugins
|
364 |
+
*/
|
365 |
+
public function add_plugin_favs($plugin_slug, $res)
|
366 |
+
{
|
367 |
+
if (!isset($res->plugins) || !is_array($res->plugins)) {
|
368 |
+
return $res;
|
369 |
+
}
|
370 |
+
|
371 |
+
if (!empty($res->plugins) && is_array($res->plugins)) {
|
372 |
+
foreach ($res->plugins as $plugin) {
|
373 |
+
if (is_object($plugin) && !empty($plugin->slug) && $plugin->slug == $plugin_slug) {
|
374 |
+
return $res;
|
375 |
+
}
|
376 |
+
} // foreach
|
377 |
+
}
|
378 |
+
|
379 |
+
$plugin_info = get_transient('wf-plugin-info-' . $plugin_slug);
|
380 |
+
if ($plugin_info && is_object($plugin_info)) {
|
381 |
+
array_unshift($res->plugins, $plugin_info);
|
382 |
+
} else {
|
383 |
+
$plugin_info = plugins_api('plugin_information', array(
|
384 |
+
'slug' => $plugin_slug,
|
385 |
+
'is_ssl' => is_ssl(),
|
386 |
+
'fields' => array(
|
387 |
+
'banners' => true,
|
388 |
+
'reviews' => true,
|
389 |
+
'downloaded' => true,
|
390 |
+
'active_installs' => true,
|
391 |
+
'icons' => true,
|
392 |
+
'short_description' => true,
|
393 |
+
)
|
394 |
+
));
|
395 |
+
if (!is_wp_error($plugin_info)) {
|
396 |
+
array_unshift($res->plugins, $plugin_info);
|
397 |
+
set_transient('wf-plugin-info-' . $plugin_slug, $plugin_info, DAY_IN_SECONDS * 7);
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
return $res;
|
402 |
+
} // add_plugin_favs
|
403 |
+
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Send the HTTP Strict Transport Security (HSTS) header.
|
407 |
+
*
|
408 |
+
* @since 1.5
|
409 |
+
*
|
410 |
+
* @return null
|
411 |
+
*/
|
412 |
+
public function to_strict_transport_security()
|
413 |
+
{
|
414 |
+
header('Strict-Transport-Security: max-age=31536000; includeSubDomains; preload');
|
415 |
+
} // to_strict_transport_security
|
416 |
+
|
417 |
+
|
418 |
+
/**
|
419 |
+
* Save plugin settings received via AJAX
|
420 |
+
*
|
421 |
+
* @since 1.5
|
422 |
+
*
|
423 |
+
* @return null
|
424 |
+
*/
|
425 |
+
public function ajax_save_setting()
|
426 |
+
{
|
427 |
+
check_ajax_referer('save_settting_nonce_action');
|
428 |
+
|
429 |
+
$wpfs_ssl = isset($_POST['wpfs_ssl']) ? 'yes' : 'no';
|
430 |
+
$wpfs_hsts = isset($_POST['wpfs_hsts']) ? 'yes' : 'no';
|
431 |
+
|
432 |
+
$wpfs_settings = array(
|
433 |
+
'wpfs_ssl' => $wpfs_ssl,
|
434 |
+
'wpfs_hsts' => $wpfs_hsts
|
435 |
+
);
|
436 |
+
update_option(WPFSSL_OPTIONS_KEY, $wpfs_settings);
|
437 |
+
|
438 |
+
wp_send_json_success();
|
439 |
+
} // ajax_save_setting
|
440 |
+
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Check SSL Certificate by performing a request to home_url over https and send back a json response
|
444 |
+
*
|
445 |
+
* @since 1.5
|
446 |
+
*
|
447 |
+
* @return null
|
448 |
+
*/
|
449 |
+
public function ajax_check_ssl()
|
450 |
+
{
|
451 |
+
check_ajax_referer('test_ssl_nonce_action');
|
452 |
+
|
453 |
+
if (!version_compare(PHP_VERSION, '5.6', '>=')) {
|
454 |
+
wp_send_json_error(sprintf(__('WP Force SSL plugin <b>requires PHP version 5.6.20</b> or higher to function properly. You are using PHP version %s. Please <a href="%s" target="_blank">update it</a>.', 'wp-force-ssl'), PHP_VERSION, 'https://wordpress.org/support/update-php/'));
|
455 |
+
}
|
456 |
+
|
457 |
+
$url = home_url(false, 'https');
|
458 |
+
$response = $this->make_request($url);
|
459 |
+
|
460 |
+
if (!$response || !is_array($response)) {
|
461 |
+
wp_send_json_error(__('Unable to test SSL certificate. Assume it\'s NOT valid.', 'wp-force-ssl'));
|
462 |
+
} elseif (!empty($response['error'])) {
|
463 |
+
wp_send_json_error($response['error']);
|
464 |
+
} elseif ($response['code'] == 200 && !empty($response['body'])) {
|
465 |
+
wp_send_json_success(__('Valid SSL certificate found!', 'wp-force-ssl'));
|
466 |
+
} else {
|
467 |
+
wp_send_json_error(__('Valid SSL certificate was NOT found.', 'wp-force-ssl'));
|
468 |
+
}
|
469 |
+
} // check_ssl
|
470 |
+
|
471 |
+
|
472 |
+
/**
|
473 |
+
* Perform a POST request
|
474 |
+
*
|
475 |
+
* @since 1.5
|
476 |
+
*
|
477 |
+
* @param string $url
|
478 |
+
*
|
479 |
+
* @return array $response
|
480 |
+
*/
|
481 |
+
public function make_request($url = null)
|
482 |
+
{
|
483 |
+
if (empty($url)) {
|
484 |
+
$url = home_url(false, 'https');
|
485 |
+
}
|
486 |
+
|
487 |
+
$args = array(
|
488 |
+
'timeout' => 5,
|
489 |
+
'httpversion' => '1.1',
|
490 |
+
'sslverify' => true
|
491 |
+
);
|
492 |
+
|
493 |
+
$response = wp_remote_post($url, $args);
|
494 |
+
|
495 |
+
$error = '';
|
496 |
+
if (is_wp_error($response)) {
|
497 |
+
$error = $response->get_error_message();
|
498 |
+
}
|
499 |
+
|
500 |
+
$out = array(
|
501 |
+
'code' => wp_remote_retrieve_response_code($response),
|
502 |
+
'body' => wp_remote_retrieve_body($response),
|
503 |
+
'error' => $error
|
504 |
+
);
|
505 |
+
|
506 |
+
return $out;
|
507 |
+
} // make_request
|
508 |
+
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Check if currently on WP Force SSL settings page
|
512 |
+
*
|
513 |
+
* @since 1.5
|
514 |
+
*
|
515 |
+
* @return bool is on WP Force SSL settings page
|
516 |
+
*/
|
517 |
+
public function is_plugin_page()
|
518 |
+
{
|
519 |
+
$current_screen = get_current_screen();
|
520 |
+
if ($current_screen->id === 'settings_page_wpfs-settings') {
|
521 |
+
return true;
|
522 |
+
} else {
|
523 |
+
return false;
|
524 |
+
}
|
525 |
+
} // is_plugin_page
|
526 |
+
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Change admin footer text to show plugin information
|
530 |
+
*
|
531 |
+
* @since 1.5
|
532 |
+
*
|
533 |
+
* @param string $text_org original footer text
|
534 |
+
*
|
535 |
+
* @return string footer text html
|
536 |
+
*/
|
537 |
+
public function admin_footer_text($text_org)
|
538 |
+
{
|
539 |
+
if (false === $this->is_plugin_page()) {
|
540 |
+
return $text_org;
|
541 |
+
}
|
542 |
+
|
543 |
+
$text = '<i><a target="_blank" href="' . $this->generate_web_link('admin_footer') . '">WP Force SSL</a> v' . $this->version . ' by <a href="https://www.webfactoryltd.com/" title="' . __('Visit our site to get more great plugins', 'wp-force-ssl') . '" target="_blank">WebFactory Ltd</a>.';
|
544 |
+
$text .= ' Please <a target="_blank" href="https://wordpress.org/support/plugin/wp-force-ssl/reviews/#new-post" title="' . __('Rate the plugin', 'wp-force-ssl') . '">' . __('Rate the plugin ★★★★★', 'wp-force-ssl') . '</a>.</i> ';
|
545 |
+
return $text;
|
546 |
+
} // admin_footer_text
|
547 |
+
|
548 |
+
|
549 |
+
/**
|
550 |
+
* Generate web link
|
551 |
+
*
|
552 |
+
* @since 1.5
|
553 |
+
*
|
554 |
+
* @return string link html
|
555 |
+
*/
|
556 |
+
public function generate_web_link($placement = '', $page = '/', $params = array(), $anchor = '')
|
557 |
+
{
|
558 |
+
$base_url = 'https://wpforcessl.com';
|
559 |
+
if ('/' != $page) {
|
560 |
+
$page = '/' . trim($page, '/') . '/';
|
561 |
+
}
|
562 |
+
if ($page == '//') {
|
563 |
+
$page = '/';
|
564 |
+
}
|
565 |
+
|
566 |
+
$parts = array_merge(array('utm_source' => 'wp-force-ssl', 'utm_medium' => 'plugin', 'utm_content' => $placement, 'utm_campaign' => 'wp-force-ssl' . $this->version), $params);
|
567 |
+
if (!empty($anchor)) {
|
568 |
+
$anchor = '#' . trim($anchor, '#');
|
569 |
+
}
|
570 |
+
|
571 |
+
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
|
572 |
+
return $out;
|
573 |
+
} // generate_web_link
|
574 |
+
|
575 |
+
|
576 |
+
/**
|
577 |
+
* Activation hook, check if trying to activate on WP Network and exit if that's the case
|
578 |
+
*
|
579 |
+
* @since 1.5
|
580 |
+
*
|
581 |
+
* @return null
|
582 |
+
*/
|
583 |
+
public static function activate()
|
584 |
+
{
|
585 |
+
// Bail if activating from network, or bulk
|
586 |
+
if (is_network_admin() || isset($_GET['activate-multi'])) {
|
587 |
+
wp_die(__('Sorry, WP Force SSL is currently not compatible with WPMU.', 'wp-force-ssl'));
|
588 |
+
}
|
589 |
+
} // activate
|
590 |
+
|
591 |
+
|
592 |
+
/**
|
593 |
+
* Redirect to WP Force SSL settings page on activation
|
594 |
+
*
|
595 |
+
* @since 1.5
|
596 |
+
*
|
597 |
+
* @return null
|
598 |
+
*
|
599 |
+
*/
|
600 |
+
public function redirect_to_settings_page($plugin)
|
601 |
+
{
|
602 |
+
if ($plugin == plugin_basename(__FILE__)) {
|
603 |
+
wp_safe_redirect(
|
604 |
+
add_query_arg(
|
605 |
+
array(
|
606 |
+
'page' => 'wpfs-settings'
|
607 |
+
),
|
608 |
+
admin_url('options-general.php')
|
609 |
+
)
|
610 |
+
);
|
611 |
+
exit();
|
612 |
+
}
|
613 |
+
} // redirect_to_settings_page
|
614 |
+
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Clean-up on uninstall
|
618 |
+
*
|
619 |
+
* @since 1.5
|
620 |
+
*
|
621 |
+
* @return null
|
622 |
+
*/
|
623 |
+
public static function uninstall()
|
624 |
+
{
|
625 |
+
delete_option(WPFSSL_OPTIONS_KEY);
|
626 |
+
delete_option(WPFSSL_META_KEY);
|
627 |
+
} // uninstall
|
628 |
+
|
629 |
+
|
630 |
+
/**
|
631 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled.
|
632 |
+
*
|
633 |
+
* @since 1.5
|
634 |
+
*
|
635 |
+
* @return null
|
636 |
+
*/
|
637 |
+
private function __clone()
|
638 |
+
{ }
|
639 |
+
|
640 |
+
|
641 |
+
/**
|
642 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled.
|
643 |
+
*
|
644 |
+
* @since 1.5
|
645 |
+
*
|
646 |
+
* @return null
|
647 |
+
*/
|
648 |
+
private function __sleep()
|
649 |
+
{ }
|
650 |
+
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Disabled; we use singleton pattern so magic functions need to be disabled.
|
654 |
+
*
|
655 |
+
* @since 1.5
|
656 |
+
*
|
657 |
+
* @return null
|
658 |
+
*/
|
659 |
+
private function __wakeup()
|
660 |
+
{ }
|
661 |
+
// end class
|
662 |
+
}
|
663 |
+
|
664 |
+
|
665 |
+
$wpfs = wpForceSSL::getInstance();
|
666 |
+
add_action('plugins_loaded', array($wpfs, 'plugins_loaded'));
|
667 |
+
add_action('activated_plugin', array($wpfs, 'redirect_to_settings_page'));
|
668 |
+
register_activation_hook(__FILE__, array('wpForceSSL', 'activate'));
|
669 |
+
register_uninstall_hook(__FILE__, array('wpForceSSL', 'uninstall'));
|