Converter for Media – Optimize images | Convert WebP & AVIF - Version 3.1.1

Version Description

(2021-09-08) = * [Fixed] Generating .htaccess files for multisite websites * [Changed] Fields on plugin settings page * [Changed] Server configuration error detection

Download this release

Release Info

Developer mateuszgbiorczyk
Plugin Icon 128x128 Converter for Media – Optimize images | Convert WebP & AVIF
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.1.0 to 3.1.1

Files changed (66) hide show
  1. assets/build/css/styles.css +1 -1
  2. readme.txt +5 -0
  3. src/Error/Detector/ErrorDetector.php +16 -0
  4. src/Error/Detector/LibsNotInstalledDetector.php +24 -0
  5. src/Error/{LibsSupportAvifError.php → Detector/LibsWithoutAvifSupportDetector.php} +9 -17
  6. src/Error/Detector/LibsWithoutWebpSupportDetector.php +26 -0
  7. src/Error/{PassthruError.php → Detector/PassthruExecutionDetector.php} +7 -7
  8. src/Error/{PathsError.php → Detector/PathsErrorsDetector.php} +14 -13
  9. src/Error/Detector/RestApiDisabledDetector.php +24 -0
  10. src/Error/{RewritesError.php → Detector/RewritesErrorsDetector.php} +14 -10
  11. src/Error/{SettingsError.php → Detector/SettingsIncorrectDetector.php} +7 -19
  12. src/Error/ErrorDetectorAggregator.php +167 -0
  13. src/Error/ErrorFactory.php +0 -149
  14. src/Error/ErrorInterface.php +0 -16
  15. src/Error/LibsInstalledError.php +0 -33
  16. src/Error/LibsSupportWebpError.php +0 -35
  17. src/Error/Notice/BypassingApacheNotice.php +42 -0
  18. src/Error/Notice/ErrorNotice.php +19 -0
  19. src/Error/Notice/LibsNotInstalledNotice.php +32 -0
  20. src/Error/Notice/LibsWithoutAvifSupportNotice.php +28 -0
  21. src/Error/Notice/LibsWithoutWebpSupportNotice.php +33 -0
  22. src/Error/Notice/PassthruExecutionNotice.php +36 -0
  23. src/Error/Notice/PathHtaccessNotWritableNotice.php +31 -0
  24. src/Error/Notice/PathUploadsUnavailableNotice.php +34 -0
  25. src/Error/Notice/PathWebpDuplicatedNotice.php +32 -0
  26. src/Error/Notice/PathWebpNotWritableNotice.php +34 -0
  27. src/Error/Notice/RestApiDisabledNotice.php +33 -0
  28. src/Error/Notice/RewritesCachedNotice.php +35 -0
  29. src/Error/Notice/RewritesNotExecutedNotice.php +40 -0
  30. src/Error/Notice/RewritesNotWorkingNotice.php +40 -0
  31. src/Error/Notice/SettingsIncorrectNotice.php +27 -0
  32. src/Error/RestapiError.php +0 -32
  33. src/Helper/OptionsAccess.php +1 -1
  34. src/Loader/HtaccessLoader.php +8 -0
  35. src/Plugin/Uninstall/DebugFiles.php +5 -5
  36. src/Plugin/Uninstall/PluginSettings.php +2 -2
  37. src/Settings/Page/DebugPage.php +7 -7
  38. src/Settings/Page/SettingsPage.php +2 -1
  39. src/WebpConverter.php +2 -2
  40. templates/components/errors/bypassing-apache.php +0 -29
  41. templates/components/errors/libs-not-installed.php +0 -20
  42. templates/components/errors/libs-without-avif-support.php +0 -21
  43. templates/components/errors/libs-without-webp-support.php +0 -26
  44. templates/components/errors/passthru-execution.php +0 -27
  45. templates/components/errors/passthru-info.php +0 -21
  46. templates/components/errors/path-htaccess-not-writable.php +0 -19
  47. templates/components/errors/path-uploads-unavailable.php +0 -22
  48. templates/components/errors/path-webp-duplicated.php +0 -20
  49. templates/components/errors/path-webp-not-writable.php +0 -22
  50. templates/components/errors/rest-api-disabled.php +0 -21
  51. templates/components/errors/rewrites-cached.php +0 -22
  52. templates/components/errors/rewrites-not-executed.php +0 -38
  53. templates/components/errors/rewrites-not-working.php +0 -27
  54. templates/components/errors/settings-incorrect.php +0 -15
  55. templates/components/fields/checkbox.php +16 -23
  56. templates/components/fields/radio.php +16 -23
  57. templates/components/widgets/errors.php +12 -4
  58. templates/components/widgets/regenerate.php +11 -15
  59. templates/views/deactivation-modal.php +15 -16
  60. templates/views/settings.php +8 -7
  61. vendor/composer/ClassLoader.php +3 -1
  62. vendor/composer/InstalledVersions.php +326 -274
  63. vendor/composer/autoload_classmap.php +25 -10
  64. vendor/composer/autoload_static.php +25 -10
  65. vendor/composer/installed.php +20 -21
  66. 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:Exo\ 2;font-style:"normal";font-weight:400;src:url(../../fonts/Exo2/Exo2-Regular.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-Regular.woff) format("woff"),url(../../fonts/Exo2/Exo2-Regular.ttf) format("truetype")}@font-face{font-family:Exo\ 2;font-style:"normal";font-weight:500;src:url(../../fonts/Exo2/Exo2-SemiBold.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-SemiBold.woff) format("woff"),url(../../fonts/Exo2/Exo2-SemiBold.ttf) format("truetype")}.webpModal [hidden]{display:none!important}.webpModal *,.webpModal :after,.webpModal :before{box-sizing:border-box;margin:0;padding:0}.webpModal__outer{background-color:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.webpModal__form{background-color:#fff;font-family:Exo\ 2,sans-serif;font-size:0;left:50%;max-width:calc(100vw - 40px);padding:20px 30px;position:absolute;top:50%;transform:translate(-50%,-50%);width:600px}.webpModal__headline{font-size:16px;font-weight:500;line-height:1.5;padding:4px 0}.webpModal__desc{font-size:14px;line-height:1.64;padding:4px 0}.webpModal__table{margin-top:10px}.webpModal__textarea{border:1px solid #b4b9be!important;border-radius:0;display:none;font-size:14px;line-height:1.64;margin-top:10px;padding:4px 10px;width:100%}.webpModal__textarea[placeholder]{display:block}.webpModal__textarea[placeholder=""]{display:none}.webpModal__buttons{align-items:center;display:flex;flex-wrap:wrap;margin:5px -5px 0;padding:5px 0}.webpModal__button{padding:5px;width:50%}.webpModal__buttonInner{width:100%}.webpPage{color:#444;font-family:Exo\ 2,sans-serif;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.25;margin:0;padding:15px 0 23px}.webpPage__alert{background-color:#46b450;color:#fff;font-size:14px;line-height:1.64;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:#0073aa;color:#fff;font-size:16px;font-weight:400;line-height:1.5;padding:14px 30px}.webpPage__widgetTitle--second{background-color:#a0a5aa}.webpPage__widgetTitle--error{background-color:#dc3232}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__quality{border:1px solid #a0a5aa;display:flex;flex-wrap:wrap;margin:10px 0}.webpPage__qualityItem{border-left:1px solid #a0a5aa;flex:1;margin-left:-1px;text-align:center}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{display:block;font-size:14px;line-height:1.64;padding:14px 20px;position:relative;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{background-color:#46b450;color:#fff;margin:-1px;padding:15px 21px}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}.notice[data-notice=webp-converter]{margin-top:20px;padding:0}.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.63;min-width:180px;opacity:1!important;outline:none!important;padding:9px 30px;position:relative;text-align:center;text-decoration:none;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--green:hover{color:#fff!important}.webpButton--blue{border-color:#0073aa;color:#0073aa!important}.webpButton--blue:after{background-color:#0073aa}.webpButton--green{border-color:#46b450;color:#46b450!important}.webpButton--green:after{background-color:#46b450}.webpCheckbox__input{display:none!important}.webpCheckbox__input[type=checkbox]+label:after{content:"\f147"}.webpCheckbox__input[type=radio]+label:after{content:"\f335"}.webpCheckbox__input+label{display:inline-block;position:relative}.webpCheckbox__input+label:after,.webpCheckbox__input+label:before{align-items:center;content:"";display:flex;height:22px;justify-content:center;width:22px}.webpCheckbox__input+label:before{border:1px solid #b4b9be}.webpCheckbox__input+label:after{color:#46b450;font-family:dashicons;font-size:20px;left:0;line-height:1;position:absolute;top:0;transform:scale(0);transition:transform .3s}.webpCheckbox__input[disabled]+label{opacity:.25;pointer-events:none}.webpCheckbox__input:checked+label:after{transform:scale(1)}.webpCheckbox__label{display:inline-block;font-size:14px;line-height:1.64;max-width:650px}.webpContent{font-family:Exo\ 2,sans-serif;padding:20px 30px}.webpContent p{font-size:14px;line-height:1.64;max-width:800px}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{box-shadow:none;color:#0073aa;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{margin-top:0}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{font-size:12px;line-height:1.67;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.64}.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}.webpLoader__status{padding:20px 0 10px;position:relative}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{font-size:0;height:20px;line-height:0;position:relative}.webpLoader__barProgress:before{background-color:#46b450;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpLoader__barProgress--error:before{background-color:#dc3232}.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:#46b450;color:#fff;display:inline-block;font-family:monospace;font-size:12px;line-height:20px;padding:0 5px;position:relative}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#dc3232}.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__size{font-size:14px;line-height:1.64;margin-bottom:-10px;padding:4px 0}.webpLoader__sizeProgress{font-weight:500}.webpLoader__success{margin-top:20px;padding:4px 0 4px 20px;position:relative}.webpLoader__success:before{background-color:#46b450;content:"";height:100%;left:0;position:absolute;top:0;width:2px}.webpLoader__successContent{color:#46b450;font-size:14px;font-weight:500;line-height:1.64}.webpLoader__successContent a{color:inherit}.webpLoader__errors{border-left:2px solid #a0a5aa;margin-top:20px}.webpLoader__errorsTitle{background-color:#a0a5aa;color:#fff;display:inline-block;font-size:14px;line-height:1.64;padding:4px 22px}.webpLoader__errorsContent{font-size:12px;line-height:1.75;padding:14px 0 14px 20px}.webpLoader__errorsContentMessage{color:#dc3232;font-size:14px;font-weight:500;line-height:1.64}.webpLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpPopup{margin-top:20px}.webpPopup__inner{background-color:#fff;display:flex;flex-wrap:wrap}.webpPopup__image{background-image:url(../../img/author.jpg);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpPopup__content{border:1px solid #a0a5aa;border-left:0;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-size:12px;line-height:1.67;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}.webpTable{border-spacing:0;margin:5px 0;width:100%}.webpTable td{padding:5px 0;vertical-align:top}.webpTable td:first-child{padding-right:30px;width:22px}@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}}@media screen and (max-width:782px){.webpModal__button{width:100%}.webpPage{padding-right:10px}.webpPopup__inner{border:1px solid #a0a5aa;display:block}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border:0}}@media screen and (max-width:768px){.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #a0a5aa}}
1
+ @charset "UTF-8";@keyframes dotsLoading{0%,to{content:"..."}25%{content:" .."}50%{content:". ."}75%{content:".. "}}@font-face{font-family:Exo\ 2;font-style:"normal";font-weight:400;src:url(../../fonts/Exo2/Exo2-Regular.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-Regular.woff) format("woff"),url(../../fonts/Exo2/Exo2-Regular.ttf) format("truetype")}@font-face{font-family:Exo\ 2;font-style:"normal";font-weight:500;src:url(../../fonts/Exo2/Exo2-SemiBold.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-SemiBold.woff) format("woff"),url(../../fonts/Exo2/Exo2-SemiBold.ttf) format("truetype")}.webpModal [hidden]{display:none!important}.webpModal *,.webpModal :after,.webpModal :before{box-sizing:border-box;margin:0;padding:0}.webpModal__outer{background-color:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.webpModal__form{background-color:#fff;font-family:Exo\ 2,sans-serif;font-size:0;left:50%;max-width:calc(100vw - 40px);padding:20px 30px;position:absolute;top:50%;transform:translate(-50%,-50%);width:600px}.webpModal__headline{font-size:16px;font-weight:500;line-height:1.5;padding:4px 0}.webpModal__desc{font-size:14px;line-height:1.5714285714;padding:4px 0}.webpModal__options{padding:10px 0}.webpModal__textarea{border:1px solid #b4b9be!important;border-radius:0;display:none;font-size:14px;line-height:1.5714285714;margin-top:10px;padding:4px 10px;width:100%}.webpModal__textarea[placeholder]{display:block}.webpModal__textarea[placeholder=""]{display:none}.webpModal__buttons{align-items:center;display:flex;flex-wrap:wrap;margin:0 -5px;padding:5px 0}.webpModal__button{padding:5px;width:50%}.webpModal__buttonInner{width:100%}.webpPage{color:#444;font-family:Exo\ 2,sans-serif;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:#46b450;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:#0073aa;color:#fff;font-size:16px;font-weight:400;line-height:1.5;padding:14px 30px}.webpPage__widgetTitle--second{background-color:#a0a5aa}.webpPage__widgetTitle--error{background-color:#dc3232}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__quality{border:1px solid #a0a5aa;display:flex;flex-wrap:wrap;margin:10px 0}.webpPage__qualityItem{border-left:1px solid #a0a5aa;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:#46b450;color:#fff;margin:-1px;padding:15px 21px}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}.notice[data-notice=webp-converter]{margin-top:20px;padding:0}.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;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--green:hover{color:#fff!important}.webpButton--blue{border-color:#0073aa;color:#0073aa!important}.webpButton--blue:after{background-color:#0073aa}.webpButton--green{border-color:#46b450;color:#46b450!important}.webpButton--green:after{background-color:#46b450}.webpContent{font-family:Exo\ 2,sans-serif;padding:20px 30px}.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:#0073aa;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{margin-top:0}.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{padding:10px 0}.webpField+.webpField{margin-top:-12px}.webpField__input{display:none!important}.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{padding-left:42px}.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 #b4b9be}.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:#46b450;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:#46b450;border-radius:50%;content:"";height:6px;left:8px;top:8px;width:6px}.webpField__input--toggle+label{padding-left:64px}.webpField__input--toggle+label:after,.webpField__input--toggle+label:before{content:"";position:absolute}.webpField__input--toggle+label:before{background-color:hsla(210,7%,73%,.5);border:1px solid #b4b9be;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:#46b450}.webpField__input--toggle:checked+label:after{transform:translateX(22px)}.webpField__label{display:inline-block;font-size:14px;line-height:1.5714285714;max-width:650px;position:relative}.webpLoader__status{padding:20px 0 10px;position:relative}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{font-size:0;height:20px;line-height:0;position:relative}.webpLoader__barProgress:before{background-color:#46b450;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpLoader__barProgress--error:before{background-color:#dc3232}.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:#46b450;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:#dc3232}.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__size{font-size:14px;line-height:1.5714285714;margin-bottom:-10px;padding:4px 0}.webpLoader__sizeProgress{font-weight:500}.webpLoader__success{margin-top:20px;padding:4px 0 4px 20px;position:relative}.webpLoader__success:before{background-color:#46b450;content:"";height:100%;left:0;position:absolute;top:0;width:2px}.webpLoader__successContent{color:#46b450;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__successContent a{color:inherit}.webpLoader__errors{border-left:2px solid #a0a5aa;margin-top:20px}.webpLoader__errorsTitle{background-color:#a0a5aa;color:#fff;display:inline-block;font-size:14px;line-height:1.5714285714;padding:4px 22px}.webpLoader__errorsContent{font-size:12px;line-height:1.75;padding:14px 0 14px 20px}.webpLoader__errorsContentMessage{color:#dc3232;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpPopup{margin-top:20px}.webpPopup__inner{background-color:#fff;display:flex;flex-wrap:wrap}.webpPopup__image{background-image:url(../../img/author.jpg);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpPopup__content{border:1px solid #a0a5aa;border-left:0;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-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}}@media screen and (max-width:782px){.webpModal__button{width:100%}.webpPage{padding-right:10px}.webpPopup__inner{border:1px solid #a0a5aa;display:block}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border:0}}@media screen and (max-width:768px){.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #a0a5aa}}
readme.txt CHANGED
@@ -436,6 +436,11 @@ This is all very important to us and allows us to do even better things for you!
436
 
437
  == Changelog ==
438
 
 
 
 
 
 
439
  = 3.1.0 (2021-09-02) =
440
  * `[Fixed]` Default state of notice displaying
441
  * `[Added]` Error detection for server that does not supports using .htaccess files from custom locations
436
 
437
  == Changelog ==
438
 
439
+ = 3.1.1 (2021-09-08) =
440
+ * `[Fixed]` Generating .htaccess files for multisite websites
441
+ * `[Changed]` Fields on plugin settings page
442
+ * `[Changed]` Server configuration error detection
443
+
444
  = 3.1.0 (2021-09-02) =
445
  * `[Fixed]` Default state of notice displaying
446
  * `[Added]` Error detection for server that does not supports using .htaccess files from custom locations
src/Error/Detector/ErrorDetector.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Detector;
4
+
5
+ use WebpConverter\Error\Notice\ErrorNotice;
6
+
7
+ /**
8
+ * Interface for class that checks for configuration errors.
9
+ */
10
+ interface ErrorDetector {
11
+
12
+ /**
13
+ * @return ErrorNotice|null
14
+ */
15
+ public function get_error();
16
+ }
src/Error/Detector/LibsNotInstalledDetector.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Detector;
4
+
5
+ use WebpConverter\Conversion\Method\GdMethod;
6
+ use WebpConverter\Conversion\Method\ImagickMethod;
7
+ use WebpConverter\Error\Notice\LibsNotInstalledNotice;
8
+
9
+ /**
10
+ * Checks for configuration errors about non-installed methods for converting images.
11
+ */
12
+ class LibsNotInstalledDetector implements ErrorDetector {
13
+
14
+ /**
15
+ * {@inheritdoc}
16
+ */
17
+ public function get_error() {
18
+ if ( GdMethod::is_method_installed() || ImagickMethod::is_method_installed() ) {
19
+ return null;
20
+ }
21
+
22
+ return new LibsNotInstalledNotice();
23
+ }
24
+ }
src/Error/{LibsSupportAvifError.php → Detector/LibsWithoutAvifSupportDetector.php} RENAMED
@@ -1,16 +1,17 @@
1
  <?php
2
 
3
- namespace WebpConverter\Error;
4
 
5
  use WebpConverter\Conversion\Format\AvifFormat;
6
  use WebpConverter\Conversion\Method\GdMethod;
7
  use WebpConverter\Conversion\Method\ImagickMethod;
 
8
  use WebpConverter\PluginData;
9
 
10
  /**
11
  * Checks for configuration errors about image conversion methods that do not support AVIF output format.
12
  */
13
- class LibsSupportAvifError implements ErrorInterface {
14
 
15
  /**
16
  * @var PluginData .
@@ -27,24 +28,15 @@ class LibsSupportAvifError implements ErrorInterface {
27
  /**
28
  * {@inheritdoc}
29
  */
30
- public function get_error_codes(): array {
31
  $output_formats = $this->plugin_data->get_plugin_settings()['output_formats'] ?? [];
32
- $errors = [];
33
 
34
- if ( in_array( AvifFormat::FORMAT_EXTENSION, $output_formats )
35
- && ( $this->if_libs_support_avif() !== true ) ) {
36
- $errors[] = 'libs_without_avif_support';
 
37
  }
38
- return $errors;
39
- }
40
 
41
- /**
42
- * Checks if any conversion method supports converting to AVIF format.
43
- *
44
- * @return bool Verification status.
45
- */
46
- private function if_libs_support_avif(): bool {
47
- return ( GdMethod::is_method_active( AvifFormat::FORMAT_EXTENSION )
48
- || ImagickMethod::is_method_active( AvifFormat::FORMAT_EXTENSION ) );
49
  }
50
  }
1
  <?php
2
 
3
+ namespace WebpConverter\Error\Detector;
4
 
5
  use WebpConverter\Conversion\Format\AvifFormat;
6
  use WebpConverter\Conversion\Method\GdMethod;
7
  use WebpConverter\Conversion\Method\ImagickMethod;
8
+ use WebpConverter\Error\Notice\LibsWithoutAvifSupportNotice;
9
  use WebpConverter\PluginData;
10
 
11
  /**
12
  * Checks for configuration errors about image conversion methods that do not support AVIF output format.
13
  */
14
+ class LibsWithoutAvifSupportDetector implements ErrorDetector {
15
 
16
  /**
17
  * @var PluginData .
28
  /**
29
  * {@inheritdoc}
30
  */
31
+ public function get_error() {
32
  $output_formats = $this->plugin_data->get_plugin_settings()['output_formats'] ?? [];
 
33
 
34
+ if ( ! in_array( AvifFormat::FORMAT_EXTENSION, $output_formats )
35
+ || GdMethod::is_method_active( AvifFormat::FORMAT_EXTENSION )
36
+ || ImagickMethod::is_method_active( AvifFormat::FORMAT_EXTENSION ) ) {
37
+ return null;
38
  }
 
 
39
 
40
+ return new LibsWithoutAvifSupportNotice();
 
 
 
 
 
 
 
41
  }
42
  }
src/Error/Detector/LibsWithoutWebpSupportDetector.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Detector;
4
+
5
+ use WebpConverter\Conversion\Format\WebpFormat;
6
+ use WebpConverter\Conversion\Method\GdMethod;
7
+ use WebpConverter\Conversion\Method\ImagickMethod;
8
+ use WebpConverter\Error\Notice\LibsWithoutWebpSupportNotice;
9
+
10
+ /**
11
+ * Checks for configuration errors about image conversion methods that do not support WebP output format.
12
+ */
13
+ class LibsWithoutWebpSupportDetector implements ErrorDetector {
14
+
15
+ /**
16
+ * {@inheritdoc}
17
+ */
18
+ public function get_error() {
19
+ if ( GdMethod::is_method_active( WebpFormat::FORMAT_EXTENSION )
20
+ || ImagickMethod::is_method_active( WebpFormat::FORMAT_EXTENSION ) ) {
21
+ return null;
22
+ }
23
+
24
+ return new LibsWithoutWebpSupportNotice();
25
+ }
26
+ }
src/Error/{PassthruError.php → Detector/PassthruExecutionDetector.php} RENAMED
@@ -1,7 +1,8 @@
1
  <?php
2
 
3
- namespace WebpConverter\Error;
4
 
 
5
  use WebpConverter\Loader\LoaderAbstract;
6
  use WebpConverter\Loader\PassthruLoader;
7
  use WebpConverter\PluginData;
@@ -9,7 +10,7 @@ use WebpConverter\PluginData;
9
  /**
10
  * Checks for configuration errors about disabled file supports Pass Thru loader.
11
  */
12
- class PassthruError implements ErrorInterface {
13
 
14
  /**
15
  * @var PluginData .
@@ -26,18 +27,17 @@ class PassthruError implements ErrorInterface {
26
  /**
27
  * {@inheritdoc}
28
  */
29
- public function get_error_codes(): array {
30
- $errors = [];
31
-
32
  do_action( LoaderAbstract::ACTION_NAME, true, true );
33
 
 
34
  if ( $this->if_passthru_execution_allowed() !== true ) {
35
- $errors[] = 'passthru_execution';
36
  }
37
 
38
  do_action( LoaderAbstract::ACTION_NAME, true );
39
 
40
- return $errors;
41
  }
42
 
43
  /**
1
  <?php
2
 
3
+ namespace WebpConverter\Error\Detector;
4
 
5
+ use WebpConverter\Error\Notice\PassthruExecutionNotice;
6
  use WebpConverter\Loader\LoaderAbstract;
7
  use WebpConverter\Loader\PassthruLoader;
8
  use WebpConverter\PluginData;
10
  /**
11
  * Checks for configuration errors about disabled file supports Pass Thru loader.
12
  */
13
+ class PassthruExecutionDetector implements ErrorDetector {
14
 
15
  /**
16
  * @var PluginData .
27
  /**
28
  * {@inheritdoc}
29
  */
30
+ public function get_error() {
 
 
31
  do_action( LoaderAbstract::ACTION_NAME, true, true );
32
 
33
+ $has_error = false;
34
  if ( $this->if_passthru_execution_allowed() !== true ) {
35
+ $has_error = true;
36
  }
37
 
38
  do_action( LoaderAbstract::ACTION_NAME, true );
39
 
40
+ return ( $has_error ) ? new PassthruExecutionNotice() : null;
41
  }
42
 
43
  /**
src/Error/{PathsError.php → Detector/PathsErrorsDetector.php} RENAMED
@@ -1,31 +1,32 @@
1
  <?php
2
 
3
- namespace WebpConverter\Error;
 
 
 
 
 
4
 
5
  /**
6
  * Checks for configuration errors about incorrect paths of directories.
7
  */
8
- class PathsError implements ErrorInterface {
9
 
10
  /**
11
  * {@inheritdoc}
12
  */
13
- public function get_error_codes(): array {
14
- $errors = [];
15
-
16
  if ( $this->if_uploads_path_exists() !== true ) {
17
- $errors[] = 'path_uploads_unavailable';
18
  } elseif ( $this->if_htaccess_is_writeable() !== true ) {
19
- $errors[] = 'path_htaccess_not_writable';
20
- }
21
-
22
- if ( $this->if_paths_are_different() !== true ) {
23
- $errors[] = 'path_webp_duplicated';
24
  } elseif ( $this->if_webp_path_is_writeable() !== true ) {
25
- $errors[] = 'path_webp_not_writable';
26
  }
27
 
28
- return $errors;
29
  }
30
 
31
  /**
1
  <?php
2
 
3
+ namespace WebpConverter\Error\Detector;
4
+
5
+ use WebpConverter\Error\Notice\PathHtaccessNotWritableNotice;
6
+ use WebpConverter\Error\Notice\PathUploadsUnavailableNotice;
7
+ use WebpConverter\Error\Notice\PathWebpDuplicatedNotice;
8
+ use WebpConverter\Error\Notice\PathWebpNotWritableNotice;
9
 
10
  /**
11
  * Checks for configuration errors about incorrect paths of directories.
12
  */
13
+ class PathsErrorsDetector implements ErrorDetector {
14
 
15
  /**
16
  * {@inheritdoc}
17
  */
18
+ public function get_error() {
 
 
19
  if ( $this->if_uploads_path_exists() !== true ) {
20
+ return new PathUploadsUnavailableNotice();
21
  } elseif ( $this->if_htaccess_is_writeable() !== true ) {
22
+ return new PathHtaccessNotWritableNotice();
23
+ } elseif ( $this->if_paths_are_different() !== true ) {
24
+ return new PathWebpDuplicatedNotice();
 
 
25
  } elseif ( $this->if_webp_path_is_writeable() !== true ) {
26
+ return new PathWebpNotWritableNotice();
27
  }
28
 
29
+ return null;
30
  }
31
 
32
  /**
src/Error/Detector/RestApiDisabledDetector.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Detector;
4
+
5
+ use WebpConverter\Error\Notice\RestApiDisabledNotice;
6
+
7
+ /**
8
+ * Checks for configuration errors about disabled REST API.
9
+ */
10
+ class RestApiDisabledDetector implements ErrorDetector {
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_error() {
16
+ if ( ( apply_filters( 'rest_enabled', true ) === true )
17
+ && ( apply_filters( 'rest_jsonp_enabled', true ) === true )
18
+ && ( apply_filters( 'rest_authentication_errors', true ) === true ) ) {
19
+ return null;
20
+ }
21
+
22
+ return new RestApiDisabledNotice();
23
+ }
24
+ }
src/Error/{RewritesError.php → Detector/RewritesErrorsDetector.php} RENAMED
@@ -1,9 +1,13 @@
1
  <?php
2
 
3
- namespace WebpConverter\Error;
4
 
5
  use WebpConverter\Conversion\Format\WebpFormat;
6
  use WebpConverter\Conversion\OutputPath;
 
 
 
 
7
  use WebpConverter\Helper\FileLoader;
8
  use WebpConverter\Loader\LoaderAbstract;
9
  use WebpConverter\PluginData;
@@ -11,7 +15,7 @@ use WebpConverter\PluginData;
11
  /**
12
  * Checks for configuration errors about non-working HTTP rewrites.
13
  */
14
- class RewritesError implements ErrorInterface {
15
 
16
  const PATH_SOURCE_FILE_PNG = '/assets/img/icon-test.png';
17
  const PATH_SOURCE_FILE_WEBP = '/assets/img/icon-test.webp';
@@ -34,31 +38,31 @@ class RewritesError implements ErrorInterface {
34
  /**
35
  * {@inheritdoc}
36
  */
37
- public function get_error_codes(): array {
38
  $settings = $this->plugin_data->get_plugin_settings();
39
- $errors = [];
40
  if ( ! $settings['dirs'] || ! $settings['output_formats'] ) {
41
- return $errors;
42
  }
43
 
 
44
  $this->convert_images_for_debug();
45
  do_action( LoaderAbstract::ACTION_NAME, true, true );
46
 
47
  if ( $this->if_redirects_are_works() !== true ) {
48
  if ( $this->if_bypassing_apache_is_active() === true ) {
49
- $errors[] = 'bypassing_apache';
50
  } elseif ( $this->if_htaccess_can_be_overwritten() !== true ) {
51
- $errors[] = 'rewrites_not_executed';
52
  } else {
53
- $errors[] = 'rewrites_not_working';
54
  }
55
  } elseif ( $this->if_redirects_are_cached() === true ) {
56
- $errors[] = 'rewrites_cached';
57
  }
58
 
59
  do_action( LoaderAbstract::ACTION_NAME, true );
60
 
61
- return $errors;
62
  }
63
 
64
  /**
1
  <?php
2
 
3
+ namespace WebpConverter\Error\Detector;
4
 
5
  use WebpConverter\Conversion\Format\WebpFormat;
6
  use WebpConverter\Conversion\OutputPath;
7
+ use WebpConverter\Error\Notice\BypassingApacheNotice;
8
+ use WebpConverter\Error\Notice\RewritesCachedNotice;
9
+ use WebpConverter\Error\Notice\RewritesNotExecutedNotice;
10
+ use WebpConverter\Error\Notice\RewritesNotWorkingNotice;
11
  use WebpConverter\Helper\FileLoader;
12
  use WebpConverter\Loader\LoaderAbstract;
13
  use WebpConverter\PluginData;
15
  /**
16
  * Checks for configuration errors about non-working HTTP rewrites.
17
  */
18
+ class RewritesErrorsDetector implements ErrorDetector {
19
 
20
  const PATH_SOURCE_FILE_PNG = '/assets/img/icon-test.png';
21
  const PATH_SOURCE_FILE_WEBP = '/assets/img/icon-test.webp';
38
  /**
39
  * {@inheritdoc}
40
  */
41
+ public function get_error() {
42
  $settings = $this->plugin_data->get_plugin_settings();
 
43
  if ( ! $settings['dirs'] || ! $settings['output_formats'] ) {
44
+ return null;
45
  }
46
 
47
+ $error = null;
48
  $this->convert_images_for_debug();
49
  do_action( LoaderAbstract::ACTION_NAME, true, true );
50
 
51
  if ( $this->if_redirects_are_works() !== true ) {
52
  if ( $this->if_bypassing_apache_is_active() === true ) {
53
+ $error = new BypassingApacheNotice();
54
  } elseif ( $this->if_htaccess_can_be_overwritten() !== true ) {
55
+ $error = new RewritesNotExecutedNotice();
56
  } else {
57
+ $error = new RewritesNotWorkingNotice();
58
  }
59
  } elseif ( $this->if_redirects_are_cached() === true ) {
60
+ $error = new RewritesCachedNotice();
61
  }
62
 
63
  do_action( LoaderAbstract::ACTION_NAME, true );
64
 
65
+ return $error;
66
  }
67
 
68
  /**
src/Error/{SettingsError.php → Detector/SettingsIncorrectDetector.php} RENAMED
@@ -1,13 +1,14 @@
1
  <?php
2
 
3
- namespace WebpConverter\Error;
4
 
 
5
  use WebpConverter\PluginData;
6
 
7
  /**
8
  * Checks for configuration errors about incorrectly saved plugin settings.
9
  */
10
- class SettingsError implements ErrorInterface {
11
 
12
  /**
13
  * @var PluginData .
@@ -24,30 +25,17 @@ class SettingsError implements ErrorInterface {
24
  /**
25
  * {@inheritdoc}
26
  */
27
- public function get_error_codes(): array {
28
- $errors = [];
29
-
30
- if ( $this->if_settings_are_correct() !== true ) {
31
- $errors[] = 'settings_incorrect';
32
- }
33
- return $errors;
34
- }
35
-
36
- /**
37
- * Checks if plugin settings are correct.
38
- *
39
- * @return bool Verification status.
40
- */
41
- private function if_settings_are_correct(): bool {
42
  $settings = $this->plugin_data->get_plugin_settings();
 
43
  if ( ( ! isset( $settings['extensions'] ) || ! $settings['extensions'] )
44
  || ( ! isset( $settings['dirs'] ) || ! $settings['dirs'] )
45
  || ( ! isset( $settings['method'] ) || ! $settings['method'] )
46
  || ( ! isset( $settings['output_formats'] ) || ! $settings['output_formats'] )
47
  || ( ! isset( $settings['quality'] ) || ! $settings['quality'] ) ) {
48
- return false;
49
  }
50
 
51
- return true;
52
  }
53
  }
1
  <?php
2
 
3
+ namespace WebpConverter\Error\Detector;
4
 
5
+ use WebpConverter\Error\Notice\SettingsIncorrectNotice;
6
  use WebpConverter\PluginData;
7
 
8
  /**
9
  * Checks for configuration errors about incorrectly saved plugin settings.
10
  */
11
+ class SettingsIncorrectDetector implements ErrorDetector {
12
 
13
  /**
14
  * @var PluginData .
25
  /**
26
  * {@inheritdoc}
27
  */
28
+ public function get_error() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  $settings = $this->plugin_data->get_plugin_settings();
30
+
31
  if ( ( ! isset( $settings['extensions'] ) || ! $settings['extensions'] )
32
  || ( ! isset( $settings['dirs'] ) || ! $settings['dirs'] )
33
  || ( ! isset( $settings['method'] ) || ! $settings['method'] )
34
  || ( ! isset( $settings['output_formats'] ) || ! $settings['output_formats'] )
35
  || ( ! isset( $settings['quality'] ) || ! $settings['quality'] ) ) {
36
+ return new SettingsIncorrectNotice();
37
  }
38
 
39
+ return null;
40
  }
41
  }
src/Error/ErrorDetectorAggregator.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error;
4
+
5
+ use WebpConverter\Error\Detector\LibsNotInstalledDetector;
6
+ use WebpConverter\Error\Detector\LibsWithoutAvifSupportDetector;
7
+ use WebpConverter\Error\Detector\LibsWithoutWebpSupportDetector;
8
+ use WebpConverter\Error\Detector\PassthruExecutionDetector;
9
+ use WebpConverter\Error\Detector\PathsErrorsDetector;
10
+ use WebpConverter\Error\Detector\RestApiDisabledDetector;
11
+ use WebpConverter\Error\Detector\RewritesErrorsDetector;
12
+ use WebpConverter\Error\Detector\SettingsIncorrectDetector;
13
+ use WebpConverter\Error\Notice\ErrorNotice;
14
+ use WebpConverter\Error\Notice\RewritesCachedNotice;
15
+ use WebpConverter\Helper\OptionsAccess;
16
+ use WebpConverter\HookableInterface;
17
+ use WebpConverter\PluginData;
18
+
19
+ /**
20
+ * Supports generating list of server configuration errors.
21
+ */
22
+ class ErrorDetectorAggregator implements HookableInterface {
23
+
24
+ const ERRORS_CACHE_OPTION = 'webpc_errors_cache';
25
+
26
+ /**
27
+ * @var PluginData .
28
+ */
29
+ private $plugin_data;
30
+
31
+ /**
32
+ * @var string[]
33
+ */
34
+ private $not_fatal_errors = [
35
+ RewritesCachedNotice::ERROR_KEY,
36
+ ];
37
+
38
+ /**
39
+ * @var ErrorNotice[]|null
40
+ */
41
+ private $cached_errors = null;
42
+
43
+ /**
44
+ * @param PluginData $plugin_data .
45
+ */
46
+ public function __construct( PluginData $plugin_data ) {
47
+ $this->plugin_data = $plugin_data;
48
+ }
49
+
50
+ /**
51
+ * {@inheritdoc}
52
+ */
53
+ public function init_hooks() {
54
+ add_filter( 'webpc_server_errors', [ $this, 'get_server_errors' ], 10, 2 );
55
+ add_filter( 'webpc_server_errors_messages', [ $this, 'get_server_errors_messages' ], 10, 1 );
56
+ }
57
+
58
+ /**
59
+ * Returns list of errors codes for server configuration.
60
+ *
61
+ * @param string[] $values Default value of filter.
62
+ * @param bool $only_errors Only errors, no warnings?
63
+ *
64
+ * @return string[]
65
+ */
66
+ public function get_server_errors( array $values, bool $only_errors = false ): array {
67
+ $error_codes = $this->get_cached_error_codes();
68
+
69
+ return array_filter(
70
+ $error_codes,
71
+ function ( $error ) use ( $only_errors ) {
72
+ return ( ! $only_errors || ! in_array( $error, $this->not_fatal_errors ) );
73
+ }
74
+ );
75
+ }
76
+
77
+ /**
78
+ * Returns list of errors messages for server configuration.
79
+ *
80
+ * @param string[] $values Default value of filter.
81
+ *
82
+ * @return string[][]
83
+ */
84
+ public function get_server_errors_messages( array $values ): array {
85
+ $detected_errors = $this->get_errors_list();
86
+ $this->cache_errors( $detected_errors );
87
+
88
+ $error_messages = [];
89
+ foreach ( $detected_errors as $error ) {
90
+ $error_messages[] = $error->get_message();
91
+ }
92
+ return $error_messages;
93
+ }
94
+
95
+ /**
96
+ * @return string[]
97
+ */
98
+ private function get_cached_error_codes(): array {
99
+ $error_codes = [];
100
+
101
+ if ( $this->cached_errors !== null ) {
102
+ foreach ( $this->cached_errors as $error ) {
103
+ $error_codes[] = $error->get_key();
104
+ }
105
+ } else {
106
+ $error_codes = OptionsAccess::get_option( self::ERRORS_CACHE_OPTION, [] );
107
+ }
108
+
109
+ return $error_codes;
110
+ }
111
+
112
+ /**
113
+ * @param ErrorNotice[] $detected_errors .
114
+ *
115
+ * @return void
116
+ */
117
+ private function cache_errors( array $detected_errors ) {
118
+ $error_codes = [];
119
+ foreach ( $detected_errors as $error ) {
120
+ $error_codes[] = $error->get_key();
121
+ }
122
+
123
+ OptionsAccess::update_option( self::ERRORS_CACHE_OPTION, $error_codes );
124
+ }
125
+
126
+ /**
127
+ * Checks for configuration errors according to specified logic.
128
+ * Saves errors to cache.
129
+ *
130
+ * @return ErrorNotice[]
131
+ */
132
+ private function get_errors_list(): array {
133
+ if ( $this->cached_errors !== null ) {
134
+ return $this->cached_errors;
135
+ }
136
+
137
+ $this->cached_errors = [];
138
+
139
+ if ( $new_error = ( new LibsNotInstalledDetector() )->get_error() ) {
140
+ $this->cached_errors[] = $new_error;
141
+ } elseif ( $new_error = ( new LibsWithoutWebpSupportDetector() )->get_error() ) {
142
+ $this->cached_errors[] = $new_error;
143
+ } elseif ( $new_error = ( new LibsWithoutAvifSupportDetector( $this->plugin_data ) )->get_error() ) {
144
+ $this->cached_errors[] = $new_error;
145
+ }
146
+
147
+ if ( $new_error = ( new RestApiDisabledDetector() )->get_error() ) {
148
+ $this->cached_errors[] = $new_error;
149
+ }
150
+
151
+ if ( $new_error = ( new PathsErrorsDetector() )->get_error() ) {
152
+ $this->cached_errors[] = $new_error;
153
+ }
154
+
155
+ if ( $new_error = ( new PassthruExecutionDetector( $this->plugin_data ) )->get_error() ) {
156
+ $this->cached_errors[] = $new_error;
157
+ } elseif ( $new_error = ( new RewritesErrorsDetector( $this->plugin_data ) )->get_error() ) {
158
+ $this->cached_errors[] = $new_error;
159
+ }
160
+
161
+ if ( ! $this->cached_errors && ( $new_error = ( new SettingsIncorrectDetector( $this->plugin_data ) )->get_error() ) ) {
162
+ $this->cached_errors[] = $new_error;
163
+ }
164
+
165
+ return $this->cached_errors;
166
+ }
167
+ }
src/Error/ErrorFactory.php DELETED
@@ -1,149 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Error;
4
-
5
- use WebpConverter\Helper\OptionsAccess;
6
- use WebpConverter\Helper\ViewLoader;
7
- use WebpConverter\HookableInterface;
8
- use WebpConverter\Loader\PassthruLoader;
9
- use WebpConverter\PluginData;
10
-
11
- /**
12
- * Supports generating list of server configuration errors.
13
- */
14
- class ErrorFactory implements HookableInterface {
15
-
16
- const ERRORS_CACHE_OPTION = 'webpc_errors_cache';
17
- const ALLOWED_ERROR_KEYS = [ 'rewrites_cached' ];
18
- const ERROR_FILE_PATH = 'components/errors/%s.php';
19
-
20
- /**
21
- * @var PluginData .
22
- */
23
- private $plugin_data;
24
-
25
- /**
26
- * List of error codes saved in cache.
27
- *
28
- * @var string[]
29
- */
30
- private $cache = [];
31
-
32
- /**
33
- * @param PluginData $plugin_data .
34
- */
35
- public function __construct( PluginData $plugin_data ) {
36
- $this->plugin_data = $plugin_data;
37
- }
38
-
39
- /**
40
- * {@inheritdoc}
41
- */
42
- public function init_hooks() {
43
- add_filter( 'webpc_server_errors', [ $this, 'get_server_errors' ], 10, 3 );
44
- add_filter( 'webpc_server_errors_messages', [ $this, 'get_server_errors_messages' ], 10, 3 );
45
- }
46
-
47
- /**
48
- * Returns list of errors codes for server configuration.
49
- * Uses cache for errors list.
50
- *
51
- * @param string[] $values Default value.
52
- * @param bool $only_errors Only errors, no warnings?
53
- * @param bool $is_force_refresh Force refresh error list?
54
- *
55
- * @return string[] Errors codes.
56
- */
57
- public function get_server_errors( array $values, bool $only_errors = false, bool $is_force_refresh = false ): array {
58
- $errors = OptionsAccess::get_option( self::ERRORS_CACHE_OPTION, $this->cache );
59
- if ( $is_force_refresh ) {
60
- $errors = $this->get_errors_list();
61
- }
62
-
63
- return array_filter(
64
- $errors,
65
- function ( $error ) use ( $only_errors ) {
66
- return ( ! $only_errors || ! in_array( $error, self::ALLOWED_ERROR_KEYS ) );
67
- }
68
- );
69
- }
70
-
71
- /**
72
- * Returns list of errors messages for server configuration.
73
- * Uses cache for errors list.
74
- *
75
- * @param string[] $values Default value.
76
- * @param bool $only_errors Only errors, no warnings?
77
- * @param bool $is_force_refresh Force refresh error list?
78
- *
79
- * @return string[] Errors messages.
80
- */
81
- public function get_server_errors_messages( array $values, bool $only_errors = false, bool $is_force_refresh = false ): array {
82
- $errors = $this->get_server_errors( $values, $only_errors, $is_force_refresh );
83
- return $this->load_error_messages( $errors );
84
- }
85
-
86
- /**
87
- * Returns list of errors messages loaded from templates files.
88
- *
89
- * @param string[] $errors Errors codes.
90
- *
91
- * @return string[] Errors messages.
92
- */
93
- private function load_error_messages( array $errors ): array {
94
- $list = [];
95
- foreach ( $errors as $error ) {
96
- ob_start();
97
- ViewLoader::load_view(
98
- sprintf( self::ERROR_FILE_PATH, str_replace( '_', '-', $error ) ),
99
- [
100
- 'passthru_url' => PassthruLoader::get_loader_url(),
101
- ]
102
- );
103
- $list[ $error ] = ob_get_clean();
104
- }
105
-
106
- return array_map( 'strval', $list );
107
- }
108
-
109
- /**
110
- * Checks for configuration errors according to specified logic.
111
- * Saves errors to cache.
112
- *
113
- * @return string[] Errors codes.
114
- */
115
- private function get_errors_list(): array {
116
- $errors = [];
117
-
118
- if ( $new_errors = ( new LibsInstalledError() )->get_error_codes() ) {
119
- $errors = array_merge( $errors, $new_errors );
120
- } elseif ( $new_errors = ( new LibsSupportWebpError() )->get_error_codes() ) {
121
- $errors = array_merge( $errors, $new_errors );
122
- } elseif ( $new_errors = ( new LibsSupportAvifError( $this->plugin_data ) )->get_error_codes() ) {
123
- $errors = array_merge( $errors, $new_errors );
124
- }
125
-
126
- if ( $new_errors = ( new RestapiError() )->get_error_codes() ) {
127
- $errors = array_merge( $errors, $new_errors );
128
- }
129
-
130
- if ( $new_errors = ( new PathsError() )->get_error_codes() ) {
131
- $errors = array_merge( $errors, $new_errors );
132
- }
133
-
134
- if ( $new_errors = ( new PassthruError( $this->plugin_data ) )->get_error_codes() ) {
135
- $errors = array_merge( $errors, $new_errors );
136
- } elseif ( $new_errors = ( new RewritesError( $this->plugin_data ) )->get_error_codes() ) {
137
- $errors = array_merge( $errors, $new_errors );
138
- }
139
-
140
- if ( ! $errors && ( $new_errors = ( new SettingsError( $this->plugin_data ) )->get_error_codes() ) ) {
141
- $errors = array_merge( $errors, $new_errors );
142
- }
143
-
144
- $this->cache = $errors;
145
- OptionsAccess::update_option( self::ERRORS_CACHE_OPTION, $errors );
146
-
147
- return $errors;
148
- }
149
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Error/ErrorInterface.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Error;
4
-
5
- /**
6
- * Interface for class that checks for configuration errors.
7
- */
8
- interface ErrorInterface {
9
-
10
- /**
11
- * Returns list of error codes.
12
- *
13
- * @return string[] Error codes.
14
- */
15
- public function get_error_codes(): array;
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Error/LibsInstalledError.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Error;
4
-
5
- use WebpConverter\Conversion\Method\GdMethod;
6
- use WebpConverter\Conversion\Method\ImagickMethod;
7
-
8
- /**
9
- * Checks for configuration errors about non-installed methods for converting images.
10
- */
11
- class LibsInstalledError implements ErrorInterface {
12
-
13
- /**
14
- * {@inheritdoc}
15
- */
16
- public function get_error_codes(): array {
17
- $errors = [];
18
-
19
- if ( $this->if_libs_are_installed() !== true ) {
20
- $errors[] = 'libs_not_installed';
21
- }
22
- return $errors;
23
- }
24
-
25
- /**
26
- * Checks if any conversion method is installed.
27
- *
28
- * @return bool Verification status.
29
- */
30
- private function if_libs_are_installed(): bool {
31
- return ( GdMethod::is_method_installed() || ImagickMethod::is_method_installed() );
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Error/LibsSupportWebpError.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Error;
4
-
5
- use WebpConverter\Conversion\Format\WebpFormat;
6
- use WebpConverter\Conversion\Method\GdMethod;
7
- use WebpConverter\Conversion\Method\ImagickMethod;
8
-
9
- /**
10
- * Checks for configuration errors about image conversion methods that do not support WebP output format.
11
- */
12
- class LibsSupportWebpError implements ErrorInterface {
13
-
14
- /**
15
- * {@inheritdoc}
16
- */
17
- public function get_error_codes(): array {
18
- $errors = [];
19
-
20
- if ( $this->if_libs_support_webp() !== true ) {
21
- $errors[] = 'libs_without_webp_support';
22
- }
23
- return $errors;
24
- }
25
-
26
- /**
27
- * Checks if any conversion method supports converting to WebP format.
28
- *
29
- * @return bool Verification status.
30
- */
31
- private function if_libs_support_webp(): bool {
32
- return ( GdMethod::is_method_active( WebpFormat::FORMAT_EXTENSION )
33
- || ImagickMethod::is_method_active( WebpFormat::FORMAT_EXTENSION ) );
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Error/Notice/BypassingApacheNotice.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class BypassingApacheNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'bypassing_apache';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
26
+ __( 'Requests to images are processed by your server bypassing Apache. When loading images, rules from the .htaccess file are not executed. Occasionally, this only applies to known file extensions: .jpg, .png, etc. and when e.g. .png2 extension is loaded, then the redirections from the .htaccess file work, because the server does not understand this format and does not treat it as image files. Check the redirects for %1$s.png file%2$s (for which the redirection does not work) and for %3$s.png2 file%4$s (for which the redirection works correctly). Change the server settings to stop ignoring the rules from the .htaccess file.', 'webp-converter-for-media' ),
27
+ '<a href="' . WEBPC_URL . 'assets/img/debug/icon-before.png" target="_blank">',
28
+ '</a>',
29
+ '<a href="' . WEBPC_URL . 'assets/img/debug/icon-before.png2" target="_blank">',
30
+ '</a>'
31
+ ),
32
+ __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' ),
33
+ sprintf(
34
+ /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: loader name */
35
+ __( '%1$sAlso try changing option "Image loading mode" to a different one.%2$s Issues about rewrites can often be resolved by setting this option to "%3$s". You can do this in plugin settings below. After changing settings, remember to flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ),
36
+ '<strong>',
37
+ '</strong>',
38
+ 'Pass Thru'
39
+ ),
40
+ ];
41
+ }
42
+ }
src/Error/Notice/ErrorNotice.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * Stores information about server configuration error.
7
+ */
8
+ interface ErrorNotice {
9
+
10
+ /**
11
+ * @return string
12
+ */
13
+ public function get_key(): string;
14
+
15
+ /**
16
+ * @return string[]
17
+ */
18
+ public function get_message(): array;
19
+ }
src/Error/Notice/LibsNotInstalledNotice.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class LibsNotInstalledNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'libs_not_installed';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
26
+ __( 'On your server is not installed GD or Imagick library. Please read %1$sthe plugin FAQ%2$s, specifically question about requirements of plugin. This issue is plugin-independent. Please contact your server administrator in this case.', 'webp-converter-for-media' ),
27
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
28
+ '</a>'
29
+ ),
30
+ ];
31
+ }
32
+ }
src/Error/Notice/LibsWithoutAvifSupportNotice.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class LibsWithoutAvifSupportNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'libs_without_avif_support';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ __( 'The selected option of "Conversion method" does not support AVIF format. This is a new format, so you will probably have to wait for its full support via PHP on your server. This issue is plugin-independent.', 'webp-converter-for-media' ),
25
+ __( 'Select a different method in the "Conversion method" option, if available. Or in the "List of supported output formats" option, select only the WebP format, because the selected conversion method does not yet allow converting to AVIF format.', 'webp-converter-for-media' ),
26
+ ];
27
+ }
28
+ }
src/Error/Notice/LibsWithoutWebpSupportNotice.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class LibsWithoutWebpSupportNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'libs_without_webp_support';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
26
+ __( 'The selected option of "Conversion method" does not support WebP format. Please read %1$sthe plugin FAQ%2$s, specifically question about requirements of plugin. GD or Imagick library is installed on your server, but it does not support the WebP format. This issue is plugin-independent.', 'webp-converter-for-media' ),
27
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
28
+ '</a>'
29
+ ),
30
+ __( 'Select a different method in the "Conversion method" option if available, or reconfigure the server so that the selected conversion method supports the WebP format. Please contact your server administrator in this case.', 'webp-converter-for-media' ),
31
+ ];
32
+ }
33
+ }
src/Error/Notice/PassthruExecutionNotice.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ use WebpConverter\Loader\PassthruLoader;
6
+
7
+ /**
8
+ * {@inheritdoc}
9
+ */
10
+ class PassthruExecutionNotice implements ErrorNotice {
11
+
12
+ const ERROR_KEY = 'passthru_execution';
13
+
14
+ /**
15
+ * {@inheritdoc}
16
+ */
17
+ public function get_key(): string {
18
+ return self::ERROR_KEY;
19
+ }
20
+
21
+ /**
22
+ * {@inheritdoc}
23
+ */
24
+ public function get_message(): array {
25
+ $passthru_url = PassthruLoader::get_loader_url();
26
+ return [
27
+ sprintf(
28
+ /* translators: %s: anchor tag */
29
+ __( 'Execution of the PHP file from path "%s" is blocked on your server, or access to this file is blocked. Add an exception and enable this file to be executed via HTTP request. To do this, check the security plugin settings (if you are using) or the security settings of your server.', 'webp-converter-for-media' ),
30
+ '<a href="' . $passthru_url . '" target="_blank">' . $passthru_url . '</a>',
31
+ '<br><br>'
32
+ ),
33
+ __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' ),
34
+ ];
35
+ }
36
+ }
src/Error/Notice/PathHtaccessNotWritableNotice.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class PathHtaccessNotWritableNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'path_htaccess_not_writable';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: server path */
26
+ __( 'Unable to create or edit .htaccess file (function is_readable() or is_writable() returns false). Change directory permissions. The current using path of file is: %1$s. Please contact your server administrator.', 'webp-converter-for-media' ),
27
+ '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '/.htaccess</strong>'
28
+ ),
29
+ ];
30
+ }
31
+ }
src/Error/Notice/PathUploadsUnavailableNotice.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class PathUploadsUnavailableNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'path_uploads_unavailable';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: filter name, %2$s: server path, %3$s: open anchor tag, %4$s: close anchor tag */
26
+ __( 'The path for /uploads files does not exist (function is_dir() returns false). Use filter %1$s to set the correct path. The current using path is: %2$s. Please read %3$sthe plugin FAQ%4$s to learn more.', 'webp-converter-for-media' ),
27
+ '<strong>webpc_dir_path</strong>',
28
+ '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '</strong>',
29
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
30
+ '</a>'
31
+ ),
32
+ ];
33
+ }
34
+ }
src/Error/Notice/PathWebpDuplicatedNotice.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class PathWebpDuplicatedNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'path_webp_duplicated';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: filter name, %2$s: server path */
26
+ __( 'The paths for /uploads files and for saving converted WebP files are the same. Change them using filter %1$s. The current path for them is: %2$s.', 'webp-converter-for-media' ),
27
+ '<strong>webpc_dir_path</strong>',
28
+ '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '</strong>'
29
+ ),
30
+ ];
31
+ }
32
+ }
src/Error/Notice/PathWebpNotWritableNotice.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class PathWebpNotWritableNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'path_webp_not_writable';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: filter name, %2$s: server path, %3$s: open anchor tag, %4$s: close anchor tag */
26
+ __( 'The path for saving converted WebP files does not exist and cannot be created (function is_writable() returns false). Use filter %1$s to set the correct path. The current using path is: %2$s. Please read %3$sthe plugin FAQ%4$s to learn more.', 'webp-converter-for-media' ),
27
+ '<strong>webpc_dir_path</strong>',
28
+ '<strong>' . apply_filters( 'webpc_dir_path', '', 'webp' ) . '</strong>',
29
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
30
+ '</a>'
31
+ ),
32
+ ];
33
+ }
34
+ }
src/Error/Notice/RestApiDisabledNotice.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class RestApiDisabledNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'rest_api_disabled';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: anchor tag, %2$s: anchor tag, %3$s: anchor tag */
26
+ __( 'The REST API on your website is not available. Please verify this and try again. Pay special attention to the filters: %1$s, %2$s and %3$s.', 'webp-converter-for-media' ),
27
+ '<a href="https://developer.wordpress.org/reference/hooks/rest_enabled/" target="_blank">rest_enabled</a>',
28
+ '<a href="https://developer.wordpress.org/reference/hooks/rest_jsonp_enabled/" target="_blank">rest_jsonp_enabled</a>',
29
+ '<a href="https://developer.wordpress.org/reference/hooks/rest_authentication_errors/" target="_blank">rest_authentication_errors</a>'
30
+ ),
31
+ ];
32
+ }
33
+ }
src/Error/Notice/RewritesCachedNotice.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class RewritesCachedNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'rewrites_cached';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ __( 'Your server uses the cache for HTTP requests. The rules from .htaccess file or from Nginx configuration are not executed every time when the image is loaded, but the last redirect from cache is performed. With each request to image, your server should execute the rules from .htaccess file or from Nginx configuration. Now it only does this the first time and then uses cache. This means that if your server redirected image to WebP format the first time, it does so on every request. It should check the rules from .htaccess file or from Nginx configuration each time during request to image and redirect only when the conditions are met.', 'webp-converter-for-media' ),
25
+ __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' ),
26
+ sprintf(
27
+ /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: loader name */
28
+ __( '%1$sAlso try changing option "Image loading mode" to a different one.%2$s Issues about rewrites can often be resolved by setting this option to "%3$s". You can do this in plugin settings below. After changing settings, remember to flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ),
29
+ '<strong>',
30
+ '</strong>',
31
+ 'Pass Thru'
32
+ ),
33
+ ];
34
+ }
35
+ }
src/Error/Notice/RewritesNotExecutedNotice.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class RewritesNotExecutedNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'rewrites_not_executed';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: directory tag, %2$s: invalid config value, %3$s: correct config value */
26
+ __( 'Your server does not supports using .htaccess files from custom locations. This is usually related to the virtual host settings in the Apache configuration. In the .conf file appropriate for your VirtualHost, in the %1$s section, replace the value of %2$s with the value of %3$s.', 'webp-converter-for-media' ),
27
+ sprintf( '<strong>%s</strong>', '&lt;Directory&gt;...&lt;/Directory&gt;' ),
28
+ sprintf( '<strong>%s</strong>', 'AllowOverride None' ),
29
+ sprintf( '<strong>%s</strong>', 'AllowOverride All' )
30
+ ),
31
+ sprintf(
32
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
33
+ __( 'If you are using a Nginx server, check the configuration for Nginx in %1$sthe plugin FAQ%2$s. Proper configuration of virtual hosts for Nginx is required for the plugin to function properly. Manual configuration is also necessary if you are using the WordPress Multisite Network.', 'webp-converter-for-media' ),
34
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
35
+ '</a>'
36
+ ),
37
+ __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' ),
38
+ ];
39
+ }
40
+ }
src/Error/Notice/RewritesNotWorkingNotice.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class RewritesNotWorkingNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'rewrites_not_working';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ sprintf(
25
+ /* translators: %1$s: open strong tag, %2$s: close strong tag */
26
+ __( 'Redirects on your server are not working. Check the correct configuration for you in %1$sthe plugin FAQ%2$s. If you have checked the configuration, it means that your server does not support redirects from the .htaccess file or your server configuration is not compatible with this plugin.', 'webp-converter-for-media' ),
27
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
28
+ '</a>'
29
+ ),
30
+ __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' ),
31
+ sprintf(
32
+ /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: loader name */
33
+ __( '%1$sAlso try changing option "Image loading mode" to a different one.%2$s Issues about rewrites can often be resolved by setting this option to "%3$s". You can do this in plugin settings below. After changing settings, remember to flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ),
34
+ '<strong>',
35
+ '</strong>',
36
+ 'Pass Thru'
37
+ ),
38
+ ];
39
+ }
40
+ }
src/Error/Notice/SettingsIncorrectNotice.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Error\Notice;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class SettingsIncorrectNotice implements ErrorNotice {
9
+
10
+ const ERROR_KEY = 'settings_incorrect';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_key(): string {
16
+ return self::ERROR_KEY;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_message(): array {
23
+ return [
24
+ __( 'The plugin settings are incorrect! Check them out and save them again. Please remember that you must have at least one option selected for each field.', 'webp-converter-for-media' ),
25
+ ];
26
+ }
27
+ }
src/Error/RestapiError.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Error;
4
-
5
- /**
6
- * Checks for configuration errors about disabled REST API.
7
- */
8
- class RestapiError implements ErrorInterface {
9
-
10
- /**
11
- * {@inheritdoc}
12
- */
13
- public function get_error_codes(): array {
14
- $errors = [];
15
-
16
- if ( $this->if_rest_api_is_enabled() !== true ) {
17
- $errors[] = 'rest_api_disabled';
18
- }
19
- return $errors;
20
- }
21
-
22
- /**
23
- * Checks if REST API is enabled.
24
- *
25
- * @return bool Verification status.
26
- */
27
- private function if_rest_api_is_enabled(): bool {
28
- return ( ( apply_filters( 'rest_enabled', true ) === true )
29
- && ( apply_filters( 'rest_jsonp_enabled', true ) === true )
30
- && ( apply_filters( 'rest_authentication_errors', true ) === true ) );
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Helper/OptionsAccess.php CHANGED
@@ -22,7 +22,7 @@ class OptionsAccess {
22
  }
23
 
24
  /**
25
- * @param string $option_name .
26
  * @param mixed $option_value .
27
  *
28
  * @return void
22
  }
23
 
24
  /**
25
+ * @param string $option_name .
26
  * @param mixed $option_value .
27
  *
28
  * @return void
src/Loader/HtaccessLoader.php CHANGED
@@ -21,6 +21,10 @@ class HtaccessLoader extends LoaderAbstract {
21
  * {@inheritdoc}
22
  */
23
  public function activate_loader( bool $is_debug = false ) {
 
 
 
 
24
  $settings = ( $is_debug ) ? $this->plugin_data->get_debug_settings() : $this->plugin_data->get_plugin_settings();
25
 
26
  $this->add_rewrite_rules_to_wp_content( true, $settings );
@@ -32,6 +36,10 @@ class HtaccessLoader extends LoaderAbstract {
32
  * {@inheritdoc}
33
  */
34
  public function deactivate_loader() {
 
 
 
 
35
  $settings = $this->plugin_data->get_plugin_settings();
36
 
37
  $this->add_rewrite_rules_to_wp_content( false, $settings );
21
  * {@inheritdoc}
22
  */
23
  public function activate_loader( bool $is_debug = false ) {
24
+ if ( is_multisite() ) {
25
+ return;
26
+ }
27
+
28
  $settings = ( $is_debug ) ? $this->plugin_data->get_debug_settings() : $this->plugin_data->get_plugin_settings();
29
 
30
  $this->add_rewrite_rules_to_wp_content( true, $settings );
36
  * {@inheritdoc}
37
  */
38
  public function deactivate_loader() {
39
+ if ( is_multisite() ) {
40
+ return;
41
+ }
42
+
43
  $settings = $this->plugin_data->get_plugin_settings();
44
 
45
  $this->add_rewrite_rules_to_wp_content( false, $settings );
src/Plugin/Uninstall/DebugFiles.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace WebpConverter\Plugin\Uninstall;
4
 
5
- use WebpConverter\Error\RewritesError;
6
 
7
  /**
8
  * Removes files needed for debugging from /uploads directory.
@@ -17,11 +17,11 @@ class DebugFiles {
17
  public static function remove_debug_files() {
18
  $uploads_dir = apply_filters( 'webpc_dir_path', '', 'uploads' );
19
 
20
- if ( is_writable( $uploads_dir . RewritesError::PATH_OUTPUT_FILE_PNG ) ) {
21
- unlink( $uploads_dir . RewritesError::PATH_OUTPUT_FILE_PNG );
22
  }
23
- if ( is_writable( $uploads_dir . RewritesError::PATH_OUTPUT_FILE_PNG2 ) ) {
24
- unlink( $uploads_dir . RewritesError::PATH_OUTPUT_FILE_PNG2 );
25
  }
26
  }
27
  }
2
 
3
  namespace WebpConverter\Plugin\Uninstall;
4
 
5
+ use WebpConverter\Error\Detector\RewritesErrorsDetector;
6
 
7
  /**
8
  * Removes files needed for debugging from /uploads directory.
17
  public static function remove_debug_files() {
18
  $uploads_dir = apply_filters( 'webpc_dir_path', '', 'uploads' );
19
 
20
+ if ( is_writable( $uploads_dir . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG ) ) {
21
+ unlink( $uploads_dir . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG );
22
  }
23
+ if ( is_writable( $uploads_dir . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2 ) ) {
24
+ unlink( $uploads_dir . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2 );
25
  }
26
  }
27
  }
src/Plugin/Uninstall/PluginSettings.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace WebpConverter\Plugin\Uninstall;
4
 
5
- use WebpConverter\Error\ErrorFactory;
6
  use WebpConverter\Helper\OptionsAccess;
7
  use WebpConverter\Notice\ThanksNotice;
8
  use WebpConverter\Notice\WelcomeNotice;
@@ -23,7 +23,7 @@ class PluginSettings {
23
  OptionsAccess::delete_option( ThanksNotice::NOTICE_OLD_OPTION );
24
  OptionsAccess::delete_option( ThanksNotice::NOTICE_OPTION );
25
  OptionsAccess::delete_option( WelcomeNotice::NOTICE_OPTION );
26
- OptionsAccess::delete_option( ErrorFactory::ERRORS_CACHE_OPTION );
27
  OptionsAccess::delete_option( SettingsSave::SETTINGS_OPTION );
28
  OptionsAccess::delete_option( Update::VERSION_OPTION );
29
  }
2
 
3
  namespace WebpConverter\Plugin\Uninstall;
4
 
5
+ use WebpConverter\Error\ErrorDetectorAggregator;
6
  use WebpConverter\Helper\OptionsAccess;
7
  use WebpConverter\Notice\ThanksNotice;
8
  use WebpConverter\Notice\WelcomeNotice;
23
  OptionsAccess::delete_option( ThanksNotice::NOTICE_OLD_OPTION );
24
  OptionsAccess::delete_option( ThanksNotice::NOTICE_OPTION );
25
  OptionsAccess::delete_option( WelcomeNotice::NOTICE_OPTION );
26
+ OptionsAccess::delete_option( ErrorDetectorAggregator::ERRORS_CACHE_OPTION );
27
  OptionsAccess::delete_option( SettingsSave::SETTINGS_OPTION );
28
  OptionsAccess::delete_option( Update::VERSION_OPTION );
29
  }
src/Settings/Page/DebugPage.php CHANGED
@@ -3,7 +3,7 @@
3
 
4
  namespace WebpConverter\Settings\Page;
5
 
6
- use WebpConverter\Error\RewritesError;
7
  use WebpConverter\Helper\FileLoader;
8
  use WebpConverter\Helper\ViewLoader;
9
  use WebpConverter\Loader\LoaderAbstract;
@@ -47,31 +47,31 @@ class DebugPage extends PageAbstract {
47
  PageIntegration::get_settings_page_url()
48
  ),
49
  'size_png_path' => FileLoader::get_file_size_by_path(
50
- $uploads_path . RewritesError::PATH_OUTPUT_FILE_PNG
51
  ),
52
  'size_png2_path' => FileLoader::get_file_size_by_path(
53
- $uploads_path . RewritesError::PATH_OUTPUT_FILE_PNG2
54
  ),
55
  'size_png_url' => FileLoader::get_file_size_by_url(
56
- $uploads_url . RewritesError::PATH_OUTPUT_FILE_PNG,
57
  $this->plugin_data,
58
  false,
59
  $ver_param
60
  ),
61
  'size_png2_url' => FileLoader::get_file_size_by_url(
62
- $uploads_url . RewritesError::PATH_OUTPUT_FILE_PNG2,
63
  $this->plugin_data,
64
  false,
65
  $ver_param
66
  ),
67
  'size_png_as_webp_url' => FileLoader::get_file_size_by_url(
68
- $uploads_url . RewritesError::PATH_OUTPUT_FILE_PNG,
69
  $this->plugin_data,
70
  true,
71
  $ver_param
72
  ),
73
  'size_png2_as_webp_url' => FileLoader::get_file_size_by_url(
74
- $uploads_url . RewritesError::PATH_OUTPUT_FILE_PNG2,
75
  $this->plugin_data,
76
  true,
77
  $ver_param
3
 
4
  namespace WebpConverter\Settings\Page;
5
 
6
+ use WebpConverter\Error\Detector\RewritesErrorsDetector;
7
  use WebpConverter\Helper\FileLoader;
8
  use WebpConverter\Helper\ViewLoader;
9
  use WebpConverter\Loader\LoaderAbstract;
47
  PageIntegration::get_settings_page_url()
48
  ),
49
  'size_png_path' => FileLoader::get_file_size_by_path(
50
+ $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG
51
  ),
52
  'size_png2_path' => FileLoader::get_file_size_by_path(
53
+ $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2
54
  ),
55
  'size_png_url' => FileLoader::get_file_size_by_url(
56
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
57
  $this->plugin_data,
58
  false,
59
  $ver_param
60
  ),
61
  'size_png2_url' => FileLoader::get_file_size_by_url(
62
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
63
  $this->plugin_data,
64
  false,
65
  $ver_param
66
  ),
67
  'size_png_as_webp_url' => FileLoader::get_file_size_by_url(
68
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
69
  $this->plugin_data,
70
  true,
71
  $ver_param
72
  ),
73
  'size_png2_as_webp_url' => FileLoader::get_file_size_by_url(
74
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
75
  $this->plugin_data,
76
  true,
77
  $ver_param
src/Settings/Page/SettingsPage.php CHANGED
@@ -33,7 +33,8 @@ class SettingsPage extends PageAbstract {
33
  ViewLoader::load_view(
34
  self::PAGE_VIEW_PATH,
35
  [
36
- 'errors' => apply_filters( 'webpc_server_errors_messages', [], false, true ),
 
37
  'options' => ( new OptionFactory() )->get_options(),
38
  'submit_value' => SettingsSave::SUBMIT_VALUE,
39
  'settings_url' => sprintf(
33
  ViewLoader::load_view(
34
  self::PAGE_VIEW_PATH,
35
  [
36
+ 'errors_messages' => apply_filters( 'webpc_server_errors_messages', [] ),
37
+ 'errors_codes' => apply_filters( 'webpc_server_errors', [] ),
38
  'options' => ( new OptionFactory() )->get_options(),
39
  'submit_value' => SettingsSave::SUBMIT_VALUE,
40
  'settings_url' => sprintf(
src/WebpConverter.php CHANGED
@@ -7,7 +7,7 @@ use WebpConverter\Conversion;
7
  use WebpConverter\Conversion\Cron;
8
  use WebpConverter\Conversion\Endpoint;
9
  use WebpConverter\Conversion\Media;
10
- use WebpConverter\Error;
11
  use WebpConverter\Notice;
12
  use WebpConverter\Plugin;
13
  use WebpConverter\Settings\Page;
@@ -33,7 +33,7 @@ class WebpConverter {
33
  ( new Conversion\SkipLarger( $plugin_data ) )->init_hooks();
34
  ( new Cron\Event( $plugin_data ) )->init_hooks();
35
  ( new Cron\Schedules() )->init_hooks();
36
- ( new Error\ErrorFactory( $plugin_data ) )->init_hooks();
37
  ( new Notice\NoticeFactory() )->init_hooks();
38
  ( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_data ) ) )->init_hooks();
39
  ( new Loader\LoaderIntegration( new Loader\PassthruLoader( $plugin_data ) ) )->init_hooks();
7
  use WebpConverter\Conversion\Cron;
8
  use WebpConverter\Conversion\Endpoint;
9
  use WebpConverter\Conversion\Media;
10
+ use WebpConverter\Error\ErrorDetectorAggregator;
11
  use WebpConverter\Notice;
12
  use WebpConverter\Plugin;
13
  use WebpConverter\Settings\Page;
33
  ( new Conversion\SkipLarger( $plugin_data ) )->init_hooks();
34
  ( new Cron\Event( $plugin_data ) )->init_hooks();
35
  ( new Cron\Schedules() )->init_hooks();
36
+ ( new ErrorDetectorAggregator( $plugin_data ) )->init_hooks();
37
  ( new Notice\NoticeFactory() )->init_hooks();
38
  ( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_data ) ) )->init_hooks();
39
  ( new Loader\LoaderIntegration( new Loader\PassthruLoader( $plugin_data ) ) )->init_hooks();
templates/components/errors/bypassing-apache.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
14
- __( 'Requests to images are processed by your server bypassing Apache. When loading images, rules from the .htaccess file are not executed. Occasionally, this only applies to known file extensions: .jpg, .png, etc. and when e.g. .png2 extension is loaded, then the redirections from the .htaccess file work, because the server does not understand this format and does not treat it as image files. Check the redirects for %1$s.png file%2$s (for which the redirection does not work) and for %3$s.png2 file%4$s (for which the redirection works correctly). Change the server settings to stop ignoring the rules from the .htaccess file.', 'webp-converter-for-media' ),
15
- '<a href="' . WEBPC_URL . 'assets/img/debug/icon-before.png" target="_blank">',
16
- '</a>',
17
- '<a href="' . WEBPC_URL . 'assets/img/debug/icon-before.png2" target="_blank">',
18
- '</a>'
19
- )
20
- );
21
- ?>
22
- <br><br>
23
- <?php
24
- echo esc_html(
25
- __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' )
26
- );
27
- ?>
28
- </p>
29
- <?php require __DIR__ . '/passthru-info.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/libs-not-installed.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
14
- __( 'On your server is not installed GD or Imagick library. Please read %1$sthe plugin FAQ%2$s, specifically question about requirements of plugin. This issue is plugin-independent. Please contact your server administrator in this case.', 'webp-converter-for-media' ),
15
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
16
- '</a>'
17
- )
18
- );
19
- ?>
20
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/libs-without-avif-support.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- __( 'The selected option of "Conversion method" does not support AVIF format. This is a new format, so you will probably have to wait for its full support via PHP on your server. This issue is plugin-independent.', 'webp-converter-for-media' )
13
- );
14
- ?>
15
- <br><br>
16
- <?php
17
- echo wp_kses_post(
18
- __( 'Select a different method in the "Conversion method" option, if available. Or in the "List of supported output formats" option, select only the WebP format, because the selected conversion method does not yet allow converting to AVIF format.', 'webp-converter-for-media' )
19
- );
20
- ?>
21
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/libs-without-webp-support.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
14
- __( 'The selected option of "Conversion method" does not support WebP format. Please read %1$sthe plugin FAQ%2$s, specifically question about requirements of plugin. GD or Imagick library is installed on your server, but it does not support the WebP format. This issue is plugin-independent.', 'webp-converter-for-media' ),
15
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
16
- '</a>'
17
- )
18
- );
19
- ?>
20
- <br><br>
21
- <?php
22
- echo wp_kses_post(
23
- __( 'Select a different method in the "Conversion method" option if available, or reconfigure the server so that the selected conversion method supports the WebP format. Please contact your server administrator in this case.', 'webp-converter-for-media' )
24
- );
25
- ?>
26
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/passthru-execution.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @var string $passthru_url URL of Pass Thru image loader.
6
- * @package WebP Converter for Media
7
- */
8
-
9
- ?>
10
- <p>
11
- <?php
12
- echo wp_kses_post(
13
- sprintf(
14
- /* translators: %s: anchor tag */
15
- __( 'Execution of the PHP file from path "%s" is blocked on your server, or access to this file is blocked. Add an exception and enable this file to be executed via HTTP request. To do this, check the security plugin settings (if you are using) or the security settings of your server.', 'webp-converter-for-media' ),
16
- '<a href="' . $passthru_url . '" target="_blank">' . $passthru_url . '</a>',
17
- '<br><br>'
18
- )
19
- );
20
- ?>
21
- <br><br>
22
- <?php
23
- echo esc_html(
24
- __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' )
25
- );
26
- ?>
27
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/passthru-info.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: loader name */
14
- __( '%1$sAlso try changing option "Image loading mode" to a different one.%2$s Issues about rewrites can often be resolved by setting this option to "%3$s". You can do this in plugin settings below. After changing settings, remember to flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ),
15
- '<strong>',
16
- '</strong>',
17
- 'Pass Thru'
18
- )
19
- );
20
- ?>
21
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/path-htaccess-not-writable.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: server path */
14
- __( 'Unable to create or edit .htaccess file (function is_readable() or is_writable() returns false). Change directory permissions. The current using path of file is: %1$s. Please contact your server administrator.', 'webp-converter-for-media' ),
15
- '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '/.htaccess</strong>'
16
- )
17
- );
18
- ?>
19
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/path-uploads-unavailable.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: filter name, %2$s: server path, %3$s: open anchor tag, %4$s: close anchor tag */
14
- __( 'The path for /uploads files does not exist (function is_dir() returns false). Use filter %1$s to set the correct path. The current using path is: %2$s. Please read %3$sthe plugin FAQ%4$s to learn more.', 'webp-converter-for-media' ),
15
- '<strong>webpc_dir_path</strong>',
16
- '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '</strong>',
17
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
18
- '</a>'
19
- )
20
- );
21
- ?>
22
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/path-webp-duplicated.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: filter name, %2$s: server path */
14
- __( 'The paths for /uploads files and for saving converted WebP files are the same. Change them using filter %1$s. The current path for them is: %2$s.', 'webp-converter-for-media' ),
15
- '<strong>webpc_dir_path</strong>',
16
- '<strong>' . apply_filters( 'webpc_dir_path', '', 'uploads' ) . '</strong>'
17
- )
18
- );
19
- ?>
20
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/path-webp-not-writable.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: filter name, %2$s: server path, %3$s: open anchor tag, %4$s: close anchor tag */
14
- __( 'The path for saving converted WebP files does not exist and cannot be created (function is_writable() returns false). Use filter %1$s to set the correct path. The current using path is: %2$s. Please read %3$sthe plugin FAQ%4$s to learn more.', 'webp-converter-for-media' ),
15
- '<strong>webpc_dir_path</strong>',
16
- '<strong>' . apply_filters( 'webpc_dir_path', '', 'webp' ) . '</strong>',
17
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
18
- '</a>'
19
- )
20
- );
21
- ?>
22
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/rest-api-disabled.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: anchor tag, %2$s: anchor tag, %3$s: anchor tag */
14
- __( 'The REST API on your website is not available. Please verify this and try again. Pay special attention to the filters: %1$s, %2$s and %3$s.', 'webp-converter-for-media' ),
15
- '<a href="https://developer.wordpress.org/reference/hooks/rest_enabled/" target="_blank">rest_enabled</a>',
16
- '<a href="https://developer.wordpress.org/reference/hooks/rest_jsonp_enabled/" target="_blank">rest_jsonp_enabled</a>',
17
- '<a href="https://developer.wordpress.org/reference/hooks/rest_authentication_errors/" target="_blank">rest_authentication_errors</a>'
18
- )
19
- );
20
- ?>
21
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/rewrites-cached.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- __( 'Your server uses the cache for HTTP requests. The rules from .htaccess file or from Nginx configuration are not executed every time when the image is loaded, but the last redirect from cache is performed. With each request to image, your server should execute the rules from .htaccess file or from Nginx configuration. Now it only does this the first time and then uses cache. This means that if your server redirected image to WebP format the first time, it does so on every request. It should check the rules from .htaccess file or from Nginx configuration each time during request to image and redirect only when the conditions are met.', 'webp-converter-for-media' )
13
- );
14
- ?>
15
- <br><br>
16
- <?php
17
- echo esc_html(
18
- __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' )
19
- );
20
- ?>
21
- </p>
22
- <?php require __DIR__ . '/passthru-info.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/rewrites-not-executed.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: directory tag, %2$s: invalid config value, %3$s: correct config value */
14
- __( 'Your server does not supports using .htaccess files from custom locations. This is usually related to the virtual host settings in the Apache configuration. In the .conf file appropriate for your VirtualHost, in the %1$s section, replace the value of %2$s with the value of %3$s.', 'webp-converter-for-media' ),
15
- sprintf( '<strong>%s</strong>', '&lt;Directory&gt;...&lt;/Directory&gt;' ),
16
- sprintf( '<strong>%s</strong>', 'AllowOverride None' ),
17
- sprintf( '<strong>%s</strong>', 'AllowOverride All' )
18
- )
19
- );
20
- ?>
21
- <br><br>
22
- <?php
23
- echo wp_kses_post(
24
- sprintf(
25
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
26
- __( 'If you are using a Nginx server, check the configuration for Nginx in %1$sthe plugin FAQ%2$s. Proper configuration of virtual hosts for Nginx is required for the plugin to function properly. Manual configuration is also necessary if you are using the WordPress Multisite Network.', 'webp-converter-for-media' ),
27
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
28
- '</a>'
29
- )
30
- );
31
- ?>
32
- <br><br>
33
- <?php
34
- echo esc_html(
35
- __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' )
36
- );
37
- ?>
38
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/rewrites-not-working.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- sprintf(
13
- /* translators: %1$s: open strong tag, %2$s: close strong tag */
14
- __( 'Redirects on your server are not working. Check the correct configuration for you in %1$sthe plugin FAQ%2$s. If you have checked the configuration, it means that your server does not support redirects from the .htaccess file or your server configuration is not compatible with this plugin.', 'webp-converter-for-media' ),
15
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
16
- '</a>'
17
- )
18
- );
19
- ?>
20
- <br><br>
21
- <?php
22
- echo esc_html(
23
- __( 'In this case, please contact your server administrator.', 'webp-converter-for-media' )
24
- );
25
- ?>
26
- </p>
27
- <?php require __DIR__ . '/passthru-info.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/errors/settings-incorrect.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /**
3
- * Server configuration error displayed in errors section.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <p>
10
- <?php
11
- echo wp_kses_post(
12
- __( 'The plugin settings are incorrect! Check them out and save them again. Please remember that you must have at least one option selected for each field.', 'webp-converter-for-media' )
13
- );
14
- ?>
15
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/fields/checkbox.php CHANGED
@@ -11,26 +11,19 @@
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
- <table class="webpTable">
15
- <?php foreach ( $option['values'] as $value => $label ) : ?>
16
- <tr>
17
- <td>
18
- <input type="checkbox"
19
- name="<?php echo esc_attr( $option['name'] ); ?>[]"
20
- value="<?php echo esc_attr( $value ); ?>"
21
- id="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
22
- class="webpCheckbox__input"
23
- <?php echo ( in_array( $value, $option['value'] ) ) ? 'checked' : ''; ?>
24
- <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>>
25
- <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"></label>
26
- </td>
27
- <td>
28
- <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
29
- class="webpCheckbox__label"
30
- >
31
- <?php echo wp_kses_post( $label ); ?>
32
- </label>
33
- </td>
34
- </tr>
35
- <?php endforeach; ?>
36
- </table>
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
+ <?php foreach ( $option['values'] as $value => $label ) : ?>
15
+ <div class="webpField">
16
+ <input type="checkbox"
17
+ name="<?php echo esc_attr( $option['name'] ); ?>[]"
18
+ value="<?php echo esc_attr( $value ); ?>"
19
+ id="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
20
+ class="webpField__input webpField__input--checkbox"
21
+ <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>
22
+ <?php echo ( in_array( $value, $option['value'] ) ) ? 'checked' : ''; ?>
23
+ >
24
+ <label for="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
25
+ class="webpField__label">
26
+ <?php echo wp_kses_post( $label ); ?>
27
+ </label>
28
+ </div>
29
+ <?php endforeach; ?>
 
 
 
 
 
 
 
templates/components/fields/radio.php CHANGED
@@ -11,26 +11,19 @@
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
- <table class="webpTable">
15
- <?php foreach ( $option['values'] as $value => $label ) : ?>
16
- <tr>
17
- <td>
18
- <input type="radio"
19
- name="<?php echo esc_attr( $option['name'] ); ?>"
20
- value="<?php echo esc_attr( $value ); ?>"
21
- id="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
22
- class="webpCheckbox__input"
23
- <?php echo ( $value == $option['value'] ) ? 'checked' : ''; // phpcs:ignore ?>
24
- <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>>
25
- <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"></label>
26
- </td>
27
- <td>
28
- <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
29
- class="webpCheckbox__label"
30
- >
31
- <?php echo wp_kses_post( $label ); ?>
32
- </label>
33
- </td>
34
- </tr>
35
- <?php endforeach; ?>
36
- </table>
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
+ <?php foreach ( $option['values'] as $value => $label ) : ?>
15
+ <div class="webpField">
16
+ <input type="radio"
17
+ name="<?php echo esc_attr( $option['name'] ); ?>"
18
+ value="<?php echo esc_attr( $value ); ?>"
19
+ id="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
20
+ class="webpField__input webpField__input--radio"
21
+ <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>
22
+ <?php echo ( $value == $option['value'] ) ? 'checked' : ''; // phpcs:ignore ?>
23
+ >
24
+ <label for="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
25
+ class="webpField__label">
26
+ <?php echo wp_kses_post( $label ); ?>
27
+ </label>
28
+ </div>
29
+ <?php endforeach; ?>
 
 
 
 
 
 
 
templates/components/widgets/errors.php CHANGED
@@ -2,18 +2,26 @@
2
  /**
3
  * Widget displayed errors on plugin settings page.
4
  *
5
- * @var string[] $errors List of errors detected by plugin.
 
6
  * @package WebP Converter for Media
7
  */
8
 
9
  ?>
10
- <?php if ( $errors ) : ?>
11
  <div class="webpPage__widget">
12
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--error">
13
  <?php echo esc_html( __( 'Server configuration error', 'webp-converter-for-media' ) ); ?>
14
  </h3>
15
  <div class="webpContent webpContent--wide">
16
- <?php echo wp_kses_post( implode( '<p>---</p>', $errors ) ); ?>
 
 
 
 
 
 
 
17
  <p>---</p>
18
  <p>
19
  <?php
@@ -23,7 +31,7 @@
23
  __( '%1$sError codes:%2$s %3$s', 'webp-converter-for-media' ),
24
  '<strong>',
25
  '</strong>',
26
- implode( ', ', array_keys( $errors ) )
27
  )
28
  );
29
  ?>
2
  /**
3
  * Widget displayed errors on plugin settings page.
4
  *
5
+ * @var string[][] $errors_messages .
6
+ * @var string[] $errors_codes .
7
  * @package WebP Converter for Media
8
  */
9
 
10
  ?>
11
+ <?php if ( $errors_messages ) : ?>
12
  <div class="webpPage__widget">
13
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--error">
14
  <?php echo esc_html( __( 'Server configuration error', 'webp-converter-for-media' ) ); ?>
15
  </h3>
16
  <div class="webpContent webpContent--wide">
17
+ <?php foreach ( $errors_messages as $error_index => $error_lines ) : ?>
18
+ <?php if ( $error_index > 0 ) : ?>
19
+ <p>---</p>
20
+ <?php endif; ?>
21
+ <?php foreach ( $error_lines as $error_line ) : ?>
22
+ <p><?php echo wp_kses_post( $error_line ); ?></p>
23
+ <?php endforeach; ?>
24
+ <?php endforeach; ?>
25
  <p>---</p>
26
  <p>
27
  <?php
31
  __( '%1$sError codes:%2$s %3$s', 'webp-converter-for-media' ),
32
  '<strong>',
33
  '</strong>',
34
+ implode( ', ', $errors_codes )
35
  )
36
  );
37
  ?>
templates/components/widgets/regenerate.php CHANGED
@@ -99,21 +99,17 @@ $error_message = __( 'An unknown error occurred while converting the images: %s'
99
  </div>
100
  </div>
101
  <div class="webpPage__widgetRow">
102
- <table class="webpTable">
103
- <tr>
104
- <td>
105
- <input type="checkbox" name="regenerate_force" value="1"
106
- id="webpc-regenerate-force" class="webpCheckbox__input"
107
- >
108
- <label for="webpc-regenerate-force"></label>
109
- </td>
110
- <td>
111
- <label for="webpc-regenerate-force" class="webpCheckbox__label">
112
- <?php echo esc_html( __( 'Force convert all images again', 'webp-converter-for-media' ) ); ?>
113
- </label>
114
- </td>
115
- </tr>
116
- </table>
117
  <button type="button"
118
  class="webpLoader__button webpButton webpButton--green"
119
  <?php echo ( apply_filters( 'webpc_server_errors', [], true ) ) ? 'disabled' : ''; ?>>
99
  </div>
100
  </div>
101
  <div class="webpPage__widgetRow">
102
+ <div class="webpField">
103
+ <input type="checkbox"
104
+ name="regenerate_force"
105
+ value="1"
106
+ id="webpc-regenerate-force"
107
+ class="webpField__input webpField__input--toggle">
108
+ <label for="webpc-regenerate-force"
109
+ class="webpField__label">
110
+ <?php echo esc_html( __( 'Force convert all images again', 'webp-converter-for-media' ) ); ?>
111
+ </label>
112
+ </div>
 
 
 
 
113
  <button type="button"
114
  class="webpLoader__button webpButton webpButton--green"
115
  <?php echo ( apply_filters( 'webpc_server_errors', [], true ) ) ? 'disabled' : ''; ?>>
templates/views/deactivation-modal.php CHANGED
@@ -19,24 +19,23 @@
19
  <div class="webpModal__desc">
20
  <?php echo esc_html( __( 'Can you please take a moment to tell us why you are deactivating this plugin (your answer is completely anonymous)?', 'webp-converter-for-media' ) ); ?>
21
  </div>
22
- <table class="webpModal__table webpTable">
23
  <?php foreach ( $reasons as $index => $reason ) : ?>
24
- <tr>
25
- <td>
26
- <input type="radio" name="webpc_reason" value="<?php echo esc_attr( $reason['key'] ); ?>"
27
- id="webpc-option-<?php echo esc_attr( $index ); ?>" class="webpCheckbox__input"
28
- data-placeholder="<?php echo esc_attr( $reason['placeholder'] ); ?>"
29
- >
30
- <label for="webpc-option-<?php echo esc_attr( $index ); ?>"></label>
31
- </td>
32
- <td>
33
- <label for="webpc-option-<?php echo esc_attr( $index ); ?>"
34
- class="webpCheckbox__label"
35
- ><?php echo esc_html( $reason['label'] ); ?></label>
36
- </td>
37
- </tr>
38
  <?php endforeach; ?>
39
- </table>
40
  <textarea class="webpModal__textarea" name="webpc_comment" rows="2"></textarea>
41
  <ul class="webpModal__buttons">
42
  <li class="webpModal__button">
19
  <div class="webpModal__desc">
20
  <?php echo esc_html( __( 'Can you please take a moment to tell us why you are deactivating this plugin (your answer is completely anonymous)?', 'webp-converter-for-media' ) ); ?>
21
  </div>
22
+ <div class="webpModal__options">
23
  <?php foreach ( $reasons as $index => $reason ) : ?>
24
+ <div class="webpField">
25
+ <input type="radio"
26
+ name="webpc_reason"
27
+ value="<?php echo esc_attr( $reason['key'] ); ?>"
28
+ id="webpc-option-<?php echo esc_attr( $index ); ?>"
29
+ class="webpField__input webpField__input--radio"
30
+ data-placeholder="<?php echo esc_attr( $reason['placeholder'] ); ?>"
31
+ >
32
+ <label for="webpc-option-<?php echo esc_attr( $index ); ?>"
33
+ class="webpField__label">
34
+ <?php echo esc_html( $reason['label'] ); ?>
35
+ </label>
36
+ </div>
 
37
  <?php endforeach; ?>
38
+ </div>
39
  <textarea class="webpModal__textarea" name="webpc_comment" rows="2"></textarea>
40
  <ul class="webpModal__buttons">
41
  <li class="webpModal__button">
templates/views/settings.php CHANGED
@@ -2,13 +2,14 @@
2
  /**
3
  * Main tab of plugin settings page.
4
  *
5
- * @var string[] $errors List of errors detected by plugin.
6
- * @var mixed[] $options Options of plugin settings.
7
- * @var string $submit_value Value of submit button.
8
- * @var string $settings_url URL of plugin settings page (default view).
9
- * @var string $settings_debug_url URL of plugin settings page (debug view).
10
- * @var string $api_paths_url URL of REST API endpoint.
11
- * @var string $api_regenerate_url URL of REST API endpoint.
 
12
  * @package WebP Converter for Media
13
  */
14
 
2
  /**
3
  * Main tab of plugin settings page.
4
  *
5
+ * @var string[][] $errors_messages .
6
+ * @var string[] $errors_codes .
7
+ * @var mixed[] $options Options of plugin settings.
8
+ * @var string $submit_value Value of submit button.
9
+ * @var string $settings_url URL of plugin settings page (default view).
10
+ * @var string $settings_debug_url URL of plugin settings page (debug view).
11
+ * @var string $api_paths_url URL of REST API endpoint.
12
+ * @var string $api_regenerate_url URL of REST API endpoint.
13
  * @package WebP Converter for Media
14
  */
15
 
vendor/composer/ClassLoader.php CHANGED
@@ -338,7 +338,7 @@ class ClassLoader
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
- * @return bool|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
@@ -347,6 +347,8 @@ class ClassLoader
347
 
348
  return true;
349
  }
 
 
350
  }
351
 
352
  /**
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
+ * @return true|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
347
 
348
  return true;
349
  }
350
+
351
+ return null;
352
  }
353
 
354
  /**
vendor/composer/InstalledVersions.php CHANGED
@@ -1,285 +1,337 @@
1
  <?php
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
  class InstalledVersions
26
  {
27
- private static $installed = array (
28
- 'root' =>
29
- array (
30
- 'pretty_version' => 'dev-master',
31
- 'version' => 'dev-master',
32
- 'aliases' =>
33
- array (
34
- ),
35
- 'reference' => '8ff5c7727df486c35bd9748eebdff230409abcdd',
36
- 'name' => 'gbiorczyk/webp-converter-for-media',
37
- ),
38
- 'versions' =>
39
- array (
40
- 'gbiorczyk/webp-converter-for-media' =>
41
- array (
42
- 'pretty_version' => 'dev-master',
43
- 'version' => 'dev-master',
44
- 'aliases' =>
45
- array (
46
- ),
47
- 'reference' => '8ff5c7727df486c35bd9748eebdff230409abcdd',
48
- ),
49
- ),
50
- );
51
- private static $canGetVendors;
52
- private static $installedByVendor = array();
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
- public static function getInstalledPackages()
61
- {
62
- $packages = array();
63
- foreach (self::getInstalled() as $installed) {
64
- $packages[] = array_keys($installed['versions']);
65
- }
66
-
67
- if (1 === \count($packages)) {
68
- return $packages[0];
69
- }
70
-
71
- return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
72
- }
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
- public static function isInstalled($packageName)
83
- {
84
- foreach (self::getInstalled() as $installed) {
85
- if (isset($installed['versions'][$packageName])) {
86
- return true;
87
- }
88
- }
89
-
90
- return false;
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
- public static function satisfies(VersionParser $parser, $packageName, $constraint)
107
- {
108
- $constraint = $parser->parseConstraints($constraint);
109
- $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
110
-
111
- return $provided->matches($constraint);
112
- }
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
- public static function getVersionRanges($packageName)
124
- {
125
- foreach (self::getInstalled() as $installed) {
126
- if (!isset($installed['versions'][$packageName])) {
127
- continue;
128
- }
129
-
130
- $ranges = array();
131
- if (isset($installed['versions'][$packageName]['pretty_version'])) {
132
- $ranges[] = $installed['versions'][$packageName]['pretty_version'];
133
- }
134
- if (array_key_exists('aliases', $installed['versions'][$packageName])) {
135
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
136
- }
137
- if (array_key_exists('replaced', $installed['versions'][$packageName])) {
138
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
139
- }
140
- if (array_key_exists('provided', $installed['versions'][$packageName])) {
141
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
142
- }
143
-
144
- return implode(' || ', $ranges);
145
- }
146
-
147
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
148
- }
149
-
150
-
151
-
152
-
153
-
154
- public static function getVersion($packageName)
155
- {
156
- foreach (self::getInstalled() as $installed) {
157
- if (!isset($installed['versions'][$packageName])) {
158
- continue;
159
- }
160
-
161
- if (!isset($installed['versions'][$packageName]['version'])) {
162
- return null;
163
- }
164
-
165
- return $installed['versions'][$packageName]['version'];
166
- }
167
-
168
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
169
- }
170
-
171
-
172
-
173
-
174
-
175
- public static function getPrettyVersion($packageName)
176
- {
177
- foreach (self::getInstalled() as $installed) {
178
- if (!isset($installed['versions'][$packageName])) {
179
- continue;
180
- }
181
-
182
- if (!isset($installed['versions'][$packageName]['pretty_version'])) {
183
- return null;
184
- }
185
-
186
- return $installed['versions'][$packageName]['pretty_version'];
187
- }
188
-
189
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
190
- }
191
-
192
-
193
-
194
-
195
-
196
- public static function getReference($packageName)
197
- {
198
- foreach (self::getInstalled() as $installed) {
199
- if (!isset($installed['versions'][$packageName])) {
200
- continue;
201
- }
202
-
203
- if (!isset($installed['versions'][$packageName]['reference'])) {
204
- return null;
205
- }
206
-
207
- return $installed['versions'][$packageName]['reference'];
208
- }
209
-
210
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
211
- }
212
-
213
-
214
-
215
-
216
-
217
- public static function getRootPackage()
218
- {
219
- $installed = self::getInstalled();
220
-
221
- return $installed[0]['root'];
222
- }
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- public static function getRawData()
231
- {
232
- return self::$installed;
233
- }
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
- public static function reload($data)
254
- {
255
- self::$installed = $data;
256
- self::$installedByVendor = array();
257
- }
258
-
259
-
260
-
261
-
262
-
263
- private static function getInstalled()
264
- {
265
- if (null === self::$canGetVendors) {
266
- self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
267
- }
268
-
269
- $installed = array();
270
-
271
- if (self::$canGetVendors) {
272
- foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
273
- if (isset(self::$installedByVendor[$vendorDir])) {
274
- $installed[] = self::$installedByVendor[$vendorDir];
275
- } elseif (is_file($vendorDir.'/composer/installed.php')) {
276
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
277
- }
278
- }
279
- }
280
-
281
- $installed[] = self::$installed;
282
-
283
- return $installed;
284
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  }
1
  <?php
2
 
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
24
+ */
25
  class InstalledVersions
26
  {
27
+ private static $installed;
28
+ private static $canGetVendors;
29
+ private static $installedByVendor = array();
30
+
31
+ /**
32
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
33
+ *
34
+ * @return string[]
35
+ * @psalm-return list<string>
36
+ */
37
+ public static function getInstalledPackages()
38
+ {
39
+ $packages = array();
40
+ foreach (self::getInstalled() as $installed) {
41
+ $packages[] = array_keys($installed['versions']);
42
+ }
43
+
44
+ if (1 === \count($packages)) {
45
+ return $packages[0];
46
+ }
47
+
48
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
49
+ }
50
+
51
+ /**
52
+ * Returns a list of all package names with a specific type e.g. 'library'
53
+ *
54
+ * @param string $type
55
+ * @return string[]
56
+ * @psalm-return list<string>
57
+ */
58
+ public static function getInstalledPackagesByType($type)
59
+ {
60
+ $packagesByType = array();
61
+
62
+ foreach (self::getInstalled() as $installed) {
63
+ foreach ($installed['versions'] as $name => $package) {
64
+ if (isset($package['type']) && $package['type'] === $type) {
65
+ $packagesByType[] = $name;
66
+ }
67
+ }
68
+ }
69
+
70
+ return $packagesByType;
71
+ }
72
+
73
+ /**
74
+ * Checks whether the given package is installed
75
+ *
76
+ * This also returns true if the package name is provided or replaced by another package
77
+ *
78
+ * @param string $packageName
79
+ * @param bool $includeDevRequirements
80
+ * @return bool
81
+ */
82
+ public static function isInstalled($packageName, $includeDevRequirements = true)
83
+ {
84
+ foreach (self::getInstalled() as $installed) {
85
+ if (isset($installed['versions'][$packageName])) {
86
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
87
+ }
88
+ }
89
+
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Checks whether the given package satisfies a version constraint
95
+ *
96
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
97
+ *
98
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
99
+ *
100
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
101
+ * @param string $packageName
102
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
103
+ * @return bool
104
+ */
105
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
106
+ {
107
+ $constraint = $parser->parseConstraints($constraint);
108
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
109
+
110
+ return $provided->matches($constraint);
111
+ }
112
+
113
+ /**
114
+ * Returns a version constraint representing all the range(s) which are installed for a given package
115
+ *
116
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
117
+ * whether a given version of a package is installed, and not just whether it exists
118
+ *
119
+ * @param string $packageName
120
+ * @return string Version constraint usable with composer/semver
121
+ */
122
+ public static function getVersionRanges($packageName)
123
+ {
124
+ foreach (self::getInstalled() as $installed) {
125
+ if (!isset($installed['versions'][$packageName])) {
126
+ continue;
127
+ }
128
+
129
+ $ranges = array();
130
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
131
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
132
+ }
133
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
134
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
135
+ }
136
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
137
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
138
+ }
139
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
140
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
141
+ }
142
+
143
+ return implode(' || ', $ranges);
144
+ }
145
+
146
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
147
+ }
148
+
149
+ /**
150
+ * @param string $packageName
151
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
152
+ */
153
+ public static function getVersion($packageName)
154
+ {
155
+ foreach (self::getInstalled() as $installed) {
156
+ if (!isset($installed['versions'][$packageName])) {
157
+ continue;
158
+ }
159
+
160
+ if (!isset($installed['versions'][$packageName]['version'])) {
161
+ return null;
162
+ }
163
+
164
+ return $installed['versions'][$packageName]['version'];
165
+ }
166
+
167
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
168
+ }
169
+
170
+ /**
171
+ * @param string $packageName
172
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
173
+ */
174
+ public static function getPrettyVersion($packageName)
175
+ {
176
+ foreach (self::getInstalled() as $installed) {
177
+ if (!isset($installed['versions'][$packageName])) {
178
+ continue;
179
+ }
180
+
181
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
182
+ return null;
183
+ }
184
+
185
+ return $installed['versions'][$packageName]['pretty_version'];
186
+ }
187
+
188
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
189
+ }
190
+
191
+ /**
192
+ * @param string $packageName
193
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
194
+ */
195
+ public static function getReference($packageName)
196
+ {
197
+ foreach (self::getInstalled() as $installed) {
198
+ if (!isset($installed['versions'][$packageName])) {
199
+ continue;
200
+ }
201
+
202
+ if (!isset($installed['versions'][$packageName]['reference'])) {
203
+ return null;
204
+ }
205
+
206
+ return $installed['versions'][$packageName]['reference'];
207
+ }
208
+
209
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
210
+ }
211
+
212
+ /**
213
+ * @param string $packageName
214
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
215
+ */
216
+ public static function getInstallPath($packageName)
217
+ {
218
+ foreach (self::getInstalled() as $installed) {
219
+ if (!isset($installed['versions'][$packageName])) {
220
+ continue;
221
+ }
222
+
223
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
224
+ }
225
+
226
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
227
+ }
228
+
229
+ /**
230
+ * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
+ */
233
+ public static function getRootPackage()
234
+ {
235
+ $installed = self::getInstalled();
236
+
237
+ return $installed[0]['root'];
238
+ }
239
+
240
+ /**
241
+ * Returns the raw installed.php data for custom implementations
242
+ *
243
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
+ * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
+ */
247
+ public static function getRawData()
248
+ {
249
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
250
+
251
+ if (null === self::$installed) {
252
+ // only require the installed.php file if this file is loaded from its dumped location,
253
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
254
+ if (substr(__DIR__, -8, 1) !== 'C') {
255
+ self::$installed = include __DIR__ . '/installed.php';
256
+ } else {
257
+ self::$installed = array();
258
+ }
259
+ }
260
+
261
+ return self::$installed;
262
+ }
263
+
264
+ /**
265
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
+ *
267
+ * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
+ */
270
+ public static function getAllRawData()
271
+ {
272
+ return self::getInstalled();
273
+ }
274
+
275
+ /**
276
+ * Lets you reload the static array from another file
277
+ *
278
+ * This is only useful for complex integrations in which a project needs to use
279
+ * this class but then also needs to execute another project's autoloader in process,
280
+ * and wants to ensure both projects have access to their version of installed.php.
281
+ *
282
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
283
+ * the data it needs from this class, then call reload() with
284
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
285
+ * the project in which it runs can then also use this class safely, without
286
+ * interference between PHPUnit's dependencies and the project's dependencies.
287
+ *
288
+ * @param array[] $data A vendor/composer/installed.php data set
289
+ * @return void
290
+ *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
+ */
293
+ public static function reload($data)
294
+ {
295
+ self::$installed = $data;
296
+ self::$installedByVendor = array();
297
+ }
298
+
299
+ /**
300
+ * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
+ */
303
+ private static function getInstalled()
304
+ {
305
+ if (null === self::$canGetVendors) {
306
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
307
+ }
308
+
309
+ $installed = array();
310
+
311
+ if (self::$canGetVendors) {
312
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
313
+ if (isset(self::$installedByVendor[$vendorDir])) {
314
+ $installed[] = self::$installedByVendor[$vendorDir];
315
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
316
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
317
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
318
+ self::$installed = $installed[count($installed) - 1];
319
+ }
320
+ }
321
+ }
322
+ }
323
+
324
+ if (null === self::$installed) {
325
+ // only require the installed.php file if this file is loaded from its dumped location,
326
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
327
+ if (substr(__DIR__, -8, 1) !== 'C') {
328
+ self::$installed = require __DIR__ . '/installed.php';
329
+ } else {
330
+ self::$installed = array();
331
+ }
332
+ }
333
+ $installed[] = self::$installed;
334
+
335
+ return $installed;
336
+ }
337
  }
vendor/composer/autoload_classmap.php CHANGED
@@ -59,16 +59,31 @@ return array(
59
  'WebpConverter\\Conversion\\OutputPath' => $baseDir . '/src/Conversion/OutputPath.php',
60
  'WebpConverter\\Conversion\\SkipExists' => $baseDir . '/src/Conversion/SkipExists.php',
61
  'WebpConverter\\Conversion\\SkipLarger' => $baseDir . '/src/Conversion/SkipLarger.php',
62
- 'WebpConverter\\Error\\ErrorFactory' => $baseDir . '/src/Error/ErrorFactory.php',
63
- 'WebpConverter\\Error\\ErrorInterface' => $baseDir . '/src/Error/ErrorInterface.php',
64
- 'WebpConverter\\Error\\LibsInstalledError' => $baseDir . '/src/Error/LibsInstalledError.php',
65
- 'WebpConverter\\Error\\LibsSupportAvifError' => $baseDir . '/src/Error/LibsSupportAvifError.php',
66
- 'WebpConverter\\Error\\LibsSupportWebpError' => $baseDir . '/src/Error/LibsSupportWebpError.php',
67
- 'WebpConverter\\Error\\PassthruError' => $baseDir . '/src/Error/PassthruError.php',
68
- 'WebpConverter\\Error\\PathsError' => $baseDir . '/src/Error/PathsError.php',
69
- 'WebpConverter\\Error\\RestapiError' => $baseDir . '/src/Error/RestapiError.php',
70
- 'WebpConverter\\Error\\RewritesError' => $baseDir . '/src/Error/RewritesError.php',
71
- 'WebpConverter\\Error\\SettingsError' => $baseDir . '/src/Error/SettingsError.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  'WebpConverter\\Helper\\FileLoader' => $baseDir . '/src/Helper/FileLoader.php',
73
  'WebpConverter\\Helper\\OptionsAccess' => $baseDir . '/src/Helper/OptionsAccess.php',
74
  'WebpConverter\\Helper\\ViewLoader' => $baseDir . '/src/Helper/ViewLoader.php',
59
  'WebpConverter\\Conversion\\OutputPath' => $baseDir . '/src/Conversion/OutputPath.php',
60
  'WebpConverter\\Conversion\\SkipExists' => $baseDir . '/src/Conversion/SkipExists.php',
61
  'WebpConverter\\Conversion\\SkipLarger' => $baseDir . '/src/Conversion/SkipLarger.php',
62
+ 'WebpConverter\\Error\\Detector\\ErrorDetector' => $baseDir . '/src/Error/Detector/ErrorDetector.php',
63
+ 'WebpConverter\\Error\\Detector\\LibsNotInstalledDetector' => $baseDir . '/src/Error/Detector/LibsNotInstalledDetector.php',
64
+ 'WebpConverter\\Error\\Detector\\LibsWithoutAvifSupportDetector' => $baseDir . '/src/Error/Detector/LibsWithoutAvifSupportDetector.php',
65
+ 'WebpConverter\\Error\\Detector\\LibsWithoutWebpSupportDetector' => $baseDir . '/src/Error/Detector/LibsWithoutWebpSupportDetector.php',
66
+ 'WebpConverter\\Error\\Detector\\PassthruExecutionDetector' => $baseDir . '/src/Error/Detector/PassthruExecutionDetector.php',
67
+ 'WebpConverter\\Error\\Detector\\PathsErrorsDetector' => $baseDir . '/src/Error/Detector/PathsErrorsDetector.php',
68
+ 'WebpConverter\\Error\\Detector\\RestApiDisabledDetector' => $baseDir . '/src/Error/Detector/RestApiDisabledDetector.php',
69
+ 'WebpConverter\\Error\\Detector\\RewritesErrorsDetector' => $baseDir . '/src/Error/Detector/RewritesErrorsDetector.php',
70
+ 'WebpConverter\\Error\\Detector\\SettingsIncorrectDetector' => $baseDir . '/src/Error/Detector/SettingsIncorrectDetector.php',
71
+ 'WebpConverter\\Error\\ErrorDetectorAggregator' => $baseDir . '/src/Error/ErrorDetectorAggregator.php',
72
+ 'WebpConverter\\Error\\Notice\\BypassingApacheNotice' => $baseDir . '/src/Error/Notice/BypassingApacheNotice.php',
73
+ 'WebpConverter\\Error\\Notice\\ErrorNotice' => $baseDir . '/src/Error/Notice/ErrorNotice.php',
74
+ 'WebpConverter\\Error\\Notice\\LibsNotInstalledNotice' => $baseDir . '/src/Error/Notice/LibsNotInstalledNotice.php',
75
+ 'WebpConverter\\Error\\Notice\\LibsWithoutAvifSupportNotice' => $baseDir . '/src/Error/Notice/LibsWithoutAvifSupportNotice.php',
76
+ 'WebpConverter\\Error\\Notice\\LibsWithoutWebpSupportNotice' => $baseDir . '/src/Error/Notice/LibsWithoutWebpSupportNotice.php',
77
+ 'WebpConverter\\Error\\Notice\\PassthruExecutionNotice' => $baseDir . '/src/Error/Notice/PassthruExecutionNotice.php',
78
+ 'WebpConverter\\Error\\Notice\\PathHtaccessNotWritableNotice' => $baseDir . '/src/Error/Notice/PathHtaccessNotWritableNotice.php',
79
+ 'WebpConverter\\Error\\Notice\\PathUploadsUnavailableNotice' => $baseDir . '/src/Error/Notice/PathUploadsUnavailableNotice.php',
80
+ 'WebpConverter\\Error\\Notice\\PathWebpDuplicatedNotice' => $baseDir . '/src/Error/Notice/PathWebpDuplicatedNotice.php',
81
+ 'WebpConverter\\Error\\Notice\\PathWebpNotWritableNotice' => $baseDir . '/src/Error/Notice/PathWebpNotWritableNotice.php',
82
+ 'WebpConverter\\Error\\Notice\\RestApiDisabledNotice' => $baseDir . '/src/Error/Notice/RestApiDisabledNotice.php',
83
+ 'WebpConverter\\Error\\Notice\\RewritesCachedNotice' => $baseDir . '/src/Error/Notice/RewritesCachedNotice.php',
84
+ 'WebpConverter\\Error\\Notice\\RewritesNotExecutedNotice' => $baseDir . '/src/Error/Notice/RewritesNotExecutedNotice.php',
85
+ 'WebpConverter\\Error\\Notice\\RewritesNotWorkingNotice' => $baseDir . '/src/Error/Notice/RewritesNotWorkingNotice.php',
86
+ 'WebpConverter\\Error\\Notice\\SettingsIncorrectNotice' => $baseDir . '/src/Error/Notice/SettingsIncorrectNotice.php',
87
  'WebpConverter\\Helper\\FileLoader' => $baseDir . '/src/Helper/FileLoader.php',
88
  'WebpConverter\\Helper\\OptionsAccess' => $baseDir . '/src/Helper/OptionsAccess.php',
89
  'WebpConverter\\Helper\\ViewLoader' => $baseDir . '/src/Helper/ViewLoader.php',
vendor/composer/autoload_static.php CHANGED
@@ -74,16 +74,31 @@ class ComposerStaticInit86c856d7af1950143b554dace890ec99
74
  'WebpConverter\\Conversion\\OutputPath' => __DIR__ . '/../..' . '/src/Conversion/OutputPath.php',
75
  'WebpConverter\\Conversion\\SkipExists' => __DIR__ . '/../..' . '/src/Conversion/SkipExists.php',
76
  'WebpConverter\\Conversion\\SkipLarger' => __DIR__ . '/../..' . '/src/Conversion/SkipLarger.php',
77
- 'WebpConverter\\Error\\ErrorFactory' => __DIR__ . '/../..' . '/src/Error/ErrorFactory.php',
78
- 'WebpConverter\\Error\\ErrorInterface' => __DIR__ . '/../..' . '/src/Error/ErrorInterface.php',
79
- 'WebpConverter\\Error\\LibsInstalledError' => __DIR__ . '/../..' . '/src/Error/LibsInstalledError.php',
80
- 'WebpConverter\\Error\\LibsSupportAvifError' => __DIR__ . '/../..' . '/src/Error/LibsSupportAvifError.php',
81
- 'WebpConverter\\Error\\LibsSupportWebpError' => __DIR__ . '/../..' . '/src/Error/LibsSupportWebpError.php',
82
- 'WebpConverter\\Error\\PassthruError' => __DIR__ . '/../..' . '/src/Error/PassthruError.php',
83
- 'WebpConverter\\Error\\PathsError' => __DIR__ . '/../..' . '/src/Error/PathsError.php',
84
- 'WebpConverter\\Error\\RestapiError' => __DIR__ . '/../..' . '/src/Error/RestapiError.php',
85
- 'WebpConverter\\Error\\RewritesError' => __DIR__ . '/../..' . '/src/Error/RewritesError.php',
86
- 'WebpConverter\\Error\\SettingsError' => __DIR__ . '/../..' . '/src/Error/SettingsError.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  'WebpConverter\\Helper\\FileLoader' => __DIR__ . '/../..' . '/src/Helper/FileLoader.php',
88
  'WebpConverter\\Helper\\OptionsAccess' => __DIR__ . '/../..' . '/src/Helper/OptionsAccess.php',
89
  'WebpConverter\\Helper\\ViewLoader' => __DIR__ . '/../..' . '/src/Helper/ViewLoader.php',
74
  'WebpConverter\\Conversion\\OutputPath' => __DIR__ . '/../..' . '/src/Conversion/OutputPath.php',
75
  'WebpConverter\\Conversion\\SkipExists' => __DIR__ . '/../..' . '/src/Conversion/SkipExists.php',
76
  'WebpConverter\\Conversion\\SkipLarger' => __DIR__ . '/../..' . '/src/Conversion/SkipLarger.php',
77
+ 'WebpConverter\\Error\\Detector\\ErrorDetector' => __DIR__ . '/../..' . '/src/Error/Detector/ErrorDetector.php',
78
+ 'WebpConverter\\Error\\Detector\\LibsNotInstalledDetector' => __DIR__ . '/../..' . '/src/Error/Detector/LibsNotInstalledDetector.php',
79
+ 'WebpConverter\\Error\\Detector\\LibsWithoutAvifSupportDetector' => __DIR__ . '/../..' . '/src/Error/Detector/LibsWithoutAvifSupportDetector.php',
80
+ 'WebpConverter\\Error\\Detector\\LibsWithoutWebpSupportDetector' => __DIR__ . '/../..' . '/src/Error/Detector/LibsWithoutWebpSupportDetector.php',
81
+ 'WebpConverter\\Error\\Detector\\PassthruExecutionDetector' => __DIR__ . '/../..' . '/src/Error/Detector/PassthruExecutionDetector.php',
82
+ 'WebpConverter\\Error\\Detector\\PathsErrorsDetector' => __DIR__ . '/../..' . '/src/Error/Detector/PathsErrorsDetector.php',
83
+ 'WebpConverter\\Error\\Detector\\RestApiDisabledDetector' => __DIR__ . '/../..' . '/src/Error/Detector/RestApiDisabledDetector.php',
84
+ 'WebpConverter\\Error\\Detector\\RewritesErrorsDetector' => __DIR__ . '/../..' . '/src/Error/Detector/RewritesErrorsDetector.php',
85
+ 'WebpConverter\\Error\\Detector\\SettingsIncorrectDetector' => __DIR__ . '/../..' . '/src/Error/Detector/SettingsIncorrectDetector.php',
86
+ 'WebpConverter\\Error\\ErrorDetectorAggregator' => __DIR__ . '/../..' . '/src/Error/ErrorDetectorAggregator.php',
87
+ 'WebpConverter\\Error\\Notice\\BypassingApacheNotice' => __DIR__ . '/../..' . '/src/Error/Notice/BypassingApacheNotice.php',
88
+ 'WebpConverter\\Error\\Notice\\ErrorNotice' => __DIR__ . '/../..' . '/src/Error/Notice/ErrorNotice.php',
89
+ 'WebpConverter\\Error\\Notice\\LibsNotInstalledNotice' => __DIR__ . '/../..' . '/src/Error/Notice/LibsNotInstalledNotice.php',
90
+ 'WebpConverter\\Error\\Notice\\LibsWithoutAvifSupportNotice' => __DIR__ . '/../..' . '/src/Error/Notice/LibsWithoutAvifSupportNotice.php',
91
+ 'WebpConverter\\Error\\Notice\\LibsWithoutWebpSupportNotice' => __DIR__ . '/../..' . '/src/Error/Notice/LibsWithoutWebpSupportNotice.php',
92
+ 'WebpConverter\\Error\\Notice\\PassthruExecutionNotice' => __DIR__ . '/../..' . '/src/Error/Notice/PassthruExecutionNotice.php',
93
+ 'WebpConverter\\Error\\Notice\\PathHtaccessNotWritableNotice' => __DIR__ . '/../..' . '/src/Error/Notice/PathHtaccessNotWritableNotice.php',
94
+ 'WebpConverter\\Error\\Notice\\PathUploadsUnavailableNotice' => __DIR__ . '/../..' . '/src/Error/Notice/PathUploadsUnavailableNotice.php',
95
+ 'WebpConverter\\Error\\Notice\\PathWebpDuplicatedNotice' => __DIR__ . '/../..' . '/src/Error/Notice/PathWebpDuplicatedNotice.php',
96
+ 'WebpConverter\\Error\\Notice\\PathWebpNotWritableNotice' => __DIR__ . '/../..' . '/src/Error/Notice/PathWebpNotWritableNotice.php',
97
+ 'WebpConverter\\Error\\Notice\\RestApiDisabledNotice' => __DIR__ . '/../..' . '/src/Error/Notice/RestApiDisabledNotice.php',
98
+ 'WebpConverter\\Error\\Notice\\RewritesCachedNotice' => __DIR__ . '/../..' . '/src/Error/Notice/RewritesCachedNotice.php',
99
+ 'WebpConverter\\Error\\Notice\\RewritesNotExecutedNotice' => __DIR__ . '/../..' . '/src/Error/Notice/RewritesNotExecutedNotice.php',
100
+ 'WebpConverter\\Error\\Notice\\RewritesNotWorkingNotice' => __DIR__ . '/../..' . '/src/Error/Notice/RewritesNotWorkingNotice.php',
101
+ 'WebpConverter\\Error\\Notice\\SettingsIncorrectNotice' => __DIR__ . '/../..' . '/src/Error/Notice/SettingsIncorrectNotice.php',
102
  'WebpConverter\\Helper\\FileLoader' => __DIR__ . '/../..' . '/src/Helper/FileLoader.php',
103
  'WebpConverter\\Helper\\OptionsAccess' => __DIR__ . '/../..' . '/src/Helper/OptionsAccess.php',
104
  'WebpConverter\\Helper\\ViewLoader' => __DIR__ . '/../..' . '/src/Helper/ViewLoader.php',
vendor/composer/installed.php CHANGED
@@ -1,24 +1,23 @@
1
- <?php return array (
2
- 'root' =>
3
- array (
4
- 'pretty_version' => 'dev-master',
5
- 'version' => 'dev-master',
6
- 'aliases' =>
7
- array (
 
 
 
8
  ),
9
- 'reference' => '8ff5c7727df486c35bd9748eebdff230409abcdd',
10
- 'name' => 'gbiorczyk/webp-converter-for-media',
11
- ),
12
- 'versions' =>
13
- array (
14
- 'gbiorczyk/webp-converter-for-media' =>
15
- array (
16
- 'pretty_version' => 'dev-master',
17
- 'version' => 'dev-master',
18
- 'aliases' =>
19
- array (
20
- ),
21
- 'reference' => '8ff5c7727df486c35bd9748eebdff230409abcdd',
22
  ),
23
- ),
24
  );
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'pretty_version' => 'dev-master',
4
+ 'version' => 'dev-master',
5
+ 'type' => 'library',
6
+ 'install_path' => __DIR__ . '/../../',
7
+ 'aliases' => array(),
8
+ 'reference' => '225ac8c9ec65c9637b8bd91cda5eed293122804a',
9
+ 'name' => 'gbiorczyk/webp-converter-for-media',
10
+ 'dev' => false,
11
  ),
12
+ 'versions' => array(
13
+ 'gbiorczyk/webp-converter-for-media' => array(
14
+ 'pretty_version' => 'dev-master',
15
+ 'version' => 'dev-master',
16
+ 'type' => 'library',
17
+ 'install_path' => __DIR__ . '/../../',
18
+ 'aliases' => array(),
19
+ 'reference' => '225ac8c9ec65c9637b8bd91cda5eed293122804a',
20
+ 'dev_requirement' => false,
21
+ ),
 
 
 
22
  ),
 
23
  );
webp-converter-for-media.php CHANGED
@@ -3,14 +3,14 @@
3
  /**
4
  * Plugin Name: WebP Converter for Media
5
  * Description: Speed up your website by serving WebP images instead of standard formats JPEG, PNG and GIF.
6
- * Version: 3.1.0
7
  * Author: Mateusz Gbiorczyk
8
  * Author URI: https://gbiorczyk.pl/
9
  * Text Domain: webp-converter-for-media
10
  * Network: true
11
  */
12
 
13
- define( 'WEBPC_VERSION', '3.1.0' );
14
  define( 'WEBPC_FILE', __FILE__ );
15
  define( 'WEBPC_NAME', plugin_basename( __FILE__ ) );
16
  define( 'WEBPC_PATH', plugin_dir_path( __FILE__ ) );
3
  /**
4
  * Plugin Name: WebP Converter for Media
5
  * Description: Speed up your website by serving WebP images instead of standard formats JPEG, PNG and GIF.
6
+ * Version: 3.1.1
7
  * Author: Mateusz Gbiorczyk
8
  * Author URI: https://gbiorczyk.pl/
9
  * Text Domain: webp-converter-for-media
10
  * Network: true
11
  */
12
 
13
+ define( 'WEBPC_VERSION', '3.1.1' );
14
  define( 'WEBPC_FILE', __FILE__ );
15
  define( 'WEBPC_NAME', plugin_basename( __FILE__ ) );
16
  define( 'WEBPC_PATH', plugin_dir_path( __FILE__ ) );