Version Description
(2022-06-19) =
* [Changed]
Calculation of number of images to be converted
* [Added]
Resizing of images before conversion
* [Added]
Notification asking to clear cache for LiteSpeed
Download this release
Release Info
Developer | mateuszgbiorczyk |
Plugin | Converter for Media – Optimize images | Convert WebP & AVIF |
Version | 4.4.0 |
Comparing to | |
See all releases |
Code changes from version 4.3.6 to 4.4.0
- assets/build/css/styles.css +1 -1
- assets/build/js/scripts.js +1 -1
- changelog.txt +5 -0
- readme.txt +5 -0
- src/Action/ConvertPaths.php +1 -4
- src/Action/DeletePaths.php +10 -1
- src/Conversion/Directory/DirectoryIntegration.php +10 -1
- src/Conversion/DirectoryFiles.php +14 -19
- src/Conversion/Endpoint/ImagesCounterEndpoint.php +6 -16
- src/Conversion/Method/GdMethod.php +2 -2
- src/Conversion/Method/LibraryMethodAbstract.php +1 -0
- src/Conversion/Method/MethodAbstract.php +10 -1
- src/Conversion/Method/RemoteMethod.php +14 -25
- src/Conversion/OutputPath.php +51 -14
- src/Conversion/PathsFinder.php +82 -5
- src/Conversion/PathsValidator.php +0 -33
- src/Conversion/SkipConvertedPaths.php +0 -120
- src/Error/Detector/RewritesErrorsDetector.php +14 -3
- src/Notice/LitespeedNotice.php +80 -0
- src/Plugin/Activation/DefaultSettings.php +2 -0
- src/Plugin/Deactivation/PluginSettings.php +2 -0
- src/Plugin/Uninstall/PluginSettings.php +2 -0
- src/Settings/Option/AccessTokenOption.php +2 -2
- src/Settings/Option/ConversionMethodOption.php +16 -5
- src/Settings/Option/ExtraFeaturesOption.php +1 -1
- src/Settings/Option/ImageResizeOption.php +134 -0
- src/Settings/Option/LoaderTypeOption.php +1 -1
- src/Settings/Option/OptionAbstract.php +6 -5
- src/Settings/Option/OptionIntegration.php +13 -0
- src/Settings/Option/OptionsAggregator.php +9 -5
- src/Settings/Option/OutputFormatsOption.php +16 -5
- src/Settings/Option/SupportedExtensionsOption.php +2 -2
- src/WebpConverter.php +1 -1
- templates/components/fields/checkbox.php +1 -1
- templates/components/fields/image_size.php +52 -0
- templates/components/fields/input.php +1 -1
- templates/components/fields/quality.php +1 -1
- templates/components/fields/radio.php +1 -1
- templates/components/fields/token.php +1 -1
- templates/components/notices/cloudflare.php +5 -1
- templates/components/notices/litespeed.php +62 -0
- vendor/composer/autoload_classmap.php +2 -2
- vendor/composer/autoload_static.php +2 -2
- vendor/composer/installed.php +2 -2
- webp-converter-for-media.php +2 -2
assets/build/css/styles.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@charset "UTF-8";@keyframes dotsLoading{0%,to{content:"..."}25%{content:" .."}50%{content:". ."}75%{content:".. "}}@font-face{font-family:webpc-icomoon;font-style:normal;font-weight:400;src:url(../../fonts/icons/icomoon.eot?ver=19411202);src:url(../../fonts/icons/icomoon.woff?ver=19411202) format("woff"),url(../../fonts/icons/icomoon.eot?ver=19411202#iefix) format("embedded-opentype"),url(../../fonts/icons/icomoon.ttf?ver=19411202) format("truetype"),url(../../fonts/icons/icomoon.svg?ver=19411202#icomoon) format("svg")}.icon-logo:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.webpPage{color:#101517;margin:0;overflow:hidden;padding:0 20px 0 0}.webpPage *,.webpPage :after,.webpPage :before{box-sizing:border-box;margin:0;padding:0}.webpPage [hidden]{display:none!important}.webpPage .webpPage__headline{font-size:24px;line-height:1.2083333333;margin:0;padding:15px 0 23px}.webpPage__alert{background-color:#00a32a;color:#fff;font-size:14px;line-height:1.5714285714;margin-bottom:30px;padding:15px 20px}.webpPage__columns{margin:0 -30px;overflow:hidden}.webpPage__column{float:left;padding:0 30px}.webpPage__column--large{width:66.666%}.webpPage__column--small{width:33.333%}.webpPage__widget{background-color:#fff}.webpPage__widget+.webpPage__widget{margin-top:60px}.webpPage__widgetTitle{background-color:#2271b1;color:#fff;font-size:16px;font-weight:400;line-height:1.5;padding:14px 30px}.webpPage__widgetTitle--second{background-color:#a7aaad}.webpPage__widgetTitle--error{background-color:#d63638}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__widgetColumns{display:flex;flex-wrap:wrap;margin:0 -10px}.webpPage__widgetColumn{padding:0 10px;width:50%}.webpPage__widgetColumn:first-child:last-child{flex:1}.webpPage__widgetColumnNotice{background-color:#2271b1;margin:10px 0;padding:10px 20px}.webpPage__widgetColumnNotice p{color:#fff;font-size:1.2rem}.webpPage__widgetColumnNotice p+p{margin-top:0}.webpPage__widgetColumnNotice p a{color:inherit;font-weight:500;letter-spacing:1px;text-decoration:none;text-transform:uppercase}.webpPage__quality{border:1px solid #c3c4c7;display:flex;flex-wrap:wrap;margin:10px 0}.webpPage__qualityItem{border-left:1px solid #c3c4c7;flex:1;margin-left:-1px;text-align:center}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{display:block;font-size:14px;line-height:1.5714285714;padding:14px 20px;position:relative;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{background-color:#00a32a;color:#fff;margin:-1px;padding:15px 21px}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}#wp-admin-bar-webpc-menu .ab-icon:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.notice[data-notice=webp-converter-for-media]{padding:0}.notice[data-notice=webp-converter-for-media]~.notice[data-notice=webp-converter-for-media]{display:none}.webpButton{background-color:#fff;border:1px solid transparent;box-shadow:none!important;box-sizing:border-box;cursor:pointer;display:inline-block;font-size:14px;font-weight:500;line-height:1.5714285714;min-width:180px;opacity:1!important;outline:none!important;padding:9px 30px;position:relative;text-align:center;text-decoration:none!important;transition:color .3s!important;z-index:10}p>.webpButton{margin:6px 0}.webpButton:before{float:left;font-family:dashicons;font-size:20px;line-height:1.1;margin-right:10px}.webpButton:after{content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0;z-index:-1}.webpButton:hover:after{width:100%}.webpButton[disabled]{opacity:.5!important;pointer-events:none}.webpButton--blue:hover,.webpButton--gray:hover,.webpButton--green:hover,.webpButton--red:hover{color:#fff!important}.webpButton--blue{border-color:#2271b1;color:#2271b1!important}.webpButton--blue.webpButton--bg,.webpButton--blue:after{background-color:#2271b1}.webpButton--blue.webpButton--bg:after{background-color:#135e96}.webpButton--green{border-color:#00a32a;color:#00a32a!important}.webpButton--green.webpButton--bg,.webpButton--green:after{background-color:#00a32a}.webpButton--green.webpButton--bg:after{background-color:#008a20}.webpButton--red{border-color:#d63638;color:#d63638!important}.webpButton--red.webpButton--bg,.webpButton--red:after{background-color:#d63638}.webpButton--red.webpButton--bg:after{background-color:#b32d2e}.webpButton--gray{border-color:#c3c4c7;color:#c3c4c7!important}.webpButton--gray.webpButton--bg,.webpButton--gray:after{background-color:#c3c4c7}.webpButton--gray.webpButton--bg:after{background-color:#a7aaad}.webpButton--bg{color:#fff!important;font-weight:400}.webpContent{padding:20px 30px}.webpContent--author{background-image:url(../../img/author.png);background-position:left calc(100% - 30px);background-repeat:no-repeat;background-size:152px 152px;margin-left:20px;padding-left:172px}.webpContent p{font-size:14px;line-height:1.5714285714;max-width:800px}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{box-shadow:none;color:#2271b1;outline:none;text-decoration:underline;transition:opacity .3s}.webpContent a:hover{opacity:.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6{font-size:16px;font-weight:500;line-height:1.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6,.webpContent p{margin:10px 0 0;padding:4px 0}.webpContent h1:first-child,.webpContent h2:first-child,.webpContent h3:first-child,.webpContent h4:first-child,.webpContent h5:first-child,.webpContent h6:first-child,.webpContent p:first-child,.webpContent p>p{margin-top:0}.webpInput+p{background-color:#f0f0f1;margin:0 0 10px;max-width:none;padding:14px 20px}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{font-size:12px;line-height:1.75;margin-top:0}.webpContent--notice h1+p,.webpContent--notice h2+p,.webpContent--notice h3+p,.webpContent--notice h4+p,.webpContent--notice h5+p,.webpContent--notice h6+p{font-size:14px;line-height:1.5714285714}.webpContent__buttons{margin-top:-10px;overflow:hidden;padding:10px 0}.webpContent__button{float:left;margin:20px 20px 0 0}.webpContent__button:last-child{margin-right:0}.webpField{display:flex;padding:10px 0}.webpField+.webpField{margin-top:-12px}.webpField__input{display:none!important}.webpField__input+label{display:inline-block;position:relative}.webpField__input[disabled]+label{pointer-events:none}.webpField__input[disabled]+label:after,.webpField__input[disabled]+label:before{opacity:.25}.webpField__input--checkbox+label,.webpField__input--radio+label{height:22px;width:22px}.webpField__input--checkbox+label:after,.webpField__input--checkbox+label:before,.webpField__input--radio+label:after,.webpField__input--radio+label:before{align-items:center;content:"";display:flex;height:22px;justify-content:center;left:0;position:absolute;top:0;width:22px}.webpField__input--checkbox+label:before,.webpField__input--radio+label:before{border:1px solid #c3c4c7}.webpField__input--checkbox+label:after,.webpField__input--radio+label:after{position:absolute;transform:scale(0);transition:transform .3s}.webpField__input--checkbox:checked+label:after,.webpField__input--radio:checked+label:after{transform:scale(1)}.webpField__input--checkbox+label:after{color:#00a32a;content:"\f147";font-family:dashicons;font-size:20px;line-height:1}.webpField__input--radio+label:before{border-radius:50%}.webpField__input--radio+label:after{background-color:#00a32a;border-radius:50%;content:"";height:6px;left:8px;top:8px;width:6px}.webpField__input--toggle+label{height:22px;width:44px}.webpField__input--toggle+label:after,.webpField__input--toggle+label:before{content:"";position:absolute}.webpField__input--toggle+label:before{background-color:#dcdcde;border:1px solid #c3c4c7;border-radius:11px;height:22px;left:0;top:0;transition:background-color .3s;width:44px}.webpField__input--toggle+label:after{background-color:#fff;border-radius:50%;height:16px;left:3px;position:absolute;top:3px;transition:transform .3s;width:16px}.webpField__input--toggle:checked+label:before{background-color:#00a32a}.webpField__input--toggle:checked+label:after{transform:translateX(22px)}.webpField__label{display:block;flex:1;font-size:14px;line-height:1.5714285714;margin-left:20px;max-width:650px;position:relative}.webpInput{align-items:center;display:flex;padding:10px 0}.webpInput__field{border:1px solid #c3c4c7!important;border-radius:0!important;box-shadow:none!important;flex:1;font-size:14px!important;line-height:1.5714285714!important;padding:9px 15px!important}.webpInput__field[readonly]{background-color:#f0f0f1}.webpInput__button{margin:0 0 0 10px!important}.webpLoader__status{padding:20px 0 10px;position:relative}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{font-size:0;height:21px;line-height:0;position:relative}.webpLoader__barProgress:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpLoader__barProgress--error:before{background-color:#d63638}.webpLoader__barProgress[data-percent="0"]:before{width:0}.webpLoader__barProgress[data-percent="1"]:before{width:1%}.webpLoader__barProgress[data-percent="2"]:before{width:2%}.webpLoader__barProgress[data-percent="3"]:before{width:3%}.webpLoader__barProgress[data-percent="4"]:before{width:4%}.webpLoader__barProgress[data-percent="5"]:before{width:5%}.webpLoader__barProgress[data-percent="6"]:before{width:6%}.webpLoader__barProgress[data-percent="7"]:before{width:7%}.webpLoader__barProgress[data-percent="8"]:before{width:8%}.webpLoader__barProgress[data-percent="9"]:before{width:9%}.webpLoader__barProgress[data-percent="10"]:before{width:10%}.webpLoader__barProgress[data-percent="11"]:before{width:11%}.webpLoader__barProgress[data-percent="12"]:before{width:12%}.webpLoader__barProgress[data-percent="13"]:before{width:13%}.webpLoader__barProgress[data-percent="14"]:before{width:14%}.webpLoader__barProgress[data-percent="15"]:before{width:15%}.webpLoader__barProgress[data-percent="16"]:before{width:16%}.webpLoader__barProgress[data-percent="17"]:before{width:17%}.webpLoader__barProgress[data-percent="18"]:before{width:18%}.webpLoader__barProgress[data-percent="19"]:before{width:19%}.webpLoader__barProgress[data-percent="20"]:before{width:20%}.webpLoader__barProgress[data-percent="21"]:before{width:21%}.webpLoader__barProgress[data-percent="22"]:before{width:22%}.webpLoader__barProgress[data-percent="23"]:before{width:23%}.webpLoader__barProgress[data-percent="24"]:before{width:24%}.webpLoader__barProgress[data-percent="25"]:before{width:25%}.webpLoader__barProgress[data-percent="26"]:before{width:26%}.webpLoader__barProgress[data-percent="27"]:before{width:27%}.webpLoader__barProgress[data-percent="28"]:before{width:28%}.webpLoader__barProgress[data-percent="29"]:before{width:29%}.webpLoader__barProgress[data-percent="30"]:before{width:30%}.webpLoader__barProgress[data-percent="31"]:before{width:31%}.webpLoader__barProgress[data-percent="32"]:before{width:32%}.webpLoader__barProgress[data-percent="33"]:before{width:33%}.webpLoader__barProgress[data-percent="34"]:before{width:34%}.webpLoader__barProgress[data-percent="35"]:before{width:35%}.webpLoader__barProgress[data-percent="36"]:before{width:36%}.webpLoader__barProgress[data-percent="37"]:before{width:37%}.webpLoader__barProgress[data-percent="38"]:before{width:38%}.webpLoader__barProgress[data-percent="39"]:before{width:39%}.webpLoader__barProgress[data-percent="40"]:before{width:40%}.webpLoader__barProgress[data-percent="41"]:before{width:41%}.webpLoader__barProgress[data-percent="42"]:before{width:42%}.webpLoader__barProgress[data-percent="43"]:before{width:43%}.webpLoader__barProgress[data-percent="44"]:before{width:44%}.webpLoader__barProgress[data-percent="45"]:before{width:45%}.webpLoader__barProgress[data-percent="46"]:before{width:46%}.webpLoader__barProgress[data-percent="47"]:before{width:47%}.webpLoader__barProgress[data-percent="48"]:before{width:48%}.webpLoader__barProgress[data-percent="49"]:before{width:49%}.webpLoader__barProgress[data-percent="50"]:before{width:50%}.webpLoader__barProgress[data-percent="51"]:before{width:51%}.webpLoader__barProgress[data-percent="52"]:before{width:52%}.webpLoader__barProgress[data-percent="53"]:before{width:53%}.webpLoader__barProgress[data-percent="54"]:before{width:54%}.webpLoader__barProgress[data-percent="55"]:before{width:55%}.webpLoader__barProgress[data-percent="56"]:before{width:56%}.webpLoader__barProgress[data-percent="57"]:before{width:57%}.webpLoader__barProgress[data-percent="58"]:before{width:58%}.webpLoader__barProgress[data-percent="59"]:before{width:59%}.webpLoader__barProgress[data-percent="60"]:before{width:60%}.webpLoader__barProgress[data-percent="61"]:before{width:61%}.webpLoader__barProgress[data-percent="62"]:before{width:62%}.webpLoader__barProgress[data-percent="63"]:before{width:63%}.webpLoader__barProgress[data-percent="64"]:before{width:64%}.webpLoader__barProgress[data-percent="65"]:before{width:65%}.webpLoader__barProgress[data-percent="66"]:before{width:66%}.webpLoader__barProgress[data-percent="67"]:before{width:67%}.webpLoader__barProgress[data-percent="68"]:before{width:68%}.webpLoader__barProgress[data-percent="69"]:before{width:69%}.webpLoader__barProgress[data-percent="70"]:before{width:70%}.webpLoader__barProgress[data-percent="71"]:before{width:71%}.webpLoader__barProgress[data-percent="72"]:before{width:72%}.webpLoader__barProgress[data-percent="73"]:before{width:73%}.webpLoader__barProgress[data-percent="74"]:before{width:74%}.webpLoader__barProgress[data-percent="75"]:before{width:75%}.webpLoader__barProgress[data-percent="76"]:before{width:76%}.webpLoader__barProgress[data-percent="77"]:before{width:77%}.webpLoader__barProgress[data-percent="78"]:before{width:78%}.webpLoader__barProgress[data-percent="79"]:before{width:79%}.webpLoader__barProgress[data-percent="80"]:before{width:80%}.webpLoader__barProgress[data-percent="81"]:before{width:81%}.webpLoader__barProgress[data-percent="82"]:before{width:82%}.webpLoader__barProgress[data-percent="83"]:before{width:83%}.webpLoader__barProgress[data-percent="84"]:before{width:84%}.webpLoader__barProgress[data-percent="85"]:before{width:85%}.webpLoader__barProgress[data-percent="86"]:before{width:86%}.webpLoader__barProgress[data-percent="87"]:before{width:87%}.webpLoader__barProgress[data-percent="88"]:before{width:88%}.webpLoader__barProgress[data-percent="89"]:before{width:89%}.webpLoader__barProgress[data-percent="90"]:before{width:90%}.webpLoader__barProgress[data-percent="91"]:before{width:91%}.webpLoader__barProgress[data-percent="92"]:before{width:92%}.webpLoader__barProgress[data-percent="93"]:before{width:93%}.webpLoader__barProgress[data-percent="94"]:before{width:94%}.webpLoader__barProgress[data-percent="95"]:before{width:95%}.webpLoader__barProgress[data-percent="96"]:before{width:96%}.webpLoader__barProgress[data-percent="97"]:before{width:97%}.webpLoader__barProgress[data-percent="98"]:before{width:98%}.webpLoader__barProgress[data-percent="99"]:before{width:99%}.webpLoader__barProgress[data-percent="100"]:before{width:100%}.webpLoader__barCount{background-color:#00a32a;color:#fff;display:inline-block;font-family:monospace;font-size:12px;line-height:1.75;padding:0 5px;position:relative}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#d63638}.webpLoader__barCount:after{animation:dotsLoading 1s linear infinite;content:"...";margin-left:5px}.webpLoader__barProgress--error .webpLoader__barCount:after,.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:after{display:none}.webpLoader__barProgress[data-percent="0"] .webpLoader__barCount:before{content:"0%"}.webpLoader__barProgress[data-percent="1"] .webpLoader__barCount:before{content:"1%"}.webpLoader__barProgress[data-percent="2"] .webpLoader__barCount:before{content:"2%"}.webpLoader__barProgress[data-percent="3"] .webpLoader__barCount:before{content:"3%"}.webpLoader__barProgress[data-percent="4"] .webpLoader__barCount:before{content:"4%"}.webpLoader__barProgress[data-percent="5"] .webpLoader__barCount:before{content:"5%"}.webpLoader__barProgress[data-percent="6"] .webpLoader__barCount:before{content:"6%"}.webpLoader__barProgress[data-percent="7"] .webpLoader__barCount:before{content:"7%"}.webpLoader__barProgress[data-percent="8"] .webpLoader__barCount:before{content:"8%"}.webpLoader__barProgress[data-percent="9"] .webpLoader__barCount:before{content:"9%"}.webpLoader__barProgress[data-percent="10"] .webpLoader__barCount:before{content:"10%"}.webpLoader__barProgress[data-percent="11"] .webpLoader__barCount:before{content:"11%"}.webpLoader__barProgress[data-percent="12"] .webpLoader__barCount:before{content:"12%"}.webpLoader__barProgress[data-percent="13"] .webpLoader__barCount:before{content:"13%"}.webpLoader__barProgress[data-percent="14"] .webpLoader__barCount:before{content:"14%"}.webpLoader__barProgress[data-percent="15"] .webpLoader__barCount:before{content:"15%"}.webpLoader__barProgress[data-percent="16"] .webpLoader__barCount:before{content:"16%"}.webpLoader__barProgress[data-percent="17"] .webpLoader__barCount:before{content:"17%"}.webpLoader__barProgress[data-percent="18"] .webpLoader__barCount:before{content:"18%"}.webpLoader__barProgress[data-percent="19"] .webpLoader__barCount:before{content:"19%"}.webpLoader__barProgress[data-percent="20"] .webpLoader__barCount:before{content:"20%"}.webpLoader__barProgress[data-percent="21"] .webpLoader__barCount:before{content:"21%"}.webpLoader__barProgress[data-percent="22"] .webpLoader__barCount:before{content:"22%"}.webpLoader__barProgress[data-percent="23"] .webpLoader__barCount:before{content:"23%"}.webpLoader__barProgress[data-percent="24"] .webpLoader__barCount:before{content:"24%"}.webpLoader__barProgress[data-percent="25"] .webpLoader__barCount:before{content:"25%"}.webpLoader__barProgress[data-percent="26"] .webpLoader__barCount:before{content:"26%"}.webpLoader__barProgress[data-percent="27"] .webpLoader__barCount:before{content:"27%"}.webpLoader__barProgress[data-percent="28"] .webpLoader__barCount:before{content:"28%"}.webpLoader__barProgress[data-percent="29"] .webpLoader__barCount:before{content:"29%"}.webpLoader__barProgress[data-percent="30"] .webpLoader__barCount:before{content:"30%"}.webpLoader__barProgress[data-percent="31"] .webpLoader__barCount:before{content:"31%"}.webpLoader__barProgress[data-percent="32"] .webpLoader__barCount:before{content:"32%"}.webpLoader__barProgress[data-percent="33"] .webpLoader__barCount:before{content:"33%"}.webpLoader__barProgress[data-percent="34"] .webpLoader__barCount:before{content:"34%"}.webpLoader__barProgress[data-percent="35"] .webpLoader__barCount:before{content:"35%"}.webpLoader__barProgress[data-percent="36"] .webpLoader__barCount:before{content:"36%"}.webpLoader__barProgress[data-percent="37"] .webpLoader__barCount:before{content:"37%"}.webpLoader__barProgress[data-percent="38"] .webpLoader__barCount:before{content:"38%"}.webpLoader__barProgress[data-percent="39"] .webpLoader__barCount:before{content:"39%"}.webpLoader__barProgress[data-percent="40"] .webpLoader__barCount:before{content:"40%"}.webpLoader__barProgress[data-percent="41"] .webpLoader__barCount:before{content:"41%"}.webpLoader__barProgress[data-percent="42"] .webpLoader__barCount:before{content:"42%"}.webpLoader__barProgress[data-percent="43"] .webpLoader__barCount:before{content:"43%"}.webpLoader__barProgress[data-percent="44"] .webpLoader__barCount:before{content:"44%"}.webpLoader__barProgress[data-percent="45"] .webpLoader__barCount:before{content:"45%"}.webpLoader__barProgress[data-percent="46"] .webpLoader__barCount:before{content:"46%"}.webpLoader__barProgress[data-percent="47"] .webpLoader__barCount:before{content:"47%"}.webpLoader__barProgress[data-percent="48"] .webpLoader__barCount:before{content:"48%"}.webpLoader__barProgress[data-percent="49"] .webpLoader__barCount:before{content:"49%"}.webpLoader__barProgress[data-percent="50"] .webpLoader__barCount:before{content:"50%"}.webpLoader__barProgress[data-percent="51"] .webpLoader__barCount:before{content:"51%"}.webpLoader__barProgress[data-percent="52"] .webpLoader__barCount:before{content:"52%"}.webpLoader__barProgress[data-percent="53"] .webpLoader__barCount:before{content:"53%"}.webpLoader__barProgress[data-percent="54"] .webpLoader__barCount:before{content:"54%"}.webpLoader__barProgress[data-percent="55"] .webpLoader__barCount:before{content:"55%"}.webpLoader__barProgress[data-percent="56"] .webpLoader__barCount:before{content:"56%"}.webpLoader__barProgress[data-percent="57"] .webpLoader__barCount:before{content:"57%"}.webpLoader__barProgress[data-percent="58"] .webpLoader__barCount:before{content:"58%"}.webpLoader__barProgress[data-percent="59"] .webpLoader__barCount:before{content:"59%"}.webpLoader__barProgress[data-percent="60"] .webpLoader__barCount:before{content:"60%"}.webpLoader__barProgress[data-percent="61"] .webpLoader__barCount:before{content:"61%"}.webpLoader__barProgress[data-percent="62"] .webpLoader__barCount:before{content:"62%"}.webpLoader__barProgress[data-percent="63"] .webpLoader__barCount:before{content:"63%"}.webpLoader__barProgress[data-percent="64"] .webpLoader__barCount:before{content:"64%"}.webpLoader__barProgress[data-percent="65"] .webpLoader__barCount:before{content:"65%"}.webpLoader__barProgress[data-percent="66"] .webpLoader__barCount:before{content:"66%"}.webpLoader__barProgress[data-percent="67"] .webpLoader__barCount:before{content:"67%"}.webpLoader__barProgress[data-percent="68"] .webpLoader__barCount:before{content:"68%"}.webpLoader__barProgress[data-percent="69"] .webpLoader__barCount:before{content:"69%"}.webpLoader__barProgress[data-percent="70"] .webpLoader__barCount:before{content:"70%"}.webpLoader__barProgress[data-percent="71"] .webpLoader__barCount:before{content:"71%"}.webpLoader__barProgress[data-percent="72"] .webpLoader__barCount:before{content:"72%"}.webpLoader__barProgress[data-percent="73"] .webpLoader__barCount:before{content:"73%"}.webpLoader__barProgress[data-percent="74"] .webpLoader__barCount:before{content:"74%"}.webpLoader__barProgress[data-percent="75"] .webpLoader__barCount:before{content:"75%"}.webpLoader__barProgress[data-percent="76"] .webpLoader__barCount:before{content:"76%"}.webpLoader__barProgress[data-percent="77"] .webpLoader__barCount:before{content:"77%"}.webpLoader__barProgress[data-percent="78"] .webpLoader__barCount:before{content:"78%"}.webpLoader__barProgress[data-percent="79"] .webpLoader__barCount:before{content:"79%"}.webpLoader__barProgress[data-percent="80"] .webpLoader__barCount:before{content:"80%"}.webpLoader__barProgress[data-percent="81"] .webpLoader__barCount:before{content:"81%"}.webpLoader__barProgress[data-percent="82"] .webpLoader__barCount:before{content:"82%"}.webpLoader__barProgress[data-percent="83"] .webpLoader__barCount:before{content:"83%"}.webpLoader__barProgress[data-percent="84"] .webpLoader__barCount:before{content:"84%"}.webpLoader__barProgress[data-percent="85"] .webpLoader__barCount:before{content:"85%"}.webpLoader__barProgress[data-percent="86"] .webpLoader__barCount:before{content:"86%"}.webpLoader__barProgress[data-percent="87"] .webpLoader__barCount:before{content:"87%"}.webpLoader__barProgress[data-percent="88"] .webpLoader__barCount:before{content:"88%"}.webpLoader__barProgress[data-percent="89"] .webpLoader__barCount:before{content:"89%"}.webpLoader__barProgress[data-percent="90"] .webpLoader__barCount:before{content:"90%"}.webpLoader__barProgress[data-percent="91"] .webpLoader__barCount:before{content:"91%"}.webpLoader__barProgress[data-percent="92"] .webpLoader__barCount:before{content:"92%"}.webpLoader__barProgress[data-percent="93"] .webpLoader__barCount:before{content:"93%"}.webpLoader__barProgress[data-percent="94"] .webpLoader__barCount:before{content:"94%"}.webpLoader__barProgress[data-percent="95"] .webpLoader__barCount:before{content:"95%"}.webpLoader__barProgress[data-percent="96"] .webpLoader__barCount:before{content:"96%"}.webpLoader__barProgress[data-percent="97"] .webpLoader__barCount:before{content:"97%"}.webpLoader__barProgress[data-percent="98"] .webpLoader__barCount:before{content:"98%"}.webpLoader__barProgress[data-percent="99"] .webpLoader__barCount:before{content:"99%"}.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:before{content:"100%"}.webpLoader__progress{font-size:14px;line-height:1.5714285714;margin-bottom:-10px;padding:4px 0}.webpLoader__progressValue{font-weight:500}.webpLoader__success{margin-top:20px;padding:4px 0 4px 20px;position:relative}.webpLoader__success:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;width:2px}.webpLoader__successContent{color:#00a32a;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__successContent a{color:inherit}.webpLoader__errors{border-left:2px solid #c3c4c7;margin-top:20px}.webpLoader__errorsTitle{background-color:#c3c4c7;color:#fff;display:inline-block;font-size:14px;line-height:1.5714285714;padding:4px 22px}.webpLoader__errorsContent{padding:10px 0 10px 20px}.webpLoader__errorsContent>p{font-size:12px;line-height:1.75;margin:0;max-width:100%}.webpLoader__errorsContent>p.webpLoader__errorsContentError{color:#d63638;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__errorsContent pre{font-size:12px;line-height:1.75;white-space:normal}.webpLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpPopup{margin-top:20px}.webpPopup__inner{background-color:#fff;border:1px solid #c3c4c7;display:flex;flex-wrap:wrap}.webpPopup__image{background-image:url(../../img/author.png);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpPopup__content{border-left:1px solid #c3c4c7;flex:1;padding:10px 20px}.webpServerInfo{color:#222;text-align:center}.webpServerInfo pre{font-family:monospace;margin:0}.webpServerInfo h1,.webpServerInfo h2{display:none}.webpServerInfo p{max-width:100%}.webpServerInfo table{border:0;border-collapse:collapse;margin:10px auto;width:100%}.webpServerInfo td,.webpServerInfo th{border:1px solid #666;font-family:monospace;font-size:12px;line-height:1.75;padding:4px 5px;text-align:center;vertical-align:baseline}.webpServerInfo .p{text-align:left}.webpServerInfo .e{background-color:#ccf;font-weight:700;width:300px}.webpServerInfo .h{background-color:#99c;font-weight:700}.webpServerInfo .v{word-wrap:break-word;background-color:#ddd;max-width:300px;overflow-x:auto}.webpServerInfo .v i{color:#999}.webpServerInfo img{border:0;float:right}@media screen and (max-width:1024px){.webpPage__column--large{width:100%}.webpPage__column--small{margin-top:40px;width:100%}.webpPage__widget+.webpPage__widget{margin-top:40px}.webpPage__widgetColumns{display:block}.webpPage__widgetColumn{width:100%}}@media screen and (max-width:782px){.webpPage{padding-right:0}.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #c3c4c7}.webpContent--author{background:none;margin-left:0;padding-left:30px}.webpInput{display:block}.webpInput__field{width:100%}.webpInput__button{margin:10px 0 0!important}.webpPopup__inner{border:1px solid #c3c4c7;display:block}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border-left:0}}
|
1 |
+
@charset "UTF-8";@keyframes dotsLoading{0%,to{content:"..."}25%{content:" .."}50%{content:". ."}75%{content:".. "}}@font-face{font-family:webpc-icomoon;font-style:normal;font-weight:400;src:url(../../fonts/icons/icomoon.eot?ver=15144553);src:url(../../fonts/icons/icomoon.woff?ver=15144553) format("woff"),url(../../fonts/icons/icomoon.eot?ver=15144553#iefix) format("embedded-opentype"),url(../../fonts/icons/icomoon.ttf?ver=15144553) format("truetype"),url(../../fonts/icons/icomoon.svg?ver=15144553#icomoon) format("svg")}.icon-logo:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.webpPage{color:#101517;margin:0;overflow:hidden;padding:0 20px 0 0}.webpPage *,.webpPage :after,.webpPage :before{box-sizing:border-box;margin:0;padding:0}.webpPage [hidden]{display:none!important}.webpPage .webpPage__headline{font-size:24px;line-height:1.2083333333;margin:0;padding:15px 0 23px}.webpPage__alert{background-color:#00a32a;color:#fff;font-size:14px;line-height:1.5714285714;margin-bottom:30px;padding:15px 20px}.webpPage__columns{margin:0 -30px;overflow:hidden}.webpPage__column{float:left;padding:0 30px}.webpPage__column--large{width:66.666%}.webpPage__column--small{width:33.333%}.webpPage__widget{background-color:#fff}.webpPage__widget+.webpPage__widget{margin-top:60px}.webpPage__widgetTitle{background-color:#2271b1;color:#fff;font-size:16px;font-weight:400;line-height:1.5;padding:14px 30px}.webpPage__widgetTitle--second{background-color:#a7aaad}.webpPage__widgetTitle--error{background-color:#d63638}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__widgetColumns{display:flex;flex-wrap:wrap;margin:0 -10px}.webpPage__widgetColumn{padding:0 10px;width:50%}.webpPage__widgetColumn:first-child:last-child{flex:1}.webpPage__widgetColumnNotice{background-color:#2271b1;margin:10px 0;padding:10px 20px}.webpPage__widgetColumnNotice p{color:#fff;font-size:1.2rem}.webpPage__widgetColumnNotice p+p{margin-top:0}.webpPage__widgetColumnNotice p a{color:inherit;font-weight:500;letter-spacing:1px;text-decoration:none;text-transform:uppercase}.webpPage__quality{border:1px solid #c3c4c7;display:flex;flex-wrap:wrap;margin:10px 0}.webpPage__qualityItem{border-left:1px solid #c3c4c7;flex:1;margin-left:-1px;text-align:center}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{display:block;font-size:14px;line-height:1.5714285714;padding:14px 20px;position:relative;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{background-color:#00a32a;color:#fff;margin:-1px;padding:15px 21px}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}#wp-admin-bar-webpc-menu .ab-icon:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.notice[data-notice=webp-converter-for-media]{padding:0}.notice[data-notice=webp-converter-for-media]~.notice[data-notice=webp-converter-for-media]{display:none}.webpButton{background-color:#fff;border:1px solid transparent;box-shadow:none!important;box-sizing:border-box;cursor:pointer;display:inline-block;font-size:14px;font-weight:500;line-height:1.5714285714;min-width:180px;opacity:1!important;outline:none!important;padding:9px 30px;position:relative;text-align:center;text-decoration:none!important;transition:color .3s!important;z-index:10}p>.webpButton{margin:6px 0}.webpButton:before{float:left;font-family:dashicons;font-size:20px;line-height:1.1;margin-right:10px}.webpButton:after{content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0;z-index:-1}.webpButton:hover:after{width:100%}.webpButton[disabled]{opacity:.5!important;pointer-events:none}.webpButton--blue:hover,.webpButton--gray:hover,.webpButton--green:hover,.webpButton--red:hover{color:#fff!important}.webpButton--blue{border-color:#2271b1;color:#2271b1!important}.webpButton--blue.webpButton--bg,.webpButton--blue:after{background-color:#2271b1}.webpButton--blue.webpButton--bg:after{background-color:#135e96}.webpButton--green{border-color:#00a32a;color:#00a32a!important}.webpButton--green.webpButton--bg,.webpButton--green:after{background-color:#00a32a}.webpButton--green.webpButton--bg:after{background-color:#008a20}.webpButton--red{border-color:#d63638;color:#d63638!important}.webpButton--red.webpButton--bg,.webpButton--red:after{background-color:#d63638}.webpButton--red.webpButton--bg:after{background-color:#b32d2e}.webpButton--gray{border-color:#c3c4c7;color:#c3c4c7!important}.webpButton--gray.webpButton--bg,.webpButton--gray:after{background-color:#c3c4c7}.webpButton--gray.webpButton--bg:after{background-color:#a7aaad}.webpButton--bg{color:#fff!important;font-weight:400}.webpContent{padding:20px 30px}.webpContent--author{background-image:url(../../img/author.png);background-position:left calc(100% - 30px);background-repeat:no-repeat;background-size:152px 152px;margin-left:20px;padding-left:172px}.webpContent p{font-size:14px;line-height:1.5714285714;max-width:800px}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{box-shadow:none;color:#2271b1;outline:none;text-decoration:underline;transition:opacity .3s}.webpContent a:hover{opacity:.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6{font-size:16px;font-weight:500;line-height:1.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6,.webpContent p{margin:10px 0 0;padding:4px 0}.webpContent h1:first-child,.webpContent h2:first-child,.webpContent h3:first-child,.webpContent h4:first-child,.webpContent h5:first-child,.webpContent h6:first-child,.webpContent p:first-child,.webpContent p>p{margin-top:0}.webpInput+p{background-color:#f0f0f1;margin:0 0 10px;max-width:none;padding:14px 20px}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{font-size:12px;line-height:1.75;margin-top:0}.webpContent--notice h1+p,.webpContent--notice h2+p,.webpContent--notice h3+p,.webpContent--notice h4+p,.webpContent--notice h5+p,.webpContent--notice h6+p{font-size:14px;line-height:1.5714285714}.webpContent__buttons{margin-top:-10px;overflow:hidden;padding:10px 0}.webpContent__button{float:left;margin:20px 20px 0 0}.webpContent__button:last-child{margin-right:0}.webpField{display:flex;padding:10px 0}.webpField--center{align-items:center}.webpField+.webpField{margin-top:-12px}.webpField__input{display:none!important}.webpField__input+label{display:inline-block;position:relative}.webpField__input[disabled]+label{pointer-events:none}.webpField__input[disabled]+label:after,.webpField__input[disabled]+label:before{opacity:.25}.webpField__input--checkbox+label,.webpField__input--radio+label{height:22px;width:22px}.webpField__input--checkbox+label:after,.webpField__input--checkbox+label:before,.webpField__input--radio+label:after,.webpField__input--radio+label:before{align-items:center;content:"";display:flex;height:22px;justify-content:center;left:0;position:absolute;top:0;width:22px}.webpField__input--checkbox+label:before,.webpField__input--radio+label:before{border:1px solid #c3c4c7}.webpField__input--checkbox+label:after,.webpField__input--radio+label:after{position:absolute;transform:scale(0);transition:transform .3s}.webpField__input--checkbox:checked+label:after,.webpField__input--radio:checked+label:after{transform:scale(1)}.webpField__input--checkbox+label:after{color:#00a32a;content:"\f147";font-family:dashicons;font-size:20px;line-height:1}.webpField__input--radio+label:before{border-radius:50%}.webpField__input--radio+label:after{background-color:#00a32a;border-radius:50%;content:"";height:6px;left:8px;top:8px;width:6px}.webpField__input--toggle+label{height:22px;width:44px}.webpField__input--toggle+label:after,.webpField__input--toggle+label:before{content:"";position:absolute}.webpField__input--toggle+label:before{background-color:#dcdcde;border:1px solid #c3c4c7;border-radius:11px;height:22px;left:0;top:0;transition:background-color .3s;width:44px}.webpField__input--toggle+label:after{background-color:#fff;border-radius:50%;height:16px;left:3px;position:absolute;top:3px;transition:transform .3s;width:16px}.webpField__input--toggle:checked+label:before{background-color:#00a32a}.webpField__input--toggle:checked+label:after{transform:translateX(22px)}.webpField__label{display:block;font-size:14px;line-height:1.5714285714;max-width:650px;position:relative}.webpField__input~.webpField__label{margin-left:20px}.webpInput{align-items:center;display:flex;padding:10px 0}.webpInput__field{border:1px solid #c3c4c7!important;border-radius:0!important;box-shadow:none!important;flex:1;font-size:14px!important;line-height:1.5714285714!important;padding:9px 15px!important}.webpInput__field--small{margin:0 10px;padding:4px 10px!important;width:80px}.webpInput__field[readonly]{background-color:#f0f0f1}.webpInput__button{margin:0 0 0 10px!important}.webpLoader__status{padding:20px 0 10px;position:relative}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{font-size:0;height:21px;line-height:0;position:relative}.webpLoader__barProgress:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpLoader__barProgress--error:before{background-color:#d63638}.webpLoader__barProgress[data-percent="0"]:before{width:0}.webpLoader__barProgress[data-percent="1"]:before{width:1%}.webpLoader__barProgress[data-percent="2"]:before{width:2%}.webpLoader__barProgress[data-percent="3"]:before{width:3%}.webpLoader__barProgress[data-percent="4"]:before{width:4%}.webpLoader__barProgress[data-percent="5"]:before{width:5%}.webpLoader__barProgress[data-percent="6"]:before{width:6%}.webpLoader__barProgress[data-percent="7"]:before{width:7%}.webpLoader__barProgress[data-percent="8"]:before{width:8%}.webpLoader__barProgress[data-percent="9"]:before{width:9%}.webpLoader__barProgress[data-percent="10"]:before{width:10%}.webpLoader__barProgress[data-percent="11"]:before{width:11%}.webpLoader__barProgress[data-percent="12"]:before{width:12%}.webpLoader__barProgress[data-percent="13"]:before{width:13%}.webpLoader__barProgress[data-percent="14"]:before{width:14%}.webpLoader__barProgress[data-percent="15"]:before{width:15%}.webpLoader__barProgress[data-percent="16"]:before{width:16%}.webpLoader__barProgress[data-percent="17"]:before{width:17%}.webpLoader__barProgress[data-percent="18"]:before{width:18%}.webpLoader__barProgress[data-percent="19"]:before{width:19%}.webpLoader__barProgress[data-percent="20"]:before{width:20%}.webpLoader__barProgress[data-percent="21"]:before{width:21%}.webpLoader__barProgress[data-percent="22"]:before{width:22%}.webpLoader__barProgress[data-percent="23"]:before{width:23%}.webpLoader__barProgress[data-percent="24"]:before{width:24%}.webpLoader__barProgress[data-percent="25"]:before{width:25%}.webpLoader__barProgress[data-percent="26"]:before{width:26%}.webpLoader__barProgress[data-percent="27"]:before{width:27%}.webpLoader__barProgress[data-percent="28"]:before{width:28%}.webpLoader__barProgress[data-percent="29"]:before{width:29%}.webpLoader__barProgress[data-percent="30"]:before{width:30%}.webpLoader__barProgress[data-percent="31"]:before{width:31%}.webpLoader__barProgress[data-percent="32"]:before{width:32%}.webpLoader__barProgress[data-percent="33"]:before{width:33%}.webpLoader__barProgress[data-percent="34"]:before{width:34%}.webpLoader__barProgress[data-percent="35"]:before{width:35%}.webpLoader__barProgress[data-percent="36"]:before{width:36%}.webpLoader__barProgress[data-percent="37"]:before{width:37%}.webpLoader__barProgress[data-percent="38"]:before{width:38%}.webpLoader__barProgress[data-percent="39"]:before{width:39%}.webpLoader__barProgress[data-percent="40"]:before{width:40%}.webpLoader__barProgress[data-percent="41"]:before{width:41%}.webpLoader__barProgress[data-percent="42"]:before{width:42%}.webpLoader__barProgress[data-percent="43"]:before{width:43%}.webpLoader__barProgress[data-percent="44"]:before{width:44%}.webpLoader__barProgress[data-percent="45"]:before{width:45%}.webpLoader__barProgress[data-percent="46"]:before{width:46%}.webpLoader__barProgress[data-percent="47"]:before{width:47%}.webpLoader__barProgress[data-percent="48"]:before{width:48%}.webpLoader__barProgress[data-percent="49"]:before{width:49%}.webpLoader__barProgress[data-percent="50"]:before{width:50%}.webpLoader__barProgress[data-percent="51"]:before{width:51%}.webpLoader__barProgress[data-percent="52"]:before{width:52%}.webpLoader__barProgress[data-percent="53"]:before{width:53%}.webpLoader__barProgress[data-percent="54"]:before{width:54%}.webpLoader__barProgress[data-percent="55"]:before{width:55%}.webpLoader__barProgress[data-percent="56"]:before{width:56%}.webpLoader__barProgress[data-percent="57"]:before{width:57%}.webpLoader__barProgress[data-percent="58"]:before{width:58%}.webpLoader__barProgress[data-percent="59"]:before{width:59%}.webpLoader__barProgress[data-percent="60"]:before{width:60%}.webpLoader__barProgress[data-percent="61"]:before{width:61%}.webpLoader__barProgress[data-percent="62"]:before{width:62%}.webpLoader__barProgress[data-percent="63"]:before{width:63%}.webpLoader__barProgress[data-percent="64"]:before{width:64%}.webpLoader__barProgress[data-percent="65"]:before{width:65%}.webpLoader__barProgress[data-percent="66"]:before{width:66%}.webpLoader__barProgress[data-percent="67"]:before{width:67%}.webpLoader__barProgress[data-percent="68"]:before{width:68%}.webpLoader__barProgress[data-percent="69"]:before{width:69%}.webpLoader__barProgress[data-percent="70"]:before{width:70%}.webpLoader__barProgress[data-percent="71"]:before{width:71%}.webpLoader__barProgress[data-percent="72"]:before{width:72%}.webpLoader__barProgress[data-percent="73"]:before{width:73%}.webpLoader__barProgress[data-percent="74"]:before{width:74%}.webpLoader__barProgress[data-percent="75"]:before{width:75%}.webpLoader__barProgress[data-percent="76"]:before{width:76%}.webpLoader__barProgress[data-percent="77"]:before{width:77%}.webpLoader__barProgress[data-percent="78"]:before{width:78%}.webpLoader__barProgress[data-percent="79"]:before{width:79%}.webpLoader__barProgress[data-percent="80"]:before{width:80%}.webpLoader__barProgress[data-percent="81"]:before{width:81%}.webpLoader__barProgress[data-percent="82"]:before{width:82%}.webpLoader__barProgress[data-percent="83"]:before{width:83%}.webpLoader__barProgress[data-percent="84"]:before{width:84%}.webpLoader__barProgress[data-percent="85"]:before{width:85%}.webpLoader__barProgress[data-percent="86"]:before{width:86%}.webpLoader__barProgress[data-percent="87"]:before{width:87%}.webpLoader__barProgress[data-percent="88"]:before{width:88%}.webpLoader__barProgress[data-percent="89"]:before{width:89%}.webpLoader__barProgress[data-percent="90"]:before{width:90%}.webpLoader__barProgress[data-percent="91"]:before{width:91%}.webpLoader__barProgress[data-percent="92"]:before{width:92%}.webpLoader__barProgress[data-percent="93"]:before{width:93%}.webpLoader__barProgress[data-percent="94"]:before{width:94%}.webpLoader__barProgress[data-percent="95"]:before{width:95%}.webpLoader__barProgress[data-percent="96"]:before{width:96%}.webpLoader__barProgress[data-percent="97"]:before{width:97%}.webpLoader__barProgress[data-percent="98"]:before{width:98%}.webpLoader__barProgress[data-percent="99"]:before{width:99%}.webpLoader__barProgress[data-percent="100"]:before{width:100%}.webpLoader__barCount{background-color:#00a32a;color:#fff;display:inline-block;font-family:monospace;font-size:12px;line-height:1.75;padding:0 5px;position:relative}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#d63638}.webpLoader__barCount:after{animation:dotsLoading 1s linear infinite;content:"...";margin-left:5px}.webpLoader__barProgress--error .webpLoader__barCount:after,.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:after{display:none}.webpLoader__barProgress[data-percent="0"] .webpLoader__barCount:before{content:"0%"}.webpLoader__barProgress[data-percent="1"] .webpLoader__barCount:before{content:"1%"}.webpLoader__barProgress[data-percent="2"] .webpLoader__barCount:before{content:"2%"}.webpLoader__barProgress[data-percent="3"] .webpLoader__barCount:before{content:"3%"}.webpLoader__barProgress[data-percent="4"] .webpLoader__barCount:before{content:"4%"}.webpLoader__barProgress[data-percent="5"] .webpLoader__barCount:before{content:"5%"}.webpLoader__barProgress[data-percent="6"] .webpLoader__barCount:before{content:"6%"}.webpLoader__barProgress[data-percent="7"] .webpLoader__barCount:before{content:"7%"}.webpLoader__barProgress[data-percent="8"] .webpLoader__barCount:before{content:"8%"}.webpLoader__barProgress[data-percent="9"] .webpLoader__barCount:before{content:"9%"}.webpLoader__barProgress[data-percent="10"] .webpLoader__barCount:before{content:"10%"}.webpLoader__barProgress[data-percent="11"] .webpLoader__barCount:before{content:"11%"}.webpLoader__barProgress[data-percent="12"] .webpLoader__barCount:before{content:"12%"}.webpLoader__barProgress[data-percent="13"] .webpLoader__barCount:before{content:"13%"}.webpLoader__barProgress[data-percent="14"] .webpLoader__barCount:before{content:"14%"}.webpLoader__barProgress[data-percent="15"] .webpLoader__barCount:before{content:"15%"}.webpLoader__barProgress[data-percent="16"] .webpLoader__barCount:before{content:"16%"}.webpLoader__barProgress[data-percent="17"] .webpLoader__barCount:before{content:"17%"}.webpLoader__barProgress[data-percent="18"] .webpLoader__barCount:before{content:"18%"}.webpLoader__barProgress[data-percent="19"] .webpLoader__barCount:before{content:"19%"}.webpLoader__barProgress[data-percent="20"] .webpLoader__barCount:before{content:"20%"}.webpLoader__barProgress[data-percent="21"] .webpLoader__barCount:before{content:"21%"}.webpLoader__barProgress[data-percent="22"] .webpLoader__barCount:before{content:"22%"}.webpLoader__barProgress[data-percent="23"] .webpLoader__barCount:before{content:"23%"}.webpLoader__barProgress[data-percent="24"] .webpLoader__barCount:before{content:"24%"}.webpLoader__barProgress[data-percent="25"] .webpLoader__barCount:before{content:"25%"}.webpLoader__barProgress[data-percent="26"] .webpLoader__barCount:before{content:"26%"}.webpLoader__barProgress[data-percent="27"] .webpLoader__barCount:before{content:"27%"}.webpLoader__barProgress[data-percent="28"] .webpLoader__barCount:before{content:"28%"}.webpLoader__barProgress[data-percent="29"] .webpLoader__barCount:before{content:"29%"}.webpLoader__barProgress[data-percent="30"] .webpLoader__barCount:before{content:"30%"}.webpLoader__barProgress[data-percent="31"] .webpLoader__barCount:before{content:"31%"}.webpLoader__barProgress[data-percent="32"] .webpLoader__barCount:before{content:"32%"}.webpLoader__barProgress[data-percent="33"] .webpLoader__barCount:before{content:"33%"}.webpLoader__barProgress[data-percent="34"] .webpLoader__barCount:before{content:"34%"}.webpLoader__barProgress[data-percent="35"] .webpLoader__barCount:before{content:"35%"}.webpLoader__barProgress[data-percent="36"] .webpLoader__barCount:before{content:"36%"}.webpLoader__barProgress[data-percent="37"] .webpLoader__barCount:before{content:"37%"}.webpLoader__barProgress[data-percent="38"] .webpLoader__barCount:before{content:"38%"}.webpLoader__barProgress[data-percent="39"] .webpLoader__barCount:before{content:"39%"}.webpLoader__barProgress[data-percent="40"] .webpLoader__barCount:before{content:"40%"}.webpLoader__barProgress[data-percent="41"] .webpLoader__barCount:before{content:"41%"}.webpLoader__barProgress[data-percent="42"] .webpLoader__barCount:before{content:"42%"}.webpLoader__barProgress[data-percent="43"] .webpLoader__barCount:before{content:"43%"}.webpLoader__barProgress[data-percent="44"] .webpLoader__barCount:before{content:"44%"}.webpLoader__barProgress[data-percent="45"] .webpLoader__barCount:before{content:"45%"}.webpLoader__barProgress[data-percent="46"] .webpLoader__barCount:before{content:"46%"}.webpLoader__barProgress[data-percent="47"] .webpLoader__barCount:before{content:"47%"}.webpLoader__barProgress[data-percent="48"] .webpLoader__barCount:before{content:"48%"}.webpLoader__barProgress[data-percent="49"] .webpLoader__barCount:before{content:"49%"}.webpLoader__barProgress[data-percent="50"] .webpLoader__barCount:before{content:"50%"}.webpLoader__barProgress[data-percent="51"] .webpLoader__barCount:before{content:"51%"}.webpLoader__barProgress[data-percent="52"] .webpLoader__barCount:before{content:"52%"}.webpLoader__barProgress[data-percent="53"] .webpLoader__barCount:before{content:"53%"}.webpLoader__barProgress[data-percent="54"] .webpLoader__barCount:before{content:"54%"}.webpLoader__barProgress[data-percent="55"] .webpLoader__barCount:before{content:"55%"}.webpLoader__barProgress[data-percent="56"] .webpLoader__barCount:before{content:"56%"}.webpLoader__barProgress[data-percent="57"] .webpLoader__barCount:before{content:"57%"}.webpLoader__barProgress[data-percent="58"] .webpLoader__barCount:before{content:"58%"}.webpLoader__barProgress[data-percent="59"] .webpLoader__barCount:before{content:"59%"}.webpLoader__barProgress[data-percent="60"] .webpLoader__barCount:before{content:"60%"}.webpLoader__barProgress[data-percent="61"] .webpLoader__barCount:before{content:"61%"}.webpLoader__barProgress[data-percent="62"] .webpLoader__barCount:before{content:"62%"}.webpLoader__barProgress[data-percent="63"] .webpLoader__barCount:before{content:"63%"}.webpLoader__barProgress[data-percent="64"] .webpLoader__barCount:before{content:"64%"}.webpLoader__barProgress[data-percent="65"] .webpLoader__barCount:before{content:"65%"}.webpLoader__barProgress[data-percent="66"] .webpLoader__barCount:before{content:"66%"}.webpLoader__barProgress[data-percent="67"] .webpLoader__barCount:before{content:"67%"}.webpLoader__barProgress[data-percent="68"] .webpLoader__barCount:before{content:"68%"}.webpLoader__barProgress[data-percent="69"] .webpLoader__barCount:before{content:"69%"}.webpLoader__barProgress[data-percent="70"] .webpLoader__barCount:before{content:"70%"}.webpLoader__barProgress[data-percent="71"] .webpLoader__barCount:before{content:"71%"}.webpLoader__barProgress[data-percent="72"] .webpLoader__barCount:before{content:"72%"}.webpLoader__barProgress[data-percent="73"] .webpLoader__barCount:before{content:"73%"}.webpLoader__barProgress[data-percent="74"] .webpLoader__barCount:before{content:"74%"}.webpLoader__barProgress[data-percent="75"] .webpLoader__barCount:before{content:"75%"}.webpLoader__barProgress[data-percent="76"] .webpLoader__barCount:before{content:"76%"}.webpLoader__barProgress[data-percent="77"] .webpLoader__barCount:before{content:"77%"}.webpLoader__barProgress[data-percent="78"] .webpLoader__barCount:before{content:"78%"}.webpLoader__barProgress[data-percent="79"] .webpLoader__barCount:before{content:"79%"}.webpLoader__barProgress[data-percent="80"] .webpLoader__barCount:before{content:"80%"}.webpLoader__barProgress[data-percent="81"] .webpLoader__barCount:before{content:"81%"}.webpLoader__barProgress[data-percent="82"] .webpLoader__barCount:before{content:"82%"}.webpLoader__barProgress[data-percent="83"] .webpLoader__barCount:before{content:"83%"}.webpLoader__barProgress[data-percent="84"] .webpLoader__barCount:before{content:"84%"}.webpLoader__barProgress[data-percent="85"] .webpLoader__barCount:before{content:"85%"}.webpLoader__barProgress[data-percent="86"] .webpLoader__barCount:before{content:"86%"}.webpLoader__barProgress[data-percent="87"] .webpLoader__barCount:before{content:"87%"}.webpLoader__barProgress[data-percent="88"] .webpLoader__barCount:before{content:"88%"}.webpLoader__barProgress[data-percent="89"] .webpLoader__barCount:before{content:"89%"}.webpLoader__barProgress[data-percent="90"] .webpLoader__barCount:before{content:"90%"}.webpLoader__barProgress[data-percent="91"] .webpLoader__barCount:before{content:"91%"}.webpLoader__barProgress[data-percent="92"] .webpLoader__barCount:before{content:"92%"}.webpLoader__barProgress[data-percent="93"] .webpLoader__barCount:before{content:"93%"}.webpLoader__barProgress[data-percent="94"] .webpLoader__barCount:before{content:"94%"}.webpLoader__barProgress[data-percent="95"] .webpLoader__barCount:before{content:"95%"}.webpLoader__barProgress[data-percent="96"] .webpLoader__barCount:before{content:"96%"}.webpLoader__barProgress[data-percent="97"] .webpLoader__barCount:before{content:"97%"}.webpLoader__barProgress[data-percent="98"] .webpLoader__barCount:before{content:"98%"}.webpLoader__barProgress[data-percent="99"] .webpLoader__barCount:before{content:"99%"}.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:before{content:"100%"}.webpLoader__progress{font-size:14px;line-height:1.5714285714;margin-bottom:-10px;padding:4px 0}.webpLoader__progressValue{font-weight:500}.webpLoader__success{margin-top:20px;padding:4px 0 4px 20px;position:relative}.webpLoader__success:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;width:2px}.webpLoader__successContent{color:#00a32a;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__successContent a{color:inherit}.webpLoader__errors{border-left:2px solid #c3c4c7;margin-top:20px}.webpLoader__errorsTitle{background-color:#c3c4c7;color:#fff;display:inline-block;font-size:14px;line-height:1.5714285714;padding:4px 22px}.webpLoader__errorsContent{padding:10px 0 10px 20px}.webpLoader__errorsContent>p{font-size:12px;line-height:1.75;margin:0;max-width:100%}.webpLoader__errorsContent>p.webpLoader__errorsContentError{color:#d63638;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__errorsContent pre{font-size:12px;line-height:1.75;white-space:normal}.webpLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpPopup{margin-top:20px}.webpPopup__inner{background-color:#fff;border:1px solid #c3c4c7;display:flex;flex-wrap:wrap}.webpPopup__image{background-image:url(../../img/author.png);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpPopup__content{border-left:1px solid #c3c4c7;flex:1;padding:10px 20px}.webpServerInfo{color:#222;text-align:center}.webpServerInfo pre{font-family:monospace;margin:0}.webpServerInfo h1,.webpServerInfo h2{display:none}.webpServerInfo p{max-width:100%}.webpServerInfo table{border:0;border-collapse:collapse;margin:10px auto;width:100%}.webpServerInfo td,.webpServerInfo th{border:1px solid #666;font-family:monospace;font-size:12px;line-height:1.75;padding:4px 5px;text-align:center;vertical-align:baseline}.webpServerInfo .p{text-align:left}.webpServerInfo .e{background-color:#ccf;font-weight:700;width:300px}.webpServerInfo .h{background-color:#99c;font-weight:700}.webpServerInfo .v{word-wrap:break-word;background-color:#ddd;max-width:300px;overflow-x:auto}.webpServerInfo .v i{color:#999}.webpServerInfo img{border:0;float:right}@media screen and (max-width:1280px){.webpPage__columns{margin:0 -15px}.webpPage__column{padding:0 15px}.webpPage__widget+.webpPage__widget{margin-top:30px}}@media screen and (max-width:1024px){.webpPage__column--large{width:100%}.webpPage__column--small{margin-top:40px;width:100%}.webpPage__widgetColumns{display:block}.webpPage__widgetColumn{width:100%}}@media screen and (max-width:782px){.webpPage{padding-right:0}.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #c3c4c7}.webpContent--author{background:none;margin-left:0;padding-left:30px}.webpInput{display:block}.webpInput__field{width:100%}.webpInput__button{margin:10px 0 0!important}.webpPopup__inner{border:1px solid #c3c4c7;display:block}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border-left:0}}
|
assets/build/js/scripts.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){var e,t={669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),o=r(26),i=r(372),s=r(327),a=r(97),u=r(109),c=r(985),f=r(61);e.exports=function(e){return new Promise((function(t,r){var l=e.data,d=e.headers,h=e.responseType;n.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+v)}var g=a(e.baseURL,e.url);function _(){if(p){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,i={data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,r,i),p=null}}if(p.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(_)},p.onabort=function(){p&&(r(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(f("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(g))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),l||(l=null),p.send(l)}))}},609:function(e,t,r){"use strict";var n=r(867),o=r(849),i=r(321),s=r(185);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var u=a(r(655));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),o=r(327),i=r(782),s=r(572),a=r(185),u=r(875),c=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift());return o}for(var l=e;r.length;){var d=r.shift(),h=r.shift();try{l=d(l)}catch(e){h(e);break}}try{o=s(l)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},f.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},782:function(e,t,r){"use strict";var n=r(867);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},97:function(e,t,r){"use strict";var n=r(793),o=r(303);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,o,i){var s=new Error(e);return n(s,t,r,o,i)}},572:function(e,t,r){"use strict";var n=r(867),o=r(527),i=r(502),s=r(655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(i,c),n.forEach(s,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=o.concat(i).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(l,c),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),o=r(655);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(155),o=r(867),i=r(16),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,f={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(448)),c),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||n&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};f.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){f.headers[e]=o.merge(a)})),e.exports=f},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:function(e,t,r){"use strict";var n=r(867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(593),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}o.transitional=function(e,t,r){var o=t&&a(t);return function(s,a,u){if(!1===e)throw new Error(function(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(a," has been removed in "+t));return o&&!i[a]&&(i[a]=!0),!e||e(s,a,u)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},867:function(e,t,r){"use strict";var n=r(849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},712:function(e,t,r){"use strict";var n=r(669),o=r.n(n);function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector("[data-calculate-widget]"),this.section)return this.button=this.section.querySelector("[data-calculate-widget-button]"),this.loading=this.section.querySelector("[data-calculate-widget-loading]"),this.output=this.section.querySelector("[data-calculate-widget-output]"),this.settings={ajax:{url_calculation:this.section.getAttribute("data-calculate-widget-api")}},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_calculation.bind(this))}},{key:"init_calculation",value:function(e){e.preventDefault(),this.button.setAttribute("hidden","hidden"),this.output.setAttribute("hidden","hidden"),this.loading.removeAttribute("hidden"),this.send_request_for_calculation()}},{key:"send_request_for_calculation",value:function(){var e=this,t=this.settings.ajax.url_calculation,r=new Date;o()({method:"GET",url:t}).then((function(t){e.loading.setAttribute("hidden","hidden"),e.output.innerText=t.data.value_output,e.output.removeAttribute("hidden","hidden")})).catch((function(t){if(e.button.removeAttribute("hidden"),e.loading.setAttribute("hidden","hidden"),t.response){var n=(new Date-r)/1e3,o=t.response.status,i=JSON.stringify(t.response.data);e.output.innerText="HTTP Error ".concat(o," (").concat(n,"s): ").concat(i),e.output.removeAttribute("hidden","hidden")}}))}}])&&i(t.prototype,r),n&&i(t,n),e}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(t){a(this,e),this.notice=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){return this.settings={ajax_action:this.notice.getAttribute("data-notice-action"),ajax_url:this.notice.getAttribute("data-notice-url"),button_close_class:".notice-dismiss",button_hide_class:"[data-permanently]"},this.events={click_on_close:this.click_on_close.bind(this)},!0}},{key:"set_events",value:function(){this.notice.addEventListener("click",this.events.click_on_close)}},{key:"click_on_close",value:function(e){var t=this.settings,r=t.button_close_class,n=t.button_hide_class;this.notice.removeEventListener("click",this.events.click_on_close),e.target.matches(r)?this.hide_notice(!1):e.target.matches(n)&&this.hide_notice(!0)}},{key:"hide_notice",value:function(e){var t=this.settings.button_close_class;this.send_request(e),e&&this.notice.querySelector(t).click()}},{key:"send_request",value:function(e){var t=this.settings.ajax_url;o()({method:"POST",url:t,data:this.get_data_for_request(e)})}},{key:"get_data_for_request",value:function(e){var t=this.settings.ajax_action,r=new FormData;return r.append("action",t),r.append("is_permanently",e?1:0),r}}])&&u(t.prototype,r),n&&u(t,n),e}(),f=function e(){a(this,e);for(var t=document.querySelectorAll('.notice[data-notice="webp-converter-for-media"][data-notice-action]'),r=t.length,n=0;n<r;n++)new c(t[n])};function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var d=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector(".webpLoader"),this.section)return this.wrapper=this.section.querySelector(".webpLoader__status"),this.progress=this.wrapper.querySelector(".webpLoader__barProgress"),this.progress_size=this.section.querySelector(".webpLoader__progressValue--size"),this.progress_successful=this.section.querySelector(".webpLoader__progressValue--successful"),this.progress_failed=this.section.querySelector(".webpLoader__progressValue--failed"),this.errors=this.section.querySelector(".webpLoader__errors"),this.errors_inner=this.errors.querySelector(".webpLoader__errorsContent"),this.success=this.section.querySelector(".webpLoader__success"),this.success_popup=this.section.querySelector(".webpLoader__popup"),this.option_force=this.section.querySelector('input[name="regenerate_force"]'),this.button=this.section.querySelector(".webpLoader__button"),this.data={count:0,max:0,items:[],size:{before:0,after:0},files:{all:0,converted:0},errors:0},this.settings={is_disabled:!1,ajax:{url_paths:this.section.getAttribute("data-api-paths"),url_regenerate:this.section.getAttribute("data-api-regenerate"),error_message:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"],max_errors:1e3,connection_timeout:6e4},this.atts={progress:"data-percent"},this.classes={progress_error:"webpLoader__barProgress--error",button_disabled:"webpLoader__button--disabled",error_message:"webpLoader__errorsContentError"},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_regeneration.bind(this))}},{key:"init_regeneration",value:function(e){e.preventDefault(),this.settings.is_disabled||(this.settings.is_disabled=!0,this.button.classList.add(this.classes.button_disabled),this.option_force.setAttribute("disabled","disabled"),this.wrapper.removeAttribute("hidden"),this.send_request_for_paths())}},{key:"send_request_for_paths",value:function(){var e=this,t=this.settings.ajax.url_paths;o()({method:"POST",url:t,data:{regenerate_force:this.option_force.checked?1:0}}).then((function(t){e.data.items=t.data,e.data.max=t.data.length,e.regenerate_next_images()})).catch((function(t){e.catch_request_error(t,!0)}))}},{key:"regenerate_next_images",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0===this.data.max&&this.update_progress(),!(this.data.count>=this.data.max)){e&&this.data.count--;var t=this.data.items[this.data.count];this.data.count++,this.send_request_for_regeneration(t)}}},{key:"send_request_for_regeneration",value:function(e){var t=this,r=this.settings.ajax.url_regenerate;o()({method:"POST",url:r,data:{regenerate_force:this.option_force.checked?1:0,paths:e},timeout:this.settings.connection_timeout}).then((function(e){var r=e.data.is_fatal_error;t.update_errors(e.data.errors,r),r||(t.update_size(e.data),t.update_files_count(e.data),t.update_progress(),t.regenerate_next_images())})).catch((function(r){r.response?(t.catch_request_error(r,!1,e),setTimeout(t.regenerate_next_images.bind(t),1e3)):setTimeout(t.regenerate_next_images.bind(t,!0),1e3)}))}},{key:"update_errors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.data.errors>this.settings.max_errors&&(this.data.errors=0,this.errors_inner.innerHTML="");for(var r=this.get_date(),n=0;n<e.length;n++)this.print_error_message(e[n],t,!1,r),this.data.errors++;t&&this.set_fatal_error()}},{key:"get_date",value:function(){var e=new Date,t=("0"+e.getHours()).substr(-2),r=("0"+e.getMinutes()).substr(-2),n=("0"+e.getSeconds()).substr(-2);return"".concat(t,":").concat(r,":").concat(n)}},{key:"set_fatal_error",value:function(){this.progress.classList.add(this.classes.progress_error)}},{key:"catch_request_error",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&(this.print_error_message([this.settings.ajax.error_message],!0,!1),this.set_fatal_error());var n=null!==r?'["'.concat(r.join('", "'),'"]'):"";this.print_error_message("".concat(e.response.status," - ").concat(e.response.statusText," (").concat(e.response.config.url,") ").concat(n),!0,!0)}},{key:"print_error_message",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=document.createElement("p"),i=n||this.get_date();if(r){var s=document.createElement("pre");s.innerText=e,o.appendChild(s)}else o.innerHTML="<strong>".concat(i,"</strong> - ").concat(e);t&&o.classList.add(this.classes.error_message),this.errors.removeAttribute("hidden"),this.errors_inner.appendChild(o)}},{key:"update_size",value:function(e){var t=this.data.size;t.before+=e.size.before,t.after+=e.size.after;var r=t.before-t.after;if(r<0&&(r=0),0!==r){var n=Math.round(100*(1-t.after/t.before));n<0&&(n=0);var o=-1;do{o++,r/=1024}while(r>1024);var i=r.toFixed(2),s=this.settings.units[o];this.progress_size.innerHTML="".concat(i," ").concat(s," (").concat(n,"%)")}}},{key:"update_files_count",value:function(e){var t=this.data.files;t.all+=e.files.all,t.converted+=e.files.converted,this.progress_successful.innerText=t.converted,this.progress_failed.innerText=t.all-t.converted}},{key:"update_progress",value:function(){var e=this.data.max>0?Math.floor(this.data.count/this.data.max*100):100;e>100&&(e=100),100===e&&(this.success.removeAttribute("hidden"),this.success_popup&&this.success_popup.removeAttribute("hidden")),this.progress.setAttribute(this.atts.progress,e.toString())}}])&&l(t.prototype,r),n&&l(t,n),e}();new function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new f,new d,new s}},694:function(){},155:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},593:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=function(t,r,o,i){if(!r){var s=1/0;for(f=0;f<e.length;f++){r=e[f][0],o=e[f][1],i=e[f][2];for(var a=!0,u=0;u<r.length;u++)(!1&i||s>=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[u])}))?r.splice(u--,1):(a=!1,i<s&&(s=i));if(a){e.splice(f--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,o,i]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={794:0,505:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,i,s=r[0],a=r[1],u=r[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(u)var f=u(n)}for(t&&t(r);c<s.length;c++)i=s[c],n.o(e,i)&&e[i]&&e[i][0](),e[s[c]]=0;return n.O(f)},r=self.webpackChunkwebp_converter_for_media=self.webpackChunkwebp_converter_for_media||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),n.O(void 0,[505],(function(){return n(712)}));var o=n.O(void 0,[505],(function(){return n(694)}));o=n.O(o)}();
|
1 |
+
!function(){var e,t={669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),o=r(26),i=r(372),s=r(327),a=r(97),u=r(109),c=r(985),f=r(61);e.exports=function(e){return new Promise((function(t,r){var l=e.data,d=e.headers,h=e.responseType;n.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var v=a(e.baseURL,e.url);function _(){if(p){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,i={data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,r,i),p=null}}if(p.open(e.method.toUpperCase(),s(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(_)},p.onabort=function(){p&&(r(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(f("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(v))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),l||(l=null),p.send(l)}))}},609:function(e,t,r){"use strict";var n=r(867),o=r(849),i=r(321),s=r(185);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var u=a(r(655));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),o=r(327),i=r(782),s=r(572),a=r(185),u=r(875),c=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift());return o}for(var l=e;r.length;){var d=r.shift(),h=r.shift();try{l=d(l)}catch(e){h(e);break}}try{o=s(l)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},f.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},782:function(e,t,r){"use strict";var n=r(867);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},97:function(e,t,r){"use strict";var n=r(793),o=r(303);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,o,i){var s=new Error(e);return n(s,t,r,o,i)}},572:function(e,t,r){"use strict";var n=r(867),o=r(527),i=r(502),s=r(655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(i,c),n.forEach(s,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=o.concat(i).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(l,c),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),o=r(655);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(155),o=r(867),i=r(16),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,f={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(448)),c),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||n&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};f.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){f.headers[e]=o.merge(a)})),e.exports=f},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:function(e,t,r){"use strict";var n=r(867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(593),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}o.transitional=function(e,t,r){var o=t&&a(t);return function(s,a,u){if(!1===e)throw new Error(function(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(a," has been removed in "+t));return o&&!i[a]&&(i[a]=!0),!e||e(s,a,u)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},867:function(e,t,r){"use strict";var n=r(849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},917:function(e,t,r){"use strict";var n=r(669),o=r.n(n);function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector("[data-calculate-widget]"),this.section)return this.button=this.section.querySelector("[data-calculate-widget-button]"),this.loading=this.section.querySelector("[data-calculate-widget-loading]"),this.output=this.section.querySelector("[data-calculate-widget-output]"),this.settings={ajax:{url_calculation:this.section.getAttribute("data-calculate-widget-api")}},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_calculation.bind(this))}},{key:"init_calculation",value:function(e){e.preventDefault(),this.button.setAttribute("hidden","hidden"),this.output.setAttribute("hidden","hidden"),this.loading.removeAttribute("hidden"),this.send_request_for_calculation()}},{key:"send_request_for_calculation",value:function(){var e=this,t=this.settings.ajax.url_calculation,r=new Date;o()({method:"GET",url:t}).then((function(t){e.loading.setAttribute("hidden","hidden"),e.output.innerText=t.data.value_output,e.output.removeAttribute("hidden","hidden")})).catch((function(t){if(e.button.removeAttribute("hidden"),e.loading.setAttribute("hidden","hidden"),t.response){var n=(new Date-r)/1e3,o=t.response.status,i=JSON.stringify(t.response.data);e.output.innerText="HTTP Error ".concat(o," (").concat(n,"s): ").concat(i),e.output.removeAttribute("hidden","hidden")}}))}}])&&i(t.prototype,r),n&&i(t,n),e}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(t){a(this,e),this.input_toggle=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){var e=this.input_toggle.getAttribute("data-inputs-group-toggle");return this.inputs=document.querySelectorAll('[data-inputs-group-input="'.concat(e,'"]')),!!this.inputs.length}},{key:"set_events",value:function(){this.input_toggle.addEventListener("change",this.toggle_inputs.bind(this))}},{key:"toggle_inputs",value:function(e){for(var t=this.inputs.length,r=0;r<t;r++)this.input_toggle.checked?this.inputs[r].removeAttribute("readonly"):this.inputs[r].setAttribute("readonly","readonly")}}])&&u(t.prototype,r),n&&u(t,n),e}(),f=function e(){a(this,e);for(var t=document.querySelectorAll("[data-inputs-group-toggle]"),r=t.length,n=0;n<r;n++)new c(t[n])};function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h=function(){function e(t){l(this,e),this.notice=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){return this.settings={ajax_action:this.notice.getAttribute("data-notice-action"),ajax_url:this.notice.getAttribute("data-notice-url"),button_close_class:".notice-dismiss",button_hide_class:"[data-permanently]"},this.events={click_on_close:this.click_on_close.bind(this)},!0}},{key:"set_events",value:function(){this.notice.addEventListener("click",this.events.click_on_close)}},{key:"click_on_close",value:function(e){var t=this.settings,r=t.button_close_class,n=t.button_hide_class;this.notice.removeEventListener("click",this.events.click_on_close),e.target.matches(r)?this.hide_notice(!1):e.target.matches(n)&&this.hide_notice(!0)}},{key:"hide_notice",value:function(e){var t=this.settings.button_close_class;this.send_request(e),e&&this.notice.querySelector(t).click()}},{key:"send_request",value:function(e){var t=this.settings.ajax_url;o()({method:"POST",url:t,data:this.get_data_for_request(e)})}},{key:"get_data_for_request",value:function(e){var t=this.settings.ajax_action,r=new FormData;return r.append("action",t),r.append("is_permanently",e?1:0),r}}])&&d(t.prototype,r),n&&d(t,n),e}(),p=function e(){l(this,e);for(var t=document.querySelectorAll('.notice[data-notice="webp-converter-for-media"][data-notice-action]'),r=t.length,n=0;n<r;n++)new h(t[n])};function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var g=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector(".webpLoader"),this.section)return this.wrapper=this.section.querySelector(".webpLoader__status"),this.progress=this.wrapper.querySelector(".webpLoader__barProgress"),this.progress_size=this.section.querySelector(".webpLoader__progressValue--size"),this.progress_successful=this.section.querySelector(".webpLoader__progressValue--successful"),this.progress_failed=this.section.querySelector(".webpLoader__progressValue--failed"),this.errors=this.section.querySelector(".webpLoader__errors"),this.errors_inner=this.errors.querySelector(".webpLoader__errorsContent"),this.success=this.section.querySelector(".webpLoader__success"),this.success_popup=this.section.querySelector(".webpLoader__popup"),this.option_force=this.section.querySelector('input[name="regenerate_force"]'),this.button=this.section.querySelector(".webpLoader__button"),this.data={count:0,max:0,items:[],size:{before:0,after:0},files:{all:0,converted:0},errors:0},this.settings={is_disabled:!1,ajax:{url_paths:this.section.getAttribute("data-api-paths"),url_regenerate:this.section.getAttribute("data-api-regenerate"),error_message:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"],max_errors:1e3,connection_timeout:6e4},this.atts={progress:"data-percent"},this.classes={progress_error:"webpLoader__barProgress--error",button_disabled:"webpLoader__button--disabled",error_message:"webpLoader__errorsContentError"},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_regeneration.bind(this))}},{key:"init_regeneration",value:function(e){e.preventDefault(),this.settings.is_disabled||(this.settings.is_disabled=!0,this.button.classList.add(this.classes.button_disabled),this.option_force.setAttribute("disabled","disabled"),this.wrapper.removeAttribute("hidden"),this.send_request_for_paths())}},{key:"send_request_for_paths",value:function(){var e=this,t=this.settings.ajax.url_paths;o()({method:"POST",url:t,data:{regenerate_force:this.option_force.checked?1:0}}).then((function(t){e.data.items=t.data,e.data.max=t.data.length,e.regenerate_next_images()})).catch((function(t){e.catch_request_error(t,!0)}))}},{key:"regenerate_next_images",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0===this.data.max&&this.update_progress(),!(this.data.count>=this.data.max)){e&&this.data.count--;var t=this.data.items[this.data.count];this.data.count++,this.send_request_for_regeneration(t)}}},{key:"send_request_for_regeneration",value:function(e){var t=this,r=this.settings.ajax.url_regenerate;o()({method:"POST",url:r,data:{regenerate_force:this.option_force.checked?1:0,paths:e},timeout:this.settings.connection_timeout}).then((function(e){var r=e.data.is_fatal_error;t.update_errors(e.data.errors,r),r||(t.update_size(e.data),t.update_files_count(e.data),t.update_progress(),t.regenerate_next_images())})).catch((function(r){r.response?(t.catch_request_error(r,!1,e),setTimeout(t.regenerate_next_images.bind(t),1e3)):setTimeout(t.regenerate_next_images.bind(t,!0),1e3)}))}},{key:"update_errors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.data.errors>this.settings.max_errors&&(this.data.errors=0,this.errors_inner.innerHTML="");for(var r=this.get_date(),n=0;n<e.length;n++)this.print_error_message(e[n],t,!1,r),this.data.errors++;t&&this.set_fatal_error()}},{key:"get_date",value:function(){var e=new Date,t=("0"+e.getHours()).substr(-2),r=("0"+e.getMinutes()).substr(-2),n=("0"+e.getSeconds()).substr(-2);return"".concat(t,":").concat(r,":").concat(n)}},{key:"set_fatal_error",value:function(){this.progress.classList.add(this.classes.progress_error)}},{key:"catch_request_error",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&(this.print_error_message([this.settings.ajax.error_message],!0,!1),this.set_fatal_error());var n=null!==r?'["'.concat(r.join('", "'),'"]'):"";this.print_error_message("".concat(e.response.status," - ").concat(e.response.statusText," (").concat(e.response.config.url,") ").concat(n),!0,!0)}},{key:"print_error_message",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=document.createElement("p"),i=n||this.get_date();if(r){var s=document.createElement("pre");s.innerText=e,o.appendChild(s)}else o.innerHTML="<strong>".concat(i,"</strong> - ").concat(e);t&&o.classList.add(this.classes.error_message),this.errors.removeAttribute("hidden"),this.errors_inner.appendChild(o)}},{key:"update_size",value:function(e){var t=this.data.size;t.before+=e.size.before,t.after+=e.size.after;var r=t.before-t.after;if(r<0&&(r=0),0!==r){var n=Math.round(100*(1-t.after/t.before));n<0&&(n=0);var o=-1;do{o++,r/=1024}while(r>1024);var i=r.toFixed(2),s=this.settings.units[o];this.progress_size.innerHTML="".concat(i," ").concat(s," (").concat(n,"%)")}}},{key:"update_files_count",value:function(e){var t=this.data.files;t.all+=e.files.all,t.converted+=e.files.converted,this.progress_successful.innerText=t.converted,this.progress_failed.innerText=t.all-t.converted}},{key:"update_progress",value:function(){var e=this.data.max>0?Math.floor(this.data.count/this.data.max*100):100;e>100&&(e=100),100===e&&(this.success.removeAttribute("hidden"),this.success_popup&&this.success_popup.removeAttribute("hidden")),this.progress.setAttribute(this.atts.progress,e.toString())}}])&&m(t.prototype,r),n&&m(t,n),e}();new function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new p,new g,new s,new f}},694:function(){},155:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},593:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=function(t,r,o,i){if(!r){var s=1/0;for(f=0;f<e.length;f++){r=e[f][0],o=e[f][1],i=e[f][2];for(var a=!0,u=0;u<r.length;u++)(!1&i||s>=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[u])}))?r.splice(u--,1):(a=!1,i<s&&(s=i));if(a){e.splice(f--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,o,i]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={794:0,505:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,i,s=r[0],a=r[1],u=r[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(u)var f=u(n)}for(t&&t(r);c<s.length;c++)i=s[c],n.o(e,i)&&e[i]&&e[i][0](),e[s[c]]=0;return n.O(f)},r=self.webpackChunkwebp_converter_for_media=self.webpackChunkwebp_converter_for_media||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),n.O(void 0,[505],(function(){return n(917)}));var o=n.O(void 0,[505],(function(){return n(694)}));o=n.O(o)}();
|
changelog.txt
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
= 4.3.6 (2022-06-03) =
|
4 |
* `[Fixed]` Notification about Cloudflare cache
|
5 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 4.4.0 (2022-06-19) =
|
4 |
+
* `[Changed]` Calculation of number of images to be converted
|
5 |
+
* `[Added]` Resizing of images before conversion
|
6 |
+
* `[Added]` Notification asking to clear cache for LiteSpeed
|
7 |
+
|
8 |
= 4.3.6 (2022-06-03) =
|
9 |
* `[Fixed]` Notification about Cloudflare cache
|
10 |
|
readme.txt
CHANGED
@@ -329,6 +329,11 @@ After making changes, remember to restart the machine:
|
|
329 |
|
330 |
== Changelog ==
|
331 |
|
|
|
|
|
|
|
|
|
|
|
332 |
= 4.3.6 (2022-06-03) =
|
333 |
* `[Fixed]` Notification about Cloudflare cache
|
334 |
|
329 |
|
330 |
== Changelog ==
|
331 |
|
332 |
+
= 4.4.0 (2022-06-19) =
|
333 |
+
* `[Changed]` Calculation of number of images to be converted
|
334 |
+
* `[Added]` Resizing of images before conversion
|
335 |
+
* `[Added]` Notification asking to clear cache for LiteSpeed
|
336 |
+
|
337 |
= 4.3.6 (2022-06-03) =
|
338 |
* `[Fixed]` Notification about Cloudflare cache
|
339 |
|
src/Action/ConvertPaths.php
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
namespace WebpConverter\Action;
|
4 |
|
5 |
use WebpConverter\Conversion\Method\MethodIntegrator;
|
6 |
-
use WebpConverter\Conversion\PathsValidator;
|
7 |
use WebpConverter\HookableInterface;
|
8 |
use WebpConverter\PluginData;
|
9 |
|
@@ -12,8 +11,6 @@ use WebpConverter\PluginData;
|
|
12 |
*/
|
13 |
class ConvertPaths implements HookableInterface {
|
14 |
|
15 |
-
use PathsValidator;
|
16 |
-
|
17 |
/**
|
18 |
* @var PluginData
|
19 |
*/
|
@@ -52,7 +49,7 @@ class ConvertPaths implements HookableInterface {
|
|
52 |
*/
|
53 |
private function remove_paths_from_excluded_paths( array $source_paths ): array {
|
54 |
foreach ( $source_paths as $path_index => $path ) {
|
55 |
-
if ( !
|
56 |
unset( $source_paths[ $path_index ] );
|
57 |
}
|
58 |
}
|
3 |
namespace WebpConverter\Action;
|
4 |
|
5 |
use WebpConverter\Conversion\Method\MethodIntegrator;
|
|
|
6 |
use WebpConverter\HookableInterface;
|
7 |
use WebpConverter\PluginData;
|
8 |
|
11 |
*/
|
12 |
class ConvertPaths implements HookableInterface {
|
13 |
|
|
|
|
|
14 |
/**
|
15 |
* @var PluginData
|
16 |
*/
|
49 |
*/
|
50 |
private function remove_paths_from_excluded_paths( array $source_paths ): array {
|
51 |
foreach ( $source_paths as $path_index => $path ) {
|
52 |
+
if ( ! apply_filters( 'webpc_supported_source_file', true, basename( $path ), $path ) ) {
|
53 |
unset( $source_paths[ $path_index ] );
|
54 |
}
|
55 |
}
|
src/Action/DeletePaths.php
CHANGED
@@ -12,6 +12,15 @@ use WebpConverter\HookableInterface;
|
|
12 |
*/
|
13 |
class DeletePaths implements HookableInterface {
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* {@inheritdoc}
|
17 |
*/
|
@@ -41,7 +50,7 @@ class DeletePaths implements HookableInterface {
|
|
41 |
* @return void
|
42 |
*/
|
43 |
private function delete_file_by_path( string $path ) {
|
44 |
-
if ( ! ( $output_paths =
|
45 |
return;
|
46 |
}
|
47 |
|
12 |
*/
|
13 |
class DeletePaths implements HookableInterface {
|
14 |
|
15 |
+
/**
|
16 |
+
* @var OutputPath
|
17 |
+
*/
|
18 |
+
private $output_path;
|
19 |
+
|
20 |
+
public function __construct( OutputPath $output_path = null ) {
|
21 |
+
$this->output_path = $output_path ?: new OutputPath();
|
22 |
+
}
|
23 |
+
|
24 |
/**
|
25 |
* {@inheritdoc}
|
26 |
*/
|
50 |
* @return void
|
51 |
*/
|
52 |
private function delete_file_by_path( string $path ) {
|
53 |
+
if ( ! ( $output_paths = $this->output_path->get_paths( $path ) ) ) {
|
54 |
return;
|
55 |
}
|
56 |
|
src/Conversion/Directory/DirectoryIntegration.php
CHANGED
@@ -18,6 +18,15 @@ class DirectoryIntegration implements HookableInterface {
|
|
18 |
*/
|
19 |
private $directories = [];
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* {@inheritdoc}
|
23 |
*/
|
@@ -63,7 +72,7 @@ class DirectoryIntegration implements HookableInterface {
|
|
63 |
$values = [];
|
64 |
foreach ( $this->directories as $directory ) {
|
65 |
if ( ! $directory->is_output_directory()
|
66 |
-
&& ( $output_path =
|
67 |
&& ( $output_path !== $directory->get_server_path() ) ) {
|
68 |
$values[ $directory->get_type() ] = $output_path;
|
69 |
}
|
18 |
*/
|
19 |
private $directories = [];
|
20 |
|
21 |
+
/**
|
22 |
+
* @var OutputPath
|
23 |
+
*/
|
24 |
+
private $output_path;
|
25 |
+
|
26 |
+
public function __construct( OutputPath $output_path = null ) {
|
27 |
+
$this->output_path = $output_path ?: new OutputPath();
|
28 |
+
}
|
29 |
+
|
30 |
/**
|
31 |
* {@inheritdoc}
|
32 |
*/
|
72 |
$values = [];
|
73 |
foreach ( $this->directories as $directory ) {
|
74 |
if ( ! $directory->is_output_directory()
|
75 |
+
&& ( $output_path = $this->output_path->get_directory_path( $directory->get_server_path() ) )
|
76 |
&& ( $output_path !== $directory->get_server_path() ) ) {
|
77 |
$values[ $directory->get_type() ] = $output_path;
|
78 |
}
|
src/Conversion/DirectoryFiles.php
CHANGED
@@ -12,8 +12,6 @@ use WebpConverter\Settings\Option\SupportedExtensionsOption;
|
|
12 |
*/
|
13 |
class DirectoryFiles implements HookableInterface {
|
14 |
|
15 |
-
use PathsValidator;
|
16 |
-
|
17 |
/**
|
18 |
* @var PluginData
|
19 |
*/
|
@@ -33,21 +31,20 @@ class DirectoryFiles implements HookableInterface {
|
|
33 |
* {@inheritdoc}
|
34 |
*/
|
35 |
public function init_hooks() {
|
36 |
-
add_filter( 'webpc_dir_files', [ $this, 'get_files_by_directory' ], 10,
|
37 |
}
|
38 |
|
39 |
/**
|
40 |
* Returns list of source images for directory.
|
41 |
*
|
42 |
-
* @param string[]
|
43 |
-
* @param string
|
44 |
-
* @param bool
|
45 |
-
* @param string[]|null $allowed_output_formats List of extensions or use selected in plugin settings.
|
46 |
*
|
47 |
* @return string[] Server paths of source images.
|
48 |
* @internal
|
49 |
*/
|
50 |
-
public function get_files_by_directory( array $value, string $dir_path, bool $skip_converted = false
|
51 |
if ( ! file_exists( $dir_path ) ) {
|
52 |
return $value;
|
53 |
}
|
@@ -59,22 +56,20 @@ class DirectoryFiles implements HookableInterface {
|
|
59 |
return $this->find_files_in_directory(
|
60 |
$dir_path,
|
61 |
$settings[ SupportedExtensionsOption::OPTION_NAME ],
|
62 |
-
$skip_converted
|
63 |
-
$allowed_output_formats
|
64 |
);
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* Returns list of source images for directory.
|
69 |
*
|
70 |
-
* @param string
|
71 |
-
* @param string[]
|
72 |
-
* @param bool
|
73 |
-
* @param string[]|null $allowed_output_formats List of extensions or use selected in plugin settings.
|
74 |
*
|
75 |
* @return string[] Server paths of source images.
|
76 |
*/
|
77 |
-
private function find_files_in_directory( string $dir_path, array $allowed_source_exts, bool $skip_converted
|
78 |
$paths = scandir( $dir_path );
|
79 |
$list = [];
|
80 |
if ( ! is_array( $paths ) ) {
|
@@ -82,13 +77,13 @@ class DirectoryFiles implements HookableInterface {
|
|
82 |
}
|
83 |
|
84 |
foreach ( $paths as $path ) {
|
85 |
-
$current_path = $dir_path . '/' .
|
86 |
if ( is_dir( $current_path ) ) {
|
87 |
-
if (
|
88 |
-
$list = array_merge( $list, $this->find_files_in_directory( $current_path, $allowed_source_exts, $skip_converted
|
89 |
}
|
90 |
} elseif ( in_array( strtolower( pathinfo( $current_path, PATHINFO_EXTENSION ) ), $allowed_source_exts ) ) {
|
91 |
-
if (
|
92 |
$list[] = $current_path;
|
93 |
}
|
94 |
}
|
12 |
*/
|
13 |
class DirectoryFiles implements HookableInterface {
|
14 |
|
|
|
|
|
15 |
/**
|
16 |
* @var PluginData
|
17 |
*/
|
31 |
* {@inheritdoc}
|
32 |
*/
|
33 |
public function init_hooks() {
|
34 |
+
add_filter( 'webpc_dir_files', [ $this, 'get_files_by_directory' ], 10, 3 );
|
35 |
}
|
36 |
|
37 |
/**
|
38 |
* Returns list of source images for directory.
|
39 |
*
|
40 |
+
* @param string[] $value Server paths of source images.
|
41 |
+
* @param string $dir_path Server path of source directory.
|
42 |
+
* @param bool $skip_converted Skip images already converted?
|
|
|
43 |
*
|
44 |
* @return string[] Server paths of source images.
|
45 |
* @internal
|
46 |
*/
|
47 |
+
public function get_files_by_directory( array $value, string $dir_path, bool $skip_converted = false ): array {
|
48 |
if ( ! file_exists( $dir_path ) ) {
|
49 |
return $value;
|
50 |
}
|
56 |
return $this->find_files_in_directory(
|
57 |
$dir_path,
|
58 |
$settings[ SupportedExtensionsOption::OPTION_NAME ],
|
59 |
+
$skip_converted
|
|
|
60 |
);
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
* Returns list of source images for directory.
|
65 |
*
|
66 |
+
* @param string $dir_path Server path of source directory.
|
67 |
+
* @param string[] $allowed_source_exts File extensions to find.
|
68 |
+
* @param bool $skip_converted Skip images already converted?
|
|
|
69 |
*
|
70 |
* @return string[] Server paths of source images.
|
71 |
*/
|
72 |
+
private function find_files_in_directory( string $dir_path, array $allowed_source_exts, bool $skip_converted ): array {
|
73 |
$paths = scandir( $dir_path );
|
74 |
$list = [];
|
75 |
if ( ! is_array( $paths ) ) {
|
77 |
}
|
78 |
|
79 |
foreach ( $paths as $path ) {
|
80 |
+
$current_path = $dir_path . '/' . $path;
|
81 |
if ( is_dir( $current_path ) ) {
|
82 |
+
if ( apply_filters( 'webpc_supported_source_directory', true, basename( $current_path ), $current_path ) ) {
|
83 |
+
$list = array_merge( $list, $this->find_files_in_directory( $current_path, $allowed_source_exts, $skip_converted ) );
|
84 |
}
|
85 |
} elseif ( in_array( strtolower( pathinfo( $current_path, PATHINFO_EXTENSION ) ), $allowed_source_exts ) ) {
|
86 |
+
if ( apply_filters( 'webpc_supported_source_file', true, basename( $current_path ), $current_path ) ) {
|
87 |
$list[] = $current_path;
|
88 |
}
|
89 |
}
|
src/Conversion/Endpoint/ImagesCounterEndpoint.php
CHANGED
@@ -7,7 +7,6 @@ use WebpConverter\Conversion\Format\WebpFormat;
|
|
7 |
use WebpConverter\Conversion\PathsFinder;
|
8 |
use WebpConverter\PluginData;
|
9 |
use WebpConverter\Repository\TokenRepository;
|
10 |
-
use WebpConverter\Service\StatsManager;
|
11 |
|
12 |
/**
|
13 |
* Calculates the number of all images to be converted.
|
@@ -24,19 +23,12 @@ class ImagesCounterEndpoint extends EndpointAbstract {
|
|
24 |
*/
|
25 |
private $token_repository;
|
26 |
|
27 |
-
/**
|
28 |
-
* @var StatsManager
|
29 |
-
*/
|
30 |
-
private $stats_manager;
|
31 |
-
|
32 |
public function __construct(
|
33 |
PluginData $plugin_data,
|
34 |
-
TokenRepository $token_repository
|
35 |
-
StatsManager $stats_manager = null
|
36 |
) {
|
37 |
$this->plugin_data = $plugin_data;
|
38 |
$this->token_repository = $token_repository;
|
39 |
-
$this->stats_manager = $stats_manager ?: new StatsManager();
|
40 |
}
|
41 |
|
42 |
/**
|
@@ -50,18 +42,16 @@ class ImagesCounterEndpoint extends EndpointAbstract {
|
|
50 |
* {@inheritdoc}
|
51 |
*/
|
52 |
public function get_route_response( \WP_REST_Request $request ) {
|
53 |
-
$images_count =
|
54 |
-
(
|
55 |
-
->get_paths( true, [ AvifFormat::FORMAT_EXTENSION, WebpFormat::FORMAT_EXTENSION ] )
|
56 |
-
);
|
57 |
-
$this->stats_manager->set_calculation_images_count( $images_count );
|
58 |
|
59 |
return new \WP_REST_Response(
|
60 |
[
|
61 |
'value_output' => sprintf(
|
62 |
/* translators: %1$s: images count */
|
63 |
-
__( '%1$s for AVIF and %
|
64 |
-
number_format( $images_count, 0, '', ' ' )
|
|
|
65 |
),
|
66 |
],
|
67 |
200
|
7 |
use WebpConverter\Conversion\PathsFinder;
|
8 |
use WebpConverter\PluginData;
|
9 |
use WebpConverter\Repository\TokenRepository;
|
|
|
10 |
|
11 |
/**
|
12 |
* Calculates the number of all images to be converted.
|
23 |
*/
|
24 |
private $token_repository;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
public function __construct(
|
27 |
PluginData $plugin_data,
|
28 |
+
TokenRepository $token_repository
|
|
|
29 |
) {
|
30 |
$this->plugin_data = $plugin_data;
|
31 |
$this->token_repository = $token_repository;
|
|
|
32 |
}
|
33 |
|
34 |
/**
|
42 |
* {@inheritdoc}
|
43 |
*/
|
44 |
public function get_route_response( \WP_REST_Request $request ) {
|
45 |
+
$images_count = ( new PathsFinder( $this->plugin_data, $this->token_repository ) )
|
46 |
+
->get_paths_count( [ AvifFormat::FORMAT_EXTENSION, WebpFormat::FORMAT_EXTENSION ] );
|
|
|
|
|
|
|
47 |
|
48 |
return new \WP_REST_Response(
|
49 |
[
|
50 |
'value_output' => sprintf(
|
51 |
/* translators: %1$s: images count */
|
52 |
+
__( '%1$s for AVIF and %2$s for WebP', 'webp-converter-for-media' ),
|
53 |
+
number_format( $images_count[ AvifFormat::FORMAT_EXTENSION ] ?? 0, 0, '', ' ' ),
|
54 |
+
number_format( $images_count[ WebpFormat::FORMAT_EXTENSION ] ?? 0, 0, '', ' ' )
|
55 |
),
|
56 |
],
|
57 |
200
|
src/Conversion/Method/GdMethod.php
CHANGED
@@ -183,8 +183,8 @@ class GdMethod extends LibraryMethodAbstract {
|
|
183 |
|
184 |
$count = 0;
|
185 |
while ( ! feof( $fh ) && ( $count < 2 ) ) {
|
186 |
-
$chunk
|
187 |
-
$count
|
188 |
}
|
189 |
|
190 |
fclose( $fh );
|
183 |
|
184 |
$count = 0;
|
185 |
while ( ! feof( $fh ) && ( $count < 2 ) ) {
|
186 |
+
$chunk = fread( $fh, 1024 * 100 );
|
187 |
+
$count = $count + preg_match_all( '#\x00\x21\xF9\x04.{4}\x00(\x2C|\x21)#s', $chunk ?: '', $matches );
|
188 |
}
|
189 |
|
190 |
fclose( $fh );
|
src/Conversion/Method/LibraryMethodAbstract.php
CHANGED
@@ -33,6 +33,7 @@ abstract class LibraryMethodAbstract extends MethodAbstract implements LibraryMe
|
|
33 |
SkipLarger $skip_larger,
|
34 |
ServerConfigurator $server_configurator
|
35 |
) {
|
|
|
36 |
$this->skip_crashed = $skip_crashed;
|
37 |
$this->skip_larger = $skip_larger;
|
38 |
$this->server_configurator = $server_configurator;
|
33 |
SkipLarger $skip_larger,
|
34 |
ServerConfigurator $server_configurator
|
35 |
) {
|
36 |
+
parent::__construct();
|
37 |
$this->skip_crashed = $skip_crashed;
|
38 |
$this->skip_larger = $skip_larger;
|
39 |
$this->server_configurator = $server_configurator;
|
src/Conversion/Method/MethodAbstract.php
CHANGED
@@ -11,6 +11,15 @@ use WebpConverter\Settings\Option\ExtraFeaturesOption;
|
|
11 |
*/
|
12 |
abstract class MethodAbstract implements MethodInterface {
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
/**
|
15 |
* @var bool
|
16 |
*/
|
@@ -125,7 +134,7 @@ abstract class MethodAbstract implements MethodInterface {
|
|
125 |
* @throws Exception\OutputPathException
|
126 |
*/
|
127 |
protected function get_image_output_path( string $source_path, string $format ): string {
|
128 |
-
if ( ! $output_path =
|
129 |
throw new Exception\OutputPathException( $source_path );
|
130 |
}
|
131 |
|
11 |
*/
|
12 |
abstract class MethodAbstract implements MethodInterface {
|
13 |
|
14 |
+
/**
|
15 |
+
* @var OutputPath
|
16 |
+
*/
|
17 |
+
private $output_path;
|
18 |
+
|
19 |
+
public function __construct( OutputPath $output_path = null ) {
|
20 |
+
$this->output_path = $output_path ?: new OutputPath();
|
21 |
+
}
|
22 |
+
|
23 |
/**
|
24 |
* @var bool
|
25 |
*/
|
134 |
* @throws Exception\OutputPathException
|
135 |
*/
|
136 |
protected function get_image_output_path( string $source_path, string $format ): string {
|
137 |
+
if ( ! $output_path = $this->output_path->get_path( $source_path, true, $format ) ) {
|
138 |
throw new Exception\OutputPathException( $source_path );
|
139 |
}
|
140 |
|
src/Conversion/Method/RemoteMethod.php
CHANGED
@@ -10,6 +10,7 @@ use WebpConverter\Repository\TokenRepository;
|
|
10 |
use WebpConverter\Service\ServerConfigurator;
|
11 |
use WebpConverter\Settings\Option\AccessTokenOption;
|
12 |
use WebpConverter\Settings\Option\ExtraFeaturesOption;
|
|
|
13 |
use WebpConverter\Settings\Option\ImagesQualityOption;
|
14 |
use WebpConverter\Settings\Option\OutputFormatsOption;
|
15 |
use WebpConverter\WebpConverterConstants;
|
@@ -20,7 +21,7 @@ use WebpConverter\WebpConverterConstants;
|
|
20 |
class RemoteMethod extends MethodAbstract {
|
21 |
|
22 |
const METHOD_NAME = 'remote';
|
23 |
-
const MAX_FILESIZE_BYTES = (
|
24 |
|
25 |
/**
|
26 |
* @var SkipCrashed
|
@@ -51,7 +52,9 @@ class RemoteMethod extends MethodAbstract {
|
|
51 |
SkipCrashed $skip_crashed,
|
52 |
SkipLarger $skip_larger,
|
53 |
TokenRepository $token_repository,
|
54 |
-
ServerConfigurator $server_configurator
|
|
|
|
|
55 |
$this->skip_crashed = $skip_crashed;
|
56 |
$this->skip_larger = $skip_larger;
|
57 |
$this->token_repository = $token_repository;
|
@@ -126,9 +129,8 @@ class RemoteMethod extends MethodAbstract {
|
|
126 |
$this->token = $this->token_repository->get_token();
|
127 |
|
128 |
foreach ( $output_formats as $output_format ) {
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$output_paths[ $output_format ] = $this->get_output_paths( $valid_file_paths, $output_format );
|
132 |
}
|
133 |
|
134 |
if ( ! $regenerate_force ) {
|
@@ -137,6 +139,7 @@ class RemoteMethod extends MethodAbstract {
|
|
137 |
if ( file_exists( $output_paths[ $output_format ][ $path_index ] ) ) {
|
138 |
unset( $source_paths[ $output_format ][ $path_index ] );
|
139 |
unset( $output_paths[ $output_format ][ $path_index ] );
|
|
|
140 |
}
|
141 |
}
|
142 |
}
|
@@ -167,26 +170,6 @@ class RemoteMethod extends MethodAbstract {
|
|
167 |
$this->token_repository->update_token( $this->token );
|
168 |
}
|
169 |
|
170 |
-
/**
|
171 |
-
* @param string[] $file_paths .
|
172 |
-
* @param string $output_format .
|
173 |
-
*
|
174 |
-
* @return string[]
|
175 |
-
*/
|
176 |
-
private function skip_invalid_paths( array $file_paths, string $output_format ): array {
|
177 |
-
$valid_paths = [];
|
178 |
-
foreach ( $file_paths as $file_path ) {
|
179 |
-
$source_format = strtolower( pathinfo( $file_path, PATHINFO_EXTENSION ) );
|
180 |
-
|
181 |
-
if ( $source_format === $output_format ) {
|
182 |
-
continue;
|
183 |
-
}
|
184 |
-
$valid_paths[] = $file_path;
|
185 |
-
}
|
186 |
-
|
187 |
-
return $valid_paths;
|
188 |
-
}
|
189 |
-
|
190 |
/**
|
191 |
* @param string $error_message .
|
192 |
* @param mixed[] $plugin_settings .
|
@@ -335,6 +318,12 @@ class RemoteMethod extends MethodAbstract {
|
|
335 |
'output_format' => $output_format,
|
336 |
'quality_level' => $plugin_settings[ ImagesQualityOption::OPTION_NAME ],
|
337 |
'strip_metadata' => ( ! in_array( ExtraFeaturesOption::OPTION_VALUE_KEEP_METADATA, $plugin_settings[ ExtraFeaturesOption::OPTION_NAME ] ) ),
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
]
|
339 |
);
|
340 |
curl_setopt(
|
10 |
use WebpConverter\Service\ServerConfigurator;
|
11 |
use WebpConverter\Settings\Option\AccessTokenOption;
|
12 |
use WebpConverter\Settings\Option\ExtraFeaturesOption;
|
13 |
+
use WebpConverter\Settings\Option\ImageResizeOption;
|
14 |
use WebpConverter\Settings\Option\ImagesQualityOption;
|
15 |
use WebpConverter\Settings\Option\OutputFormatsOption;
|
16 |
use WebpConverter\WebpConverterConstants;
|
21 |
class RemoteMethod extends MethodAbstract {
|
22 |
|
23 |
const METHOD_NAME = 'remote';
|
24 |
+
const MAX_FILESIZE_BYTES = ( 25 * 1024 * 1024 );
|
25 |
|
26 |
/**
|
27 |
* @var SkipCrashed
|
52 |
SkipCrashed $skip_crashed,
|
53 |
SkipLarger $skip_larger,
|
54 |
TokenRepository $token_repository,
|
55 |
+
ServerConfigurator $server_configurator
|
56 |
+
) {
|
57 |
+
parent::__construct();
|
58 |
$this->skip_crashed = $skip_crashed;
|
59 |
$this->skip_larger = $skip_larger;
|
60 |
$this->token_repository = $token_repository;
|
129 |
$this->token = $this->token_repository->get_token();
|
130 |
|
131 |
foreach ( $output_formats as $output_format ) {
|
132 |
+
$source_paths[ $output_format ] = $file_paths;
|
133 |
+
$output_paths[ $output_format ] = $this->get_output_paths( $file_paths, $output_format );
|
|
|
134 |
}
|
135 |
|
136 |
if ( ! $regenerate_force ) {
|
139 |
if ( file_exists( $output_paths[ $output_format ][ $path_index ] ) ) {
|
140 |
unset( $source_paths[ $output_format ][ $path_index ] );
|
141 |
unset( $output_paths[ $output_format ][ $path_index ] );
|
142 |
+
$this->files_to_conversion -= 1;
|
143 |
}
|
144 |
}
|
145 |
}
|
170 |
$this->token_repository->update_token( $this->token );
|
171 |
}
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
/**
|
174 |
* @param string $error_message .
|
175 |
* @param mixed[] $plugin_settings .
|
318 |
'output_format' => $output_format,
|
319 |
'quality_level' => $plugin_settings[ ImagesQualityOption::OPTION_NAME ],
|
320 |
'strip_metadata' => ( ! in_array( ExtraFeaturesOption::OPTION_VALUE_KEEP_METADATA, $plugin_settings[ ExtraFeaturesOption::OPTION_NAME ] ) ),
|
321 |
+
'max_width' => ( $plugin_settings[ ImageResizeOption::OPTION_NAME ][0] === 'yes' )
|
322 |
+
? $plugin_settings[ ImageResizeOption::OPTION_NAME ][1]
|
323 |
+
: 0,
|
324 |
+
'max_height' => ( $plugin_settings[ ImageResizeOption::OPTION_NAME ][0] === 'yes' )
|
325 |
+
? $plugin_settings[ ImageResizeOption::OPTION_NAME ][2]
|
326 |
+
: 0,
|
327 |
]
|
328 |
);
|
329 |
curl_setopt(
|
src/Conversion/OutputPath.php
CHANGED
@@ -9,6 +9,25 @@ use WebpConverter\Conversion\Format\FormatFactory;
|
|
9 |
*/
|
10 |
class OutputPath {
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Generates output path from path of source image.
|
14 |
*
|
@@ -18,8 +37,8 @@ class OutputPath {
|
|
18 |
*
|
19 |
* @return string|null Server path for output image.
|
20 |
*/
|
21 |
-
public
|
22 |
-
$paths =
|
23 |
return $paths[0] ?? null;
|
24 |
}
|
25 |
|
@@ -33,18 +52,22 @@ class OutputPath {
|
|
33 |
*
|
34 |
* @return string[] Server paths for output images.
|
35 |
*/
|
36 |
-
public
|
37 |
-
$new_path =
|
38 |
-
if ( $new_path
|
39 |
return [];
|
40 |
}
|
41 |
|
42 |
-
$extensions
|
43 |
-
$
|
|
|
44 |
foreach ( $extensions as $extension ) {
|
45 |
-
|
|
|
|
|
|
|
46 |
if ( ( $file_extensions === null ) || in_array( $extension, $file_extensions, true ) ) {
|
47 |
-
$paths[] = $
|
48 |
}
|
49 |
}
|
50 |
return $paths;
|
@@ -57,9 +80,9 @@ class OutputPath {
|
|
57 |
*
|
58 |
* @return string|null Server paths for output directory.
|
59 |
*/
|
60 |
-
public
|
61 |
-
$webp_root =
|
62 |
-
$wp_content =
|
63 |
$output_path = str_replace(
|
64 |
preg_replace( '/(\/|\\\\)/', DIRECTORY_SEPARATOR, $wp_content ) ?: '',
|
65 |
'',
|
@@ -81,7 +104,7 @@ class OutputPath {
|
|
81 |
*
|
82 |
* @return string[] Directory paths to be created.
|
83 |
*/
|
84 |
-
private
|
85 |
$current = dirname( $path );
|
86 |
$paths = [];
|
87 |
while ( ! file_exists( $current ) ) {
|
@@ -98,7 +121,7 @@ class OutputPath {
|
|
98 |
*
|
99 |
* @return bool Paths created successfully?
|
100 |
*/
|
101 |
-
private
|
102 |
$paths = array_reverse( $paths );
|
103 |
foreach ( $paths as $path ) {
|
104 |
if ( ! is_writable( dirname( $path ) ) ) {
|
@@ -108,4 +131,18 @@ class OutputPath {
|
|
108 |
}
|
109 |
return true;
|
110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
9 |
*/
|
10 |
class OutputPath {
|
11 |
|
12 |
+
/**
|
13 |
+
* @var FormatFactory
|
14 |
+
*/
|
15 |
+
private $format_factory;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var string|null
|
19 |
+
*/
|
20 |
+
private $path_wp_content_dir = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @var string|null
|
24 |
+
*/
|
25 |
+
private $path_output_dir = null;
|
26 |
+
|
27 |
+
public function __construct( FormatFactory $format_factory = null ) {
|
28 |
+
$this->format_factory = $format_factory ?: new FormatFactory();
|
29 |
+
}
|
30 |
+
|
31 |
/**
|
32 |
* Generates output path from path of source image.
|
33 |
*
|
37 |
*
|
38 |
* @return string|null Server path for output image.
|
39 |
*/
|
40 |
+
public function get_path( string $path, bool $create_dir = false, string $file_extension = '' ) {
|
41 |
+
$paths = $this->get_paths( $path, $create_dir, [ $file_extension ] );
|
42 |
return $paths[0] ?? null;
|
43 |
}
|
44 |
|
52 |
*
|
53 |
* @return string[] Server paths for output images.
|
54 |
*/
|
55 |
+
public function get_paths( string $path, bool $create_dir = false, array $file_extensions = null ): array {
|
56 |
+
$new_path = $this->get_directory_path( $path );
|
57 |
+
if ( ! $new_path || ( $create_dir && ! $this->make_directories( $this->check_directories( $new_path ) ) ) ) {
|
58 |
return [];
|
59 |
}
|
60 |
|
61 |
+
$extensions = $this->format_factory->get_format_extensions();
|
62 |
+
$path_extension = strtolower( pathinfo( $new_path, PATHINFO_EXTENSION ) );
|
63 |
+
$paths = [];
|
64 |
foreach ( $extensions as $extension ) {
|
65 |
+
if ( $extension === $path_extension ) {
|
66 |
+
continue;
|
67 |
+
}
|
68 |
+
|
69 |
if ( ( $file_extensions === null ) || in_array( $extension, $file_extensions, true ) ) {
|
70 |
+
$paths[] = sprintf( '%1$s.%2$s', $new_path, $extension );
|
71 |
}
|
72 |
}
|
73 |
return $paths;
|
80 |
*
|
81 |
* @return string|null Server paths for output directory.
|
82 |
*/
|
83 |
+
public function get_directory_path( string $path ) {
|
84 |
+
$webp_root = $this->get_output_dir();
|
85 |
+
$wp_content = $this->get_wp_content_dir();
|
86 |
$output_path = str_replace(
|
87 |
preg_replace( '/(\/|\\\\)/', DIRECTORY_SEPARATOR, $wp_content ) ?: '',
|
88 |
'',
|
104 |
*
|
105 |
* @return string[] Directory paths to be created.
|
106 |
*/
|
107 |
+
private function check_directories( string $path ): array {
|
108 |
$current = dirname( $path );
|
109 |
$paths = [];
|
110 |
while ( ! file_exists( $current ) ) {
|
121 |
*
|
122 |
* @return bool Paths created successfully?
|
123 |
*/
|
124 |
+
private function make_directories( array $paths ): bool {
|
125 |
$paths = array_reverse( $paths );
|
126 |
foreach ( $paths as $path ) {
|
127 |
if ( ! is_writable( dirname( $path ) ) ) {
|
131 |
}
|
132 |
return true;
|
133 |
}
|
134 |
+
|
135 |
+
private function get_wp_content_dir(): string {
|
136 |
+
if ( $this->path_wp_content_dir === null ) {
|
137 |
+
$this->path_wp_content_dir = dirname( apply_filters( 'webpc_dir_path', '', 'uploads' ) );
|
138 |
+
}
|
139 |
+
return $this->path_wp_content_dir;
|
140 |
+
}
|
141 |
+
|
142 |
+
private function get_output_dir(): string {
|
143 |
+
if ( $this->path_output_dir === null ) {
|
144 |
+
$this->path_output_dir = apply_filters( 'webpc_dir_path', '', 'webp' );
|
145 |
+
}
|
146 |
+
return $this->path_output_dir;
|
147 |
+
}
|
148 |
}
|
src/Conversion/PathsFinder.php
CHANGED
@@ -36,25 +36,36 @@ class PathsFinder {
|
|
36 |
*/
|
37 |
private $stats_manager;
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
public function __construct(
|
40 |
PluginData $plugin_data,
|
41 |
TokenRepository $token_repository,
|
42 |
-
StatsManager $stats_manager = null
|
|
|
43 |
) {
|
44 |
$this->plugin_data = $plugin_data;
|
45 |
$this->token_repository = $token_repository;
|
46 |
$this->stats_manager = $stats_manager ?: new StatsManager();
|
|
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
* Returns list of chunked server paths of source images to be converted.
|
51 |
*
|
52 |
-
* @param bool
|
|
|
53 |
*
|
54 |
* @return string[][] Array of arrays with server paths.
|
55 |
*/
|
56 |
-
public function get_paths_by_chunks( bool $skip_converted = false ): array {
|
57 |
-
$
|
|
|
|
|
|
|
58 |
$paths_count = count( $paths );
|
59 |
|
60 |
$this->stats_manager->set_regeneration_images_count( $paths_count );
|
@@ -70,6 +81,65 @@ class PathsFinder {
|
|
70 |
* @return string[] Server paths of source images.
|
71 |
*/
|
72 |
public function get_paths( bool $skip_converted = false, array $allowed_output_formats = null ): array {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
$settings = $this->plugin_data->get_plugin_settings();
|
74 |
$dirs = array_filter(
|
75 |
array_map(
|
@@ -82,7 +152,7 @@ class PathsFinder {
|
|
82 |
|
83 |
$list = [];
|
84 |
foreach ( $dirs as $dir_path ) {
|
85 |
-
$paths = apply_filters( 'webpc_dir_files', [], $dir_path, $skip_converted
|
86 |
$list = array_merge( $list, $paths );
|
87 |
}
|
88 |
|
@@ -90,6 +160,13 @@ class PathsFinder {
|
|
90 |
return $list;
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
private function get_paths_chunk_size( int $paths_count ): int {
|
94 |
$settings = $this->plugin_data->get_plugin_settings();
|
95 |
if ( $settings[ ConversionMethodOption::OPTION_NAME ] !== RemoteMethod::METHOD_NAME ) {
|
36 |
*/
|
37 |
private $stats_manager;
|
38 |
|
39 |
+
/**
|
40 |
+
* @var OutputPath
|
41 |
+
*/
|
42 |
+
private $output_path;
|
43 |
+
|
44 |
public function __construct(
|
45 |
PluginData $plugin_data,
|
46 |
TokenRepository $token_repository,
|
47 |
+
StatsManager $stats_manager = null,
|
48 |
+
OutputPath $output_path = null
|
49 |
) {
|
50 |
$this->plugin_data = $plugin_data;
|
51 |
$this->token_repository = $token_repository;
|
52 |
$this->stats_manager = $stats_manager ?: new StatsManager();
|
53 |
+
$this->output_path = $output_path ?: new OutputPath();
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* Returns list of chunked server paths of source images to be converted.
|
58 |
*
|
59 |
+
* @param bool $skip_converted Skip converted images?
|
60 |
+
* @param string[]|null $allowed_output_formats List of extensions or use selected in plugin settings.
|
61 |
*
|
62 |
* @return string[][] Array of arrays with server paths.
|
63 |
*/
|
64 |
+
public function get_paths_by_chunks( bool $skip_converted = false, array $allowed_output_formats = null ): array {
|
65 |
+
$allowed_output_formats = $allowed_output_formats
|
66 |
+
?: $this->plugin_data->get_plugin_settings()[ OutputFormatsOption::OPTION_NAME ];
|
67 |
+
|
68 |
+
$paths = $this->get_paths( $skip_converted, $allowed_output_formats );
|
69 |
$paths_count = count( $paths );
|
70 |
|
71 |
$this->stats_manager->set_regeneration_images_count( $paths_count );
|
81 |
* @return string[] Server paths of source images.
|
82 |
*/
|
83 |
public function get_paths( bool $skip_converted = false, array $allowed_output_formats = null ): array {
|
84 |
+
$allowed_output_formats = $allowed_output_formats
|
85 |
+
?: $this->plugin_data->get_plugin_settings()[ OutputFormatsOption::OPTION_NAME ];
|
86 |
+
|
87 |
+
$paths = $this->find_source_paths( true );
|
88 |
+
if ( ! $skip_converted ) {
|
89 |
+
return $paths;
|
90 |
+
}
|
91 |
+
|
92 |
+
foreach ( $paths as $path_index => $path ) {
|
93 |
+
$is_converted = true;
|
94 |
+
foreach ( $allowed_output_formats as $output_format ) {
|
95 |
+
$output_path = $this->output_path->get_path( $path, false, $output_format );
|
96 |
+
|
97 |
+
if ( $output_path && $this->is_converted_file( $output_path ) ) {
|
98 |
+
$is_converted = false;
|
99 |
+
break;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
if ( $is_converted ) {
|
103 |
+
unset( $paths[ $path_index ] );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
return $paths;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Returns number of images to be converted to given output formats.
|
112 |
+
*
|
113 |
+
* @param string[] $allowed_output_formats List of extensions.
|
114 |
+
*
|
115 |
+
* @return int[]
|
116 |
+
*/
|
117 |
+
public function get_paths_count( array $allowed_output_formats ): array {
|
118 |
+
$paths = $this->find_source_paths( true );
|
119 |
+
$values = [];
|
120 |
+
foreach ( $allowed_output_formats as $output_format ) {
|
121 |
+
$values[ $output_format ] = 0;
|
122 |
+
foreach ( $paths as $path ) {
|
123 |
+
$output_path = $this->output_path->get_path( $path, false, $output_format );
|
124 |
+
|
125 |
+
if ( $output_path && $this->is_converted_file( $output_path ) ) {
|
126 |
+
$values[ $output_format ]++;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
$this->stats_manager->set_calculation_images_count( count( $paths ) );
|
132 |
+
return $values;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Returns list of server paths of source images to be converted.
|
137 |
+
*
|
138 |
+
* @param bool $skip_converted Skip converted images?
|
139 |
+
*
|
140 |
+
* @return string[] Server paths of source images.
|
141 |
+
*/
|
142 |
+
private function find_source_paths( bool $skip_converted = false ): array {
|
143 |
$settings = $this->plugin_data->get_plugin_settings();
|
144 |
$dirs = array_filter(
|
145 |
array_map(
|
152 |
|
153 |
$list = [];
|
154 |
foreach ( $dirs as $dir_path ) {
|
155 |
+
$paths = apply_filters( 'webpc_dir_files', [], $dir_path, $skip_converted );
|
156 |
$list = array_merge( $list, $paths );
|
157 |
}
|
158 |
|
160 |
return $list;
|
161 |
}
|
162 |
|
163 |
+
private function is_converted_file( string $output_path ): bool {
|
164 |
+
return ( ! file_exists( $output_path )
|
165 |
+
&& ! file_exists( $output_path . '.' . SkipLarger::DELETED_FILE_EXTENSION )
|
166 |
+
&& ! file_exists( $output_path . '.' . SkipCrashed::CRASHED_FILE_EXTENSION )
|
167 |
+
);
|
168 |
+
}
|
169 |
+
|
170 |
private function get_paths_chunk_size( int $paths_count ): int {
|
171 |
$settings = $this->plugin_data->get_plugin_settings();
|
172 |
if ( $settings[ ConversionMethodOption::OPTION_NAME ] !== RemoteMethod::METHOD_NAME ) {
|
src/Conversion/PathsValidator.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WebpConverter\Conversion;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Handles checking if paths are supported for image conversion.
|
7 |
-
*/
|
8 |
-
trait PathsValidator {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* @param string $file_path .
|
12 |
-
* @param bool $skip_converted Skip images already converted?
|
13 |
-
* @param string[]|null $allowed_output_formats List of extensions or use selected in plugin settings.
|
14 |
-
*/
|
15 |
-
public function is_supported_source_file( string $file_path, bool $skip_converted = false, array $allowed_output_formats = null ): bool {
|
16 |
-
if ( ! $this->is_supported_source_directory( dirname( $file_path ) ) ) {
|
17 |
-
return false;
|
18 |
-
}
|
19 |
-
|
20 |
-
$server_path = $this->convert_server_path( $file_path );
|
21 |
-
return apply_filters( 'webpc_supported_source_file', true, basename( $server_path ), $server_path, $skip_converted, $allowed_output_formats );
|
22 |
-
}
|
23 |
-
|
24 |
-
public function is_supported_source_directory( string $directory_path ): bool {
|
25 |
-
$server_path = $this->convert_server_path( $directory_path );
|
26 |
-
return apply_filters( 'webpc_supported_source_directory', true, basename( $server_path ), $server_path );
|
27 |
-
}
|
28 |
-
|
29 |
-
private function convert_server_path( string $original_path ): string {
|
30 |
-
$server_path = urldecode( $original_path );
|
31 |
-
return (string) preg_replace( '/[\\\\\/]+/', DIRECTORY_SEPARATOR, $server_path );
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Conversion/SkipConvertedPaths.php
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WebpConverter\Conversion;
|
4 |
-
|
5 |
-
use WebpConverter\Conversion\Format\FormatFactory;
|
6 |
-
use WebpConverter\HookableInterface;
|
7 |
-
use WebpConverter\PluginData;
|
8 |
-
use WebpConverter\Settings\Option\ConversionMethodOption;
|
9 |
-
use WebpConverter\Settings\Option\OutputFormatsOption;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Removes from list of source file paths those that have already been converted.
|
13 |
-
*/
|
14 |
-
class SkipConvertedPaths implements HookableInterface {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @var PluginData
|
18 |
-
*/
|
19 |
-
private $plugin_data;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @var string[]
|
23 |
-
*/
|
24 |
-
private $extensions;
|
25 |
-
|
26 |
-
public function __construct( PluginData $plugin_data ) {
|
27 |
-
$this->plugin_data = $plugin_data;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* {@inheritdoc}
|
32 |
-
*/
|
33 |
-
public function init_hooks() {
|
34 |
-
add_filter( 'webpc_supported_source_file', [ $this, 'skip_converted_path' ], 0, 5 );
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Returns the status if the given file path should be converted.
|
39 |
-
*
|
40 |
-
* @param bool $path_status .
|
41 |
-
* @param string $filename .
|
42 |
-
* @param string $server_path .
|
43 |
-
* @param bool $skip_converted Skip images already converted?
|
44 |
-
* @param string[]|null $allowed_output_formats List of extensions or use selected in plugin settings.
|
45 |
-
*
|
46 |
-
* @return bool Status if the given path should be converted.
|
47 |
-
* @internal
|
48 |
-
*/
|
49 |
-
public function skip_converted_path(
|
50 |
-
bool $path_status,
|
51 |
-
string $filename,
|
52 |
-
string $server_path,
|
53 |
-
bool $skip_converted,
|
54 |
-
array $allowed_output_formats = null
|
55 |
-
): bool {
|
56 |
-
$this->extensions = $this->extensions ?: $this->get_output_extensions();
|
57 |
-
$directory = new OutputPath();
|
58 |
-
$output_paths = $directory->get_paths(
|
59 |
-
urldecode( $server_path ),
|
60 |
-
false,
|
61 |
-
( $allowed_output_formats === null ) ? $this->extensions : $allowed_output_formats
|
62 |
-
);
|
63 |
-
|
64 |
-
if ( $this->has_crashed_paths( $output_paths )
|
65 |
-
|| ( $skip_converted && $this->has_converted_paths( $output_paths ) ) ) {
|
66 |
-
return false;
|
67 |
-
}
|
68 |
-
|
69 |
-
return $path_status;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* @param string[] $output_paths .
|
74 |
-
*
|
75 |
-
* @return bool
|
76 |
-
*/
|
77 |
-
private function has_crashed_paths( array $output_paths ): bool {
|
78 |
-
foreach ( $output_paths as $output_path ) {
|
79 |
-
if ( file_exists( $output_path . '.' . SkipCrashed::CRASHED_FILE_EXTENSION ) ) {
|
80 |
-
return true;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
return false;
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* @param string[] $output_paths .
|
89 |
-
*
|
90 |
-
* @return bool
|
91 |
-
*/
|
92 |
-
private function has_converted_paths( array $output_paths ): bool {
|
93 |
-
foreach ( $output_paths as $output_path ) {
|
94 |
-
if ( ! file_exists( $output_path ) && ! file_exists( $output_path . '.' . SkipLarger::DELETED_FILE_EXTENSION ) ) {
|
95 |
-
return false;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
return true;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Returns list of file extensions in output directory.
|
104 |
-
*
|
105 |
-
* @return string[] Available output extensions.
|
106 |
-
*/
|
107 |
-
private function get_output_extensions(): array {
|
108 |
-
$settings = $this->plugin_data->get_plugin_settings();
|
109 |
-
$current_exts = $settings[ OutputFormatsOption::OPTION_NAME ];
|
110 |
-
$allowed_exts = ( new FormatFactory() )->get_available_formats( $settings[ ConversionMethodOption::OPTION_NAME ] ?? null );
|
111 |
-
|
112 |
-
$values = [];
|
113 |
-
foreach ( $allowed_exts as $extension => $format_label ) {
|
114 |
-
if ( in_array( $extension, $current_exts ) ) {
|
115 |
-
$values[] = $extension;
|
116 |
-
}
|
117 |
-
}
|
118 |
-
return $values;
|
119 |
-
}
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Error/Detector/RewritesErrorsDetector.php
CHANGED
@@ -46,10 +46,21 @@ class RewritesErrorsDetector implements ErrorDetector {
|
|
46 |
*/
|
47 |
private $file_loader;
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
$this->plugin_info = $plugin_info;
|
51 |
$this->plugin_data = $plugin_data;
|
52 |
$this->file_loader = $file_loader ?: new FileLoader( $plugin_info, $plugin_data );
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
@@ -125,11 +136,11 @@ class RewritesErrorsDetector implements ErrorDetector {
|
|
125 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_PNG, $path_file_png2 );
|
126 |
}
|
127 |
|
128 |
-
if ( ( $output_path =
|
129 |
&& ! file_exists( $output_path ) ) {
|
130 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_WEBP, $output_path );
|
131 |
}
|
132 |
-
if ( ( $output_path =
|
133 |
&& ! file_exists( $output_path ) ) {
|
134 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_WEBP, $output_path );
|
135 |
}
|
46 |
*/
|
47 |
private $file_loader;
|
48 |
|
49 |
+
/**
|
50 |
+
* @var OutputPath
|
51 |
+
*/
|
52 |
+
private $output_path;
|
53 |
+
|
54 |
+
public function __construct(
|
55 |
+
PluginInfo $plugin_info,
|
56 |
+
PluginData $plugin_data,
|
57 |
+
FileLoader $file_loader = null,
|
58 |
+
OutputPath $output_path = null
|
59 |
+
) {
|
60 |
$this->plugin_info = $plugin_info;
|
61 |
$this->plugin_data = $plugin_data;
|
62 |
$this->file_loader = $file_loader ?: new FileLoader( $plugin_info, $plugin_data );
|
63 |
+
$this->output_path = $output_path ?: new OutputPath();
|
64 |
}
|
65 |
|
66 |
/**
|
136 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_PNG, $path_file_png2 );
|
137 |
}
|
138 |
|
139 |
+
if ( ( $output_path = $this->output_path->get_path( $path_file_png, true, WebpFormat::FORMAT_EXTENSION ) )
|
140 |
&& ! file_exists( $output_path ) ) {
|
141 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_WEBP, $output_path );
|
142 |
}
|
143 |
+
if ( ( $output_path = $this->output_path->get_path( $path_file_png2, true, WebpFormat::FORMAT_EXTENSION ) )
|
144 |
&& ! file_exists( $output_path ) ) {
|
145 |
copy( $this->plugin_info->get_plugin_directory_path() . self::PATH_SOURCE_FILE_WEBP, $output_path );
|
146 |
}
|
src/Notice/LitespeedNotice.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WebpConverter\Notice;
|
4 |
+
|
5 |
+
use WebpConverter\Service\OptionsAccessManager;
|
6 |
+
use WebpConverter\Settings\Page\PageIntegration;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Supports notice asking to clear CDN cache for Cloudflare.
|
10 |
+
*/
|
11 |
+
class LitespeedNotice extends NoticeAbstract implements NoticeInterface {
|
12 |
+
|
13 |
+
const NOTICE_OPTION = 'webpc_notice_litespeed';
|
14 |
+
const NOTICE_VIEW_PATH = 'components/notices/litespeed.php';
|
15 |
+
const NOTICE_ACTION_NAME = 'webpc_notice_cloudflare';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* {@inheritdoc}
|
19 |
+
*/
|
20 |
+
public function get_option_name(): string {
|
21 |
+
return self::NOTICE_OPTION;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* {@inheritdoc}
|
26 |
+
*/
|
27 |
+
public function get_default_value(): string {
|
28 |
+
return '';
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
public function is_available(): bool {
|
35 |
+
if ( is_plugin_active( 'litespeed-cache/litespeed-cache.php' ) ) {
|
36 |
+
return ( isset( $_GET['page'] ) && ( $_GET['page'] === PageIntegration::ADMIN_MENU_PAGE ) ); // phpcs:ignore WordPress.Security.NonceVerification
|
37 |
+
}
|
38 |
+
|
39 |
+
return false;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* {@inheritdoc}
|
44 |
+
*/
|
45 |
+
public function is_active(): bool {
|
46 |
+
$option_value = OptionsAccessManager::get_option( $this->get_option_name() );
|
47 |
+
return ( $option_value !== 'yes' );
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* {@inheritdoc}
|
52 |
+
*/
|
53 |
+
public function get_disable_value(): string {
|
54 |
+
return 'yes';
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* {@inheritdoc}
|
59 |
+
*/
|
60 |
+
public function get_output_path(): string {
|
61 |
+
return self::NOTICE_VIEW_PATH;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* {@inheritdoc}
|
66 |
+
*/
|
67 |
+
public function get_vars_for_view(): array {
|
68 |
+
return [
|
69 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
70 |
+
'close_action' => self::NOTICE_ACTION_NAME,
|
71 |
+
];
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* {@inheritdoc}
|
76 |
+
*/
|
77 |
+
public function get_ajax_action_to_disable(): string {
|
78 |
+
return self::NOTICE_ACTION_NAME;
|
79 |
+
}
|
80 |
+
}
|
src/Plugin/Activation/DefaultSettings.php
CHANGED
@@ -4,6 +4,7 @@ namespace WebpConverter\Plugin\Activation;
|
|
4 |
|
5 |
use WebpConverter\Notice\AvifSupportNotice;
|
6 |
use WebpConverter\Notice\CloudflareNotice;
|
|
|
7 |
use WebpConverter\Notice\NoticeIntegration;
|
8 |
use WebpConverter\Notice\ThanksNotice;
|
9 |
use WebpConverter\Notice\WelcomeNotice;
|
@@ -38,6 +39,7 @@ class DefaultSettings {
|
|
38 |
( new NoticeIntegration( $this->plugin_info, new ThanksNotice() ) )->set_default_value();
|
39 |
( new NoticeIntegration( $this->plugin_info, new AvifSupportNotice() ) )->set_default_value();
|
40 |
( new NoticeIntegration( $this->plugin_info, new CloudflareNotice() ) )->set_default_value();
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
4 |
|
5 |
use WebpConverter\Notice\AvifSupportNotice;
|
6 |
use WebpConverter\Notice\CloudflareNotice;
|
7 |
+
use WebpConverter\Notice\LitespeedNotice;
|
8 |
use WebpConverter\Notice\NoticeIntegration;
|
9 |
use WebpConverter\Notice\ThanksNotice;
|
10 |
use WebpConverter\Notice\WelcomeNotice;
|
39 |
( new NoticeIntegration( $this->plugin_info, new ThanksNotice() ) )->set_default_value();
|
40 |
( new NoticeIntegration( $this->plugin_info, new AvifSupportNotice() ) )->set_default_value();
|
41 |
( new NoticeIntegration( $this->plugin_info, new CloudflareNotice() ) )->set_default_value();
|
42 |
+
( new NoticeIntegration( $this->plugin_info, new LitespeedNotice() ) )->set_default_value();
|
43 |
}
|
44 |
|
45 |
/**
|
src/Plugin/Deactivation/PluginSettings.php
CHANGED
@@ -4,6 +4,7 @@ namespace WebpConverter\Plugin\Deactivation;
|
|
4 |
|
5 |
use WebpConverter\Conversion\Cron\CronStatusManager;
|
6 |
use WebpConverter\Notice\CloudflareNotice;
|
|
|
7 |
use WebpConverter\Service\OptionsAccessManager;
|
8 |
|
9 |
/**
|
@@ -18,6 +19,7 @@ class PluginSettings {
|
|
18 |
*/
|
19 |
public function remove_plugin_settings() {
|
20 |
OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
|
|
|
21 |
|
22 |
delete_site_transient( CronStatusManager::CRON_PATHS_TRANSIENT );
|
23 |
delete_site_transient( CronStatusManager::CRON_PATHS_SKIPPED_TRANSIENT );
|
4 |
|
5 |
use WebpConverter\Conversion\Cron\CronStatusManager;
|
6 |
use WebpConverter\Notice\CloudflareNotice;
|
7 |
+
use WebpConverter\Notice\LitespeedNotice;
|
8 |
use WebpConverter\Service\OptionsAccessManager;
|
9 |
|
10 |
/**
|
19 |
*/
|
20 |
public function remove_plugin_settings() {
|
21 |
OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
|
22 |
+
OptionsAccessManager::delete_option( LitespeedNotice::NOTICE_OPTION );
|
23 |
|
24 |
delete_site_transient( CronStatusManager::CRON_PATHS_TRANSIENT );
|
25 |
delete_site_transient( CronStatusManager::CRON_PATHS_SKIPPED_TRANSIENT );
|
src/Plugin/Uninstall/PluginSettings.php
CHANGED
@@ -6,6 +6,7 @@ use WebpConverter\Conversion\Cron\CronStatusManager;
|
|
6 |
use WebpConverter\Error\ErrorDetectorAggregator;
|
7 |
use WebpConverter\Notice\AvifSupportNotice;
|
8 |
use WebpConverter\Notice\CloudflareNotice;
|
|
|
9 |
use WebpConverter\Notice\ThanksNotice;
|
10 |
use WebpConverter\Notice\WelcomeNotice;
|
11 |
use WebpConverter\Plugin\Update;
|
@@ -30,6 +31,7 @@ class PluginSettings {
|
|
30 |
OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OPTION );
|
31 |
OptionsAccessManager::delete_option( AvifSupportNotice::NOTICE_OPTION );
|
32 |
OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
|
|
|
33 |
|
34 |
OptionsAccessManager::delete_option( ErrorDetectorAggregator::ERRORS_CACHE_OPTION );
|
35 |
OptionsAccessManager::delete_option( SettingsSave::SETTINGS_OPTION );
|
6 |
use WebpConverter\Error\ErrorDetectorAggregator;
|
7 |
use WebpConverter\Notice\AvifSupportNotice;
|
8 |
use WebpConverter\Notice\CloudflareNotice;
|
9 |
+
use WebpConverter\Notice\LitespeedNotice;
|
10 |
use WebpConverter\Notice\ThanksNotice;
|
11 |
use WebpConverter\Notice\WelcomeNotice;
|
12 |
use WebpConverter\Plugin\Update;
|
31 |
OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OPTION );
|
32 |
OptionsAccessManager::delete_option( AvifSupportNotice::NOTICE_OPTION );
|
33 |
OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
|
34 |
+
OptionsAccessManager::delete_option( LitespeedNotice::NOTICE_OPTION );
|
35 |
|
36 |
OptionsAccessManager::delete_option( ErrorDetectorAggregator::ERRORS_CACHE_OPTION );
|
37 |
OptionsAccessManager::delete_option( SettingsSave::SETTINGS_OPTION );
|
src/Settings/Option/AccessTokenOption.php
CHANGED
@@ -17,8 +17,8 @@ class AccessTokenOption extends OptionAbstract {
|
|
17 |
*/
|
18 |
private $token_repository;
|
19 |
|
20 |
-
public function __construct( TokenRepository $token_repository
|
21 |
-
$this->token_repository = $token_repository
|
22 |
}
|
23 |
|
24 |
/**
|
17 |
*/
|
18 |
private $token_repository;
|
19 |
|
20 |
+
public function __construct( TokenRepository $token_repository ) {
|
21 |
+
$this->token_repository = $token_repository;
|
22 |
}
|
23 |
|
24 |
/**
|
src/Settings/Option/ConversionMethodOption.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
namespace WebpConverter\Settings\Option;
|
4 |
|
5 |
use WebpConverter\Conversion\Method\MethodFactory;
|
|
|
6 |
use WebpConverter\WebpConverterConstants;
|
7 |
|
8 |
/**
|
@@ -12,6 +13,11 @@ class ConversionMethodOption extends OptionAbstract {
|
|
12 |
|
13 |
const OPTION_NAME = 'method';
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Object of integration class supports all output formats.
|
17 |
*
|
@@ -19,7 +25,8 @@ class ConversionMethodOption extends OptionAbstract {
|
|
19 |
*/
|
20 |
private $methods_integration;
|
21 |
|
22 |
-
public function __construct() {
|
|
|
23 |
$this->methods_integration = new MethodFactory();
|
24 |
}
|
25 |
|
@@ -55,15 +62,19 @@ class ConversionMethodOption extends OptionAbstract {
|
|
55 |
* {@inheritdoc}
|
56 |
*/
|
57 |
public function get_notice_lines() {
|
58 |
-
|
59 |
__( 'The Remote server allows you to reduce the server load, because your images are converted by our server. This option is also useful when the server does not meet all of the plugin\'s technical requirements.', 'webp-converter-for-media' ),
|
60 |
-
|
|
|
|
|
|
|
61 |
/* translators: %1$s: open anchor tag, %2$s: close anchor tag */
|
62 |
__( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
|
63 |
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-info' ) ) . '" target="_blank">',
|
64 |
'<span class="dashicons dashicons-arrow-right-alt"></span></a>'
|
65 |
-
)
|
66 |
-
|
|
|
67 |
}
|
68 |
|
69 |
/**
|
3 |
namespace WebpConverter\Settings\Option;
|
4 |
|
5 |
use WebpConverter\Conversion\Method\MethodFactory;
|
6 |
+
use WebpConverter\Repository\TokenRepository;
|
7 |
use WebpConverter\WebpConverterConstants;
|
8 |
|
9 |
/**
|
13 |
|
14 |
const OPTION_NAME = 'method';
|
15 |
|
16 |
+
/**
|
17 |
+
* @var TokenRepository
|
18 |
+
*/
|
19 |
+
private $token_repository;
|
20 |
+
|
21 |
/**
|
22 |
* Object of integration class supports all output formats.
|
23 |
*
|
25 |
*/
|
26 |
private $methods_integration;
|
27 |
|
28 |
+
public function __construct( TokenRepository $token_repository ) {
|
29 |
+
$this->token_repository = $token_repository;
|
30 |
$this->methods_integration = new MethodFactory();
|
31 |
}
|
32 |
|
62 |
* {@inheritdoc}
|
63 |
*/
|
64 |
public function get_notice_lines() {
|
65 |
+
$notice = [
|
66 |
__( 'The Remote server allows you to reduce the server load, because your images are converted by our server. This option is also useful when the server does not meet all of the plugin\'s technical requirements.', 'webp-converter-for-media' ),
|
67 |
+
];
|
68 |
+
|
69 |
+
if ( $this->token_repository->get_token()->get_token_value() === null ) {
|
70 |
+
$notice[] = sprintf(
|
71 |
/* translators: %1$s: open anchor tag, %2$s: close anchor tag */
|
72 |
__( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
|
73 |
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-info' ) ) . '" target="_blank">',
|
74 |
'<span class="dashicons dashicons-arrow-right-alt"></span></a>'
|
75 |
+
);
|
76 |
+
}
|
77 |
+
return $notice;
|
78 |
}
|
79 |
|
80 |
/**
|
src/Settings/Option/ExtraFeaturesOption.php
CHANGED
@@ -22,7 +22,7 @@ class ExtraFeaturesOption extends OptionAbstract {
|
|
22 |
* {@inheritdoc}
|
23 |
*/
|
24 |
public function get_priority(): int {
|
25 |
-
return
|
26 |
}
|
27 |
|
28 |
/**
|
22 |
* {@inheritdoc}
|
23 |
*/
|
24 |
public function get_priority(): int {
|
25 |
+
return 90;
|
26 |
}
|
27 |
|
28 |
/**
|
src/Settings/Option/ImageResizeOption.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WebpConverter\Settings\Option;
|
4 |
+
|
5 |
+
use WebpConverter\Repository\TokenRepository;
|
6 |
+
use WebpConverter\WebpConverterConstants;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* {@inheritdoc}
|
10 |
+
*/
|
11 |
+
class ImageResizeOption extends OptionAbstract {
|
12 |
+
|
13 |
+
const OPTION_NAME = 'image_resize';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var TokenRepository
|
17 |
+
*/
|
18 |
+
private $token_repository;
|
19 |
+
|
20 |
+
public function __construct( TokenRepository $token_repository ) {
|
21 |
+
$this->token_repository = $token_repository;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* {@inheritdoc}
|
26 |
+
*/
|
27 |
+
public function get_priority(): int {
|
28 |
+
return 70;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
public function get_name(): string {
|
35 |
+
return self::OPTION_NAME;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* {@inheritdoc}
|
40 |
+
*/
|
41 |
+
public function get_type(): string {
|
42 |
+
return OptionAbstract::OPTION_TYPE_IMAGE_SIZE;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* {@inheritdoc}
|
47 |
+
*/
|
48 |
+
public function get_label(): string {
|
49 |
+
return __( 'Maximum image dimensions', 'webp-converter-for-media' );
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* {@inheritdoc}
|
54 |
+
*/
|
55 |
+
public function get_info(): string {
|
56 |
+
$message = __( 'Resize large images to maximum dimensions in pixels during image conversion, keeping the original aspect ratio', 'webp-converter-for-media' );
|
57 |
+
|
58 |
+
if ( ! $this->token_repository->get_token()->get_valid_status() ) {
|
59 |
+
return sprintf(
|
60 |
+
/* translators: %1$s: option name, %2$s: open anchor tag, %3$s: close anchor tag */
|
61 |
+
__( '%1$s (available in %2$sthe PRO version%3$s)', 'webp-converter-for-media' ),
|
62 |
+
$message,
|
63 |
+
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-upgrade' ) ) . '" target="_blank">',
|
64 |
+
'</a>'
|
65 |
+
);
|
66 |
+
}
|
67 |
+
return $message;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* {@inheritdoc}
|
72 |
+
*/
|
73 |
+
public function get_notice_lines() {
|
74 |
+
$sizes = wp_get_additional_image_sizes();
|
75 |
+
usort(
|
76 |
+
$sizes,
|
77 |
+
function ( $a, $b ) {
|
78 |
+
if ( $a['width'] === $a['height'] ) {
|
79 |
+
return $b['height'] - $a['height'];
|
80 |
+
}
|
81 |
+
return $b['width'] - $a['width'];
|
82 |
+
}
|
83 |
+
);
|
84 |
+
|
85 |
+
$notice = [
|
86 |
+
sprintf(
|
87 |
+
/* translators: %1$s: width value, %2$s: height value */
|
88 |
+
__( 'Reduce even more the weight of converted images that are larger than their largest image size (thumbnail size) using in your theme. The recommended value for you is %1$s x %2$s pixels.', 'webp-converter-for-media' ),
|
89 |
+
$sizes[0]['width'] ?? 0,
|
90 |
+
$sizes[0]['height'] ?? 0
|
91 |
+
),
|
92 |
+
];
|
93 |
+
|
94 |
+
if ( $this->token_repository->get_token()->get_token_value() === null ) {
|
95 |
+
$notice[] = sprintf(
|
96 |
+
/* translators: %1$s: open anchor tag, %2$s: close anchor tag */
|
97 |
+
__( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
|
98 |
+
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-info' ) ) . '" target="_blank">',
|
99 |
+
'<span class="dashicons dashicons-arrow-right-alt"></span></a>'
|
100 |
+
);
|
101 |
+
}
|
102 |
+
return $notice;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* {@inheritdoc}
|
107 |
+
*
|
108 |
+
* @return string[]
|
109 |
+
*/
|
110 |
+
public function get_values( array $settings ): array {
|
111 |
+
return [];
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* {@inheritdoc}
|
116 |
+
*
|
117 |
+
* @return string[]
|
118 |
+
*/
|
119 |
+
public function get_default_value( array $settings = null ): array {
|
120 |
+
return [ '', '', '' ];
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* {@inheritdoc}
|
125 |
+
*
|
126 |
+
* @return string[]
|
127 |
+
*/
|
128 |
+
public function get_disabled_values( array $settings ): array {
|
129 |
+
if ( ! $this->token_repository->get_token()->get_valid_status() ) {
|
130 |
+
return [ 'yes' ];
|
131 |
+
}
|
132 |
+
return [];
|
133 |
+
}
|
134 |
+
}
|
src/Settings/Option/LoaderTypeOption.php
CHANGED
@@ -16,7 +16,7 @@ class LoaderTypeOption extends OptionAbstract {
|
|
16 |
* {@inheritdoc}
|
17 |
*/
|
18 |
public function get_priority(): int {
|
19 |
-
return
|
20 |
}
|
21 |
|
22 |
/**
|
16 |
* {@inheritdoc}
|
17 |
*/
|
18 |
public function get_priority(): int {
|
19 |
+
return 80;
|
20 |
}
|
21 |
|
22 |
/**
|
src/Settings/Option/OptionAbstract.php
CHANGED
@@ -7,11 +7,12 @@ namespace WebpConverter\Settings\Option;
|
|
7 |
*/
|
8 |
abstract class OptionAbstract implements OptionInterface {
|
9 |
|
10 |
-
const OPTION_TYPE_CHECKBOX
|
11 |
-
const OPTION_TYPE_RADIO
|
12 |
-
const OPTION_TYPE_QUALITY
|
13 |
-
const OPTION_TYPE_INPUT
|
14 |
-
const OPTION_TYPE_TOKEN
|
|
|
15 |
|
16 |
/**
|
17 |
* {@inheritdoc}
|
7 |
*/
|
8 |
abstract class OptionAbstract implements OptionInterface {
|
9 |
|
10 |
+
const OPTION_TYPE_CHECKBOX = 'checkbox';
|
11 |
+
const OPTION_TYPE_RADIO = 'radio';
|
12 |
+
const OPTION_TYPE_QUALITY = 'quality';
|
13 |
+
const OPTION_TYPE_INPUT = 'input';
|
14 |
+
const OPTION_TYPE_TOKEN = 'token';
|
15 |
+
const OPTION_TYPE_IMAGE_SIZE = 'image_size';
|
16 |
|
17 |
/**
|
18 |
* {@inheritdoc}
|
src/Settings/Option/OptionIntegration.php
CHANGED
@@ -87,6 +87,19 @@ class OptionIntegration {
|
|
87 |
case OptionAbstract::OPTION_TYPE_INPUT:
|
88 |
case OptionAbstract::OPTION_TYPE_TOKEN:
|
89 |
return sanitize_text_field( $current_value );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
return null;
|
87 |
case OptionAbstract::OPTION_TYPE_INPUT:
|
88 |
case OptionAbstract::OPTION_TYPE_TOKEN:
|
89 |
return sanitize_text_field( $current_value );
|
90 |
+
case OptionAbstract::OPTION_TYPE_IMAGE_SIZE:
|
91 |
+
if ( ! is_array( $current_value ) ) {
|
92 |
+
return [ '', '', '' ];
|
93 |
+
}
|
94 |
+
|
95 |
+
$value_min = intval( $current_value[1] ?? '' );
|
96 |
+
$value_max = intval( $current_value[2] ?? '' );
|
97 |
+
|
98 |
+
return [
|
99 |
+
( ( $current_value[0] ?? '' ) === 'yes' ) ? 'yes' : '',
|
100 |
+
( $value_min <= 1 ) ? '' : (string) $value_min,
|
101 |
+
( $value_max <= 1 ) ? '' : (string) $value_max,
|
102 |
+
];
|
103 |
}
|
104 |
|
105 |
return null;
|
src/Settings/Option/OptionsAggregator.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace WebpConverter\Settings\Option;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* .
|
7 |
*/
|
@@ -14,15 +16,17 @@ class OptionsAggregator {
|
|
14 |
*/
|
15 |
private $options = [];
|
16 |
|
17 |
-
public function __construct() {
|
18 |
-
$
|
|
|
19 |
|
20 |
-
$this->set_option( new SupportedExtensionsOption() );
|
21 |
$this->set_option( new SupportedDirectoriesOption() );
|
22 |
-
$this->set_option( new AccessTokenOption() );
|
23 |
-
$this->set_option( new OutputFormatsOption( $conversion_method ) );
|
24 |
$this->set_option( $conversion_method );
|
25 |
$this->set_option( new ImagesQualityOption() );
|
|
|
26 |
$this->set_option( new LoaderTypeOption() );
|
27 |
$this->set_option( new ExtraFeaturesOption() );
|
28 |
}
|
2 |
|
3 |
namespace WebpConverter\Settings\Option;
|
4 |
|
5 |
+
use WebpConverter\Repository\TokenRepository;
|
6 |
+
|
7 |
/**
|
8 |
* .
|
9 |
*/
|
16 |
*/
|
17 |
private $options = [];
|
18 |
|
19 |
+
public function __construct( TokenRepository $token_repository = null ) {
|
20 |
+
$token_repository = $token_repository ?: new TokenRepository();
|
21 |
+
$conversion_method = new ConversionMethodOption( $token_repository );
|
22 |
|
23 |
+
$this->set_option( new SupportedExtensionsOption( $token_repository ) );
|
24 |
$this->set_option( new SupportedDirectoriesOption() );
|
25 |
+
$this->set_option( new AccessTokenOption( $token_repository ) );
|
26 |
+
$this->set_option( new OutputFormatsOption( $token_repository, $conversion_method ) );
|
27 |
$this->set_option( $conversion_method );
|
28 |
$this->set_option( new ImagesQualityOption() );
|
29 |
+
$this->set_option( new ImageResizeOption( $token_repository ) );
|
30 |
$this->set_option( new LoaderTypeOption() );
|
31 |
$this->set_option( new ExtraFeaturesOption() );
|
32 |
}
|
src/Settings/Option/OutputFormatsOption.php
CHANGED
@@ -5,6 +5,7 @@ namespace WebpConverter\Settings\Option;
|
|
5 |
use WebpConverter\Conversion\Format\AvifFormat;
|
6 |
use WebpConverter\Conversion\Format\FormatFactory;
|
7 |
use WebpConverter\Conversion\Format\WebpFormat;
|
|
|
8 |
use WebpConverter\WebpConverterConstants;
|
9 |
|
10 |
/**
|
@@ -14,6 +15,11 @@ class OutputFormatsOption extends OptionAbstract {
|
|
14 |
|
15 |
const OPTION_NAME = 'output_formats';
|
16 |
|
|
|
|
|
|
|
|
|
|
|
17 |
/**
|
18 |
* @var ConversionMethodOption
|
19 |
*/
|
@@ -26,7 +32,8 @@ class OutputFormatsOption extends OptionAbstract {
|
|
26 |
*/
|
27 |
private $formats_integration;
|
28 |
|
29 |
-
public function __construct( ConversionMethodOption $conversion_method_option ) {
|
|
|
30 |
$this->conversion_method_option = $conversion_method_option;
|
31 |
$this->formats_integration = new FormatFactory();
|
32 |
}
|
@@ -63,15 +70,19 @@ class OutputFormatsOption extends OptionAbstract {
|
|
63 |
* {@inheritdoc}
|
64 |
*/
|
65 |
public function get_notice_lines() {
|
66 |
-
|
67 |
__( 'The AVIF format is a new extension - is the successor to WebP. It allows you to achieve even higher levels of image compression, and the quality of the converted images is better than in WebP.', 'webp-converter-for-media' ),
|
68 |
-
|
|
|
|
|
|
|
69 |
/* translators: %1$s: open anchor tag, %2$s: close anchor tag */
|
70 |
__( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
|
71 |
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-info' ) ) . '" target="_blank">',
|
72 |
'<span class="dashicons dashicons-arrow-right-alt"></span></a>'
|
73 |
-
)
|
74 |
-
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
5 |
use WebpConverter\Conversion\Format\AvifFormat;
|
6 |
use WebpConverter\Conversion\Format\FormatFactory;
|
7 |
use WebpConverter\Conversion\Format\WebpFormat;
|
8 |
+
use WebpConverter\Repository\TokenRepository;
|
9 |
use WebpConverter\WebpConverterConstants;
|
10 |
|
11 |
/**
|
15 |
|
16 |
const OPTION_NAME = 'output_formats';
|
17 |
|
18 |
+
/**
|
19 |
+
* @var TokenRepository
|
20 |
+
*/
|
21 |
+
private $token_repository;
|
22 |
+
|
23 |
/**
|
24 |
* @var ConversionMethodOption
|
25 |
*/
|
32 |
*/
|
33 |
private $formats_integration;
|
34 |
|
35 |
+
public function __construct( TokenRepository $token_repository, ConversionMethodOption $conversion_method_option ) {
|
36 |
+
$this->token_repository = $token_repository;
|
37 |
$this->conversion_method_option = $conversion_method_option;
|
38 |
$this->formats_integration = new FormatFactory();
|
39 |
}
|
70 |
* {@inheritdoc}
|
71 |
*/
|
72 |
public function get_notice_lines() {
|
73 |
+
$notice = [
|
74 |
__( 'The AVIF format is a new extension - is the successor to WebP. It allows you to achieve even higher levels of image compression, and the quality of the converted images is better than in WebP.', 'webp-converter-for-media' ),
|
75 |
+
];
|
76 |
+
|
77 |
+
if ( $this->token_repository->get_token()->get_token_value() === null ) {
|
78 |
+
$notice[] = sprintf(
|
79 |
/* translators: %1$s: open anchor tag, %2$s: close anchor tag */
|
80 |
__( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
|
81 |
'<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-info' ) ) . '" target="_blank">',
|
82 |
'<span class="dashicons dashicons-arrow-right-alt"></span></a>'
|
83 |
+
);
|
84 |
+
}
|
85 |
+
return $notice;
|
86 |
}
|
87 |
|
88 |
/**
|
src/Settings/Option/SupportedExtensionsOption.php
CHANGED
@@ -17,8 +17,8 @@ class SupportedExtensionsOption extends OptionAbstract {
|
|
17 |
*/
|
18 |
private $token_repository;
|
19 |
|
20 |
-
public function __construct( TokenRepository $token_repository
|
21 |
-
$this->token_repository = $token_repository
|
22 |
}
|
23 |
|
24 |
/**
|
17 |
*/
|
18 |
private $token_repository;
|
19 |
|
20 |
+
public function __construct( TokenRepository $token_repository ) {
|
21 |
+
$this->token_repository = $token_repository;
|
22 |
}
|
23 |
|
24 |
/**
|
src/WebpConverter.php
CHANGED
@@ -33,7 +33,6 @@ class WebpConverter {
|
|
33 |
( new Endpoint\EndpointIntegration( new Endpoint\PathsEndpoint( $plugin_data, $token_repository ) ) )->init_hooks();
|
34 |
( new Endpoint\EndpointIntegration( new Endpoint\RegenerateEndpoint( $plugin_data ) ) )->init_hooks();
|
35 |
( new Endpoint\EndpointIntegration( new Endpoint\CronConversionEndpoint( $plugin_data, $token_repository ) ) )->init_hooks();
|
36 |
-
( new Conversion\SkipConvertedPaths( $plugin_data ) )->init_hooks();
|
37 |
( new Conversion\SkipExcludedPaths() )->init_hooks();
|
38 |
( new Cron\CronEventGenerator( $plugin_data, $token_repository ) )->init_hooks();
|
39 |
( new Cron\CronSchedulesGenerator() )->init_hooks();
|
@@ -43,6 +42,7 @@ class WebpConverter {
|
|
43 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\ThanksNotice() ) )->init_hooks();
|
44 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\AvifSupportNotice( $token_repository ) ) )->init_hooks();
|
45 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\CloudflareNotice() ) )->init_hooks();
|
|
|
46 |
( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
|
47 |
( new Loader\LoaderIntegration( new Loader\PassthruLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
|
48 |
( new Media\Delete() )->init_hooks();
|
33 |
( new Endpoint\EndpointIntegration( new Endpoint\PathsEndpoint( $plugin_data, $token_repository ) ) )->init_hooks();
|
34 |
( new Endpoint\EndpointIntegration( new Endpoint\RegenerateEndpoint( $plugin_data ) ) )->init_hooks();
|
35 |
( new Endpoint\EndpointIntegration( new Endpoint\CronConversionEndpoint( $plugin_data, $token_repository ) ) )->init_hooks();
|
|
|
36 |
( new Conversion\SkipExcludedPaths() )->init_hooks();
|
37 |
( new Cron\CronEventGenerator( $plugin_data, $token_repository ) )->init_hooks();
|
38 |
( new Cron\CronSchedulesGenerator() )->init_hooks();
|
42 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\ThanksNotice() ) )->init_hooks();
|
43 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\AvifSupportNotice( $token_repository ) ) )->init_hooks();
|
44 |
( new Notice\NoticeIntegration( $plugin_info, new Notice\CloudflareNotice() ) )->init_hooks();
|
45 |
+
( new Notice\NoticeIntegration( $plugin_info, new Notice\LitespeedNotice() ) )->init_hooks();
|
46 |
( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
|
47 |
( new Loader\LoaderIntegration( new Loader\PassthruLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
|
48 |
( new Media\Delete() )->init_hooks();
|
templates/components/fields/checkbox.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
templates/components/fields/image_size.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
+
*
|
5 |
+
* @var mixed[] $option Data of field.
|
6 |
+
* @var string $index Index of field.
|
7 |
+
* @package WebP Converter for Media
|
8 |
+
*/
|
9 |
+
|
10 |
+
?>
|
11 |
+
<div class="webpField">
|
12 |
+
<input type="checkbox"
|
13 |
+
name="<?php echo esc_attr( $option['name'] ); ?>[0]"
|
14 |
+
value="yes"
|
15 |
+
id="<?php echo esc_attr( $option['name'] ); ?>"
|
16 |
+
class="webpField__input webpField__input--checkbox"
|
17 |
+
data-inputs-group-toggle="<?php echo esc_attr( $option['name'] ); ?>"
|
18 |
+
<?php echo ( ( $option['value'][0] ?? '' ) === 'yes' ) ? 'checked' : ''; ?>
|
19 |
+
<?php echo ( in_array( 'yes', $option['disabled'] ) ) ? 'disabled' : ''; ?>
|
20 |
+
>
|
21 |
+
<label for="<?php echo esc_attr( $option['name'] ); ?>"></label>
|
22 |
+
<span class="webpField__label"><?php echo wp_kses_post( $option['info'] ); ?></span>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<div class="webpField webpField--center">
|
26 |
+
<span class="webpField__label">
|
27 |
+
<?php echo esc_html( __( 'Max. width:', 'webp-converter-for-media' ) ); ?>
|
28 |
+
</span>
|
29 |
+
<div class="webpInput">
|
30 |
+
<input type="number" min="0" step="1"
|
31 |
+
name="<?php echo esc_attr( $option['name'] ); ?>[1]"
|
32 |
+
value="<?php echo esc_attr( $option['value'][1] ?? '' ); ?>"
|
33 |
+
id="<?php echo esc_attr( $option['name'] ); ?>"
|
34 |
+
class="webpInput__field webpInput__field--small"
|
35 |
+
data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
|
36 |
+
<?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
|
37 |
+
>
|
38 |
+
</div>
|
39 |
+
<span class="webpField__label">
|
40 |
+
<?php echo esc_html( __( 'Max. height:', 'webp-converter-for-media' ) ); ?>
|
41 |
+
</span>
|
42 |
+
<div class="webpInput">
|
43 |
+
<input type="number" min="0" step="1"
|
44 |
+
name="<?php echo esc_attr( $option['name'] ); ?>[2]"
|
45 |
+
value="<?php echo esc_attr( $option['value'][2] ?? '' ); ?>"
|
46 |
+
id="<?php echo esc_attr( $option['name'] ); ?>"
|
47 |
+
class="webpInput__field webpInput__field--small"
|
48 |
+
data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
|
49 |
+
<?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
|
50 |
+
>
|
51 |
+
</div>
|
52 |
+
</div>
|
templates/components/fields/input.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
templates/components/fields/quality.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
templates/components/fields/radio.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
*
|
5 |
* @var mixed[] $option Data of field.
|
6 |
* @var string $index Index of field.
|
templates/components/fields/token.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* @var string $submit_activate_token .
|
6 |
* @var string $submit_deactivate_token .
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Field displayed in plugin settings form.
|
4 |
*
|
5 |
* @var string $submit_activate_token .
|
6 |
* @var string $submit_deactivate_token .
|
templates/components/notices/cloudflare.php
CHANGED
@@ -17,7 +17,11 @@
|
|
17 |
<p>
|
18 |
<?php
|
19 |
echo esc_html(
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
);
|
22 |
?>
|
23 |
</p>
|
17 |
<p>
|
18 |
<?php
|
19 |
echo esc_html(
|
20 |
+
sprintf(
|
21 |
+
/* translators: %1$s: service name */
|
22 |
+
__( 'You are using %1$s, right? Please follow the steps below for the plugin to function properly:', 'webp-converter-for-media' ),
|
23 |
+
'Cloudflare'
|
24 |
+
)
|
25 |
);
|
26 |
?>
|
27 |
</p>
|
templates/components/notices/litespeed.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Notice displayed in admin panel.
|
4 |
+
*
|
5 |
+
* @var string $ajax_url URL of admin-ajax.
|
6 |
+
* @var string $close_action Action using in WP Ajax.
|
7 |
+
* @package WebP Converter for Media
|
8 |
+
*/
|
9 |
+
|
10 |
+
?>
|
11 |
+
<div class="notice notice-success is-dismissible"
|
12 |
+
data-notice="webp-converter-for-media"
|
13 |
+
data-notice-action="<?php echo esc_attr( $close_action ); ?>"
|
14 |
+
data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
|
15 |
+
>
|
16 |
+
<div class="webpContent webpContent--notice">
|
17 |
+
<p>
|
18 |
+
<?php
|
19 |
+
echo esc_html(
|
20 |
+
sprintf(
|
21 |
+
/* translators: %1$s: service name */
|
22 |
+
__( 'You are using %1$s, right? Please follow the steps below for the plugin to function properly:', 'webp-converter-for-media' ),
|
23 |
+
'LiteSpeed Cache'
|
24 |
+
)
|
25 |
+
);
|
26 |
+
?>
|
27 |
+
</p>
|
28 |
+
<ul>
|
29 |
+
<li>
|
30 |
+
1.
|
31 |
+
<?php
|
32 |
+
echo wp_kses_post(
|
33 |
+
sprintf(
|
34 |
+
/* translators: %1$s: button label */
|
35 |
+
__( 'Look for the %1$s icon in the admin bar.', 'webp-converter-for-media' ),
|
36 |
+
'<strong>"LiteSpeed Cache Purge All - LSCache"</strong>'
|
37 |
+
)
|
38 |
+
);
|
39 |
+
?>
|
40 |
+
</li>
|
41 |
+
<li>
|
42 |
+
2.
|
43 |
+
<?php
|
44 |
+
echo wp_kses_post(
|
45 |
+
sprintf(
|
46 |
+
/* translators: %1$s: button label */
|
47 |
+
__( 'Click %1$s.', 'webp-converter-for-media' ),
|
48 |
+
'<strong>"Purge All"</strong>'
|
49 |
+
)
|
50 |
+
);
|
51 |
+
?>
|
52 |
+
</li>
|
53 |
+
</ul>
|
54 |
+
<div class="webpContent__buttons">
|
55 |
+
<button type="button" data-permanently
|
56 |
+
class="webpContent__button webpButton webpButton--blue webpButton--bg"
|
57 |
+
>
|
58 |
+
<?php echo esc_html( __( 'Done', 'webp-converter-for-media' ) ); ?>
|
59 |
+
</button>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
</div>
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -65,8 +65,6 @@ return array(
|
|
65 |
'WebpConverter\\Conversion\\Method\\RemoteMethod' => $baseDir . '/src/Conversion/Method/RemoteMethod.php',
|
66 |
'WebpConverter\\Conversion\\OutputPath' => $baseDir . '/src/Conversion/OutputPath.php',
|
67 |
'WebpConverter\\Conversion\\PathsFinder' => $baseDir . '/src/Conversion/PathsFinder.php',
|
68 |
-
'WebpConverter\\Conversion\\PathsValidator' => $baseDir . '/src/Conversion/PathsValidator.php',
|
69 |
-
'WebpConverter\\Conversion\\SkipConvertedPaths' => $baseDir . '/src/Conversion/SkipConvertedPaths.php',
|
70 |
'WebpConverter\\Conversion\\SkipCrashed' => $baseDir . '/src/Conversion/SkipCrashed.php',
|
71 |
'WebpConverter\\Conversion\\SkipExcludedPaths' => $baseDir . '/src/Conversion/SkipExcludedPaths.php',
|
72 |
'WebpConverter\\Conversion\\SkipLarger' => $baseDir . '/src/Conversion/SkipLarger.php',
|
@@ -125,6 +123,7 @@ return array(
|
|
125 |
'WebpConverter\\Model\\Token' => $baseDir . '/src/Model/Token.php',
|
126 |
'WebpConverter\\Notice\\AvifSupportNotice' => $baseDir . '/src/Notice/AvifSupportNotice.php',
|
127 |
'WebpConverter\\Notice\\CloudflareNotice' => $baseDir . '/src/Notice/CloudflareNotice.php',
|
|
|
128 |
'WebpConverter\\Notice\\NoticeAbstract' => $baseDir . '/src/Notice/NoticeAbstract.php',
|
129 |
'WebpConverter\\Notice\\NoticeIntegration' => $baseDir . '/src/Notice/NoticeIntegration.php',
|
130 |
'WebpConverter\\Notice\\NoticeInterface' => $baseDir . '/src/Notice/NoticeInterface.php',
|
@@ -162,6 +161,7 @@ return array(
|
|
162 |
'WebpConverter\\Settings\\Option\\AccessTokenOption' => $baseDir . '/src/Settings/Option/AccessTokenOption.php',
|
163 |
'WebpConverter\\Settings\\Option\\ConversionMethodOption' => $baseDir . '/src/Settings/Option/ConversionMethodOption.php',
|
164 |
'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => $baseDir . '/src/Settings/Option/ExtraFeaturesOption.php',
|
|
|
165 |
'WebpConverter\\Settings\\Option\\ImagesQualityOption' => $baseDir . '/src/Settings/Option/ImagesQualityOption.php',
|
166 |
'WebpConverter\\Settings\\Option\\LoaderTypeOption' => $baseDir . '/src/Settings/Option/LoaderTypeOption.php',
|
167 |
'WebpConverter\\Settings\\Option\\OptionAbstract' => $baseDir . '/src/Settings/Option/OptionAbstract.php',
|
65 |
'WebpConverter\\Conversion\\Method\\RemoteMethod' => $baseDir . '/src/Conversion/Method/RemoteMethod.php',
|
66 |
'WebpConverter\\Conversion\\OutputPath' => $baseDir . '/src/Conversion/OutputPath.php',
|
67 |
'WebpConverter\\Conversion\\PathsFinder' => $baseDir . '/src/Conversion/PathsFinder.php',
|
|
|
|
|
68 |
'WebpConverter\\Conversion\\SkipCrashed' => $baseDir . '/src/Conversion/SkipCrashed.php',
|
69 |
'WebpConverter\\Conversion\\SkipExcludedPaths' => $baseDir . '/src/Conversion/SkipExcludedPaths.php',
|
70 |
'WebpConverter\\Conversion\\SkipLarger' => $baseDir . '/src/Conversion/SkipLarger.php',
|
123 |
'WebpConverter\\Model\\Token' => $baseDir . '/src/Model/Token.php',
|
124 |
'WebpConverter\\Notice\\AvifSupportNotice' => $baseDir . '/src/Notice/AvifSupportNotice.php',
|
125 |
'WebpConverter\\Notice\\CloudflareNotice' => $baseDir . '/src/Notice/CloudflareNotice.php',
|
126 |
+
'WebpConverter\\Notice\\LitespeedNotice' => $baseDir . '/src/Notice/LitespeedNotice.php',
|
127 |
'WebpConverter\\Notice\\NoticeAbstract' => $baseDir . '/src/Notice/NoticeAbstract.php',
|
128 |
'WebpConverter\\Notice\\NoticeIntegration' => $baseDir . '/src/Notice/NoticeIntegration.php',
|
129 |
'WebpConverter\\Notice\\NoticeInterface' => $baseDir . '/src/Notice/NoticeInterface.php',
|
161 |
'WebpConverter\\Settings\\Option\\AccessTokenOption' => $baseDir . '/src/Settings/Option/AccessTokenOption.php',
|
162 |
'WebpConverter\\Settings\\Option\\ConversionMethodOption' => $baseDir . '/src/Settings/Option/ConversionMethodOption.php',
|
163 |
'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => $baseDir . '/src/Settings/Option/ExtraFeaturesOption.php',
|
164 |
+
'WebpConverter\\Settings\\Option\\ImageResizeOption' => $baseDir . '/src/Settings/Option/ImageResizeOption.php',
|
165 |
'WebpConverter\\Settings\\Option\\ImagesQualityOption' => $baseDir . '/src/Settings/Option/ImagesQualityOption.php',
|
166 |
'WebpConverter\\Settings\\Option\\LoaderTypeOption' => $baseDir . '/src/Settings/Option/LoaderTypeOption.php',
|
167 |
'WebpConverter\\Settings\\Option\\OptionAbstract' => $baseDir . '/src/Settings/Option/OptionAbstract.php',
|
vendor/composer/autoload_static.php
CHANGED
@@ -80,8 +80,6 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
|
|
80 |
'WebpConverter\\Conversion\\Method\\RemoteMethod' => __DIR__ . '/../..' . '/src/Conversion/Method/RemoteMethod.php',
|
81 |
'WebpConverter\\Conversion\\OutputPath' => __DIR__ . '/../..' . '/src/Conversion/OutputPath.php',
|
82 |
'WebpConverter\\Conversion\\PathsFinder' => __DIR__ . '/../..' . '/src/Conversion/PathsFinder.php',
|
83 |
-
'WebpConverter\\Conversion\\PathsValidator' => __DIR__ . '/../..' . '/src/Conversion/PathsValidator.php',
|
84 |
-
'WebpConverter\\Conversion\\SkipConvertedPaths' => __DIR__ . '/../..' . '/src/Conversion/SkipConvertedPaths.php',
|
85 |
'WebpConverter\\Conversion\\SkipCrashed' => __DIR__ . '/../..' . '/src/Conversion/SkipCrashed.php',
|
86 |
'WebpConverter\\Conversion\\SkipExcludedPaths' => __DIR__ . '/../..' . '/src/Conversion/SkipExcludedPaths.php',
|
87 |
'WebpConverter\\Conversion\\SkipLarger' => __DIR__ . '/../..' . '/src/Conversion/SkipLarger.php',
|
@@ -140,6 +138,7 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
|
|
140 |
'WebpConverter\\Model\\Token' => __DIR__ . '/../..' . '/src/Model/Token.php',
|
141 |
'WebpConverter\\Notice\\AvifSupportNotice' => __DIR__ . '/../..' . '/src/Notice/AvifSupportNotice.php',
|
142 |
'WebpConverter\\Notice\\CloudflareNotice' => __DIR__ . '/../..' . '/src/Notice/CloudflareNotice.php',
|
|
|
143 |
'WebpConverter\\Notice\\NoticeAbstract' => __DIR__ . '/../..' . '/src/Notice/NoticeAbstract.php',
|
144 |
'WebpConverter\\Notice\\NoticeIntegration' => __DIR__ . '/../..' . '/src/Notice/NoticeIntegration.php',
|
145 |
'WebpConverter\\Notice\\NoticeInterface' => __DIR__ . '/../..' . '/src/Notice/NoticeInterface.php',
|
@@ -177,6 +176,7 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
|
|
177 |
'WebpConverter\\Settings\\Option\\AccessTokenOption' => __DIR__ . '/../..' . '/src/Settings/Option/AccessTokenOption.php',
|
178 |
'WebpConverter\\Settings\\Option\\ConversionMethodOption' => __DIR__ . '/../..' . '/src/Settings/Option/ConversionMethodOption.php',
|
179 |
'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => __DIR__ . '/../..' . '/src/Settings/Option/ExtraFeaturesOption.php',
|
|
|
180 |
'WebpConverter\\Settings\\Option\\ImagesQualityOption' => __DIR__ . '/../..' . '/src/Settings/Option/ImagesQualityOption.php',
|
181 |
'WebpConverter\\Settings\\Option\\LoaderTypeOption' => __DIR__ . '/../..' . '/src/Settings/Option/LoaderTypeOption.php',
|
182 |
'WebpConverter\\Settings\\Option\\OptionAbstract' => __DIR__ . '/../..' . '/src/Settings/Option/OptionAbstract.php',
|
80 |
'WebpConverter\\Conversion\\Method\\RemoteMethod' => __DIR__ . '/../..' . '/src/Conversion/Method/RemoteMethod.php',
|
81 |
'WebpConverter\\Conversion\\OutputPath' => __DIR__ . '/../..' . '/src/Conversion/OutputPath.php',
|
82 |
'WebpConverter\\Conversion\\PathsFinder' => __DIR__ . '/../..' . '/src/Conversion/PathsFinder.php',
|
|
|
|
|
83 |
'WebpConverter\\Conversion\\SkipCrashed' => __DIR__ . '/../..' . '/src/Conversion/SkipCrashed.php',
|
84 |
'WebpConverter\\Conversion\\SkipExcludedPaths' => __DIR__ . '/../..' . '/src/Conversion/SkipExcludedPaths.php',
|
85 |
'WebpConverter\\Conversion\\SkipLarger' => __DIR__ . '/../..' . '/src/Conversion/SkipLarger.php',
|
138 |
'WebpConverter\\Model\\Token' => __DIR__ . '/../..' . '/src/Model/Token.php',
|
139 |
'WebpConverter\\Notice\\AvifSupportNotice' => __DIR__ . '/../..' . '/src/Notice/AvifSupportNotice.php',
|
140 |
'WebpConverter\\Notice\\CloudflareNotice' => __DIR__ . '/../..' . '/src/Notice/CloudflareNotice.php',
|
141 |
+
'WebpConverter\\Notice\\LitespeedNotice' => __DIR__ . '/../..' . '/src/Notice/LitespeedNotice.php',
|
142 |
'WebpConverter\\Notice\\NoticeAbstract' => __DIR__ . '/../..' . '/src/Notice/NoticeAbstract.php',
|
143 |
'WebpConverter\\Notice\\NoticeIntegration' => __DIR__ . '/../..' . '/src/Notice/NoticeIntegration.php',
|
144 |
'WebpConverter\\Notice\\NoticeInterface' => __DIR__ . '/../..' . '/src/Notice/NoticeInterface.php',
|
176 |
'WebpConverter\\Settings\\Option\\AccessTokenOption' => __DIR__ . '/../..' . '/src/Settings/Option/AccessTokenOption.php',
|
177 |
'WebpConverter\\Settings\\Option\\ConversionMethodOption' => __DIR__ . '/../..' . '/src/Settings/Option/ConversionMethodOption.php',
|
178 |
'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => __DIR__ . '/../..' . '/src/Settings/Option/ExtraFeaturesOption.php',
|
179 |
+
'WebpConverter\\Settings\\Option\\ImageResizeOption' => __DIR__ . '/../..' . '/src/Settings/Option/ImageResizeOption.php',
|
180 |
'WebpConverter\\Settings\\Option\\ImagesQualityOption' => __DIR__ . '/../..' . '/src/Settings/Option/ImagesQualityOption.php',
|
181 |
'WebpConverter\\Settings\\Option\\LoaderTypeOption' => __DIR__ . '/../..' . '/src/Settings/Option/LoaderTypeOption.php',
|
182 |
'WebpConverter\\Settings\\Option\\OptionAbstract' => __DIR__ . '/../..' . '/src/Settings/Option/OptionAbstract.php',
|
vendor/composer/installed.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
'type' => 'library',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'gbiorczyk/webp-converter-for-media',
|
10 |
'dev' => false,
|
11 |
),
|
@@ -16,7 +16,7 @@
|
|
16 |
'type' => 'library',
|
17 |
'install_path' => __DIR__ . '/../../',
|
18 |
'aliases' => array(),
|
19 |
-
'reference' => '
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'matt-plugins/deactivation-modal' => array(
|
5 |
'type' => 'library',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => '46666841beb912ecb11eea0febe0da7eceffda4b',
|
9 |
'name' => 'gbiorczyk/webp-converter-for-media',
|
10 |
'dev' => false,
|
11 |
),
|
16 |
'type' => 'library',
|
17 |
'install_path' => __DIR__ . '/../../',
|
18 |
'aliases' => array(),
|
19 |
+
'reference' => '46666841beb912ecb11eea0febe0da7eceffda4b',
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'matt-plugins/deactivation-modal' => array(
|
webp-converter-for-media.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Plugin Name: WebP Converter for Media
|
5 |
* Description: Speed up your website by using our WebP & AVIF Converter. Serve WebP and AVIF images instead of standard formats JPEG, PNG and GIF just now!
|
6 |
-
* Version: 4.
|
7 |
* Author: Mateusz Gbiorczyk
|
8 |
* Author URI: https://mattplugins.com/
|
9 |
* Text Domain: webp-converter-for-media
|
@@ -13,5 +13,5 @@
|
|
13 |
require_once __DIR__ . '/vendor/autoload.php';
|
14 |
|
15 |
new WebpConverter\WebpConverter(
|
16 |
-
new WebpConverter\PluginInfo( __FILE__, '4.
|
17 |
);
|
3 |
/**
|
4 |
* Plugin Name: WebP Converter for Media
|
5 |
* Description: Speed up your website by using our WebP & AVIF Converter. Serve WebP and AVIF images instead of standard formats JPEG, PNG and GIF just now!
|
6 |
+
* Version: 4.4.0
|
7 |
* Author: Mateusz Gbiorczyk
|
8 |
* Author URI: https://mattplugins.com/
|
9 |
* Text Domain: webp-converter-for-media
|
13 |
require_once __DIR__ . '/vendor/autoload.php';
|
14 |
|
15 |
new WebpConverter\WebpConverter(
|
16 |
+
new WebpConverter\PluginInfo( __FILE__, '4.4.0' )
|
17 |
);
|