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

Version Description

(2022-08-20) = * [Changed] Information about plugin operation and technical support on plugin settings page * [Changed] Option field for configuration of quality level * [Changed] Labels of options in plugin settings * [Changed] Widget for conversion process * [Added] Filter webpc_htaccess_cache_control_private to disable Cache-Control as private * [Added] Statistics on number of converted images * [Added] Tabs for plugin settings

See changelog.txt for previous versions.

=

Download this release

Release Info

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

Code changes from version 4.5.1 to 5.0.0

Files changed (88) hide show
  1. assets/build/css/styles.css +1 -1
  2. assets/build/js/scripts.js +1 -1
  3. assets/fonts/icons/icomoon.eot +0 -0
  4. assets/fonts/icons/icomoon.svg +3 -0
  5. assets/fonts/icons/icomoon.ttf +0 -0
  6. assets/fonts/icons/icomoon.woff +0 -0
  7. assets/img/debug/.htaccess +6 -6
  8. assets/img/logo-bg.png +0 -0
  9. assets/img/logo-headline.png +0 -0
  10. changelog.txt +9 -0
  11. includes/passthru.php +1 -1
  12. readme.txt +30 -44
  13. src/Conversion/Directory/DirectoryAbstract.php +1 -1
  14. src/Conversion/Directory/DirectoryIntegration.php +1 -1
  15. src/Conversion/Endpoint/ImagesCounterEndpoint.php +5 -1
  16. src/Conversion/Format/AvifFormat.php +7 -4
  17. src/Conversion/Media/Upload.php +12 -3
  18. src/Conversion/Method/LibraryMethodAbstract.php +2 -1
  19. src/Conversion/Method/MethodAbstract.php +22 -3
  20. src/Conversion/Method/MethodIntegrator.php +6 -2
  21. src/Conversion/Method/MethodInterface.php +7 -0
  22. src/Conversion/Method/RemoteMethod.php +15 -6
  23. src/Conversion/PathsFinder.php +11 -6
  24. src/Error/ErrorDetectorAggregator.php +1 -0
  25. src/Error/Notice/LibsNotInstalledNotice.php +11 -2
  26. src/Error/Notice/LibsWithoutWebpSupportNotice.php +13 -5
  27. src/Loader/HtaccessLoader.php +14 -6
  28. src/Notice/AvifSupportNotice.php +0 -89
  29. src/Plugin/Activation/DefaultSettings.php +0 -2
  30. src/Plugin/Uninstall/PluginSettings.php +1 -2
  31. src/PluginData.php +25 -5
  32. src/Service/DeactivationModalGenerator.php +1 -8
  33. src/Settings/Option/AccessTokenOption.php +24 -6
  34. src/Settings/Option/AutoConversionOption.php +67 -0
  35. src/Settings/Option/ConversionMethodOption.php +18 -6
  36. src/Settings/Option/ExtraFeaturesOption.php +20 -5
  37. src/Settings/Option/ImageResizeOption.php +65 -32
  38. src/Settings/Option/ImagesQualityOption.php +18 -14
  39. src/Settings/Option/LoaderTypeOption.php +17 -5
  40. src/Settings/Option/OptionAbstract.php +10 -7
  41. src/Settings/Option/OptionIntegration.php +6 -55
  42. src/Settings/Option/OptionInterface.php +28 -21
  43. src/Settings/Option/OptionsAggregator.php +17 -13
  44. src/Settings/Option/OutputFormatsOption.php +35 -20
  45. src/Settings/Option/SupportedDirectoriesOption.php +20 -5
  46. src/Settings/Option/SupportedExtensionsOption.php +23 -17
  47. src/Settings/Page/AdvancedSettingsPage.php +42 -0
  48. src/Settings/Page/DebugPage.php +61 -56
  49. src/Settings/Page/GeneralSettingsPage.php +119 -0
  50. src/Settings/Page/PageIntegration.php +29 -17
  51. src/Settings/Page/PageInterface.php +14 -8
  52. src/Settings/Page/SettingsPage.php +0 -85
  53. src/Settings/PluginOptions.php +19 -4
  54. src/Settings/SettingsSave.php +10 -34
  55. src/WebpConverter.php +2 -2
  56. templates/components/fields/checkbox.php +5 -4
  57. templates/components/fields/image_size.php +12 -11
  58. templates/components/fields/input.php +4 -3
  59. templates/components/fields/quality.php +53 -17
  60. templates/components/fields/radio.php +5 -4
  61. templates/components/fields/toggle.php +22 -0
  62. templates/components/fields/token.php +11 -29
  63. templates/components/notices/avif-support.php +0 -50
  64. templates/components/notices/clear-cache.php +8 -7
  65. templates/components/notices/thanks.php +6 -5
  66. templates/components/notices/welcome.php +7 -7
  67. templates/components/server/debug.php +3 -2
  68. templates/components/server/filters.php +6 -6
  69. templates/components/server/gd.php +1 -1
  70. templates/components/server/imagick.php +1 -1
  71. templates/components/server/options.php +1 -2
  72. templates/components/server/php.php +1 -1
  73. templates/components/server/wordpress.php +1 -1
  74. templates/components/widgets/about.php +7 -25
  75. templates/components/widgets/donate.php +0 -37
  76. templates/components/widgets/errors.php +8 -7
  77. templates/components/widgets/menu.php +24 -0
  78. templates/components/widgets/options-sidebar.php +57 -0
  79. templates/components/widgets/options.php +25 -50
  80. templates/components/widgets/regenerate.php +146 -96
  81. templates/components/widgets/server.php +22 -26
  82. templates/components/widgets/support.php +12 -45
  83. templates/views/settings-debug.php +42 -16
  84. templates/views/settings.php +54 -29
  85. vendor/composer/autoload_classmap.php +3 -2
  86. vendor/composer/autoload_static.php +3 -2
  87. vendor/composer/installed.php +2 -2
  88. webp-converter-for-media.php +2 -2
assets/build/css/styles.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";@keyframes dotsLoading{0%,to{content:"..."}25%{content:" .."}50%{content:". ."}75%{content:".. "}}@font-face{font-family:webpc-icomoon;font-style:normal;font-weight:400;src:url(../../fonts/icons/icomoon.eot?ver=14771249);src:url(../../fonts/icons/icomoon.woff?ver=14771249) format("woff"),url(../../fonts/icons/icomoon.eot?ver=14771249#iefix) format("embedded-opentype"),url(../../fonts/icons/icomoon.ttf?ver=14771249) format("truetype"),url(../../fonts/icons/icomoon.svg?ver=14771249#icomoon) format("svg")}.icon-logo:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.webpPage{color:#101517;margin:0;overflow:hidden;padding:0 20px 0 0}.webpPage *,.webpPage :after,.webpPage :before{box-sizing:border-box;margin:0;padding:0}.webpPage [hidden]{display:none!important}.webpPage .webpPage__headline{font-size:24px;line-height:1.2083333333;margin:0;padding:15px 0 23px}.webpPage__alert{background-color:#00a32a;color:#fff;font-size:14px;line-height:1.5714285714;margin-bottom:30px;padding:15px 20px}.webpPage__columns{margin:0 -30px;overflow:hidden}.webpPage__column{float:left;padding:0 30px}.webpPage__column--large{width:66.666%}.webpPage__column--small{width:33.333%}.webpPage__widget{background-color:#fff}.webpPage__widget+.webpPage__widget{margin-top:60px}.webpPage__widgetTitle{background-color:#2271b1;color:#fff;font-size:16px;font-weight:400;line-height:1.5;padding:14px 30px}.webpPage__widgetTitle--second{background-color:#a7aaad}.webpPage__widgetTitle--error{background-color:#d63638}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__widgetColumns{display:flex;flex-wrap:wrap;margin:0 -10px}.webpPage__widgetColumn{padding:0 10px;width:50%}.webpPage__widgetColumn:first-child:last-child{flex:1}.webpPage__widgetColumnNotice{background-color:#2271b1;margin:10px 0;padding:10px 20px}.webpPage__widgetColumnNotice p{color:#fff;font-size:1.2rem}.webpPage__widgetColumnNotice p+p{margin-top:0}.webpPage__widgetColumnNotice p a{color:inherit;font-weight:500;letter-spacing:1px;text-decoration:none;text-transform:uppercase}.webpPage__quality{border:1px solid #c3c4c7;display:flex;flex-wrap:wrap;margin:10px 0}.webpPage__qualityItem{border-left:1px solid #c3c4c7;flex:1;margin-left:-1px;text-align:center}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{display:block;font-size:14px;line-height:1.5714285714;padding:14px 20px;position:relative;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{background-color:#00a32a;color:#fff;margin:-1px;padding:15px 21px}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}#wp-admin-bar-webpc-menu .ab-icon:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e900"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.notice[data-notice=webp-converter-for-media]{padding:0}.notice[data-notice=webp-converter-for-media]~.notice[data-notice=webp-converter-for-media]{display:none}.webpButton{background-color:#fff;border:1px solid transparent;box-shadow:none!important;box-sizing:border-box;cursor:pointer;display:inline-block;font-size:14px;font-weight:500;line-height:1.5714285714;min-width:180px;opacity:1!important;outline:none!important;padding:9px 30px;position:relative;text-align:center;text-decoration:none!important;transition:color .3s!important;z-index:10}p>.webpButton{margin:6px 0}.webpButton:before{float:left;font-family:dashicons;font-size:20px;line-height:1.1;margin-right:10px}.webpButton:after{content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0;z-index:-1}.webpButton:hover:after{width:100%}.webpButton[disabled]{opacity:.5!important;pointer-events:none}.webpButton--blue:hover,.webpButton--gray:hover,.webpButton--green:hover,.webpButton--red:hover{color:#fff!important}.webpButton--blue{border-color:#2271b1;color:#2271b1!important}.webpButton--blue.webpButton--bg,.webpButton--blue:after{background-color:#2271b1}.webpButton--blue.webpButton--bg:after{background-color:#135e96}.webpButton--green{border-color:#00a32a;color:#00a32a!important}.webpButton--green.webpButton--bg,.webpButton--green:after{background-color:#00a32a}.webpButton--green.webpButton--bg:after{background-color:#008a20}.webpButton--red{border-color:#d63638;color:#d63638!important}.webpButton--red.webpButton--bg,.webpButton--red:after{background-color:#d63638}.webpButton--red.webpButton--bg:after{background-color:#b32d2e}.webpButton--gray{border-color:#c3c4c7;color:#c3c4c7!important}.webpButton--gray.webpButton--bg,.webpButton--gray:after{background-color:#c3c4c7}.webpButton--gray.webpButton--bg:after{background-color:#a7aaad}.webpButton--bg{color:#fff!important;font-weight:400}.webpContent{padding:20px 30px}.webpContent--author{background-image:url(../../img/author.png);background-position:left calc(100% - 30px);background-repeat:no-repeat;background-size:152px 152px;margin-left:20px;padding-left:172px}.webpContent p{font-size:14px;line-height:1.5714285714;max-width:800px}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{box-shadow:none;color:#2271b1;outline:none;text-decoration:underline;transition:opacity .3s}.webpContent a:hover{opacity:.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6{font-size:16px;font-weight:500;line-height:1.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6,.webpContent p{margin:10px 0 0;padding:4px 0}.webpContent h1:first-child,.webpContent h2:first-child,.webpContent h3:first-child,.webpContent h4:first-child,.webpContent h5:first-child,.webpContent h6:first-child,.webpContent p:first-child,.webpContent p>p{margin-top:0}.webpInput+p{background-color:#f0f0f1;margin:0 0 10px;max-width:none;padding:14px 20px}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{font-size:12px;line-height:1.75;margin-top:0}.webpContent--notice h1+p,.webpContent--notice h2+p,.webpContent--notice h3+p,.webpContent--notice h4+p,.webpContent--notice h5+p,.webpContent--notice h6+p{font-size:14px;line-height:1.5714285714}.webpContent__buttons{margin-top:-10px;overflow:hidden;padding:10px 0}.webpContent__button{float:left;margin:20px 20px 0 0}.webpContent__button:last-child{margin-right:0}.webpField{display:flex;padding:10px 0}.webpField--center{align-items:center}.webpField+.webpField{margin-top:-12px}.webpField__input{display:none!important}.webpField__input+label{display:inline-block;position:relative}.webpField__input[disabled]+label{pointer-events:none}.webpField__input[disabled]+label:after,.webpField__input[disabled]+label:before{opacity:.25}.webpField__input--checkbox+label,.webpField__input--radio+label{height:22px;width:22px}.webpField__input--checkbox+label:after,.webpField__input--checkbox+label:before,.webpField__input--radio+label:after,.webpField__input--radio+label:before{align-items:center;content:"";display:flex;height:22px;justify-content:center;left:0;position:absolute;top:0;width:22px}.webpField__input--checkbox+label:before,.webpField__input--radio+label:before{border:1px solid #c3c4c7}.webpField__input--checkbox+label:after,.webpField__input--radio+label:after{position:absolute;transform:scale(0);transition:transform .3s}.webpField__input--checkbox:checked+label:after,.webpField__input--radio:checked+label:after{transform:scale(1)}.webpField__input--checkbox+label:after{color:#00a32a;content:"\f147";font-family:dashicons;font-size:20px;line-height:1}.webpField__input--radio+label:before{border-radius:50%}.webpField__input--radio+label:after{background-color:#00a32a;border-radius:50%;content:"";height:6px;left:8px;top:8px;width:6px}.webpField__input--toggle+label{height:22px;width:44px}.webpField__input--toggle+label:after,.webpField__input--toggle+label:before{content:"";position:absolute}.webpField__input--toggle+label:before{background-color:#dcdcde;border:1px solid #c3c4c7;border-radius:11px;height:22px;left:0;top:0;transition:background-color .3s;width:44px}.webpField__input--toggle+label:after{background-color:#fff;border-radius:50%;height:16px;left:3px;position:absolute;top:3px;transition:transform .3s;width:16px}.webpField__input--toggle:checked+label:before{background-color:#00a32a}.webpField__input--toggle:checked+label:after{transform:translateX(22px)}.webpField__label{display:block;font-size:14px;line-height:1.5714285714;max-width:650px;position:relative}.webpField__input~.webpField__label{margin-left:20px}.webpInput{align-items:center;display:flex;padding:10px 0}.webpInput__field{border:1px solid #c3c4c7!important;border-radius:0!important;box-shadow:none!important;flex:1;font-size:14px!important;line-height:1.5714285714!important;padding:9px 15px!important}.webpInput__field--small{margin:0 10px;padding:4px 10px!important;width:80px}.webpInput__field[readonly]{background-color:#f0f0f1}.webpInput__button{margin:0 0 0 10px!important}.webpLoader__status{padding:20px 0 10px;position:relative}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{font-size:0;height:21px;line-height:0;position:relative}.webpLoader__barProgress:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpLoader__barProgress--error:before{background-color:#d63638}.webpLoader__barProgress[data-percent="0"]:before{width:0}.webpLoader__barProgress[data-percent="1"]:before{width:1%}.webpLoader__barProgress[data-percent="2"]:before{width:2%}.webpLoader__barProgress[data-percent="3"]:before{width:3%}.webpLoader__barProgress[data-percent="4"]:before{width:4%}.webpLoader__barProgress[data-percent="5"]:before{width:5%}.webpLoader__barProgress[data-percent="6"]:before{width:6%}.webpLoader__barProgress[data-percent="7"]:before{width:7%}.webpLoader__barProgress[data-percent="8"]:before{width:8%}.webpLoader__barProgress[data-percent="9"]:before{width:9%}.webpLoader__barProgress[data-percent="10"]:before{width:10%}.webpLoader__barProgress[data-percent="11"]:before{width:11%}.webpLoader__barProgress[data-percent="12"]:before{width:12%}.webpLoader__barProgress[data-percent="13"]:before{width:13%}.webpLoader__barProgress[data-percent="14"]:before{width:14%}.webpLoader__barProgress[data-percent="15"]:before{width:15%}.webpLoader__barProgress[data-percent="16"]:before{width:16%}.webpLoader__barProgress[data-percent="17"]:before{width:17%}.webpLoader__barProgress[data-percent="18"]:before{width:18%}.webpLoader__barProgress[data-percent="19"]:before{width:19%}.webpLoader__barProgress[data-percent="20"]:before{width:20%}.webpLoader__barProgress[data-percent="21"]:before{width:21%}.webpLoader__barProgress[data-percent="22"]:before{width:22%}.webpLoader__barProgress[data-percent="23"]:before{width:23%}.webpLoader__barProgress[data-percent="24"]:before{width:24%}.webpLoader__barProgress[data-percent="25"]:before{width:25%}.webpLoader__barProgress[data-percent="26"]:before{width:26%}.webpLoader__barProgress[data-percent="27"]:before{width:27%}.webpLoader__barProgress[data-percent="28"]:before{width:28%}.webpLoader__barProgress[data-percent="29"]:before{width:29%}.webpLoader__barProgress[data-percent="30"]:before{width:30%}.webpLoader__barProgress[data-percent="31"]:before{width:31%}.webpLoader__barProgress[data-percent="32"]:before{width:32%}.webpLoader__barProgress[data-percent="33"]:before{width:33%}.webpLoader__barProgress[data-percent="34"]:before{width:34%}.webpLoader__barProgress[data-percent="35"]:before{width:35%}.webpLoader__barProgress[data-percent="36"]:before{width:36%}.webpLoader__barProgress[data-percent="37"]:before{width:37%}.webpLoader__barProgress[data-percent="38"]:before{width:38%}.webpLoader__barProgress[data-percent="39"]:before{width:39%}.webpLoader__barProgress[data-percent="40"]:before{width:40%}.webpLoader__barProgress[data-percent="41"]:before{width:41%}.webpLoader__barProgress[data-percent="42"]:before{width:42%}.webpLoader__barProgress[data-percent="43"]:before{width:43%}.webpLoader__barProgress[data-percent="44"]:before{width:44%}.webpLoader__barProgress[data-percent="45"]:before{width:45%}.webpLoader__barProgress[data-percent="46"]:before{width:46%}.webpLoader__barProgress[data-percent="47"]:before{width:47%}.webpLoader__barProgress[data-percent="48"]:before{width:48%}.webpLoader__barProgress[data-percent="49"]:before{width:49%}.webpLoader__barProgress[data-percent="50"]:before{width:50%}.webpLoader__barProgress[data-percent="51"]:before{width:51%}.webpLoader__barProgress[data-percent="52"]:before{width:52%}.webpLoader__barProgress[data-percent="53"]:before{width:53%}.webpLoader__barProgress[data-percent="54"]:before{width:54%}.webpLoader__barProgress[data-percent="55"]:before{width:55%}.webpLoader__barProgress[data-percent="56"]:before{width:56%}.webpLoader__barProgress[data-percent="57"]:before{width:57%}.webpLoader__barProgress[data-percent="58"]:before{width:58%}.webpLoader__barProgress[data-percent="59"]:before{width:59%}.webpLoader__barProgress[data-percent="60"]:before{width:60%}.webpLoader__barProgress[data-percent="61"]:before{width:61%}.webpLoader__barProgress[data-percent="62"]:before{width:62%}.webpLoader__barProgress[data-percent="63"]:before{width:63%}.webpLoader__barProgress[data-percent="64"]:before{width:64%}.webpLoader__barProgress[data-percent="65"]:before{width:65%}.webpLoader__barProgress[data-percent="66"]:before{width:66%}.webpLoader__barProgress[data-percent="67"]:before{width:67%}.webpLoader__barProgress[data-percent="68"]:before{width:68%}.webpLoader__barProgress[data-percent="69"]:before{width:69%}.webpLoader__barProgress[data-percent="70"]:before{width:70%}.webpLoader__barProgress[data-percent="71"]:before{width:71%}.webpLoader__barProgress[data-percent="72"]:before{width:72%}.webpLoader__barProgress[data-percent="73"]:before{width:73%}.webpLoader__barProgress[data-percent="74"]:before{width:74%}.webpLoader__barProgress[data-percent="75"]:before{width:75%}.webpLoader__barProgress[data-percent="76"]:before{width:76%}.webpLoader__barProgress[data-percent="77"]:before{width:77%}.webpLoader__barProgress[data-percent="78"]:before{width:78%}.webpLoader__barProgress[data-percent="79"]:before{width:79%}.webpLoader__barProgress[data-percent="80"]:before{width:80%}.webpLoader__barProgress[data-percent="81"]:before{width:81%}.webpLoader__barProgress[data-percent="82"]:before{width:82%}.webpLoader__barProgress[data-percent="83"]:before{width:83%}.webpLoader__barProgress[data-percent="84"]:before{width:84%}.webpLoader__barProgress[data-percent="85"]:before{width:85%}.webpLoader__barProgress[data-percent="86"]:before{width:86%}.webpLoader__barProgress[data-percent="87"]:before{width:87%}.webpLoader__barProgress[data-percent="88"]:before{width:88%}.webpLoader__barProgress[data-percent="89"]:before{width:89%}.webpLoader__barProgress[data-percent="90"]:before{width:90%}.webpLoader__barProgress[data-percent="91"]:before{width:91%}.webpLoader__barProgress[data-percent="92"]:before{width:92%}.webpLoader__barProgress[data-percent="93"]:before{width:93%}.webpLoader__barProgress[data-percent="94"]:before{width:94%}.webpLoader__barProgress[data-percent="95"]:before{width:95%}.webpLoader__barProgress[data-percent="96"]:before{width:96%}.webpLoader__barProgress[data-percent="97"]:before{width:97%}.webpLoader__barProgress[data-percent="98"]:before{width:98%}.webpLoader__barProgress[data-percent="99"]:before{width:99%}.webpLoader__barProgress[data-percent="100"]:before{width:100%}.webpLoader__barCount{background-color:#00a32a;color:#fff;display:inline-block;font-family:monospace;font-size:12px;line-height:1.75;padding:0 5px;position:relative}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#d63638}.webpLoader__barCount:after{animation:dotsLoading 1s linear infinite;content:"...";margin-left:5px}.webpLoader__barProgress--error .webpLoader__barCount:after,.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:after{display:none}.webpLoader__barProgress[data-percent="0"] .webpLoader__barCount:before{content:"0%"}.webpLoader__barProgress[data-percent="1"] .webpLoader__barCount:before{content:"1%"}.webpLoader__barProgress[data-percent="2"] .webpLoader__barCount:before{content:"2%"}.webpLoader__barProgress[data-percent="3"] .webpLoader__barCount:before{content:"3%"}.webpLoader__barProgress[data-percent="4"] .webpLoader__barCount:before{content:"4%"}.webpLoader__barProgress[data-percent="5"] .webpLoader__barCount:before{content:"5%"}.webpLoader__barProgress[data-percent="6"] .webpLoader__barCount:before{content:"6%"}.webpLoader__barProgress[data-percent="7"] .webpLoader__barCount:before{content:"7%"}.webpLoader__barProgress[data-percent="8"] .webpLoader__barCount:before{content:"8%"}.webpLoader__barProgress[data-percent="9"] .webpLoader__barCount:before{content:"9%"}.webpLoader__barProgress[data-percent="10"] .webpLoader__barCount:before{content:"10%"}.webpLoader__barProgress[data-percent="11"] .webpLoader__barCount:before{content:"11%"}.webpLoader__barProgress[data-percent="12"] .webpLoader__barCount:before{content:"12%"}.webpLoader__barProgress[data-percent="13"] .webpLoader__barCount:before{content:"13%"}.webpLoader__barProgress[data-percent="14"] .webpLoader__barCount:before{content:"14%"}.webpLoader__barProgress[data-percent="15"] .webpLoader__barCount:before{content:"15%"}.webpLoader__barProgress[data-percent="16"] .webpLoader__barCount:before{content:"16%"}.webpLoader__barProgress[data-percent="17"] .webpLoader__barCount:before{content:"17%"}.webpLoader__barProgress[data-percent="18"] .webpLoader__barCount:before{content:"18%"}.webpLoader__barProgress[data-percent="19"] .webpLoader__barCount:before{content:"19%"}.webpLoader__barProgress[data-percent="20"] .webpLoader__barCount:before{content:"20%"}.webpLoader__barProgress[data-percent="21"] .webpLoader__barCount:before{content:"21%"}.webpLoader__barProgress[data-percent="22"] .webpLoader__barCount:before{content:"22%"}.webpLoader__barProgress[data-percent="23"] .webpLoader__barCount:before{content:"23%"}.webpLoader__barProgress[data-percent="24"] .webpLoader__barCount:before{content:"24%"}.webpLoader__barProgress[data-percent="25"] .webpLoader__barCount:before{content:"25%"}.webpLoader__barProgress[data-percent="26"] .webpLoader__barCount:before{content:"26%"}.webpLoader__barProgress[data-percent="27"] .webpLoader__barCount:before{content:"27%"}.webpLoader__barProgress[data-percent="28"] .webpLoader__barCount:before{content:"28%"}.webpLoader__barProgress[data-percent="29"] .webpLoader__barCount:before{content:"29%"}.webpLoader__barProgress[data-percent="30"] .webpLoader__barCount:before{content:"30%"}.webpLoader__barProgress[data-percent="31"] .webpLoader__barCount:before{content:"31%"}.webpLoader__barProgress[data-percent="32"] .webpLoader__barCount:before{content:"32%"}.webpLoader__barProgress[data-percent="33"] .webpLoader__barCount:before{content:"33%"}.webpLoader__barProgress[data-percent="34"] .webpLoader__barCount:before{content:"34%"}.webpLoader__barProgress[data-percent="35"] .webpLoader__barCount:before{content:"35%"}.webpLoader__barProgress[data-percent="36"] .webpLoader__barCount:before{content:"36%"}.webpLoader__barProgress[data-percent="37"] .webpLoader__barCount:before{content:"37%"}.webpLoader__barProgress[data-percent="38"] .webpLoader__barCount:before{content:"38%"}.webpLoader__barProgress[data-percent="39"] .webpLoader__barCount:before{content:"39%"}.webpLoader__barProgress[data-percent="40"] .webpLoader__barCount:before{content:"40%"}.webpLoader__barProgress[data-percent="41"] .webpLoader__barCount:before{content:"41%"}.webpLoader__barProgress[data-percent="42"] .webpLoader__barCount:before{content:"42%"}.webpLoader__barProgress[data-percent="43"] .webpLoader__barCount:before{content:"43%"}.webpLoader__barProgress[data-percent="44"] .webpLoader__barCount:before{content:"44%"}.webpLoader__barProgress[data-percent="45"] .webpLoader__barCount:before{content:"45%"}.webpLoader__barProgress[data-percent="46"] .webpLoader__barCount:before{content:"46%"}.webpLoader__barProgress[data-percent="47"] .webpLoader__barCount:before{content:"47%"}.webpLoader__barProgress[data-percent="48"] .webpLoader__barCount:before{content:"48%"}.webpLoader__barProgress[data-percent="49"] .webpLoader__barCount:before{content:"49%"}.webpLoader__barProgress[data-percent="50"] .webpLoader__barCount:before{content:"50%"}.webpLoader__barProgress[data-percent="51"] .webpLoader__barCount:before{content:"51%"}.webpLoader__barProgress[data-percent="52"] .webpLoader__barCount:before{content:"52%"}.webpLoader__barProgress[data-percent="53"] .webpLoader__barCount:before{content:"53%"}.webpLoader__barProgress[data-percent="54"] .webpLoader__barCount:before{content:"54%"}.webpLoader__barProgress[data-percent="55"] .webpLoader__barCount:before{content:"55%"}.webpLoader__barProgress[data-percent="56"] .webpLoader__barCount:before{content:"56%"}.webpLoader__barProgress[data-percent="57"] .webpLoader__barCount:before{content:"57%"}.webpLoader__barProgress[data-percent="58"] .webpLoader__barCount:before{content:"58%"}.webpLoader__barProgress[data-percent="59"] .webpLoader__barCount:before{content:"59%"}.webpLoader__barProgress[data-percent="60"] .webpLoader__barCount:before{content:"60%"}.webpLoader__barProgress[data-percent="61"] .webpLoader__barCount:before{content:"61%"}.webpLoader__barProgress[data-percent="62"] .webpLoader__barCount:before{content:"62%"}.webpLoader__barProgress[data-percent="63"] .webpLoader__barCount:before{content:"63%"}.webpLoader__barProgress[data-percent="64"] .webpLoader__barCount:before{content:"64%"}.webpLoader__barProgress[data-percent="65"] .webpLoader__barCount:before{content:"65%"}.webpLoader__barProgress[data-percent="66"] .webpLoader__barCount:before{content:"66%"}.webpLoader__barProgress[data-percent="67"] .webpLoader__barCount:before{content:"67%"}.webpLoader__barProgress[data-percent="68"] .webpLoader__barCount:before{content:"68%"}.webpLoader__barProgress[data-percent="69"] .webpLoader__barCount:before{content:"69%"}.webpLoader__barProgress[data-percent="70"] .webpLoader__barCount:before{content:"70%"}.webpLoader__barProgress[data-percent="71"] .webpLoader__barCount:before{content:"71%"}.webpLoader__barProgress[data-percent="72"] .webpLoader__barCount:before{content:"72%"}.webpLoader__barProgress[data-percent="73"] .webpLoader__barCount:before{content:"73%"}.webpLoader__barProgress[data-percent="74"] .webpLoader__barCount:before{content:"74%"}.webpLoader__barProgress[data-percent="75"] .webpLoader__barCount:before{content:"75%"}.webpLoader__barProgress[data-percent="76"] .webpLoader__barCount:before{content:"76%"}.webpLoader__barProgress[data-percent="77"] .webpLoader__barCount:before{content:"77%"}.webpLoader__barProgress[data-percent="78"] .webpLoader__barCount:before{content:"78%"}.webpLoader__barProgress[data-percent="79"] .webpLoader__barCount:before{content:"79%"}.webpLoader__barProgress[data-percent="80"] .webpLoader__barCount:before{content:"80%"}.webpLoader__barProgress[data-percent="81"] .webpLoader__barCount:before{content:"81%"}.webpLoader__barProgress[data-percent="82"] .webpLoader__barCount:before{content:"82%"}.webpLoader__barProgress[data-percent="83"] .webpLoader__barCount:before{content:"83%"}.webpLoader__barProgress[data-percent="84"] .webpLoader__barCount:before{content:"84%"}.webpLoader__barProgress[data-percent="85"] .webpLoader__barCount:before{content:"85%"}.webpLoader__barProgress[data-percent="86"] .webpLoader__barCount:before{content:"86%"}.webpLoader__barProgress[data-percent="87"] .webpLoader__barCount:before{content:"87%"}.webpLoader__barProgress[data-percent="88"] .webpLoader__barCount:before{content:"88%"}.webpLoader__barProgress[data-percent="89"] .webpLoader__barCount:before{content:"89%"}.webpLoader__barProgress[data-percent="90"] .webpLoader__barCount:before{content:"90%"}.webpLoader__barProgress[data-percent="91"] .webpLoader__barCount:before{content:"91%"}.webpLoader__barProgress[data-percent="92"] .webpLoader__barCount:before{content:"92%"}.webpLoader__barProgress[data-percent="93"] .webpLoader__barCount:before{content:"93%"}.webpLoader__barProgress[data-percent="94"] .webpLoader__barCount:before{content:"94%"}.webpLoader__barProgress[data-percent="95"] .webpLoader__barCount:before{content:"95%"}.webpLoader__barProgress[data-percent="96"] .webpLoader__barCount:before{content:"96%"}.webpLoader__barProgress[data-percent="97"] .webpLoader__barCount:before{content:"97%"}.webpLoader__barProgress[data-percent="98"] .webpLoader__barCount:before{content:"98%"}.webpLoader__barProgress[data-percent="99"] .webpLoader__barCount:before{content:"99%"}.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:before{content:"100%"}.webpLoader__progress{font-size:14px;line-height:1.5714285714;margin-bottom:-10px;padding:4px 0}.webpLoader__progressValue{font-weight:500}.webpLoader__success{margin-top:20px;padding:4px 0 4px 20px;position:relative}.webpLoader__success:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;width:2px}.webpLoader__successContent{color:#00a32a;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__successContent a{color:inherit}.webpLoader__errors{border-left:2px solid #c3c4c7;margin-top:20px}.webpLoader__errorsTitle{background-color:#c3c4c7;color:#fff;display:inline-block;font-size:14px;line-height:1.5714285714;padding:4px 22px}.webpLoader__errorsContent{padding:10px 0 10px 20px}.webpLoader__errorsContent>p{font-size:12px;line-height:1.75;margin:0;max-width:100%}.webpLoader__errorsContent>p.webpLoader__errorsContentError{color:#d63638;font-size:14px;font-weight:500;line-height:1.5714285714}.webpLoader__errorsContent pre{font-size:12px;line-height:1.75;white-space:normal}.webpLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpPopup{margin-top:20px}.webpPopup__inner{background-color:#fff;border:1px solid #c3c4c7;display:flex;flex-wrap:wrap}.webpPopup__image{background-image:url(../../img/author.png);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpPopup__content{border-left:1px solid #c3c4c7;flex:1;padding:10px 20px}.webpServerInfo{color:#222;text-align:center}.webpServerInfo pre{font-family:monospace;margin:0}.webpServerInfo h1,.webpServerInfo h2{display:none}.webpServerInfo p{max-width:100%}.webpServerInfo table{border:0;border-collapse:collapse;margin:10px auto;width:100%}.webpServerInfo td,.webpServerInfo th{border:1px solid #666;font-family:monospace;font-size:12px;line-height:1.75;padding:4px 5px;text-align:center;vertical-align:baseline}.webpServerInfo .p{text-align:left}.webpServerInfo .e{background-color:#ccf;font-weight:700;width:300px}.webpServerInfo .h{background-color:#99c;font-weight:700}.webpServerInfo .v{word-wrap:break-word;background-color:#ddd;max-width:300px;overflow-x:auto}.webpServerInfo .v i{color:#999}.webpServerInfo img{border:0;float:right}@media screen and (max-width:1280px){.webpPage__columns{margin:0 -15px}.webpPage__column{padding:0 15px}.webpPage__widget+.webpPage__widget{margin-top:30px}}@media screen and (max-width:1024px){.webpPage__column--large{width:100%}.webpPage__column--small{margin-top:40px;width:100%}.webpPage__widgetColumns{display:block}.webpPage__widgetColumn{width:100%}}@media screen and (max-width:782px){.webpPage{padding-right:0}.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #c3c4c7}.webpContent--author{background:none;margin-left:0;padding-left:30px}.webpInput{display:block}.webpInput__field{width:100%}.webpInput__button{margin:10px 0 0!important}.webpPopup__inner{border:1px solid #c3c4c7;display:block}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border-left:0}}
1
+ @charset "UTF-8";@keyframes dotsLoading{0%,to{content:"..."}25%{content:" .."}50%{content:". ."}75%{content:".. "}}@font-face{font-family:webpc-icomoon;font-style:normal;font-weight:400;src:url(../../fonts/icons/icomoon.eot?ver=11690510);src:url(../../fonts/icons/icomoon.woff?ver=11690510) format("woff"),url(../../fonts/icons/icomoon.eot?ver=11690510#iefix) format("embedded-opentype"),url(../../fonts/icons/icomoon.ttf?ver=11690510) format("truetype"),url(../../fonts/icons/icomoon.svg?ver=11690510#icomoon) format("svg")}.webpcPage{color:#101517;margin:0;overflow:hidden;padding:0 20px 0 0}.webpcPage *,.webpcPage :after,.webpcPage :before{box-sizing:border-box;margin:0;padding:0}.webpcPage [hidden]{display:none!important}.webpcPage__headline{background-color:#11f3af;line-height:0;margin-bottom:30px;margin-top:10px;padding:20px 30px;position:relative;width:100%;z-index:1}.webpcPage__headline img{max-width:100%}.webpcPage__headline:before{background-image:url(../../img/logo-bg.png);background-position:0 0;background-repeat:repeat;content:"";height:100%;left:0;opacity:.05;position:absolute;top:0;width:100%;z-index:-1}.webpcPage__alert{background-color:#00a32a;color:#fff;font-size:14px;line-height:1.5714285714;margin-bottom:30px;padding:15px 20px}.webpcPage__columns{margin:0 -30px;overflow:hidden}.webpcPage__column{float:left;padding:0 30px}.webpcPage__column--large{width:66.666%}.webpcPage__column--small{width:33.333%}.webpcPage__widget{background-color:#fff}.webpcPage__widget+.webpcPage__widget{margin-top:60px}.webpcPage__widget--border{border:1px solid #11f3af;border-top:0}.webpcPage__widgetTitle{border-bottom:1px solid #dcdcde;font-size:16px;font-weight:600;line-height:1.5;padding:13px 30px;position:relative;z-index:1}.webpcPage__widgetTitle--error{background-color:#d63638;border-color:transparent;color:#fff;font-weight:400}.webpcPage__widgetTitle--logo{background-color:#11f3af;border-color:transparent;color:#fff}.webpcPage__widgetTitle--logo:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e902"!important;font-family:webpc-icomoon!important;font-size:30px;font-style:normal;font-variant:normal;font-weight:400;line-height:1;position:absolute;right:30px;text-transform:none;top:10px}.webpcPage__widgetTitle--logo:after{background-image:url(../../img/logo-bg.png);background-position:0 0;background-repeat:repeat;content:"";height:100%;left:0;opacity:.05;position:absolute;top:0;width:100%;z-index:-1}.webpcPage__widgetRow{padding-bottom:10px}.webpcPage__widgetRow:last-child{padding-bottom:0}.webpcPage__widgetRow .webpcButton{margin:10px 0}.webpcPage__widgetColumns{display:flex;flex-wrap:wrap;margin:0 -10px}.webpcPage__widgetColumn{padding:0 10px;width:50%}.webpcPage__widgetColumn:first-child:last-child{flex:1}.webpcPage__widgetNotice{background-color:#2271b1;margin:10px 0;padding:10px 20px}.webpcPage__widgetNotice p{color:#fff;font-size:1.2rem}.webpcPage__widgetNotice p+p{margin-top:0}.webpcPage__widgetNotice p a{color:inherit;font-weight:600;letter-spacing:1px;text-decoration:none;text-transform:uppercase}.webpcPage__footer{margin-top:30px}.webpcPage__footerLogo{text-align:center}.webpcPage__footerLogo:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#dcdcde;content:"\e902"!important;font-family:webpc-icomoon!important;font-size:50px;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.webpcPage__footerContent{font-size:14px;line-height:1.5714285714;padding:14px 20px;text-align:center}.webpcPage__footerIcon{display:inline-block;padding:0 3px}.webpcPage__footerIcon--heart{color:#d63638}.webpcPage__footerIcon--heart:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\e901"!important;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}.webpcPage__footerIcon--stars{color:#f0c33c}.webpcPage__footerIcon--stars:before{content:"\e903"!important}#wp-admin-bar-webpc-menu .ab-icon:before,.webpcPage__footerIcon--stars:before{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:webpc-icomoon!important;font-style:normal;font-variant:normal;font-weight:400;text-transform:none}#wp-admin-bar-webpc-menu .ab-icon:before{content:"\e900"!important}.notice[data-notice=webp-converter-for-media]{padding:0}.notice[data-notice=webp-converter-for-media]~.notice[data-notice=webp-converter-for-media]{display:none}.webpcButton{background-color:#fff;border:1px solid transparent;box-shadow:none!important;box-sizing:border-box;cursor:pointer;display:inline-block;font-size:14px;line-height:1.5714285714;min-width:180px;opacity:1!important;outline:none!important;padding:9px 30px;position:relative;text-align:center;text-decoration:none!important;transition:color .3s!important;z-index:10}p>.webpcButton{margin:6px 0}.webpcButton:before{float:left;font-family:dashicons;font-size:20px;line-height:1.1;margin-right:10px}.webpcButton:after{content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0;z-index:-1}.webpcButton:hover:after{width:100%}.webpcButton[disabled]{opacity:.5!important;pointer-events:none}.webpcButton--blue:hover,.webpcButton--gray:hover,.webpcButton--red:hover{color:#fff!important}.webpcButton--blue{border-color:#2271b1;color:#2271b1!important}.webpcButton--blue.webpcButton--bg,.webpcButton--blue:after{background-color:#2271b1}.webpcButton--blue.webpcButton--bg:after{background-color:#135e96}.webpcButton--red{border-color:#d63638;color:#d63638!important}.webpcButton--red.webpcButton--bg,.webpcButton--red:after{background-color:#d63638}.webpcButton--red.webpcButton--bg:after{background-color:#b32d2e}.webpcButton--gray{border-color:#c3c4c7;color:#c3c4c7!important}.webpcButton--gray.webpcButton--bg,.webpcButton--gray:after{background-color:#c3c4c7}.webpcButton--gray.webpcButton--bg:after{background-color:#a7aaad}.webpcButton--bg{color:#fff!important}.webpcContent{padding:20px 30px}.webpcContent--author{background-image:url(../../img/author.png);background-position:left calc(100% - 30px);background-repeat:no-repeat;background-size:152px 152px;margin-left:20px;padding-left:172px}.webpcContent p{font-size:14px;line-height:1.5714285714;max-width:800px}.webpcContent p.center{text-align:center}.webpcContent--wide p{max-width:100%}.webpcContent a{box-shadow:none;color:#2271b1;outline:none;text-decoration:underline;transition:opacity .3s}.webpcContent a:hover{opacity:.5}.webpcContent h1,.webpcContent h2,.webpcContent h3,.webpcContent h4,.webpcContent h5,.webpcContent h6{font-size:16px;font-weight:600;line-height:1.5}.webpcContent h1,.webpcContent h2,.webpcContent h3,.webpcContent h4,.webpcContent h5,.webpcContent h6,.webpcContent p{margin:10px 0 0;padding:4px 0}.webpcContent h1:first-child,.webpcContent h2:first-child,.webpcContent h3:first-child,.webpcContent h4:first-child,.webpcContent h5:first-child,.webpcContent h6:first-child,.webpcContent p:first-child,.webpcContent p>p{margin-top:0}.webpcInput+p{background-color:#f0f0f1;margin:0 0 10px;max-width:none;padding:14px 20px}.webpcContent h1+p,.webpcContent h2+p,.webpcContent h3+p,.webpcContent h4+p,.webpcContent h5+p,.webpcContent h6+p{font-size:12px;line-height:1.75;margin-top:0}.webpcContent--notice h1+p,.webpcContent--notice h2+p,.webpcContent--notice h3+p,.webpcContent--notice h4+p,.webpcContent--notice h5+p,.webpcContent--notice h6+p{font-size:14px;line-height:1.5714285714}.webpcContent__buttons{margin-top:-10px;overflow:hidden;padding:10px 0}.webpcContent__button{float:left;margin:20px 20px 0 0}.webpcContent__button:last-child{margin-right:0}.webpcField{display:flex;padding:10px 0}.webpcField--center{align-items:center}.webpcField+.webpcField{margin-top:-12px}.webpcField__input{display:none!important}.webpcField__input+label{display:inline-block;position:relative}.webpcField__input[disabled]+label{pointer-events:none}.webpcField__input[disabled]+label:after,.webpcField__input[disabled]+label:before{opacity:.25}.webpcField__input--checkbox+label,.webpcField__input--radio+label{height:22px;width:22px}.webpcField__input--checkbox+label:after,.webpcField__input--checkbox+label:before,.webpcField__input--radio+label:after,.webpcField__input--radio+label:before{align-items:center;content:"";display:flex;height:22px;justify-content:center;left:0;position:absolute;top:0;width:22px}.webpcField__input--checkbox+label:before,.webpcField__input--radio+label:before{border:1px solid #c3c4c7}.webpcField__input--checkbox+label:after,.webpcField__input--radio+label:after{position:absolute;transform:scale(0);transition:transform .3s}.webpcField__input--checkbox:checked+label:after,.webpcField__input--radio:checked+label:after{transform:scale(1)}.webpcField__input--checkbox+label:after{color:#00a32a;content:"\f147";font-family:dashicons;font-size:20px;line-height:1}.webpcField__input--radio+label:before{border-radius:50%}.webpcField__input--radio+label:after{background-color:#00a32a;border-radius:50%;content:"";height:8px;left:7px;top:7px;width:8px}.webpcField__input--toggle+label{height:22px;width:44px}.webpcField__input--toggle+label:after,.webpcField__input--toggle+label:before{content:"";position:absolute}.webpcField__input--toggle+label:before{background-color:#dcdcde;border:1px solid #c3c4c7;border-radius:11px;height:22px;left:0;top:0;transition:background-color .3s;width:44px}.webpcField__input--toggle+label:after{background-color:#fff;border-radius:50%;height:16px;left:3px;position:absolute;top:3px;transition:transform .3s;width:16px}.webpcField__input--toggle:checked+label:before{background-color:#00a32a}.webpcField__input--toggle:checked+label:after{transform:translateX(22px)}.webpcField__label{display:block;font-size:14px;line-height:1.5714285714;max-width:650px;position:relative}.webpcField__input~.webpcField__label{margin-left:20px}.webpcInput{align-items:center;display:flex;padding:10px 0}.webpcInput__field{border:1px solid #c3c4c7!important;border-radius:0!important;box-shadow:none!important;flex:1;font-size:14px!important;line-height:1.5714285714!important;padding:9px 15px!important}.webpcInput__field--small{margin:0 10px;padding:4px 10px!important;width:80px}.webpcInput__field[readonly]{background-color:#f0f0f1}.webpcInput__button{margin:0 0 0 10px!important}.webpcLoader__columns{display:flex;justify-content:center;margin:-30px -30px 0;padding:10px 0;text-align:center}.webpcLoader__column{line-height:0;margin-top:30px;padding:0 30px}.webpcLoader__columnInner{display:inline-block;position:relative}.webpcLoader__columnInner:before{background-color:#f0f0f1;border-radius:50%;content:"";height:calc(100% - 10px);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(100% - 10px)}.webpcLoader__columnCircle{fill:none;stroke:#00a32a;stroke-width:10px;stroke-dasharray:596.90248;stroke-dashoffset:596.90248;height:200px;transform:rotate(-90deg);transition:stroke-dashoffset 2.5s;width:200px}.webpcLoader__column[data-percent="1"] .webpcLoader__columnCircle{stroke-dashoffset:590.9334552}.webpcLoader__column[data-percent="2"] .webpcLoader__columnCircle{stroke-dashoffset:584.9644304}.webpcLoader__column[data-percent="3"] .webpcLoader__columnCircle{stroke-dashoffset:578.9954056}.webpcLoader__column[data-percent="4"] .webpcLoader__columnCircle{stroke-dashoffset:573.0263808}.webpcLoader__column[data-percent="5"] .webpcLoader__columnCircle{stroke-dashoffset:567.057356}.webpcLoader__column[data-percent="6"] .webpcLoader__columnCircle{stroke-dashoffset:561.0883312}.webpcLoader__column[data-percent="7"] .webpcLoader__columnCircle{stroke-dashoffset:555.1193064}.webpcLoader__column[data-percent="8"] .webpcLoader__columnCircle{stroke-dashoffset:549.1502816}.webpcLoader__column[data-percent="9"] .webpcLoader__columnCircle{stroke-dashoffset:543.1812568}.webpcLoader__column[data-percent="10"] .webpcLoader__columnCircle{stroke-dashoffset:537.212232}.webpcLoader__column[data-percent="11"] .webpcLoader__columnCircle{stroke-dashoffset:531.2432072}.webpcLoader__column[data-percent="12"] .webpcLoader__columnCircle{stroke-dashoffset:525.2741824}.webpcLoader__column[data-percent="13"] .webpcLoader__columnCircle{stroke-dashoffset:519.3051576}.webpcLoader__column[data-percent="14"] .webpcLoader__columnCircle{stroke-dashoffset:513.3361328}.webpcLoader__column[data-percent="15"] .webpcLoader__columnCircle{stroke-dashoffset:507.367108}.webpcLoader__column[data-percent="16"] .webpcLoader__columnCircle{stroke-dashoffset:501.3980832}.webpcLoader__column[data-percent="17"] .webpcLoader__columnCircle{stroke-dashoffset:495.4290584}.webpcLoader__column[data-percent="18"] .webpcLoader__columnCircle{stroke-dashoffset:489.4600336}.webpcLoader__column[data-percent="19"] .webpcLoader__columnCircle{stroke-dashoffset:483.4910088}.webpcLoader__column[data-percent="20"] .webpcLoader__columnCircle{stroke-dashoffset:477.521984}.webpcLoader__column[data-percent="21"] .webpcLoader__columnCircle{stroke-dashoffset:471.5529592}.webpcLoader__column[data-percent="22"] .webpcLoader__columnCircle{stroke-dashoffset:465.5839344}.webpcLoader__column[data-percent="23"] .webpcLoader__columnCircle{stroke-dashoffset:459.6149096}.webpcLoader__column[data-percent="24"] .webpcLoader__columnCircle{stroke-dashoffset:453.6458848}.webpcLoader__column[data-percent="25"] .webpcLoader__columnCircle{stroke-dashoffset:447.67686}.webpcLoader__column[data-percent="26"] .webpcLoader__columnCircle{stroke-dashoffset:441.7078352}.webpcLoader__column[data-percent="27"] .webpcLoader__columnCircle{stroke-dashoffset:435.7388104}.webpcLoader__column[data-percent="28"] .webpcLoader__columnCircle{stroke-dashoffset:429.7697856}.webpcLoader__column[data-percent="29"] .webpcLoader__columnCircle{stroke-dashoffset:423.8007608}.webpcLoader__column[data-percent="30"] .webpcLoader__columnCircle{stroke-dashoffset:417.831736}.webpcLoader__column[data-percent="31"] .webpcLoader__columnCircle{stroke-dashoffset:411.8627112}.webpcLoader__column[data-percent="32"] .webpcLoader__columnCircle{stroke-dashoffset:405.8936864}.webpcLoader__column[data-percent="33"] .webpcLoader__columnCircle{stroke-dashoffset:399.9246616}.webpcLoader__column[data-percent="34"] .webpcLoader__columnCircle{stroke-dashoffset:393.9556368}.webpcLoader__column[data-percent="35"] .webpcLoader__columnCircle{stroke-dashoffset:387.986612}.webpcLoader__column[data-percent="36"] .webpcLoader__columnCircle{stroke-dashoffset:382.0175872}.webpcLoader__column[data-percent="37"] .webpcLoader__columnCircle{stroke-dashoffset:376.0485624}.webpcLoader__column[data-percent="38"] .webpcLoader__columnCircle{stroke-dashoffset:370.0795376}.webpcLoader__column[data-percent="39"] .webpcLoader__columnCircle{stroke-dashoffset:364.1105128}.webpcLoader__column[data-percent="40"] .webpcLoader__columnCircle{stroke-dashoffset:358.141488}.webpcLoader__column[data-percent="41"] .webpcLoader__columnCircle{stroke-dashoffset:352.1724632}.webpcLoader__column[data-percent="42"] .webpcLoader__columnCircle{stroke-dashoffset:346.2034384}.webpcLoader__column[data-percent="43"] .webpcLoader__columnCircle{stroke-dashoffset:340.2344136}.webpcLoader__column[data-percent="44"] .webpcLoader__columnCircle{stroke-dashoffset:334.2653888}.webpcLoader__column[data-percent="45"] .webpcLoader__columnCircle{stroke-dashoffset:328.296364}.webpcLoader__column[data-percent="46"] .webpcLoader__columnCircle{stroke-dashoffset:322.3273392}.webpcLoader__column[data-percent="47"] .webpcLoader__columnCircle{stroke-dashoffset:316.3583144}.webpcLoader__column[data-percent="48"] .webpcLoader__columnCircle{stroke-dashoffset:310.3892896}.webpcLoader__column[data-percent="49"] .webpcLoader__columnCircle{stroke-dashoffset:304.4202648}.webpcLoader__column[data-percent="50"] .webpcLoader__columnCircle{stroke-dashoffset:298.45124}.webpcLoader__column[data-percent="51"] .webpcLoader__columnCircle{stroke-dashoffset:292.4822152}.webpcLoader__column[data-percent="52"] .webpcLoader__columnCircle{stroke-dashoffset:286.5131904}.webpcLoader__column[data-percent="53"] .webpcLoader__columnCircle{stroke-dashoffset:280.5441656}.webpcLoader__column[data-percent="54"] .webpcLoader__columnCircle{stroke-dashoffset:274.5751408}.webpcLoader__column[data-percent="55"] .webpcLoader__columnCircle{stroke-dashoffset:268.606116}.webpcLoader__column[data-percent="56"] .webpcLoader__columnCircle{stroke-dashoffset:262.6370912}.webpcLoader__column[data-percent="57"] .webpcLoader__columnCircle{stroke-dashoffset:256.6680664}.webpcLoader__column[data-percent="58"] .webpcLoader__columnCircle{stroke-dashoffset:250.6990416}.webpcLoader__column[data-percent="59"] .webpcLoader__columnCircle{stroke-dashoffset:244.7300168}.webpcLoader__column[data-percent="60"] .webpcLoader__columnCircle{stroke-dashoffset:238.760992}.webpcLoader__column[data-percent="61"] .webpcLoader__columnCircle{stroke-dashoffset:232.7919672}.webpcLoader__column[data-percent="62"] .webpcLoader__columnCircle{stroke-dashoffset:226.8229424}.webpcLoader__column[data-percent="63"] .webpcLoader__columnCircle{stroke-dashoffset:220.8539176}.webpcLoader__column[data-percent="64"] .webpcLoader__columnCircle{stroke-dashoffset:214.8848928}.webpcLoader__column[data-percent="65"] .webpcLoader__columnCircle{stroke-dashoffset:208.915868}.webpcLoader__column[data-percent="66"] .webpcLoader__columnCircle{stroke-dashoffset:202.9468432}.webpcLoader__column[data-percent="67"] .webpcLoader__columnCircle{stroke-dashoffset:196.9778184}.webpcLoader__column[data-percent="68"] .webpcLoader__columnCircle{stroke-dashoffset:191.0087936}.webpcLoader__column[data-percent="69"] .webpcLoader__columnCircle{stroke-dashoffset:185.0397688}.webpcLoader__column[data-percent="70"] .webpcLoader__columnCircle{stroke-dashoffset:179.070744}.webpcLoader__column[data-percent="71"] .webpcLoader__columnCircle{stroke-dashoffset:173.1017192}.webpcLoader__column[data-percent="72"] .webpcLoader__columnCircle{stroke-dashoffset:167.1326944}.webpcLoader__column[data-percent="73"] .webpcLoader__columnCircle{stroke-dashoffset:161.1636696}.webpcLoader__column[data-percent="74"] .webpcLoader__columnCircle{stroke-dashoffset:155.1946448}.webpcLoader__column[data-percent="75"] .webpcLoader__columnCircle{stroke-dashoffset:149.22562}.webpcLoader__column[data-percent="76"] .webpcLoader__columnCircle{stroke-dashoffset:143.2565952}.webpcLoader__column[data-percent="77"] .webpcLoader__columnCircle{stroke-dashoffset:137.2875704}.webpcLoader__column[data-percent="78"] .webpcLoader__columnCircle{stroke-dashoffset:131.3185456}.webpcLoader__column[data-percent="79"] .webpcLoader__columnCircle{stroke-dashoffset:125.3495208}.webpcLoader__column[data-percent="80"] .webpcLoader__columnCircle{stroke-dashoffset:119.380496}.webpcLoader__column[data-percent="81"] .webpcLoader__columnCircle{stroke-dashoffset:113.4114712}.webpcLoader__column[data-percent="82"] .webpcLoader__columnCircle{stroke-dashoffset:107.4424464}.webpcLoader__column[data-percent="83"] .webpcLoader__columnCircle{stroke-dashoffset:101.4734216}.webpcLoader__column[data-percent="84"] .webpcLoader__columnCircle{stroke-dashoffset:95.5043968}.webpcLoader__column[data-percent="85"] .webpcLoader__columnCircle{stroke-dashoffset:89.535372}.webpcLoader__column[data-percent="86"] .webpcLoader__columnCircle{stroke-dashoffset:83.5663472}.webpcLoader__column[data-percent="87"] .webpcLoader__columnCircle{stroke-dashoffset:77.5973224}.webpcLoader__column[data-percent="88"] .webpcLoader__columnCircle{stroke-dashoffset:71.6282976}.webpcLoader__column[data-percent="89"] .webpcLoader__columnCircle{stroke-dashoffset:65.6592728}.webpcLoader__column[data-percent="90"] .webpcLoader__columnCircle{stroke-dashoffset:59.690248}.webpcLoader__column[data-percent="91"] .webpcLoader__columnCircle{stroke-dashoffset:53.7212232}.webpcLoader__column[data-percent="92"] .webpcLoader__columnCircle{stroke-dashoffset:47.7521984}.webpcLoader__column[data-percent="93"] .webpcLoader__columnCircle{stroke-dashoffset:41.7831736}.webpcLoader__column[data-percent="94"] .webpcLoader__columnCircle{stroke-dashoffset:35.8141488}.webpcLoader__column[data-percent="95"] .webpcLoader__columnCircle{stroke-dashoffset:29.845124}.webpcLoader__column[data-percent="96"] .webpcLoader__columnCircle{stroke-dashoffset:23.8760992}.webpcLoader__column[data-percent="97"] .webpcLoader__columnCircle{stroke-dashoffset:17.9070744}.webpcLoader__column[data-percent="98"] .webpcLoader__columnCircle{stroke-dashoffset:11.9380496}.webpcLoader__column[data-percent="99"] .webpcLoader__columnCircle{stroke-dashoffset:5.9690248}.webpcLoader__column[data-percent="100"] .webpcLoader__columnCircle{stroke-dashoffset:0}.webpcLoader__columnOverlay{left:0;position:absolute;text-align:center;top:50%;transform:translateY(-50%);width:100%}.webpcLoader__columnOverlayTitle{font-size:14px;font-weight:600;line-height:1.5714285714;padding:4px 20px}.webpcLoader__columnOverlayTitle strong{display:block;font-size:24px;line-height:1.2083333333}.webpcLoader__columnOverlayDesc{font-size:14px;line-height:1.5714285714;min-height:52px;padding:4px 20px}.webpcLoader__columnOverlayDesc--active{display:none}.webpcLoader__column[data-percent] .webpcLoader__columnOverlayDesc--active{display:block}.webpcLoader__column[data-percent] .webpcLoader__columnOverlayDesc--loading{display:none}.webpcLoader__columnOverlayDesc--loading:after{animation:dotsLoading 1s linear infinite;content:"...";font-family:monospace}.webpcLoader__statusProgress--error .webpcLoader__columnOverlayDesc--loading:after,.webpcLoader__statusProgress[data-percent="100"] .webpcLoader__columnOverlayDesc--loading:after{display:none}.webpcLoader__columnDesc{font-size:14px;line-height:1.5714285714;margin-bottom:-10px;margin-top:10px;padding:4px 0;text-align:center}.webpcLoader__status{margin-top:10px;padding-top:10px}.webpcLoader__statusProgress{font-size:0;height:31px;line-height:0;margin:10px 0;position:relative}.webpcLoader__statusProgress:before{background-color:#00a32a;content:"";height:100%;left:0;position:absolute;top:0;transition:width .3s;width:0}.webpcLoader__statusProgress--error:before{background-color:#d63638}.webpcLoader__statusProgress[data-percent="0"]:before{width:0}.webpcLoader__statusProgress[data-percent="1"]:before{width:1%}.webpcLoader__statusProgress[data-percent="2"]:before{width:2%}.webpcLoader__statusProgress[data-percent="3"]:before{width:3%}.webpcLoader__statusProgress[data-percent="4"]:before{width:4%}.webpcLoader__statusProgress[data-percent="5"]:before{width:5%}.webpcLoader__statusProgress[data-percent="6"]:before{width:6%}.webpcLoader__statusProgress[data-percent="7"]:before{width:7%}.webpcLoader__statusProgress[data-percent="8"]:before{width:8%}.webpcLoader__statusProgress[data-percent="9"]:before{width:9%}.webpcLoader__statusProgress[data-percent="10"]:before{width:10%}.webpcLoader__statusProgress[data-percent="11"]:before{width:11%}.webpcLoader__statusProgress[data-percent="12"]:before{width:12%}.webpcLoader__statusProgress[data-percent="13"]:before{width:13%}.webpcLoader__statusProgress[data-percent="14"]:before{width:14%}.webpcLoader__statusProgress[data-percent="15"]:before{width:15%}.webpcLoader__statusProgress[data-percent="16"]:before{width:16%}.webpcLoader__statusProgress[data-percent="17"]:before{width:17%}.webpcLoader__statusProgress[data-percent="18"]:before{width:18%}.webpcLoader__statusProgress[data-percent="19"]:before{width:19%}.webpcLoader__statusProgress[data-percent="20"]:before{width:20%}.webpcLoader__statusProgress[data-percent="21"]:before{width:21%}.webpcLoader__statusProgress[data-percent="22"]:before{width:22%}.webpcLoader__statusProgress[data-percent="23"]:before{width:23%}.webpcLoader__statusProgress[data-percent="24"]:before{width:24%}.webpcLoader__statusProgress[data-percent="25"]:before{width:25%}.webpcLoader__statusProgress[data-percent="26"]:before{width:26%}.webpcLoader__statusProgress[data-percent="27"]:before{width:27%}.webpcLoader__statusProgress[data-percent="28"]:before{width:28%}.webpcLoader__statusProgress[data-percent="29"]:before{width:29%}.webpcLoader__statusProgress[data-percent="30"]:before{width:30%}.webpcLoader__statusProgress[data-percent="31"]:before{width:31%}.webpcLoader__statusProgress[data-percent="32"]:before{width:32%}.webpcLoader__statusProgress[data-percent="33"]:before{width:33%}.webpcLoader__statusProgress[data-percent="34"]:before{width:34%}.webpcLoader__statusProgress[data-percent="35"]:before{width:35%}.webpcLoader__statusProgress[data-percent="36"]:before{width:36%}.webpcLoader__statusProgress[data-percent="37"]:before{width:37%}.webpcLoader__statusProgress[data-percent="38"]:before{width:38%}.webpcLoader__statusProgress[data-percent="39"]:before{width:39%}.webpcLoader__statusProgress[data-percent="40"]:before{width:40%}.webpcLoader__statusProgress[data-percent="41"]:before{width:41%}.webpcLoader__statusProgress[data-percent="42"]:before{width:42%}.webpcLoader__statusProgress[data-percent="43"]:before{width:43%}.webpcLoader__statusProgress[data-percent="44"]:before{width:44%}.webpcLoader__statusProgress[data-percent="45"]:before{width:45%}.webpcLoader__statusProgress[data-percent="46"]:before{width:46%}.webpcLoader__statusProgress[data-percent="47"]:before{width:47%}.webpcLoader__statusProgress[data-percent="48"]:before{width:48%}.webpcLoader__statusProgress[data-percent="49"]:before{width:49%}.webpcLoader__statusProgress[data-percent="50"]:before{width:50%}.webpcLoader__statusProgress[data-percent="51"]:before{width:51%}.webpcLoader__statusProgress[data-percent="52"]:before{width:52%}.webpcLoader__statusProgress[data-percent="53"]:before{width:53%}.webpcLoader__statusProgress[data-percent="54"]:before{width:54%}.webpcLoader__statusProgress[data-percent="55"]:before{width:55%}.webpcLoader__statusProgress[data-percent="56"]:before{width:56%}.webpcLoader__statusProgress[data-percent="57"]:before{width:57%}.webpcLoader__statusProgress[data-percent="58"]:before{width:58%}.webpcLoader__statusProgress[data-percent="59"]:before{width:59%}.webpcLoader__statusProgress[data-percent="60"]:before{width:60%}.webpcLoader__statusProgress[data-percent="61"]:before{width:61%}.webpcLoader__statusProgress[data-percent="62"]:before{width:62%}.webpcLoader__statusProgress[data-percent="63"]:before{width:63%}.webpcLoader__statusProgress[data-percent="64"]:before{width:64%}.webpcLoader__statusProgress[data-percent="65"]:before{width:65%}.webpcLoader__statusProgress[data-percent="66"]:before{width:66%}.webpcLoader__statusProgress[data-percent="67"]:before{width:67%}.webpcLoader__statusProgress[data-percent="68"]:before{width:68%}.webpcLoader__statusProgress[data-percent="69"]:before{width:69%}.webpcLoader__statusProgress[data-percent="70"]:before{width:70%}.webpcLoader__statusProgress[data-percent="71"]:before{width:71%}.webpcLoader__statusProgress[data-percent="72"]:before{width:72%}.webpcLoader__statusProgress[data-percent="73"]:before{width:73%}.webpcLoader__statusProgress[data-percent="74"]:before{width:74%}.webpcLoader__statusProgress[data-percent="75"]:before{width:75%}.webpcLoader__statusProgress[data-percent="76"]:before{width:76%}.webpcLoader__statusProgress[data-percent="77"]:before{width:77%}.webpcLoader__statusProgress[data-percent="78"]:before{width:78%}.webpcLoader__statusProgress[data-percent="79"]:before{width:79%}.webpcLoader__statusProgress[data-percent="80"]:before{width:80%}.webpcLoader__statusProgress[data-percent="81"]:before{width:81%}.webpcLoader__statusProgress[data-percent="82"]:before{width:82%}.webpcLoader__statusProgress[data-percent="83"]:before{width:83%}.webpcLoader__statusProgress[data-percent="84"]:before{width:84%}.webpcLoader__statusProgress[data-percent="85"]:before{width:85%}.webpcLoader__statusProgress[data-percent="86"]:before{width:86%}.webpcLoader__statusProgress[data-percent="87"]:before{width:87%}.webpcLoader__statusProgress[data-percent="88"]:before{width:88%}.webpcLoader__statusProgress[data-percent="89"]:before{width:89%}.webpcLoader__statusProgress[data-percent="90"]:before{width:90%}.webpcLoader__statusProgress[data-percent="91"]:before{width:91%}.webpcLoader__statusProgress[data-percent="92"]:before{width:92%}.webpcLoader__statusProgress[data-percent="93"]:before{width:93%}.webpcLoader__statusProgress[data-percent="94"]:before{width:94%}.webpcLoader__statusProgress[data-percent="95"]:before{width:95%}.webpcLoader__statusProgress[data-percent="96"]:before{width:96%}.webpcLoader__statusProgress[data-percent="97"]:before{width:97%}.webpcLoader__statusProgress[data-percent="98"]:before{width:98%}.webpcLoader__statusProgress[data-percent="99"]:before{width:99%}.webpcLoader__statusProgress[data-percent="100"]:before{width:100%}.webpcLoader__statusProgressCount{background-color:#00a32a;color:#fff;display:inline-block;font-family:monospace;font-size:12px;line-height:1.75;padding:5px 10px;position:relative}.webpcLoader__statusProgress--error .webpcLoader__statusProgressCount{background-color:#d63638}.webpcLoader__statusProgressCount:after{animation:dotsLoading 1s linear infinite;content:"...";margin-left:5px}.webpcLoader__statusProgress--error .webpcLoader__statusProgressCount:after,.webpcLoader__statusProgress[data-percent="100"] .webpcLoader__statusProgressCount:after{display:none}.webpcLoader__statusProgress[data-percent="0"] .webpcLoader__statusProgressCount:before{content:"0%"}.webpcLoader__statusProgress[data-percent="1"] .webpcLoader__statusProgressCount:before{content:"1%"}.webpcLoader__statusProgress[data-percent="2"] .webpcLoader__statusProgressCount:before{content:"2%"}.webpcLoader__statusProgress[data-percent="3"] .webpcLoader__statusProgressCount:before{content:"3%"}.webpcLoader__statusProgress[data-percent="4"] .webpcLoader__statusProgressCount:before{content:"4%"}.webpcLoader__statusProgress[data-percent="5"] .webpcLoader__statusProgressCount:before{content:"5%"}.webpcLoader__statusProgress[data-percent="6"] .webpcLoader__statusProgressCount:before{content:"6%"}.webpcLoader__statusProgress[data-percent="7"] .webpcLoader__statusProgressCount:before{content:"7%"}.webpcLoader__statusProgress[data-percent="8"] .webpcLoader__statusProgressCount:before{content:"8%"}.webpcLoader__statusProgress[data-percent="9"] .webpcLoader__statusProgressCount:before{content:"9%"}.webpcLoader__statusProgress[data-percent="10"] .webpcLoader__statusProgressCount:before{content:"10%"}.webpcLoader__statusProgress[data-percent="11"] .webpcLoader__statusProgressCount:before{content:"11%"}.webpcLoader__statusProgress[data-percent="12"] .webpcLoader__statusProgressCount:before{content:"12%"}.webpcLoader__statusProgress[data-percent="13"] .webpcLoader__statusProgressCount:before{content:"13%"}.webpcLoader__statusProgress[data-percent="14"] .webpcLoader__statusProgressCount:before{content:"14%"}.webpcLoader__statusProgress[data-percent="15"] .webpcLoader__statusProgressCount:before{content:"15%"}.webpcLoader__statusProgress[data-percent="16"] .webpcLoader__statusProgressCount:before{content:"16%"}.webpcLoader__statusProgress[data-percent="17"] .webpcLoader__statusProgressCount:before{content:"17%"}.webpcLoader__statusProgress[data-percent="18"] .webpcLoader__statusProgressCount:before{content:"18%"}.webpcLoader__statusProgress[data-percent="19"] .webpcLoader__statusProgressCount:before{content:"19%"}.webpcLoader__statusProgress[data-percent="20"] .webpcLoader__statusProgressCount:before{content:"20%"}.webpcLoader__statusProgress[data-percent="21"] .webpcLoader__statusProgressCount:before{content:"21%"}.webpcLoader__statusProgress[data-percent="22"] .webpcLoader__statusProgressCount:before{content:"22%"}.webpcLoader__statusProgress[data-percent="23"] .webpcLoader__statusProgressCount:before{content:"23%"}.webpcLoader__statusProgress[data-percent="24"] .webpcLoader__statusProgressCount:before{content:"24%"}.webpcLoader__statusProgress[data-percent="25"] .webpcLoader__statusProgressCount:before{content:"25%"}.webpcLoader__statusProgress[data-percent="26"] .webpcLoader__statusProgressCount:before{content:"26%"}.webpcLoader__statusProgress[data-percent="27"] .webpcLoader__statusProgressCount:before{content:"27%"}.webpcLoader__statusProgress[data-percent="28"] .webpcLoader__statusProgressCount:before{content:"28%"}.webpcLoader__statusProgress[data-percent="29"] .webpcLoader__statusProgressCount:before{content:"29%"}.webpcLoader__statusProgress[data-percent="30"] .webpcLoader__statusProgressCount:before{content:"30%"}.webpcLoader__statusProgress[data-percent="31"] .webpcLoader__statusProgressCount:before{content:"31%"}.webpcLoader__statusProgress[data-percent="32"] .webpcLoader__statusProgressCount:before{content:"32%"}.webpcLoader__statusProgress[data-percent="33"] .webpcLoader__statusProgressCount:before{content:"33%"}.webpcLoader__statusProgress[data-percent="34"] .webpcLoader__statusProgressCount:before{content:"34%"}.webpcLoader__statusProgress[data-percent="35"] .webpcLoader__statusProgressCount:before{content:"35%"}.webpcLoader__statusProgress[data-percent="36"] .webpcLoader__statusProgressCount:before{content:"36%"}.webpcLoader__statusProgress[data-percent="37"] .webpcLoader__statusProgressCount:before{content:"37%"}.webpcLoader__statusProgress[data-percent="38"] .webpcLoader__statusProgressCount:before{content:"38%"}.webpcLoader__statusProgress[data-percent="39"] .webpcLoader__statusProgressCount:before{content:"39%"}.webpcLoader__statusProgress[data-percent="40"] .webpcLoader__statusProgressCount:before{content:"40%"}.webpcLoader__statusProgress[data-percent="41"] .webpcLoader__statusProgressCount:before{content:"41%"}.webpcLoader__statusProgress[data-percent="42"] .webpcLoader__statusProgressCount:before{content:"42%"}.webpcLoader__statusProgress[data-percent="43"] .webpcLoader__statusProgressCount:before{content:"43%"}.webpcLoader__statusProgress[data-percent="44"] .webpcLoader__statusProgressCount:before{content:"44%"}.webpcLoader__statusProgress[data-percent="45"] .webpcLoader__statusProgressCount:before{content:"45%"}.webpcLoader__statusProgress[data-percent="46"] .webpcLoader__statusProgressCount:before{content:"46%"}.webpcLoader__statusProgress[data-percent="47"] .webpcLoader__statusProgressCount:before{content:"47%"}.webpcLoader__statusProgress[data-percent="48"] .webpcLoader__statusProgressCount:before{content:"48%"}.webpcLoader__statusProgress[data-percent="49"] .webpcLoader__statusProgressCount:before{content:"49%"}.webpcLoader__statusProgress[data-percent="50"] .webpcLoader__statusProgressCount:before{content:"50%"}.webpcLoader__statusProgress[data-percent="51"] .webpcLoader__statusProgressCount:before{content:"51%"}.webpcLoader__statusProgress[data-percent="52"] .webpcLoader__statusProgressCount:before{content:"52%"}.webpcLoader__statusProgress[data-percent="53"] .webpcLoader__statusProgressCount:before{content:"53%"}.webpcLoader__statusProgress[data-percent="54"] .webpcLoader__statusProgressCount:before{content:"54%"}.webpcLoader__statusProgress[data-percent="55"] .webpcLoader__statusProgressCount:before{content:"55%"}.webpcLoader__statusProgress[data-percent="56"] .webpcLoader__statusProgressCount:before{content:"56%"}.webpcLoader__statusProgress[data-percent="57"] .webpcLoader__statusProgressCount:before{content:"57%"}.webpcLoader__statusProgress[data-percent="58"] .webpcLoader__statusProgressCount:before{content:"58%"}.webpcLoader__statusProgress[data-percent="59"] .webpcLoader__statusProgressCount:before{content:"59%"}.webpcLoader__statusProgress[data-percent="60"] .webpcLoader__statusProgressCount:before{content:"60%"}.webpcLoader__statusProgress[data-percent="61"] .webpcLoader__statusProgressCount:before{content:"61%"}.webpcLoader__statusProgress[data-percent="62"] .webpcLoader__statusProgressCount:before{content:"62%"}.webpcLoader__statusProgress[data-percent="63"] .webpcLoader__statusProgressCount:before{content:"63%"}.webpcLoader__statusProgress[data-percent="64"] .webpcLoader__statusProgressCount:before{content:"64%"}.webpcLoader__statusProgress[data-percent="65"] .webpcLoader__statusProgressCount:before{content:"65%"}.webpcLoader__statusProgress[data-percent="66"] .webpcLoader__statusProgressCount:before{content:"66%"}.webpcLoader__statusProgress[data-percent="67"] .webpcLoader__statusProgressCount:before{content:"67%"}.webpcLoader__statusProgress[data-percent="68"] .webpcLoader__statusProgressCount:before{content:"68%"}.webpcLoader__statusProgress[data-percent="69"] .webpcLoader__statusProgressCount:before{content:"69%"}.webpcLoader__statusProgress[data-percent="70"] .webpcLoader__statusProgressCount:before{content:"70%"}.webpcLoader__statusProgress[data-percent="71"] .webpcLoader__statusProgressCount:before{content:"71%"}.webpcLoader__statusProgress[data-percent="72"] .webpcLoader__statusProgressCount:before{content:"72%"}.webpcLoader__statusProgress[data-percent="73"] .webpcLoader__statusProgressCount:before{content:"73%"}.webpcLoader__statusProgress[data-percent="74"] .webpcLoader__statusProgressCount:before{content:"74%"}.webpcLoader__statusProgress[data-percent="75"] .webpcLoader__statusProgressCount:before{content:"75%"}.webpcLoader__statusProgress[data-percent="76"] .webpcLoader__statusProgressCount:before{content:"76%"}.webpcLoader__statusProgress[data-percent="77"] .webpcLoader__statusProgressCount:before{content:"77%"}.webpcLoader__statusProgress[data-percent="78"] .webpcLoader__statusProgressCount:before{content:"78%"}.webpcLoader__statusProgress[data-percent="79"] .webpcLoader__statusProgressCount:before{content:"79%"}.webpcLoader__statusProgress[data-percent="80"] .webpcLoader__statusProgressCount:before{content:"80%"}.webpcLoader__statusProgress[data-percent="81"] .webpcLoader__statusProgressCount:before{content:"81%"}.webpcLoader__statusProgress[data-percent="82"] .webpcLoader__statusProgressCount:before{content:"82%"}.webpcLoader__statusProgress[data-percent="83"] .webpcLoader__statusProgressCount:before{content:"83%"}.webpcLoader__statusProgress[data-percent="84"] .webpcLoader__statusProgressCount:before{content:"84%"}.webpcLoader__statusProgress[data-percent="85"] .webpcLoader__statusProgressCount:before{content:"85%"}.webpcLoader__statusProgress[data-percent="86"] .webpcLoader__statusProgressCount:before{content:"86%"}.webpcLoader__statusProgress[data-percent="87"] .webpcLoader__statusProgressCount:before{content:"87%"}.webpcLoader__statusProgress[data-percent="88"] .webpcLoader__statusProgressCount:before{content:"88%"}.webpcLoader__statusProgress[data-percent="89"] .webpcLoader__statusProgressCount:before{content:"89%"}.webpcLoader__statusProgress[data-percent="90"] .webpcLoader__statusProgressCount:before{content:"90%"}.webpcLoader__statusProgress[data-percent="91"] .webpcLoader__statusProgressCount:before{content:"91%"}.webpcLoader__statusProgress[data-percent="92"] .webpcLoader__statusProgressCount:before{content:"92%"}.webpcLoader__statusProgress[data-percent="93"] .webpcLoader__statusProgressCount:before{content:"93%"}.webpcLoader__statusProgress[data-percent="94"] .webpcLoader__statusProgressCount:before{content:"94%"}.webpcLoader__statusProgress[data-percent="95"] .webpcLoader__statusProgressCount:before{content:"95%"}.webpcLoader__statusProgress[data-percent="96"] .webpcLoader__statusProgressCount:before{content:"96%"}.webpcLoader__statusProgress[data-percent="97"] .webpcLoader__statusProgressCount:before{content:"97%"}.webpcLoader__statusProgress[data-percent="98"] .webpcLoader__statusProgressCount:before{content:"98%"}.webpcLoader__statusProgress[data-percent="99"] .webpcLoader__statusProgressCount:before{content:"99%"}.webpcLoader__statusProgress[data-percent="100"] .webpcLoader__statusProgressCount:before{content:"100%"}.webpcLoader__statusContent{font-size:14px;line-height:1.5714285714;max-width:800px;padding:4px 0}.webpcLoader__statusContent--small{font-size:12px;line-height:1.75}.webpcLoader__statusContent strong{font-weight:600}.webpcLoader__success{padding:10px 0}.webpcLoader__successInner{border-left:2px solid #00a32a;padding:0 20px}.webpcLoader__successContent{color:#00a32a;font-size:14px;font-weight:600;line-height:1.5714285714;padding:4px 0}.webpcLoader__successContent a{color:inherit}.webpcLoader__errors{margin-top:10px;padding:10px 0}.webpcLoader__errorsInner{border-left:2px solid #c3c4c7}.webpcLoader__errorsTitle{background-color:#c3c4c7;color:#fff;display:inline-block;font-size:14px;line-height:1.5714285714;padding:4px 20px}.webpcLoader__errorsContent{padding:10px 0 10px 20px}.webpcLoader__errorsContent>p{font-size:12px;line-height:1.75;margin:0;max-width:100%}.webpcLoader__errorsContent>p.webpcLoader__errorsContentError{color:#d63638;font-size:14px;font-weight:600;line-height:1.5714285714}.webpcLoader__errorsContent pre{font-size:12px;line-height:1.75;white-space:normal}.webpcLoader__button--disabled{opacity:.25!important;pointer-events:none}.webpcMenu{margin-top:30px}.webpcMenu:first-child{margin-top:0}.webpcMenu__wrapper{border-bottom:1px solid #dcdcde}.webpcMenu__items{display:flex;font-size:0}.webpcMenu__itemLink{box-shadow:none!important;display:block;font-size:16px;line-height:1.5;outline:none!important;padding:13px 30px;text-align:center;text-decoration:none!important;transition:color .3s}.webpcMenu__itemLink:focus,.webpcMenu__itemLink:hover{color:rgba(34,113,177,.5)}.webpcMenu__itemLink--active{background-color:#fff;color:#101517;font-weight:600}.webpcMenu__itemLink--active:focus,.webpcMenu__itemLink--active:hover{color:inherit}.webpcPopup{margin-top:20px}.webpcPopup__inner{background-color:#fff;border:1px solid #c3c4c7;display:flex;flex-wrap:wrap}.webpcPopup__image{background-image:url(../../img/author.png);background-position:50%;background-repeat:no-repeat;background-size:cover;width:152px}.webpcPopup__content{border-left:1px solid #c3c4c7;flex:1;padding:10px 20px}.webpcQuality__items{display:flex;flex-wrap:wrap;justify-content:space-between}.webpcQuality__item{display:flex;flex:1;justify-content:center;position:relative}.webpcQuality__item:before{background-color:#c3c4c7;content:"";height:1px;left:0;position:absolute;top:50%;width:100%}.webpcQuality__item:first-child:before{left:50%}.webpcQuality__item:last-child:before{width:50%}.webpcQuality__itemInput{display:none!important}.webpcQuality__itemLabel{display:block;height:42px;position:relative;width:42px}.webpcQuality__itemLabel:after,.webpcQuality__itemLabel:before{border-radius:50%;content:"";height:22px;position:absolute;width:22px}.webpcQuality__itemLabel:before{background-color:#fff;border:1px solid #c3c4c7;left:10px;top:10px}.webpcQuality__itemLabel:after{background-color:#00a32a;height:8px;left:17px;top:17px;transform:scale(0);transition:transform .3s;width:8px}.webpcQuality__itemInput:checked+.webpcQuality__itemLabel:after{transform:scale(1)}.webpcQuality__texts{display:flex;flex-wrap:wrap}.webpcQuality__text{flex:1;font-size:12px;line-height:1.75;padding:4px 0;text-align:center}.webpcQuality__text strong{font-size:14px;line-height:1.5714285714}.webpcServerInfo{color:#222;text-align:center}.webpcServerInfo pre{font-family:monospace;margin:0}.webpcServerInfo h1,.webpcServerInfo h2{display:none}.webpcServerInfo p{max-width:100%}.webpcServerInfo table{border:0;border-collapse:collapse;margin:10px auto;width:100%}.webpcServerInfo td,.webpcServerInfo th{border:1px solid #666;font-family:monospace;font-size:12px;line-height:1.75;padding:4px 5px;text-align:center;vertical-align:baseline}.webpcServerInfo .p{text-align:left}.webpcServerInfo .e{background-color:#ccf;font-weight:700;width:300px}.webpcServerInfo .h{background-color:#99c;font-weight:700}.webpcServerInfo .v{word-wrap:break-word;background-color:#ddd;max-width:300px;overflow-x:auto}.webpcServerInfo .v i{color:#999}.webpcServerInfo img{border:0;float:right}@media screen and (max-width:1600px){.webpcPage__columns{margin:0 -15px}.webpcPage__column{padding:0 15px}.webpcPage__widget+.webpcPage__widget{margin-top:30px}}@media screen and (max-width:1279px){.webpcPage__column--large{width:100%}.webpcPage__column--small{margin-top:30px;width:100%}}@media screen and (max-width:1024px){.webpcPage__widgetColumns{display:block}.webpcPage__widgetColumn{width:100%}}@media screen and (max-width:782px){.webpcPage{padding-right:0}.webpcContent--author{background:none;margin-left:0;padding-left:30px}.webpcInput{display:block}.webpcInput__field{width:100%}.webpcInput__field--small{width:calc(100% - 20px)}.webpcInput__button{margin:10px 0 0!important}.webpcLoader__columns,.webpcMenu__items{display:block}.webpcPopup__inner{border:1px solid #c3c4c7;display:block}.webpcPopup__image{height:152px;margin:20px auto 0}.webpcPopup__content{border-left:0}}
assets/build/js/scripts.js CHANGED
@@ -1 +1 @@
1
- !function(){var e,t={669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),o=r(26),i=r(372),s=r(327),a=r(97),u=r(109),c=r(985),f=r(61);e.exports=function(e){return new Promise((function(t,r){var l=e.data,d=e.headers,h=e.responseType;n.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var v=a(e.baseURL,e.url);function _(){if(p){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,i={data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,r,i),p=null}}if(p.open(e.method.toUpperCase(),s(v,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(_)},p.onabort=function(){p&&(r(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(f("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(v))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),l||(l=null),p.send(l)}))}},609:function(e,t,r){"use strict";var n=r(867),o=r(849),i=r(321),s=r(185);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var u=a(r(655));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),o=r(327),i=r(782),s=r(572),a=r(185),u=r(875),c=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift());return o}for(var l=e;r.length;){var d=r.shift(),h=r.shift();try{l=d(l)}catch(e){h(e);break}}try{o=s(l)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},f.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},782:function(e,t,r){"use strict";var n=r(867);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},97:function(e,t,r){"use strict";var n=r(793),o=r(303);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,o,i){var s=new Error(e);return n(s,t,r,o,i)}},572:function(e,t,r){"use strict";var n=r(867),o=r(527),i=r(502),s=r(655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(i,c),n.forEach(s,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=o.concat(i).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(l,c),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),o=r(655);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(155),o=r(867),i=r(16),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,f={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(448)),c),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||n&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};f.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){f.headers[e]=o.merge(a)})),e.exports=f},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:function(e,t,r){"use strict";var n=r(867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(593),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}o.transitional=function(e,t,r){var o=t&&a(t);return function(s,a,u){if(!1===e)throw new Error(function(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(a," has been removed in "+t));return o&&!i[a]&&(i[a]=!0),!e||e(s,a,u)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},867:function(e,t,r){"use strict";var n=r(849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},917:function(e,t,r){"use strict";var n=r(669),o=r.n(n);function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector("[data-calculate-widget]"),this.section)return this.button=this.section.querySelector("[data-calculate-widget-button]"),this.loading=this.section.querySelector("[data-calculate-widget-loading]"),this.output=this.section.querySelector("[data-calculate-widget-output]"),this.settings={ajax:{url_calculation:this.section.getAttribute("data-calculate-widget-api")}},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_calculation.bind(this))}},{key:"init_calculation",value:function(e){e.preventDefault(),this.button.setAttribute("hidden","hidden"),this.output.setAttribute("hidden","hidden"),this.loading.removeAttribute("hidden"),this.send_request_for_calculation()}},{key:"send_request_for_calculation",value:function(){var e=this,t=this.settings.ajax.url_calculation,r=new Date;o()({method:"GET",url:t}).then((function(t){e.loading.setAttribute("hidden","hidden"),e.output.innerText=t.data.value_output,e.output.removeAttribute("hidden","hidden")})).catch((function(t){if(e.button.removeAttribute("hidden"),e.loading.setAttribute("hidden","hidden"),t.response){var n=(new Date-r)/1e3,o=t.response.status,i=JSON.stringify(t.response.data);e.output.innerText="HTTP Error ".concat(o," (").concat(n,"s): ").concat(i),e.output.removeAttribute("hidden","hidden")}}))}}])&&i(t.prototype,r),n&&i(t,n),e}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(t){a(this,e),this.input_toggle=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){var e=this.input_toggle.getAttribute("data-inputs-group-toggle");return this.inputs=document.querySelectorAll('[data-inputs-group-input="'.concat(e,'"]')),!!this.inputs.length}},{key:"set_events",value:function(){this.input_toggle.addEventListener("change",this.toggle_inputs.bind(this))}},{key:"toggle_inputs",value:function(e){for(var t=this.inputs.length,r=0;r<t;r++)this.input_toggle.checked?this.inputs[r].removeAttribute("readonly"):this.inputs[r].setAttribute("readonly","readonly")}}])&&u(t.prototype,r),n&&u(t,n),e}(),f=function e(){a(this,e);for(var t=document.querySelectorAll("[data-inputs-group-toggle]"),r=t.length,n=0;n<r;n++)new c(t[n])};function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h=function(){function e(t){l(this,e),this.notice=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){return this.settings={ajax_action:this.notice.getAttribute("data-notice-action"),ajax_url:this.notice.getAttribute("data-notice-url"),button_close_class:".notice-dismiss",button_hide_class:"[data-permanently]"},this.events={click_on_close:this.click_on_close.bind(this)},!0}},{key:"set_events",value:function(){this.notice.addEventListener("click",this.events.click_on_close)}},{key:"click_on_close",value:function(e){var t=this.settings,r=t.button_close_class,n=t.button_hide_class;this.notice.removeEventListener("click",this.events.click_on_close),e.target.matches(r)?this.hide_notice(!1):e.target.matches(n)&&this.hide_notice(!0)}},{key:"hide_notice",value:function(e){var t=this.settings.button_close_class;this.send_request(e),e&&this.notice.querySelector(t).click()}},{key:"send_request",value:function(e){var t=this.settings.ajax_url;o()({method:"POST",url:t,data:this.get_data_for_request(e)})}},{key:"get_data_for_request",value:function(e){var t=this.settings.ajax_action,r=new FormData;return r.append("action",t),r.append("is_permanently",e?1:0),r}}])&&d(t.prototype,r),n&&d(t,n),e}(),p=function e(){l(this,e);for(var t=document.querySelectorAll('.notice[data-notice="webp-converter-for-media"][data-notice-action]'),r=t.length,n=0;n<r;n++)new h(t[n])};function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var g=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector(".webpLoader"),this.section)return this.wrapper=this.section.querySelector(".webpLoader__status"),this.progress=this.wrapper.querySelector(".webpLoader__barProgress"),this.progress_size=this.section.querySelector(".webpLoader__progressValue--size"),this.progress_successful=this.section.querySelector(".webpLoader__progressValue--successful"),this.progress_failed=this.section.querySelector(".webpLoader__progressValue--failed"),this.errors=this.section.querySelector(".webpLoader__errors"),this.errors_inner=this.errors.querySelector(".webpLoader__errorsContent"),this.success=this.section.querySelector(".webpLoader__success"),this.success_popup=this.section.querySelector(".webpLoader__popup"),this.option_force=this.section.querySelector('input[name="regenerate_force"]'),this.button=this.section.querySelector(".webpLoader__button"),this.data={count:0,max:0,items:[],size:{before:0,after:0},files:{all:0,converted:0},errors:0},this.settings={is_disabled:!1,ajax:{url_paths:this.section.getAttribute("data-api-paths"),url_regenerate:this.section.getAttribute("data-api-regenerate"),error_message:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"],max_errors:1e3,connection_timeout:6e4},this.atts={progress:"data-percent"},this.classes={progress_error:"webpLoader__barProgress--error",button_disabled:"webpLoader__button--disabled",error_message:"webpLoader__errorsContentError"},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_regeneration.bind(this))}},{key:"init_regeneration",value:function(e){e.preventDefault(),this.settings.is_disabled||(this.settings.is_disabled=!0,this.button.classList.add(this.classes.button_disabled),this.option_force.setAttribute("disabled","disabled"),this.wrapper.removeAttribute("hidden"),this.send_request_for_paths())}},{key:"send_request_for_paths",value:function(){var e=this,t=this.settings.ajax.url_paths;o()({method:"POST",url:t,data:{regenerate_force:this.option_force.checked?1:0}}).then((function(t){e.data.items=t.data,e.data.max=t.data.length,e.regenerate_next_images()})).catch((function(t){e.catch_request_error(t,!0)}))}},{key:"regenerate_next_images",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===this.data.max&&this.update_progress(),!(this.data.count>=this.data.max)){e>3?e=0:e>0&&this.data.count--;var t=this.data.items[this.data.count];this.data.count++,this.send_request_for_regeneration(t,e)}}},{key:"send_request_for_regeneration",value:function(e,t){var r=this,n=this.settings.ajax.url_regenerate;o()({method:"POST",url:n,data:{regenerate_force:this.option_force.checked?1:0,paths:e},timeout:this.settings.connection_timeout}).then((function(e){var t=e.data.is_fatal_error;r.update_errors(e.data.errors,t),t||(r.update_size(e.data),r.update_files_count(e.data),r.update_progress(),r.regenerate_next_images())})).catch((function(n){n.response?(r.catch_request_error(n,!1,e),setTimeout(r.regenerate_next_images.bind(r),1e3)):setTimeout(r.regenerate_next_images.bind(r,t+1),1e3)}))}},{key:"update_errors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.data.errors>this.settings.max_errors&&(this.data.errors=0,this.errors_inner.innerHTML="");for(var r=this.get_date(),n=0;n<e.length;n++)this.print_error_message(e[n],t,!1,r),this.data.errors++;t&&this.set_fatal_error()}},{key:"get_date",value:function(){var e=new Date,t=("0"+e.getHours()).substr(-2),r=("0"+e.getMinutes()).substr(-2),n=("0"+e.getSeconds()).substr(-2);return"".concat(t,":").concat(r,":").concat(n)}},{key:"set_fatal_error",value:function(){this.progress.classList.add(this.classes.progress_error)}},{key:"catch_request_error",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&(this.print_error_message([this.settings.ajax.error_message],!0,!1),this.set_fatal_error());var n=null!==r?'["'.concat(r.join('", "'),'"]'):"";this.print_error_message("".concat(e.response.status," - ").concat(e.response.statusText," (").concat(e.response.config.url,") ").concat(n),!0,!0)}},{key:"print_error_message",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=document.createElement("p"),i=n||this.get_date();if(r){var s=document.createElement("pre");s.innerText=e,o.appendChild(s)}else o.innerHTML="<strong>".concat(i,"</strong> - ").concat(e);t&&o.classList.add(this.classes.error_message),this.errors.removeAttribute("hidden"),this.errors_inner.appendChild(o)}},{key:"update_size",value:function(e){var t=this.data.size;t.before+=e.size.before,t.after+=e.size.after;var r=t.before-t.after;if(r<0&&(r=0),0!==r){var n=Math.round(100*(1-t.after/t.before));n<0&&(n=0);var o=-1;do{o++,r/=1024}while(r>1024);var i=r.toFixed(2),s=this.settings.units[o];this.progress_size.innerHTML="".concat(i," ").concat(s," (").concat(n,"%)")}}},{key:"update_files_count",value:function(e){var t=this.data.files;t.all+=e.files.all,t.converted+=e.files.converted,this.progress_successful.innerText=t.converted,this.progress_failed.innerText=t.all-t.converted}},{key:"update_progress",value:function(){var e=this.data.max>0?Math.floor(this.data.count/this.data.max*100):100;e>100&&(e=100),100===e&&(this.success.removeAttribute("hidden"),this.success_popup&&this.success_popup.removeAttribute("hidden")),this.progress.setAttribute(this.atts.progress,e.toString())}}])&&m(t.prototype,r),n&&m(t,n),e}();new function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new p,new g,new s,new f}},694:function(){},155:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},593:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=function(t,r,o,i){if(!r){var s=1/0;for(f=0;f<e.length;f++){r=e[f][0],o=e[f][1],i=e[f][2];for(var a=!0,u=0;u<r.length;u++)(!1&i||s>=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[u])}))?r.splice(u--,1):(a=!1,i<s&&(s=i));if(a){e.splice(f--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,o,i]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={794:0,505:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,i,s=r[0],a=r[1],u=r[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(u)var f=u(n)}for(t&&t(r);c<s.length;c++)i=s[c],n.o(e,i)&&e[i]&&e[i][0](),e[s[c]]=0;return n.O(f)},r=self.webpackChunkwebp_converter_for_media=self.webpackChunkwebp_converter_for_media||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),n.O(void 0,[505],(function(){return n(917)}));var o=n.O(void 0,[505],(function(){return n(694)}));o=n.O(o)}();
1
+ !function(){var e,t={669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),i=r(26),o=r(372),s=r(327),a=r(97),u=r(109),c=r(985),l=r(61);e.exports=function(e){return new Promise((function(t,r){var f=e.data,d=e.headers,h=e.responseType;n.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var v=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(v+":"+m)}var _=a(e.baseURL,e.url);function g(){if(p){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,o={data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};i(t,r,o),p=null}}if(p.open(e.method.toUpperCase(),s(_,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(r(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(_))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),f||(f=null),p.send(f)}))}},609:function(e,t,r){"use strict";var n=r(867),i=r(849),o=r(321),s=r(185);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=a(r(655));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(263),u.CancelToken=r(972),u.isCancel=r(502),u.all=function(e){return Promise.all(e)},u.spread=r(713),u.isAxiosError=r(268),e.exports=u,e.exports.default=u},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),i=r(327),o=r(782),s=r(572),a=r(185),u=r(875),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!n){var l=[s,void 0];for(Array.prototype.unshift.apply(l,r),l=l.concat(o),i=Promise.resolve(e);l.length;)i=i.then(l.shift(),l.shift());return i}for(var f=e;r.length;){var d=r.shift(),h=r.shift();try{f=d(f)}catch(e){h(e);break}}try{i=s(f)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},782:function(e,t,r){"use strict";var n=r(867);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},97:function(e,t,r){"use strict";var n=r(793),i=r(303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},572:function(e,t,r){"use strict";var n=r(867),i=r(527),o=r(502),s=r(655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(o,c),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var l=i.concat(o).concat(s).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return n.forEach(f,c),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),i=r(655);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(155),i=r(867),o=r(16),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(448)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(a)})),e.exports=l},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:function(e,t,r){"use strict";var n=r(867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(593),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}i.transitional=function(e,t,r){var i=t&&a(t);return function(s,a,u){if(!1===e)throw new Error(function(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(a," has been removed in "+t));return i&&!o[a]&&(o[a]=!0),!e||e(s,a,u)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],u=void 0===a||s(a,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},867:function(e,t,r){"use strict";var n=r(849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)l(arguments[n],r);return t},extend:function(e,t,r){return l(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},917:function(e,t,r){"use strict";var n=r(669),i=r.n(n);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector("[data-calculate-widget]"),this.section)return this.button=this.section.querySelector("[data-calculate-widget-button]"),this.loading=this.section.querySelector("[data-calculate-widget-loading]"),this.output=this.section.querySelector("[data-calculate-widget-output]"),this.settings={ajax:{url_calculation:this.section.getAttribute("data-calculate-widget-api")}},!0}},{key:"set_events",value:function(){this.button.addEventListener("click",this.init_calculation.bind(this))}},{key:"init_calculation",value:function(e){e.preventDefault(),this.button.setAttribute("hidden","hidden"),this.output.setAttribute("hidden","hidden"),this.loading.removeAttribute("hidden"),this.send_request_for_calculation()}},{key:"send_request_for_calculation",value:function(){var e=this,t=this.settings.ajax.url_calculation,r=new Date;i()({method:"GET",url:t}).then((function(t){e.loading.setAttribute("hidden","hidden"),e.output.innerText=t.data.value_output,e.output.removeAttribute("hidden","hidden")})).catch((function(t){if(e.button.removeAttribute("hidden"),e.loading.setAttribute("hidden","hidden"),t.response){var n=(new Date-r)/1e3,i=t.response.status,o=JSON.stringify(t.response.data);e.output.innerText="HTTP Error ".concat(i," (").concat(n,"s): ").concat(o),e.output.removeAttribute("hidden","hidden")}}))}}])&&o(t.prototype,r),n&&o(t,n),e}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(t){a(this,e),this.input_toggle=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){var e=this.input_toggle.getAttribute("data-inputs-group-toggle");return this.inputs=document.querySelectorAll('[data-inputs-group-input="'.concat(e,'"]')),!!this.inputs.length}},{key:"set_events",value:function(){this.input_toggle.addEventListener("change",this.toggle_inputs.bind(this))}},{key:"toggle_inputs",value:function(e){for(var t=this.inputs.length,r=0;r<t;r++)this.input_toggle.checked?this.inputs[r].removeAttribute("readonly"):this.inputs[r].setAttribute("readonly","readonly")}}])&&u(t.prototype,r),n&&u(t,n),e}(),l=function e(){a(this,e);for(var t=document.querySelectorAll("[data-inputs-group-toggle]"),r=t.length,n=0;n<r;n++)new c(t[n])};function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h=function(){function e(t){f(this,e),this.notice=t,this.set_vars()&&this.set_events()}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){return this.settings={ajax_action:this.notice.getAttribute("data-notice-action"),ajax_url:this.notice.getAttribute("data-notice-url"),button_close_class:".notice-dismiss",button_hide_class:"[data-permanently]"},this.events={click_on_close:this.click_on_close.bind(this)},!0}},{key:"set_events",value:function(){this.notice.addEventListener("click",this.events.click_on_close)}},{key:"click_on_close",value:function(e){var t=this.settings,r=t.button_close_class,n=t.button_hide_class;this.notice.removeEventListener("click",this.events.click_on_close),e.target.matches(r)?this.hide_notice(!1):e.target.matches(n)&&this.hide_notice(!0)}},{key:"hide_notice",value:function(e){var t=this.settings.button_close_class;this.send_request(e),e&&this.notice.querySelector(t).click()}},{key:"send_request",value:function(e){var t=this.settings.ajax_url;i()({method:"POST",url:t,data:this.get_data_for_request(e)})}},{key:"get_data_for_request",value:function(e){var t=this.settings.ajax_action,r=new FormData;return r.append("action",t),r.append("is_permanently",e?1:0),r}}])&&d(t.prototype,r),n&&d(t,n),e}(),p=function e(){f(this,e);for(var t=document.querySelectorAll('.notice[data-notice="webp-converter-for-media"][data-notice-action]'),r=t.length,n=0;n<r;n++)new h(t[n])};function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set_vars()&&(this.set_events(),this.send_request_for_calculation())}var t,r,n;return t=e,(r=[{key:"set_vars",value:function(){if(this.section=document.querySelector(".webpcLoader"),this.section)return this.counter_webp=this.section.querySelector('[data-counter="webp"]'),this.counter_webp_percent=this.counter_webp.querySelector("[data-counter-percent]"),this.counter_webp_images=this.counter_webp.querySelector("[data-counter-left]"),this.counter_avif=this.section.querySelector('[data-counter="avif"]'),this.counter_avif_percent=this.counter_avif.querySelector("[data-counter-percent]"),this.counter_avif_images=this.counter_avif.querySelector("[data-counter-left]"),this.wrapper_status=this.section.querySelector("[data-status]"),this.progress=this.wrapper_status.querySelector("[data-status-progress]"),this.progress_size=this.section.querySelector("[data-status-count-size]"),this.progress_success=this.section.querySelector("[data-status-count-success]"),this.progress_failed=this.section.querySelector("[data-status-count-error]"),this.wrapper_errors=this.section.querySelector("[data-errors]"),this.errors_output=this.wrapper_errors.querySelector("[data-errors-output]"),this.wrapper_success=this.section.querySelector("[data-success]"),this.option_force=this.section.querySelector('input[name="regenerate_force"]'),this.submit_button=this.section.querySelector("[data-submit]"),this.data={count:0,max:0,items:[],size:{before:0,after:0},files:{all:0,converted:0},files_counter:{webp_left:0,webp_converted:0,webp_all:0,avif_left:0,avif_converted:0,avif_all:0},errors:0},this.settings={is_disabled:!1,ajax:{url_calculate:this.section.getAttribute("data-api-calculate"),url_paths:this.section.getAttribute("data-api-paths"),url_regenerate:this.section.getAttribute("data-api-regenerate"),error_message:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"],max_errors:1e3,connection_timeout:6e4},this.atts={progress:"data-percent",counter_percent:"data-percent"},this.classes={progress_error:"webpcLoader__statusProgress--error",button_disabled:"webpcLoader__button--disabled",error_message:"webpcLoader__errorsContentError"},!0}},{key:"set_events",value:function(){this.submit_button.addEventListener("click",this.init_regeneration.bind(this))}},{key:"send_request_for_calculation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=this.settings.ajax.url_calculate;t>=3||i()({method:"GET",url:r}).then((function(t){e.data.files_counter.webp_left=t.data.value_webp_left||0,e.data.files_counter.webp_all=t.data.value_webp_all||0,e.data.files_counter.avif_left=t.data.value_avif_left||0,e.data.files_counter.avif_all=t.data.value_avif_all||0,e.update_calculation_stats()})).catch((function(r){e.send_request_for_calculation(t+1)}))}},{key:"update_calculation_stats",value:function(){var e=this.data.files_counter,t=this.atts.counter_percent,r=Math.min(Math.max(e.webp_left-e.webp_converted,0),e.webp_all),n=Math.min(Math.max(e.avif_left-e.avif_converted,0),e.avif_all),i=e.webp_all>0?Math.floor(100*(1-r/e.webp_all)):0,o=e.avif_all>0?Math.floor(100*(1-n/e.avif_all)):0;this.counter_webp.setAttribute(t,i),this.counter_webp_percent.innerText=i,this.counter_webp_images.innerText=r,this.counter_avif.setAttribute(t,o),this.counter_avif_percent.innerText=o,this.counter_avif_images.innerText=n}},{key:"init_regeneration",value:function(e){e.preventDefault(),this.settings.is_disabled||(this.settings.is_disabled=!0,this.submit_button.classList.add(this.classes.button_disabled),this.option_force.setAttribute("disabled","disabled"),this.wrapper_status.removeAttribute("hidden"),this.send_request_for_paths())}},{key:"send_request_for_paths",value:function(){var e=this,t=this.settings.ajax.url_paths;i()({method:"POST",url:t,data:{regenerate_force:this.option_force.checked?1:0}}).then((function(t){e.data.items=t.data,e.data.max=t.data.length,e.regenerate_next_images()})).catch((function(t){e.catch_request_error(t,!0)}))}},{key:"regenerate_next_images",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===this.data.max&&this.update_progress(),!(this.data.count>=this.data.max)){e>=3?e=0:e>0&&this.data.count--;var t=this.data.items[this.data.count];this.data.count++,this.send_request_for_regeneration(t,e)}}},{key:"send_request_for_regeneration",value:function(e,t){var r=this,n=this.settings.ajax.url_regenerate;i()({method:"POST",url:n,data:{regenerate_force:this.option_force.checked?1:0,paths:e},timeout:this.settings.connection_timeout}).then((function(e){var t=e.data.is_fatal_error;r.update_errors(e.data.errors,t),t||(r.update_size(e.data),r.update_files_count(e.data),r.update_progress(),r.regenerate_next_images())})).catch((function(n){n.response?(r.catch_request_error(n,!1,e),setTimeout(r.regenerate_next_images.bind(r),1e3)):setTimeout(r.regenerate_next_images.bind(r,t+1),1e3)}))}},{key:"update_errors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.data.errors>this.settings.max_errors&&(this.data.errors=0,this.errors_output.innerHTML="");for(var r=this.get_date(),n=0;n<e.length;n++)this.print_error_message(e[n],t,!1,r),this.data.errors++;t&&this.set_fatal_error()}},{key:"get_date",value:function(){var e=new Date,t=("0"+e.getHours()).substr(-2),r=("0"+e.getMinutes()).substr(-2),n=("0"+e.getSeconds()).substr(-2);return"".concat(t,":").concat(r,":").concat(n)}},{key:"set_fatal_error",value:function(){this.progress.classList.add(this.classes.progress_error)}},{key:"catch_request_error",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&(this.print_error_message([this.settings.ajax.error_message],!0,!1),this.set_fatal_error());var n=null!==r?'["'.concat(r.join('", "'),'"]'):"";this.print_error_message("".concat(e.response.status," - ").concat(e.response.statusText," (").concat(e.response.config.url,") ").concat(n),!0,!0)}},{key:"print_error_message",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=document.createElement("p"),o=n||this.get_date();if(r){var s=document.createElement("pre");s.innerText=e,i.appendChild(s)}else i.innerHTML="<strong>".concat(o,"</strong> - ").concat(e);t&&i.classList.add(this.classes.error_message),this.wrapper_errors.removeAttribute("hidden"),this.errors_output.appendChild(i)}},{key:"update_size",value:function(e){var t=this.data.size;t.before+=e.size.before,t.after+=e.size.after;var r=t.before-t.after;if(r<0&&(r=0),0!==r){var n=Math.round(100*(1-t.after/t.before));n<0&&(n=0);var i=-1;do{i++,r/=1024}while(r>1024);var o=r.toFixed(2),s=this.settings.units[i];this.progress_size.innerHTML="".concat(o," ").concat(s," (").concat(n,"%)")}}},{key:"update_files_count",value:function(e){var t=this.data,r=t.files,n=t.files_counter;r.all+=e.files.all,r.converted+=e.files.converted,n.webp_converted+=e.files.converted_webp,n.avif_converted+=e.files.converted_avif,this.option_force.checked&&(n.webp_left=n.webp_all,n.avif_left=n.avif_all),this.progress_success.innerText=r.converted,this.progress_failed.innerText=r.all-r.converted,this.update_calculation_stats()}},{key:"update_progress",value:function(){var e=this.data.max>0?Math.floor(this.data.count/this.data.max*100):100;e>100&&(e=100),100===e&&this.wrapper_success.removeAttribute("hidden"),this.progress.setAttribute(this.atts.progress,e.toString())}}])&&v(t.prototype,r),n&&v(t,n),e}();new function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new p,new m,new s,new l}},694:function(){},155:function(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},593:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,e=[],n.O=function(t,r,i,o){if(!r){var s=1/0;for(l=0;l<e.length;l++){r=e[l][0],i=e[l][1],o=e[l][2];for(var a=!0,u=0;u<r.length;u++)(!1&o||s>=o)&&Object.keys(n.O).every((function(e){return n.O[e](r[u])}))?r.splice(u--,1):(a=!1,o<s&&(s=o));if(a){e.splice(l--,1);var c=i();void 0!==c&&(t=c)}}return t}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[r,i,o]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={794:0,505:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var i,o,s=r[0],a=r[1],u=r[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(u)var l=u(n)}for(t&&t(r);c<s.length;c++)o=s[c],n.o(e,o)&&e[o]&&e[o][0](),e[s[c]]=0;return n.O(l)},r=self.webpackChunkwebp_converter_for_media=self.webpackChunkwebp_converter_for_media||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),n.O(void 0,[505],(function(){return n(917)}));var i=n.O(void 0,[505],(function(){return n(694)}));i=n.O(i)}();
assets/fonts/icons/icomoon.eot CHANGED
Binary file
assets/fonts/icons/icomoon.svg CHANGED
@@ -8,4 +8,7 @@
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
  <glyph unicode="&#xe900;" glyph-name="logo" d="M1016.041 915.411v0c-7.975 9.114-19.594 12.531-25.974 13.67-1.367 0.228-2.506 0.455-3.874 0.455h-0.684c-59.238 4.101-267.938 6.836-460.69-128.045-34.86-24.378-73.136-53.314-114.375-86.351-0.911 0.228-1.823 0.684-2.734 0.684l-186.828 28.479c-5.468 0.911-10.937-0.684-15.037-4.329l-198.903-171.79c-7.975-6.607-9.341-18.455-2.734-26.429s18.455-9.341 26.429-2.734c0.228 0.228 0.684 0.455 0.911 0.911l192.296 166.094 147.639-22.556c-115.059-95.237-219.637-194.346-260.875-233.762-7.063-6.836-7.746-18.228-1.139-25.746l40.1-46.935 0.455-0.455 23.923-27.797-78.605-67.895c-7.746-6.836-8.658-18.683-1.823-26.429 3.646-4.101 8.658-6.607 14.126-6.607 4.556 0 8.886 1.595 12.303 4.556l142.171 122.805c7.975 6.607 9.341 18.455 2.734 26.429s-18.455 9.341-26.429 2.734c-0.228-0.228-0.684-0.455-0.911-0.911l-35.543-30.302-23.468 27.34-0.455 0.455-28.936 33.72c49.897 47.391 153.336 144.222 263.609 234.218 48.53 39.644 93.186 73.82 133.058 101.616 182.727 127.817 380.49 125.083 436.767 121.21h1.367c0.911-0.228 1.595-0.455 2.506-0.911 0.228-1.367 0.228-2.962 0-4.329-4.329-56.96-30.075-254.952-184.322-415.806-127.817-133.514-318.974-282.976-393.477-339.707l-61.516 71.997 33.948 29.391c8.202 6.152 10.025 17.999 3.646 26.429-6.152 8.202-17.999 10.025-26.429 3.646-0.684-0.455-1.367-1.139-1.823-1.595l-142.171-122.805c-7.518-7.063-8.202-18.91-1.139-26.657 6.607-7.291 17.999-8.202 25.518-1.823l79.744 68.807 72.908-85.212c6.379-7.518 17.771-8.658 25.518-2.734 43.061 32.581 159.487 121.893 273.178 222.37l0.911-148.778-192.296-166.094c-7.518-7.063-8.202-18.91-1.139-26.657 6.607-7.291 17.999-8.202 25.518-1.823l198.903 171.79c4.101 3.646 6.607 8.886 6.607 14.354l-1.139 188.878c0 0.455-0.228 1.139-0.228 1.595 35.999 32.809 70.63 66.074 101.844 98.654 162.905 169.74 190.017 378.896 194.574 438.817 1.595 13.67-1.139 24.378-7.518 31.898v0zM250.731 269.261c-6.836 7.746-18.683 8.658-26.429 2.051v0l-142.171-122.805c-7.746-6.836-8.43-18.683-1.595-26.429s18.455-8.43 26.201-1.823l142.171 122.805c7.746 6.379 8.658 18.228 1.823 26.201v0zM809.162 580.944l-150.146 177.942c-5.696 6.607-15.493 7.518-22.1 1.823l-235.585-198.903c-6.607-5.696-7.518-15.493-1.823-22.1l150.146-177.942c5.696-6.607 15.493-7.518 22.1-1.823l235.585 198.903c6.607 5.696 7.518 15.493 1.823 22.1v0zM774.987 572.742l-211.435-178.625-129.868 153.791 211.435 178.625 129.868-153.791zM488.594 570.008c-14.126-12.076-15.948-33.264-4.101-47.391 5.696-6.836 13.898-11.164 22.784-11.847 0.911 0 2.051-0.228 2.962-0.228 18.683 0 33.72 15.037 33.72 33.72s-15.037 33.72-33.72 33.72c-7.975 0-15.721-2.734-21.645-7.975v0zM499.758 545.174c0.455 5.696 5.696 10.025 11.392 9.569s10.025-5.696 9.569-11.392-5.696-10.025-11.392-9.569c-2.734 0.228-5.468 1.595-7.063 3.646-1.823 2.278-2.734 5.013-2.506 7.746v0zM611.171 663.65c-3.19-2.734-5.24-6.607-5.696-10.937-2.734-33.037-4.329-53.998-5.24-67.668l-17.544 4.329c-4.556 1.139-9.341 0.228-12.987-2.506-4.101-2.962-6.379-7.518-6.379-12.531l-0.684-137.386c0-8.658 6.836-15.721 15.721-15.721v0 0c3.646 0 7.291 1.367 10.253 3.646v0c3.417 2.962 5.468 7.291 5.696 11.847l0.684 117.337 52.402-12.759c8.43-2.051 16.86 3.19 18.91 11.392v0c2.051 8.43-2.962 16.86-11.392 18.91v0l-23.012 5.696c0.684 11.847 2.278 32.353 4.101 56.048l47.391-6.836c8.658-1.139 16.632 4.785 17.771 13.443s-4.785 16.632-13.443 17.771l-63.794 9.114c-4.785 0.911-9.341-0.228-12.759-3.19v0z" />
 
 
 
11
  </font></defs></svg>
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
  <glyph unicode="&#xe900;" glyph-name="logo" d="M1016.041 915.411v0c-7.975 9.114-19.594 12.531-25.974 13.67-1.367 0.228-2.506 0.455-3.874 0.455h-0.684c-59.238 4.101-267.938 6.836-460.69-128.045-34.86-24.378-73.136-53.314-114.375-86.351-0.911 0.228-1.823 0.684-2.734 0.684l-186.828 28.479c-5.468 0.911-10.937-0.684-15.037-4.329l-198.903-171.79c-7.975-6.607-9.341-18.455-2.734-26.429s18.455-9.341 26.429-2.734c0.228 0.228 0.684 0.455 0.911 0.911l192.296 166.094 147.639-22.556c-115.059-95.237-219.637-194.346-260.875-233.762-7.063-6.836-7.746-18.228-1.139-25.746l40.1-46.935 0.455-0.455 23.923-27.797-78.605-67.895c-7.746-6.836-8.658-18.683-1.823-26.429 3.646-4.101 8.658-6.607 14.126-6.607 4.556 0 8.886 1.595 12.303 4.556l142.171 122.805c7.975 6.607 9.341 18.455 2.734 26.429s-18.455 9.341-26.429 2.734c-0.228-0.228-0.684-0.455-0.911-0.911l-35.543-30.302-23.468 27.34-0.455 0.455-28.936 33.72c49.897 47.391 153.336 144.222 263.609 234.218 48.53 39.644 93.186 73.82 133.058 101.616 182.727 127.817 380.49 125.083 436.767 121.21h1.367c0.911-0.228 1.595-0.455 2.506-0.911 0.228-1.367 0.228-2.962 0-4.329-4.329-56.96-30.075-254.952-184.322-415.806-127.817-133.514-318.974-282.976-393.477-339.707l-61.516 71.997 33.948 29.391c8.202 6.152 10.025 17.999 3.646 26.429-6.152 8.202-17.999 10.025-26.429 3.646-0.684-0.455-1.367-1.139-1.823-1.595l-142.171-122.805c-7.518-7.063-8.202-18.91-1.139-26.657 6.607-7.291 17.999-8.202 25.518-1.823l79.744 68.807 72.908-85.212c6.379-7.518 17.771-8.658 25.518-2.734 43.061 32.581 159.487 121.893 273.178 222.37l0.911-148.778-192.296-166.094c-7.518-7.063-8.202-18.91-1.139-26.657 6.607-7.291 17.999-8.202 25.518-1.823l198.903 171.79c4.101 3.646 6.607 8.886 6.607 14.354l-1.139 188.878c0 0.455-0.228 1.139-0.228 1.595 35.999 32.809 70.63 66.074 101.844 98.654 162.905 169.74 190.017 378.896 194.574 438.817 1.595 13.67-1.139 24.378-7.518 31.898v0zM250.731 269.261c-6.836 7.746-18.683 8.658-26.429 2.051v0l-142.171-122.805c-7.746-6.836-8.43-18.683-1.595-26.429s18.455-8.43 26.201-1.823l142.171 122.805c7.746 6.379 8.658 18.228 1.823 26.201v0zM809.162 580.944l-150.146 177.942c-5.696 6.607-15.493 7.518-22.1 1.823l-235.585-198.903c-6.607-5.696-7.518-15.493-1.823-22.1l150.146-177.942c5.696-6.607 15.493-7.518 22.1-1.823l235.585 198.903c6.607 5.696 7.518 15.493 1.823 22.1v0zM774.987 572.742l-211.435-178.625-129.868 153.791 211.435 178.625 129.868-153.791zM488.594 570.008c-14.126-12.076-15.948-33.264-4.101-47.391 5.696-6.836 13.898-11.164 22.784-11.847 0.911 0 2.051-0.228 2.962-0.228 18.683 0 33.72 15.037 33.72 33.72s-15.037 33.72-33.72 33.72c-7.975 0-15.721-2.734-21.645-7.975v0zM499.758 545.174c0.455 5.696 5.696 10.025 11.392 9.569s10.025-5.696 9.569-11.392-5.696-10.025-11.392-9.569c-2.734 0.228-5.468 1.595-7.063 3.646-1.823 2.278-2.734 5.013-2.506 7.746v0zM611.171 663.65c-3.19-2.734-5.24-6.607-5.696-10.937-2.734-33.037-4.329-53.998-5.24-67.668l-17.544 4.329c-4.556 1.139-9.341 0.228-12.987-2.506-4.101-2.962-6.379-7.518-6.379-12.531l-0.684-137.386c0-8.658 6.836-15.721 15.721-15.721v0 0c3.646 0 7.291 1.367 10.253 3.646v0c3.417 2.962 5.468 7.291 5.696 11.847l0.684 117.337 52.402-12.759c8.43-2.051 16.86 3.19 18.91 11.392v0c2.051 8.43-2.962 16.86-11.392 18.91v0l-23.012 5.696c0.684 11.847 2.278 32.353 4.101 56.048l47.391-6.836c8.658-1.139 16.632 4.785 17.771 13.443s-4.785 16.632-13.443 17.771l-63.794 9.114c-4.785 0.911-9.341-0.228-12.759-3.19v0z" />
11
+ <glyph unicode="&#xe901;" glyph-name="heart" horiz-adv-x="1198" d="M0 612.196v13.566c0 163.494 118.118 302.896 279.273 329.794 104.552 17.776 215.185-17.074 291.435-93.325l28.068-28.068 25.963 28.068c78.355 76.25 186.884 110.867 293.54 93.325 161.155-26.898 279.273-166.301 279.273-329.794v-13.566c0-97.067-40.23-189.924-111.335-256.117l-422.651-394.584c-17.542-16.373-40.698-25.495-64.789-25.495s-47.247 9.122-64.789 25.495l-422.651 394.584c-71.105 66.193-111.335 159.050-111.335 256.117v0z" />
12
+ <glyph unicode="&#xe902;" glyph-name="matt-plugins" horiz-adv-x="2423" d="M805.681 337.927c-0.913-23.293-20.096-41.563-43.39-40.649-22.38 0.913-40.193 18.726-40.649 40.649v225.627c0 22.837-18.726 41.563-41.563 41.563s-41.563-18.726-41.563-41.563v0-279.979c0-69.424-56.178-126.059-126.059-126.059s-126.059 56.178-126.059 126.059c0 0 0 0 0 0v279.979c0 22.837-18.726 41.563-41.563 41.563s-41.563-18.726-41.563-41.563v0-225.627c-0.913-23.293-20.096-41.563-43.39-40.649-22.38 0.913-40.193 18.726-40.649 40.649v225.627c1.37 69.424 58.919 125.145 128.343 123.775 66.683-1.37 121.492-56.178 122.862-123.775v-279.979c0-22.837 18.726-41.563 41.563-41.563s41.563 18.726 41.563 41.563v279.979c1.37 69.424 58.919 125.145 128.343 123.775 67.597-1.37 122.405-55.722 123.775-123.775v-225.627zM512 960c-282.719 0-512-229.281-512-512s229.281-512 512-512 512 229.281 512 512-229.281 512-512 512v0zM1957.566 498.241c-8.221 0-16.442-2.74-22.38-8.678-12.332-12.789-12.332-32.428 0-45.217 12.789-11.418 31.971-11.418 44.76 0 11.875 12.789 11.875 32.428 0 45.217-5.938 5.938-14.159 9.135-22.38 8.678zM1272.464 397.302c-13.245 7.764-27.861 11.418-42.933 11.418-17.356 0-30.601-2.74-40.193-8.678-8.221-5.024-15.529-11.875-20.553-20.096h-6.851v23.293h-47.957v-269.93h48.871v99.568h6.851c3.197-5.024 6.851-9.135 11.418-13.245 5.481-4.567 11.875-8.221 19.183-10.505 9.591-2.74 19.183-4.111 29.231-4.111 15.072 0 30.145 3.654 42.933 11.418 13.702 7.764 24.664 19.64 31.971 33.342 8.221 16.442 12.332 35.169 11.875 53.438v6.394c0.457 18.726-3.654 36.996-11.875 53.438-7.308 14.616-18.269 26.034-31.971 34.255zM1267.44 305.042c0-18.726-5.024-32.885-15.072-42.476-21.467-19.64-53.895-19.64-75.361 0-10.048 9.591-15.072 23.75-15.072 42.476v4.111c0 18.726 5.024 32.885 15.072 42.476 21.467 19.183 53.895 19.183 75.361 0 10.048-9.591 15.072-23.75 15.072-42.476v-4.111zM1582.587 305.499c0-17.813-4.111-31.515-12.332-41.563-8.678-10.048-21.467-15.529-34.712-15.072-13.245 0-23.293 3.654-30.601 10.962s-10.505 18.269-10.505 32.428v110.987h-48.871v-114.64c-0.457-14.616 2.74-28.774 9.135-42.020 5.938-11.875 15.072-21.467 26.034-28.318 11.875-6.851 25.577-10.505 39.279-10.505 17.356 0 30.145 3.197 38.822 9.135 7.308 5.024 13.245 11.418 17.356 19.183h6.851v-25.12h48.414v192.742h-48.871v-98.198zM1831.051 379.946h-6.851c-5.024 7.764-11.875 14.159-19.64 19.183-9.135 5.938-22.38 9.135-39.736 9.135-15.529 0-30.145-3.654-43.847-11.418s-24.664-19.183-31.971-32.885c-8.221-15.986-12.332-33.798-11.875-51.611v-6.394c-0.457-17.813 3.654-35.625 11.875-51.611 7.308-13.702 18.269-25.12 31.971-32.885 22.38-12.332 48.871-14.616 73.078-7.308 6.851 2.284 13.245 5.938 18.726 10.505 4.111 3.654 7.764 7.764 10.962 12.789h6.851v-50.241c0-7.764-3.654-11.875-10.962-11.875h-111.9v-42.476h128.343c11.418-0.457 22.837 3.654 31.058 11.875 8.221 8.678 12.332 20.096 11.418 31.515v226.997h-47.957v-23.293zM1831.051 307.326c0-17.356-5.024-30.601-15.072-40.193-21.467-19.183-53.895-19.183-75.361 0-10.048 9.591-15.072 22.837-15.072 40.193v4.111c0 17.356 5.024 31.058 15.072 40.649 21.467 18.726 53.895 18.726 75.361 0 10.048-9.591 15.072-22.837 15.072-40.649v-4.111zM1933.36 403.24h48.871v-192.285h-48.871v192.285zM2187.304 395.932c-11.875 6.851-25.577 10.505-39.279 10.505-17.356 0-30.145-3.197-38.822-9.135-7.308-5.024-13.245-11.418-17.356-19.183h-6.851v25.12h-47.957v-192.285h48.871v97.741c0 17.813 4.111 31.971 12.332 41.563 8.678 10.048 21.467 15.529 34.712 15.072 11.418 0.913 22.38-3.197 30.601-10.962 7.308-7.308 10.505-18.269 10.505-32.428v-110.987h48.871v114.64c0.457 14.616-2.74 29.231-9.135 42.020-6.394 11.875-15.529 21.467-26.491 28.318zM2412.931 300.475c-7.764 8.221-17.356 14.616-27.861 18.269-12.789 4.567-26.034 7.764-39.279 10.505l-10.505 1.827c-7.308 0.913-14.159 3.197-21.010 6.851-5.024 2.74-8.221 8.221-7.764 13.702 0 5.481 2.74 10.505 7.308 13.245 6.394 3.654 13.702 5.481 21.467 5.024 8.221 0.457 16.442-1.827 23.293-6.394 6.851-5.024 11.418-12.332 12.789-21.010l45.217 14.159c-4.567 15.529-14.159 28.774-27.861 37.452-15.986 10.048-34.712 15.072-53.438 14.616-22.837 0-41.106-5.024-54.808-15.529-14.159-10.048-21.010-24.664-21.010-43.847-0.457-11.418 3.197-22.38 10.048-31.058 7.308-8.221 16.442-15.072 26.947-18.726 11.875-4.567 24.207-8.221 36.996-10.505l10.962-1.827c8.678-1.37 16.899-3.654 24.664-7.764 5.024-2.74 7.764-8.221 7.764-13.702 0-5.938-3.197-11.875-8.221-15.072-5.481-4.111-13.702-5.938-25.12-5.938-6.851 0-14.159 0.913-20.553 3.197s-11.875 5.938-15.986 10.962c-4.567 6.394-7.764 13.702-9.135 21.467l-45.217-11.875c2.74-19.183 13.245-36.082 29.231-46.587 15.986-10.962 36.539-16.442 61.659-16.442 24.664 0 44.303 5.481 58.919 16.442s21.923 26.491 21.467 46.587c0 11.418-3.654 22.837-10.962 31.971zM1360.614 636.175c-10.048 5.024-21.010 7.764-32.428 7.764-14.616 0-26.034-2.74-34.255-8.221-7.764-5.024-14.159-12.332-18.726-20.553h-6.851c-4.567 8.678-10.962 15.529-19.183 20.553-10.048 5.938-21.467 8.678-32.885 7.764-10.505 0.457-21.467-1.827-30.601-7.308-6.851-4.111-12.789-10.048-16.442-16.899h-6.851v21.010h-47.957v-192.285h48.871v113.727c0 13.245 3.197 23.293 9.135 30.601 6.394 7.308 15.986 11.418 25.577 10.505 8.221 0.457 16.442-2.284 22.837-8.221 5.938-6.394 8.678-15.072 8.221-23.75v-122.862h48.871v113.727c0 13.245 3.197 23.293 9.135 30.601 6.394 7.308 15.986 11.418 25.577 10.505 8.221 0.457 16.442-2.284 22.837-8.221 5.938-6.394 8.678-15.072 8.221-23.75v-359.45h48.871v363.104c0.457 13.245-2.74 26.491-8.678 38.366-5.481 10.048-13.702 17.813-23.293 23.293zM1606.337 500.068v71.707c0 24.207-7.308 42.476-21.923 55.265s-34.712 19.183-60.289 19.183c-14.616 0.457-28.774-2.284-42.020-7.308-10.505-4.567-20.096-11.418-27.404-19.64-6.851-7.764-11.875-16.899-15.072-26.947l45.217-15.072c1.37 8.221 5.481 15.529 11.418 21.467 5.938 5.481 15.072 8.221 27.404 8.221s21.467-2.74 26.947-8.678c5.938-5.938 8.678-14.159 8.678-22.38v-10.962h-52.981c-13.245 0-26.491-2.284-38.822-6.851-10.505-4.111-19.64-10.962-26.491-20.096-6.394-9.591-10.048-21.467-9.591-33.342-0.457-11.875 2.74-23.75 9.591-33.342 6.394-9.135 15.529-16.442 25.577-21.010 11.875-5.024 24.207-7.308 36.996-7.308 10.962-0.457 21.923 1.37 31.971 5.938 6.851 3.197 12.789 7.764 16.899 13.245 2.74 3.654 5.024 7.764 6.851 12.332h7.308v-0.457c0-7.308 3.197-14.159 9.135-18.726 6.851-5.024 15.072-7.308 23.75-6.851h32.428v40.193h-15.529c-6.394-0.457-10.048 3.654-10.048 11.418zM1559.293 524.275c0.457-11.418-4.111-22.837-12.789-30.601-9.591-7.764-21.467-11.875-33.798-11.418-8.221-0.457-16.899 1.827-23.75 6.394-5.024 4.111-8.221 10.505-7.764 16.899-0.457 6.394 2.74 12.332 7.764 16.442 6.394 4.111 13.702 6.394 21.467 5.938h49.327l-0.457-3.654zM1856.171 700.118h-48.871v-59.832h-77.645v59.832h-48.871v-59.832h-47.957v-40.193h47.957v-108.703c-0.457-11.875 3.654-23.293 11.875-31.515s19.183-12.332 31.058-11.875h54.351v40.193h-37.452c-7.308 0-10.962 4.111-10.962 11.875v100.025h77.645v-108.703c-0.457-11.875 3.654-23.293 11.875-31.515s19.183-12.332 31.058-11.875h54.351v40.193h-36.996c-7.308 0-10.962 3.654-10.962 11.875v100.025h52.525v40.193h-52.981v59.832z" />
13
+ <glyph unicode="&#xe903;" glyph-name="stars" horiz-adv-x="6123" d="M713.633 659.134l287.142-42.227c24.28-3.167 43.282-20.058 51.728-43.282 7.39-23.225 1.056-48.561-15.835-65.452l-207.967-203.744 49.616-293.476c4.223-24.28-5.278-48.561-25.336-62.285s-46.449-15.835-67.563-4.223l-257.584 136.181-256.528-137.237c-21.113-11.612-47.505-9.501-67.563 4.223s-29.559 39.060-25.336 62.285l49.616 293.476-209.023 204.8c-16.891 16.891-23.225 42.227-15.835 65.452s27.447 40.115 51.728 43.282l287.142 42.227 128.792 264.973c10.557 22.169 32.726 35.893 57.006 35.893s46.449-13.724 58.062-35.893l127.736-264.973zM1980.437 659.134l287.142-42.227c24.28-3.167 43.282-20.058 51.728-43.282 7.39-23.225 1.056-48.561-15.835-65.452l-207.967-204.8 49.616-293.476c4.223-24.28-5.278-48.561-25.336-62.285s-46.449-15.835-67.563-4.223l-256.528 137.237-256.528-137.237c-21.113-11.612-47.505-9.501-67.563 4.223s-29.559 39.060-25.336 62.285l49.616 293.476-207.967 204.8c-16.891 16.891-23.225 42.227-15.835 65.452s27.447 40.115 51.728 43.282l287.142 42.227 128.792 264.973c10.557 22.169 32.726 35.893 57.006 35.893s46.449-13.724 58.062-35.893l125.625-264.973zM3247.241 659.134l287.142-42.227c24.28-3.167 43.282-20.058 51.728-43.282 7.39-23.225 1.056-48.561-15.835-65.452l-207.967-204.8 49.616-293.476c4.223-24.28-5.278-48.561-25.336-62.285s-46.449-15.835-67.563-4.223l-256.528 137.237-256.528-137.237c-21.113-11.612-47.505-9.501-67.563 4.223s-29.559 39.060-25.336 62.285l49.616 293.476-207.967 204.8c-16.891 16.891-23.225 42.227-15.835 65.452s27.447 40.115 51.728 43.282l287.142 42.227 128.792 264.973c10.557 22.169 32.726 35.893 57.006 35.893s46.449-13.724 58.062-35.893l125.625-264.973zM4514.045 659.134l287.142-42.227c24.28-3.167 43.282-20.058 51.728-43.282 7.39-23.225 1.056-48.561-15.835-65.452l-207.967-204.8 49.616-293.476c4.223-24.28-5.278-48.561-25.336-62.285s-46.449-15.835-67.563-4.223l-256.528 137.237-256.528-137.237c-21.113-11.612-47.505-9.501-67.563 4.223s-29.559 39.060-25.336 62.285l49.616 293.476-207.967 204.8c-16.891 16.891-23.225 42.227-15.835 65.452s27.447 40.115 51.728 43.282l287.142 42.227 128.792 264.973c10.557 22.169 32.726 35.893 57.006 35.893s46.449-13.724 58.062-35.893l125.625-264.973zM5780.849 659.134l287.142-42.227c24.28-3.167 43.282-20.058 51.728-43.282 7.39-23.225 1.056-48.561-15.835-65.452l-207.967-204.8 49.616-293.476c4.223-24.28-5.278-48.561-25.336-62.285s-46.449-15.835-67.563-4.223l-256.528 137.237-256.528-137.237c-21.113-11.612-47.505-9.501-67.563 4.223s-29.559 39.060-25.336 62.285l49.616 293.476-207.967 204.8c-16.891 16.891-23.225 42.227-15.835 65.452s27.447 40.115 51.728 43.282l287.142 42.227 128.792 264.973c10.557 22.169 32.726 35.893 57.006 35.893s46.449-13.724 58.062-35.893l125.625-264.973z" />
14
  </font></defs></svg>
assets/fonts/icons/icomoon.ttf CHANGED
Binary file
assets/fonts/icons/icomoon.woff CHANGED
Binary file
assets/img/debug/.htaccess CHANGED
@@ -1,6 +1,6 @@
1
- # BEGIN WebP Converter
2
- <IfModule mod_rewrite.c>
3
- RewriteEngine On
4
- RewriteRule icon-before\.(.+)$ ./icon-after.$1 [NC,E=cache-control:private,L]
5
- </IfModule>
6
- # END WebP Converter
1
+ # BEGIN Converter for Media
2
+ <IfModule mod_rewrite.c>
3
+ RewriteEngine On
4
+ RewriteRule icon-before\.(.+)$ ./icon-after.$1 [NC,E=cache-control:private,L]
5
+ </IfModule>
6
+ # END Converter for Media
assets/img/logo-bg.png ADDED
Binary file
assets/img/logo-headline.png ADDED
Binary file
changelog.txt CHANGED
@@ -1,5 +1,14 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
3
  = 4.5.1 (2022-07-22) =
4
  * `[Removed]` Notification asking to clear cache for Cloudways
5
  * `[Changed]` Error message for bypassing_apache error in server configuration
1
  == Changelog ==
2
 
3
+ = 5.0.0 (2022-08-20) =
4
+ * `[Changed]` Information about plugin operation and technical support on plugin settings page
5
+ * `[Changed]` Option field for configuration of quality level
6
+ * `[Changed]` Labels of options in plugin settings
7
+ * `[Changed]` Widget for conversion process
8
+ * `[Added]` Filter `webpc_htaccess_cache_control_private` to disable Cache-Control as private
9
+ * `[Added]` Statistics on number of converted images
10
+ * `[Added]` Tabs for plugin settings
11
+
12
  = 4.5.1 (2022-07-22) =
13
  * `[Removed]` Notification asking to clear cache for Cloudways
14
  * `[Changed]` Error message for bypassing_apache error in server configuration
includes/passthru.php CHANGED
@@ -3,7 +3,7 @@
3
  * Loads images in WebP format or original images if browser does not support WebP.
4
  *
5
  * @category WordPress Plugin
6
- * @package WebP Converter for Media
7
  * @author Mateusz Gbiorczyk
8
  * @link https://wordpress.org/plugins/webp-converter-for-media/
9
  */
3
  * Loads images in WebP format or original images if browser does not support WebP.
4
  *
5
  * @category WordPress Plugin
6
+ * @package Converter for Media
7
  * @author Mateusz Gbiorczyk
8
  * @link https://wordpress.org/plugins/webp-converter-for-media/
9
  */
readme.txt CHANGED
@@ -56,11 +56,11 @@ If you would like to appreciate it, you can try [the PRO version](https://mattpl
56
 
57
  == Installation ==
58
 
59
- 1. Upload the plugin files to `/wp-content/plugins/webp-converter-for-media` directory, or install plugin through the WordPress plugins screen directly.
60
- 2. Activate plugin through `Plugins` screen in WordPress Admin Panel.
61
  3. Use `Settings -> Settings -> Converter for Media` screen to configure the plugin.
62
- 4. Click on the button `Regenerate All`.
63
- 5. Check if everything works fine.
64
 
65
  That's all! Your website is already loading faster!
66
 
@@ -68,25 +68,23 @@ That's all! Your website is already loading faster!
68
 
69
  = How to get technical support? (before you ask for help) =
70
 
71
- Please always adding your thread, **read all other questions in the FAQ of plugin and other threads in support forum first**. Perhaps someone had a similar problem and it has been resolved.
72
 
73
  When adding a thread, follow these steps and reply to each of them:
74
 
75
- **1.** Do you have any error on the plugin settings page? Please read [this thread](https://wordpress.org/support/topic/server-configuration-error-what-to-do/) if you have any errors.
76
 
77
  **2.** URL of your website.
78
 
79
- **3.** Configuration of your server *(link to it can be found on the settings page of plugin in the section **"We are waiting for your message"**)* - please take a screenshot of the ENTIRE page and send it to me.
80
 
81
- **4.** Settings of plugin - please take a screenshot of the ENTIRE page and send it to me.
82
 
83
- **5.** Please do the test, which is described in the FAQ in question `How to check if plugin works?`. Please send a screenshot of Devtools with test results.
84
-
85
- Please remember to include the answers for all questions by adding a thread. It is much easier and accelerate the solution of your problem.
86
 
87
  = Error on plugin settings screen? =
88
 
89
- If you have an error on the plugin settings screen, first of all please read it carefully. They are displayed when there is a problem with the configuration of your server or website.
90
 
91
  The messages are designed to reduce the number of support requests that are repeated. It saves your and our time. Please read [this thread](https://wordpress.org/support/topic/server-configuration-error-what-to-do/) for more information.
92
 
@@ -98,33 +96,29 @@ If you get an error: `File "%s" does not exist. Please check file path.` means t
98
 
99
  If you get an error: `File "%s" is unreadable. Please check file permissions.` means that the [is_readable()](https://www.php.net/manual/en/function.is-readable.php) function in PHP returned `false` using the file path given in the error message. Check the permissions for the file and the directory in which the file is located.
100
 
101
- If you get an error: `"%s" is not a valid image file.` means that the file is damaged in some way. Download the file to disk, save it again using any graphics program and add again to the page. If the error applies to individual images then you can ignore it - just the original images will load, not WebP.
102
 
103
  If you get an error: `Image "%s" converted to .webp is larger than original and converted .webp file has been deleted.` means the original image weighed less than WebP. This happens when images have been compressed before. Disable the *"Automatic removal of files in output formats larger than original"* option in plugin settings to force always using WebP.
104
 
105
- In the case of the above problems, **contacting the support forum will be useless**. Unfortunately, we are unable to help you if your files are damaged. You have to fix it yourself. If you have previously used other tools that changed the original files and damaged them, you will do nothing more.
106
-
107
- Remember that it happens that other plugins can cause problems with accessing files or the REST API. Please try to disable all other plugins and set the default theme to make sure that it is not one of them that causes these types of problems.
108
-
109
  = What are requirements of plugin? =
110
 
111
- Practically every hosting meets these requirements. You must use PHP at least 7.0 and have the `GD` or `Imagick` extension installed. **The extension must support `WebP format`.** If you have an error saying that the GD or Imagick library are not installed, but you have it installed then they are probably incorrectly configured and do not have WebP support.
112
 
113
  They are required native PHP extensions, used among others by WordPress to generate thumbnails. Your server must also have the modules `mod_mime`, `mod_rewrite` and `mod_expires` enabled.
114
 
115
- An example of the correct server configuration can be found [here](https://mattplugins.com/files/webp-server-config.png). Link to your current configuration can be found in the administration panel, on the management plugin page in the section **"We are waiting for your message"** *(or using the URL path: `/wp-admin/options-general.php?page=webpc_admin_page&action=server`)*.
116
 
117
  **Note the items marked in red.** If the values marked in red do not appear in your case, it means that your server does not meet the technical requirements. Pay attention to the **WebP Support** value for the GD library and **WEBP in the list of supported extensions** for the Imagick library.
118
 
119
  In a situation where your server does not meet the technical requirements, please contact your server Administrator. We are not able to help you. Please do not contact us about this matter, because this is a server configuration problem, not a plugin.
120
 
121
- Also REST API must be enabled and work without additional restrictions. If you have a problem with it, please contact the Developer who created your website. He should easily find the issue with the REST API not working.
122
 
123
- = How to check if plugin works? =
124
 
125
  You can find more information on how the plugin works in [our manual](https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/).
126
 
127
- = How to change path to uploads? =
128
 
129
  This is possible using the following types of filters to change default paths. It is a solution for advanced users. If you are not, please skip this question.
130
 
@@ -224,7 +218,7 @@ Filters run before images are converted - they no longer support converted image
224
 
225
  = How to run manually conversion? =
226
 
227
- By default, all images are converted when you click on the `Regenerate All` button. In addition, conversion is automatic when you add new files to your Media Library.
228
 
229
  Remember that our plugin takes into account images generated by WordPress. There are many plugins that generate, for example, images of a different size or in a different version.
230
 
@@ -286,7 +280,7 @@ Find the configuration file in one of the paths *(remember to select configurati
286
 
287
  and add this code *(add these lines at the beginning of the `server { ... }` block)* - **remember to add these rules before any other `location {}` rules**:
288
 
289
- `# BEGIN WebP Converter for Media`
290
  `set $ext_avif ".avif";`
291
  `if ($http_accept !~* "image/avif") {`
292
  ` set $ext_avif "";`
@@ -305,7 +299,7 @@ and add this code *(add these lines at the beginning of the `server { ... }` blo
305
  ` /wp-content/uploads-webpc/$path.$ext$ext_webp`
306
  ` $uri =404;`
307
  `}`
308
- `# END WebP Converter for Media`
309
 
310
  **Then add support for the required MIME types**, if they are not supported. Edit the configuration file:
311
  - `/etc/nginx/mime.types`
@@ -323,28 +317,20 @@ In case of problems, please contact us in [the support forum](https://wordpress.
323
 
324
  == Screenshots ==
325
 
326
- 1. Screenshot of the options panel
327
- 2. Screenshot when regenerating images
 
328
 
329
  == Changelog ==
330
 
331
- = 4.5.1 (2022-07-22) =
332
- * `[Removed]` Notification asking to clear cache for Cloudways
333
- * `[Changed]` Error message for bypassing_apache error in server configuration
334
-
335
- = 4.5.0 (2022-07-15) =
336
- * `[Changed]` Plugin name from "WebP Converter to Media" to "Converter for Media"
337
- * `[Removed]` "Browser Caching for files in output formats" option in plugin settings (will be active always)
338
- * `[Removed]` "Force redirections to output formats for all domains" option in plugin settings (will be active always)
339
- * `[Fixed]` Error handling about unreadable source or output path
340
- * `[Changed]` Error message for bypassing_apache error in server configuration
341
- * `[Changed]` Error message for rewrites_not_executed error in server configuration
342
- * `[Added]` Limit of 3 attempts to image regeneration to avoid infinity loops
343
- * `[Added]` Debug information about saved plugin data
344
- * `[Added]` Notification asking to clear cache for Cloudways
345
- * `[Added]` Action `webpc_after_conversion` to operation on output path after image conversion
346
- * `[Added]` Filter `webpc_htaccess_mod_rewrite_inherit` to disable mod_rewrite inheritance
347
- * `[Added]` Filter `webpc_htaccess_mod_rewrite_referer` to disable redirections to output formats for other domains
348
 
349
  See [changelog.txt](https://plugins.svn.wordpress.org/webp-converter-for-media/trunk/changelog.txt) for previous versions.
350
 
56
 
57
  == Installation ==
58
 
59
+ 1. Upload the plugin files to `/wp-content/plugins/webp-converter-for-media` directory, or install the plugin through the WordPress plugins screen directly.
60
+ 2. Activate the plugin through `Plugins` screen in WordPress Admin Panel.
61
  3. Use `Settings -> Settings -> Converter for Media` screen to configure the plugin.
62
+ 4. Click on the button `Start Bulk Optimization` and wait.
63
+ 5. Check if everything works fine using [this tutorial](https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/).
64
 
65
  That's all! Your website is already loading faster!
66
 
68
 
69
  = How to get technical support? (before you ask for help) =
70
 
71
+ Before you add a new thread, **read all other questions in this FAQ and other threads in [the support forum](https://wordpress.org/support/plugin/webp-converter-for-media/) first**. Perhaps someone had a similar problem and it has been resolved.
72
 
73
  When adding a thread, follow these steps and reply to each of them:
74
 
75
+ **1.** Do you have any errors on the plugin settings page? Please read [this thread](https://wordpress.org/support/topic/server-configuration-error-what-to-do/) if you have any errors.
76
 
77
  **2.** URL of your website.
78
 
79
+ **3.** Screenshot of the Help Center tab on the plugin settings screen - please take a screenshot of the ENTIRE page.
80
 
81
+ **4.** Please do the test, which is described in the FAQ in the question "How to check if the plugin works?". Please send a screenshot of Devtools with the test results.
82
 
83
+ Please remember to include the answers to all questions by adding a thread. It is much easier and accelerates the solution of your problem.
 
 
84
 
85
  = Error on plugin settings screen? =
86
 
87
+ If you have an error on the plugin settings screen, first of all, please read it carefully. They are displayed when there is a problem with the configuration of your server or website.
88
 
89
  The messages are designed to reduce the number of support requests that are repeated. It saves your and our time. Please read [this thread](https://wordpress.org/support/topic/server-configuration-error-what-to-do/) for more information.
90
 
96
 
97
  If you get an error: `File "%s" is unreadable. Please check file permissions.` means that the [is_readable()](https://www.php.net/manual/en/function.is-readable.php) function in PHP returned `false` using the file path given in the error message. Check the permissions for the file and the directory in which the file is located.
98
 
99
+ If you get an error: `"%s" is not a valid image file.` means that the file is damaged in some way. Download the file to disk, save it again using any graphics program and add it again to the page. If the error applies to individual images then you can ignore it - just the original images will load, not WebP.
100
 
101
  If you get an error: `Image "%s" converted to .webp is larger than original and converted .webp file has been deleted.` means the original image weighed less than WebP. This happens when images have been compressed before. Disable the *"Automatic removal of files in output formats larger than original"* option in plugin settings to force always using WebP.
102
 
 
 
 
 
103
  = What are requirements of plugin? =
104
 
105
+ Practically every hosting meets these requirements. You must use PHP at least 7.0 and have the `GD` or `Imagick` extension installed. **The extension must support `WebP format`.** If you have an error saying that the GD or Imagick library is not installed, but you have it installed then they are probably incorrectly configured and do not have WebP support.
106
 
107
  They are required native PHP extensions, used among others by WordPress to generate thumbnails. Your server must also have the modules `mod_mime`, `mod_rewrite` and `mod_expires` enabled.
108
 
109
+ An example of the correct server configuration can be found [here](https://mattplugins.com/files/webp-server-config.png). The link to your current configuration can be found in the Help Center tab on plugin settings screen.
110
 
111
  **Note the items marked in red.** If the values marked in red do not appear in your case, it means that your server does not meet the technical requirements. Pay attention to the **WebP Support** value for the GD library and **WEBP in the list of supported extensions** for the Imagick library.
112
 
113
  In a situation where your server does not meet the technical requirements, please contact your server Administrator. We are not able to help you. Please do not contact us about this matter, because this is a server configuration problem, not a plugin.
114
 
115
+ Also, REST API must be enabled and work without additional restrictions. If you have a problem with it, please contact the Developer who created your website. He should easily find the issue with the REST API not working.
116
 
117
+ = How to check if the plugin works? =
118
 
119
  You can find more information on how the plugin works in [our manual](https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/).
120
 
121
+ = How to change the path to uploads? =
122
 
123
  This is possible using the following types of filters to change default paths. It is a solution for advanced users. If you are not, please skip this question.
124
 
218
 
219
  = How to run manually conversion? =
220
 
221
+ By default, all images are converted when you click on the `Start Bulk Optimization ` button. In addition, conversion is automatic when you add new files to your Media Library.
222
 
223
  Remember that our plugin takes into account images generated by WordPress. There are many plugins that generate, for example, images of a different size or in a different version.
224
 
280
 
281
  and add this code *(add these lines at the beginning of the `server { ... }` block)* - **remember to add these rules before any other `location {}` rules**:
282
 
283
+ `# BEGIN Converter for Media`
284
  `set $ext_avif ".avif";`
285
  `if ($http_accept !~* "image/avif") {`
286
  ` set $ext_avif "";`
299
  ` /wp-content/uploads-webpc/$path.$ext$ext_webp`
300
  ` $uri =404;`
301
  `}`
302
+ `# END Converter for Media`
303
 
304
  **Then add support for the required MIME types**, if they are not supported. Edit the configuration file:
305
  - `/etc/nginx/mime.types`
317
 
318
  == Screenshots ==
319
 
320
+ 1. General tab of the plugin settings
321
+ 2. Advanced tab of the plugin settings
322
+ 3. Bulk optimization of images
323
 
324
  == Changelog ==
325
 
326
+ = 5.0.0 (2022-08-20) =
327
+ * `[Changed]` Information about plugin operation and technical support on plugin settings page
328
+ * `[Changed]` Option field for configuration of quality level
329
+ * `[Changed]` Labels of options in plugin settings
330
+ * `[Changed]` Widget for conversion process
331
+ * `[Added]` Filter `webpc_htaccess_cache_control_private` to disable Cache-Control as private
332
+ * `[Added]` Statistics on number of converted images
333
+ * `[Added]` Tabs for plugin settings
 
 
 
 
 
 
 
 
 
334
 
335
  See [changelog.txt](https://plugins.svn.wordpress.org/webp-converter-for-media/trunk/changelog.txt) for previous versions.
336
 
src/Conversion/Directory/DirectoryAbstract.php CHANGED
@@ -46,7 +46,7 @@ abstract class DirectoryAbstract implements DirectoryInterface {
46
  * {@inheritdoc}
47
  */
48
  public function get_path_url(): string {
49
- $source_url = apply_filters( 'webpc_site_url', get_home_url() );
50
  $directory_name = apply_filters( 'webpc_dir_name', $this->get_relative_path(), $this->get_type() );
51
  return sprintf( '%1$s/%2$s', $source_url, $directory_name );
52
  }
46
  * {@inheritdoc}
47
  */
48
  public function get_path_url(): string {
49
+ $source_url = apply_filters( 'webpc_site_url', get_site_url() );
50
  $directory_name = apply_filters( 'webpc_dir_name', $this->get_relative_path(), $this->get_type() );
51
  return sprintf( '%1$s/%2$s', $source_url, $directory_name );
52
  }
src/Conversion/Directory/DirectoryIntegration.php CHANGED
@@ -141,7 +141,7 @@ class DirectoryIntegration implements HookableInterface {
141
  }
142
  }
143
 
144
- $source_url = apply_filters( 'webpc_site_url', get_home_url() );
145
  return sprintf( '%1$s/%2$s', $source_url, $directory_name );
146
  }
147
  }
141
  }
142
  }
143
 
144
+ $source_url = apply_filters( 'webpc_site_url', get_site_url() );
145
  return sprintf( '%1$s/%2$s', $source_url, $directory_name );
146
  }
147
  }
src/Conversion/Endpoint/ImagesCounterEndpoint.php CHANGED
@@ -47,7 +47,11 @@ class ImagesCounterEndpoint extends EndpointAbstract {
47
 
48
  return new \WP_REST_Response(
49
  [
50
- 'value_output' => sprintf(
 
 
 
 
51
  /* translators: %1$s: images count */
52
  __( '%1$s for AVIF and %2$s for WebP', 'webp-converter-for-media' ),
53
  number_format( $images_count[ AvifFormat::FORMAT_EXTENSION ] ?? 0, 0, '', ' ' ),
47
 
48
  return new \WP_REST_Response(
49
  [
50
+ 'value_webp_left' => $images_count[ WebpFormat::FORMAT_EXTENSION ],
51
+ 'value_webp_all' => $images_count[ 'all_' . WebpFormat::FORMAT_EXTENSION ],
52
+ 'value_avif_left' => $images_count[ AvifFormat::FORMAT_EXTENSION ],
53
+ 'value_avif_all' => $images_count[ 'all_' . AvifFormat::FORMAT_EXTENSION ],
54
+ 'value_output' => sprintf(
55
  /* translators: %1$s: images count */
56
  __( '%1$s for AVIF and %2$s for WebP', 'webp-converter-for-media' ),
57
  number_format( $images_count[ AvifFormat::FORMAT_EXTENSION ] ?? 0, 0, '', ' ' ),
src/Conversion/Format/AvifFormat.php CHANGED
@@ -45,11 +45,14 @@ class AvifFormat extends FormatAbstract {
45
  }
46
 
47
  return sprintf(
48
- /* translators: %1$s: option name, %2$s: open anchor tag, %3$s: close anchor tag */
49
- __( '%1$s (available in %2$sthe PRO version%3$s)', 'webp-converter-for-media' ),
50
  'AVIF',
51
- '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-avif-upgrade' ) ) . '" target="_blank">',
52
- '</a>'
 
 
 
 
53
  );
54
  }
55
 
45
  }
46
 
47
  return sprintf(
48
+ '%1$s (%2$s)',
 
49
  'AVIF',
50
+ sprintf(
51
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
52
+ __( 'available in %1$sthe PRO version%2$s', 'webp-converter-for-media' ),
53
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-avif-upgrade' ) ) . '" target="_blank">',
54
+ '</a>'
55
+ )
56
  );
57
  }
58
 
src/Conversion/Media/Upload.php CHANGED
@@ -6,6 +6,7 @@ use WebpConverter\Conversion\Cron\CronInitiator;
6
  use WebpConverter\HookableInterface;
7
  use WebpConverter\PluginData;
8
  use WebpConverter\Repository\TokenRepository;
 
9
  use WebpConverter\Settings\Option\SupportedExtensionsOption;
10
 
11
  /**
@@ -61,9 +62,13 @@ class Upload implements HookableInterface {
61
  return $data;
62
  }
63
 
64
- $allowed_extensions = $this->plugin_data->get_plugin_settings()[ SupportedExtensionsOption::OPTION_NAME ];
65
- $file_extension = strtolower( pathinfo( $data['file'], PATHINFO_EXTENSION ) );
66
- if ( ! in_array( $file_extension, $allowed_extensions ) ) {
 
 
 
 
67
  return $data;
68
  }
69
 
@@ -87,6 +92,10 @@ class Upload implements HookableInterface {
87
  $directory = $this->get_attachment_directory( $data['file'] );
88
  $list = [];
89
 
 
 
 
 
90
  $list[] = $directory . basename( $data['file'] );
91
  foreach ( $data['sizes'] as $size ) {
92
  $path = $directory . $size['file'];
6
  use WebpConverter\HookableInterface;
7
  use WebpConverter\PluginData;
8
  use WebpConverter\Repository\TokenRepository;
9
+ use WebpConverter\Settings\Option\AutoConversionOption;
10
  use WebpConverter\Settings\Option\SupportedExtensionsOption;
11
 
12
  /**
62
  return $data;
63
  }
64
 
65
+ $plugin_settings = $this->plugin_data->get_plugin_settings();
66
+ if ( ! $plugin_settings[ AutoConversionOption::OPTION_NAME ] ) {
67
+ return $data;
68
+ }
69
+
70
+ $file_extension = strtolower( pathinfo( $data['file'], PATHINFO_EXTENSION ) );
71
+ if ( ! in_array( $file_extension, $plugin_settings[ SupportedExtensionsOption::OPTION_NAME ] ) ) {
72
  return $data;
73
  }
74
 
92
  $directory = $this->get_attachment_directory( $data['file'] );
93
  $list = [];
94
 
95
+ if ( isset( $data['original_image'] ) ) {
96
+ $list[] = $directory . $data['original_image'];
97
+ }
98
+
99
  $list[] = $directory . basename( $data['file'] );
100
  foreach ( $data['sizes'] as $size ) {
101
  $path = $directory . $size['file'];
src/Conversion/Method/LibraryMethodAbstract.php CHANGED
@@ -78,6 +78,7 @@ abstract class LibraryMethodAbstract extends MethodAbstract implements LibraryMe
78
  $output_path = $this->get_image_output_path( $source_path, $format );
79
 
80
  $this->skip_crashed->create_crashed_file( $output_path );
 
81
 
82
  $image = $this->create_image_by_path( $source_path, $plugin_settings );
83
  $this->convert_image_to_output( $image, $source_path, $output_path, $format, $plugin_settings );
@@ -85,7 +86,7 @@ abstract class LibraryMethodAbstract extends MethodAbstract implements LibraryMe
85
 
86
  $this->skip_crashed->delete_crashed_file( $output_path );
87
  $this->skip_larger->remove_image_if_is_larger( $output_path, $source_path, $plugin_settings );
88
- $this->update_conversion_stats( $source_path, $output_path );
89
  } catch ( \Exception $e ) {
90
  $this->log_conversion_error( $e->getMessage(), $plugin_settings );
91
  throw $e;
78
  $output_path = $this->get_image_output_path( $source_path, $format );
79
 
80
  $this->skip_crashed->create_crashed_file( $output_path );
81
+ $this->output_files_converted[ $format ]++;
82
 
83
  $image = $this->create_image_by_path( $source_path, $plugin_settings );
84
  $this->convert_image_to_output( $image, $source_path, $output_path, $format, $plugin_settings );
86
 
87
  $this->skip_crashed->delete_crashed_file( $output_path );
88
  $this->skip_larger->remove_image_if_is_larger( $output_path, $source_path, $plugin_settings );
89
+ $this->update_conversion_stats( $source_path, $output_path, $format );
90
  } catch ( \Exception $e ) {
91
  $this->log_conversion_error( $e->getMessage(), $plugin_settings );
92
  throw $e;
src/Conversion/Method/MethodAbstract.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WebpConverter\Conversion\Method;
4
 
 
 
5
  use WebpConverter\Conversion\OutputPath;
6
  use WebpConverter\Exception;
7
  use WebpConverter\Settings\Option\ExtraFeaturesOption;
@@ -56,6 +58,14 @@ abstract class MethodAbstract implements MethodInterface {
56
  */
57
  protected $files_converted = 0;
58
 
 
 
 
 
 
 
 
 
59
  /**
60
  * @return bool
61
  */
@@ -98,6 +108,13 @@ abstract class MethodAbstract implements MethodInterface {
98
  return $this->files_converted;
99
  }
100
 
 
 
 
 
 
 
 
101
  /**
102
  * {@inheritdoc}
103
  */
@@ -142,18 +159,20 @@ abstract class MethodAbstract implements MethodInterface {
142
  }
143
 
144
  /**
145
- * @param string $source_path Server path of source image.
146
- * @param string $output_path Server path of output image.
 
147
  *
148
  * @return void
149
  */
150
- protected function update_conversion_stats( string $source_path, string $output_path ) {
151
  $output_exist = file_exists( $output_path );
152
  $size_before = filesize( $source_path );
153
  $size_after = ( $output_exist ) ? filesize( $output_path ) : $size_before;
154
 
155
  $this->size_before += $size_before ?: 0;
156
  $this->size_after += $size_after ?: 0;
 
157
  if ( $output_exist ) {
158
  $this->files_converted++;
159
  }
2
 
3
  namespace WebpConverter\Conversion\Method;
4
 
5
+ use WebpConverter\Conversion\Format\AvifFormat;
6
+ use WebpConverter\Conversion\Format\WebpFormat;
7
  use WebpConverter\Conversion\OutputPath;
8
  use WebpConverter\Exception;
9
  use WebpConverter\Settings\Option\ExtraFeaturesOption;
58
  */
59
  protected $files_converted = 0;
60
 
61
+ /**
62
+ * @var int[]
63
+ */
64
+ protected $output_files_converted = [
65
+ WebpFormat::FORMAT_EXTENSION => 0,
66
+ AvifFormat::FORMAT_EXTENSION => 0,
67
+ ];
68
+
69
  /**
70
  * @return bool
71
  */
108
  return $this->files_converted;
109
  }
110
 
111
+ /**
112
+ * {@inheritdoc}
113
+ */
114
+ public function get_files_converted_to_format( string $output_format ): int {
115
+ return $this->output_files_converted[ $output_format ];
116
+ }
117
+
118
  /**
119
  * {@inheritdoc}
120
  */
159
  }
160
 
161
  /**
162
+ * @param string $source_path Server path of source image.
163
+ * @param string $output_path Server path of output image.
164
+ * @param string $output_format .
165
  *
166
  * @return void
167
  */
168
+ protected function update_conversion_stats( string $source_path, string $output_path, string $output_format ) {
169
  $output_exist = file_exists( $output_path );
170
  $size_before = filesize( $source_path );
171
  $size_after = ( $output_exist ) ? filesize( $output_path ) : $size_before;
172
 
173
  $this->size_before += $size_before ?: 0;
174
  $this->size_after += $size_after ?: 0;
175
+
176
  if ( $output_exist ) {
177
  $this->files_converted++;
178
  }
src/Conversion/Method/MethodIntegrator.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WebpConverter\Conversion\Method;
4
 
 
 
5
  use WebpConverter\PluginData;
6
  use WebpConverter\Settings\Option\ConversionMethodOption;
7
 
@@ -37,8 +39,10 @@ class MethodIntegrator {
37
  'is_fatal_error' => $method->is_fatal_error(),
38
  'errors' => apply_filters( 'webpc_convert_errors', $method->get_errors() ),
39
  'files' => [
40
- 'all' => $method->get_files_to_conversion(),
41
- 'converted' => $method->get_files_converted(),
 
 
42
  ],
43
  'size' => [
44
  'before' => $method->get_size_before(),
2
 
3
  namespace WebpConverter\Conversion\Method;
4
 
5
+ use WebpConverter\Conversion\Format\AvifFormat;
6
+ use WebpConverter\Conversion\Format\WebpFormat;
7
  use WebpConverter\PluginData;
8
  use WebpConverter\Settings\Option\ConversionMethodOption;
9
 
39
  'is_fatal_error' => $method->is_fatal_error(),
40
  'errors' => apply_filters( 'webpc_convert_errors', $method->get_errors() ),
41
  'files' => [
42
+ 'all' => $method->get_files_to_conversion(),
43
+ 'converted' => $method->get_files_converted(),
44
+ 'converted_webp' => $method->get_files_converted_to_format( WebpFormat::FORMAT_EXTENSION ),
45
+ 'converted_avif' => $method->get_files_converted_to_format( AvifFormat::FORMAT_EXTENSION ),
46
  ],
47
  'size' => [
48
  'before' => $method->get_size_before(),
src/Conversion/Method/MethodInterface.php CHANGED
@@ -78,6 +78,13 @@ interface MethodInterface {
78
  */
79
  public function get_files_converted(): int;
80
 
 
 
 
 
 
 
 
81
  /**
82
  * Converts source paths to output formats.
83
  *
78
  */
79
  public function get_files_converted(): int;
80
 
81
+ /**
82
+ * @param string $output_format .
83
+ *
84
+ * @return int
85
+ */
86
+ public function get_files_converted_to_format( string $output_format ): int;
87
+
88
  /**
89
  * Converts source paths to output formats.
90
  *
src/Conversion/Method/RemoteMethod.php CHANGED
@@ -77,11 +77,14 @@ class RemoteMethod extends MethodAbstract {
77
  }
78
 
79
  return sprintf(
80
- /* translators: %1$s: option name, %2$s: open anchor tag, %3$s: close anchor tag */
81
- __( '%1$s (available in %2$sthe PRO version%3$s)', 'webp-converter-for-media' ),
82
  __( 'Remote server', 'webp-converter-for-media' ),
83
- '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-remote-upgrade' ) ) . '" target="_blank">',
84
- '</a>'
 
 
 
 
85
  );
86
  }
87
 
@@ -140,7 +143,8 @@ class RemoteMethod extends MethodAbstract {
140
  if ( ! $regenerate_force ) {
141
  foreach ( $source_paths as $output_format => $extensions_paths ) {
142
  foreach ( $extensions_paths as $path_index => $extensions_path ) {
143
- if ( file_exists( $output_paths[ $output_format ][ $path_index ] ) ) {
 
144
  unset( $source_paths[ $output_format ][ $path_index ] );
145
  unset( $output_paths[ $output_format ][ $path_index ] );
146
  $this->files_to_conversion -= 1;
@@ -162,7 +166,7 @@ class RemoteMethod extends MethodAbstract {
162
 
163
  try {
164
  $this->skip_larger->remove_image_if_is_larger( $output_path, $source_path, $plugin_settings );
165
- $this->update_conversion_stats( $source_path, $output_path );
166
  } catch ( Exception\LargerThanOriginalException $e ) {
167
  $this->save_conversion_error( $e->getMessage(), $plugin_settings );
168
  }
@@ -285,10 +289,12 @@ class RemoteMethod extends MethodAbstract {
285
  if ( ( $http_code === 200 ) && $response ) {
286
  $values[ $output_format ] = $values[ $output_format ] ?? [];
287
  $values[ $output_format ][ $resource_id ] = $response;
 
288
  } else {
289
  $this->handle_request_error(
290
  $source_paths[ $output_format ][ $resource_id ],
291
  $output_paths[ $output_format ][ $resource_id ],
 
292
  $plugin_settings,
293
  $http_code,
294
  $response
@@ -379,6 +385,7 @@ class RemoteMethod extends MethodAbstract {
379
  /**
380
  * @param string $source_path .
381
  * @param string $output_path .
 
382
  * @param mixed[] $plugin_settings .
383
  * @param int $http_code .
384
  * @param string|null $response .
@@ -390,6 +397,7 @@ class RemoteMethod extends MethodAbstract {
390
  private function handle_request_error(
391
  string $source_path,
392
  string $output_path,
 
393
  array $plugin_settings,
394
  int $http_code,
395
  string $response = null
@@ -404,6 +412,7 @@ class RemoteMethod extends MethodAbstract {
404
  $this->save_conversion_error( $error_message, $plugin_settings );
405
  } elseif ( $http_code === 200 ) {
406
  $this->skip_crashed->create_crashed_file( $output_path );
 
407
  } else {
408
  $this->save_conversion_error(
409
  ( new Exception\RemoteRequestException( [ $http_code, $source_path ] ) )->getMessage(),
77
  }
78
 
79
  return sprintf(
80
+ '%1$s (%2$s)',
 
81
  __( 'Remote server', 'webp-converter-for-media' ),
82
+ sprintf(
83
+ /* translators: %%1$s: open anchor tag, %2$s: close anchor tag */
84
+ __( 'available in %1$sthe PRO version%2$s', 'webp-converter-for-media' ),
85
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-remote-upgrade' ) ) . '" target="_blank">',
86
+ '</a>'
87
+ )
88
  );
89
  }
90
 
143
  if ( ! $regenerate_force ) {
144
  foreach ( $source_paths as $output_format => $extensions_paths ) {
145
  foreach ( $extensions_paths as $path_index => $extensions_path ) {
146
+ if ( file_exists( $output_paths[ $output_format ][ $path_index ] )
147
+ || file_exists( $output_paths[ $output_format ][ $path_index ] . '.' . SkipLarger::DELETED_FILE_EXTENSION ) ) {
148
  unset( $source_paths[ $output_format ][ $path_index ] );
149
  unset( $output_paths[ $output_format ][ $path_index ] );
150
  $this->files_to_conversion -= 1;
166
 
167
  try {
168
  $this->skip_larger->remove_image_if_is_larger( $output_path, $source_path, $plugin_settings );
169
+ $this->update_conversion_stats( $source_path, $output_path, $output_format );
170
  } catch ( Exception\LargerThanOriginalException $e ) {
171
  $this->save_conversion_error( $e->getMessage(), $plugin_settings );
172
  }
289
  if ( ( $http_code === 200 ) && $response ) {
290
  $values[ $output_format ] = $values[ $output_format ] ?? [];
291
  $values[ $output_format ][ $resource_id ] = $response;
292
+ $this->output_files_converted[ $output_format ]++;
293
  } else {
294
  $this->handle_request_error(
295
  $source_paths[ $output_format ][ $resource_id ],
296
  $output_paths[ $output_format ][ $resource_id ],
297
+ $output_format,
298
  $plugin_settings,
299
  $http_code,
300
  $response
385
  /**
386
  * @param string $source_path .
387
  * @param string $output_path .
388
+ * @param string $output_format .
389
  * @param mixed[] $plugin_settings .
390
  * @param int $http_code .
391
  * @param string|null $response .
397
  private function handle_request_error(
398
  string $source_path,
399
  string $output_path,
400
+ string $output_format,
401
  array $plugin_settings,
402
  int $http_code,
403
  string $response = null
412
  $this->save_conversion_error( $error_message, $plugin_settings );
413
  } elseif ( $http_code === 200 ) {
414
  $this->skip_crashed->create_crashed_file( $output_path );
415
+ $this->output_files_converted[ $output_format ]++;
416
  } else {
417
  $this->save_conversion_error(
418
  ( new Exception\RemoteRequestException( [ $http_code, $source_path ] ) )->getMessage(),
src/Conversion/PathsFinder.php CHANGED
@@ -99,11 +99,16 @@ class PathsFinder {
99
  $paths = $this->find_source_paths( true );
100
  $values = [];
101
  foreach ( $allowed_output_formats as $output_format ) {
102
- $values[ $output_format ] = 0;
 
103
  foreach ( $paths as $path ) {
104
  $output_path = $this->output_path->get_path( $path, false, $output_format );
 
 
 
105
 
106
- if ( $output_path && $this->is_converted_file( $output_path ) ) {
 
107
  $values[ $output_format ]++;
108
  }
109
  }
@@ -128,7 +133,7 @@ class PathsFinder {
128
  foreach ( $allowed_output_formats as $output_format ) {
129
  $output_path = $this->output_path->get_path( $path, false, $output_format );
130
 
131
- if ( $output_path && $this->is_converted_file( $output_path ) ) {
132
  $is_converted = false;
133
  break;
134
  }
@@ -170,9 +175,9 @@ class PathsFinder {
170
  }
171
 
172
  private function is_converted_file( string $output_path ): bool {
173
- return ( ! file_exists( $output_path )
174
- && ! file_exists( $output_path . '.' . SkipLarger::DELETED_FILE_EXTENSION )
175
- && ! file_exists( $output_path . '.' . SkipCrashed::CRASHED_FILE_EXTENSION )
176
  );
177
  }
178
 
99
  $paths = $this->find_source_paths( true );
100
  $values = [];
101
  foreach ( $allowed_output_formats as $output_format ) {
102
+ $values[ $output_format ] = 0;
103
+ $values[ 'all_' . $output_format ] = 0;
104
  foreach ( $paths as $path ) {
105
  $output_path = $this->output_path->get_path( $path, false, $output_format );
106
+ if ( $output_path === null ) {
107
+ continue;
108
+ }
109
 
110
+ $values[ 'all_' . $output_format ]++;
111
+ if ( ! $this->is_converted_file( $output_path ) ) {
112
  $values[ $output_format ]++;
113
  }
114
  }
133
  foreach ( $allowed_output_formats as $output_format ) {
134
  $output_path = $this->output_path->get_path( $path, false, $output_format );
135
 
136
+ if ( $output_path && ! $this->is_converted_file( $output_path ) ) {
137
  $is_converted = false;
138
  break;
139
  }
175
  }
176
 
177
  private function is_converted_file( string $output_path ): bool {
178
+ return ( file_exists( $output_path )
179
+ || file_exists( $output_path . '.' . SkipLarger::DELETED_FILE_EXTENSION )
180
+ || file_exists( $output_path . '.' . SkipCrashed::CRASHED_FILE_EXTENSION )
181
  );
182
  }
183
 
src/Error/ErrorDetectorAggregator.php CHANGED
@@ -13,6 +13,7 @@ use WebpConverter\Error\Detector\SettingsIncorrectDetector;
13
  use WebpConverter\Error\Detector\TokenStatusDetector;
14
  use WebpConverter\Error\Detector\WebpFormatActivatedDetector;
15
  use WebpConverter\Error\Notice\ErrorNotice;
 
16
  use WebpConverter\Error\Notice\RewritesCachedNotice;
17
  use WebpConverter\HookableInterface;
18
  use WebpConverter\PluginData;
13
  use WebpConverter\Error\Detector\TokenStatusDetector;
14
  use WebpConverter\Error\Detector\WebpFormatActivatedDetector;
15
  use WebpConverter\Error\Notice\ErrorNotice;
16
+ use WebpConverter\Error\Notice\LibsWithoutWebpSupportNotice;
17
  use WebpConverter\Error\Notice\RewritesCachedNotice;
18
  use WebpConverter\HookableInterface;
19
  use WebpConverter\PluginData;
src/Error/Notice/LibsNotInstalledNotice.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WebpConverter\Error\Notice;
4
 
 
 
5
  /**
6
  * {@inheritdoc}
7
  */
@@ -23,11 +25,18 @@ class LibsNotInstalledNotice implements ErrorNotice {
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
- __( 'You can also use "Remote server" option in "Conversion method" field in the plugin settings. This option allows you to convert your images using a remote server, so your server does not have to meet all technical requirements for libraries.', 'webp-converter-for-media' ),
 
 
 
 
 
 
 
31
  ];
32
  }
33
  }
2
 
3
  namespace WebpConverter\Error\Notice;
4
 
5
+ use WebpConverter\WebpConverterConstants;
6
+
7
  /**
8
  * {@inheritdoc}
9
  */
25
  return [
26
  sprintf(
27
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
28
+ __( 'On your server is not installed GD or Imagick library.', 'webp-converter-for-media' ) . ' ' . __( 'This means that you cannot convert images to WebP format on your server, because it does not meet the plugin requirements described in %1$sthe plugin FAQ%2$s. This issue is not dependent on the plugin.', 'webp-converter-for-media' ),
29
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
30
  '</a>'
31
  ),
32
+ sprintf(
33
+ /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: open anchor tag, %4$s: close anchor tag */
34
+ __( '%1$sHowever, we have a solution for you!%2$s You can activate %3$sthe PRO version%4$s of the plugin that allows you to convert images using a remote server. This will allow you to convert images without any problems and speed up your website now.', 'webp-converter-for-media' ),
35
+ '<strong>',
36
+ '</strong>',
37
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'error-notice-required-libs' ) ) . '" target="_blank">',
38
+ '</a>'
39
+ ),
40
  ];
41
  }
42
  }
src/Error/Notice/LibsWithoutWebpSupportNotice.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace WebpConverter\Error\Notice;
4
 
 
 
5
  /**
6
  * {@inheritdoc}
7
  */
@@ -21,14 +23,20 @@ class LibsWithoutWebpSupportNotice implements ErrorNotice {
21
  */
22
  public function get_message(): array {
23
  return [
24
- __( 'Required GD or Imagick library is installed on your server, but it does not support the WebP format. This means that you cannot convert images to WebP format on your server, because it does not meet the technical requirements of the plugin. This issue is plugin-independent.', 'webp-converter-for-media' ),
25
  sprintf(
26
- /* translators: %1$s: open strong tag, %2$s: close strong tag */
27
- __( '%1$sYou can also use "Remote server" in "Conversion method" field in the plugin settings.%2$s This option allows you to convert your images using a remote server, so your server does not have to meet all technical requirements for libraries.', 'webp-converter-for-media' ),
 
 
 
 
 
 
28
  '<strong>',
29
- '</strong>'
 
 
30
  ),
31
- __( 'This will allow you to convert your images to WebP without any problems and thus speed up your website.', 'webp-converter-for-media' ),
32
  ];
33
  }
34
  }
2
 
3
  namespace WebpConverter\Error\Notice;
4
 
5
+ use WebpConverter\WebpConverterConstants;
6
+
7
  /**
8
  * {@inheritdoc}
9
  */
23
  */
24
  public function get_message(): array {
25
  return [
 
26
  sprintf(
27
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
28
+ __( 'Required GD or Imagick library is installed on your server, but it does not support the WebP format.', 'webp-converter-for-media' ) . ' ' . __( 'This means that you cannot convert images to WebP format on your server, because it does not meet the plugin requirements described in %1$sthe plugin FAQ%2$s. This issue is not dependent on the plugin.', 'webp-converter-for-media' ),
29
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
30
+ '</a>'
31
+ ),
32
+ sprintf(
33
+ /* translators: %1$s: open strong tag, %2$s: close strong tag, %3$s: open anchor tag, %4$s: close anchor tag */
34
+ __( '%1$sHowever, we have a solution for you!%2$s You can activate %3$sthe PRO version%4$s of the plugin that allows you to convert images using a remote server. This will allow you to convert images without any problems and speed up your website now.', 'webp-converter-for-media' ),
35
  '<strong>',
36
+ '</strong>',
37
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'error-notice-webp-support' ) ) . '" target="_blank">',
38
+ '</a>'
39
  ),
 
40
  ];
41
  }
42
  }
src/Loader/HtaccessLoader.php CHANGED
@@ -212,14 +212,18 @@ class HtaccessLoader extends LoaderAbstract {
212
  * @return string Rules for .htaccess file.
213
  */
214
  private function get_mod_headers_rules( array $settings ): string {
215
- $content = '';
216
- $extensions = implode( '|', $settings[ SupportedExtensionsOption::OPTION_NAME ] );
 
 
 
 
217
 
218
  $content .= '<IfModule mod_headers.c>' . PHP_EOL;
219
  if ( $extensions ) {
220
  $content .= ' <FilesMatch "(?i)\.(' . $extensions . ')(\.(webp|avif))?$">' . PHP_EOL;
221
  }
222
- if ( ( ( $_SERVER['X-LSCACHE'] ?? '' ) !== 'on' ) || isset( $_SERVER['HTTP_CDN_LOOP'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
223
  $content .= ' Header always set Cache-Control "private"' . PHP_EOL;
224
  }
225
  $content .= ' Header append Vary "Accept"' . PHP_EOL;
@@ -285,11 +289,11 @@ class HtaccessLoader extends LoaderAbstract {
285
 
286
  $rows = [];
287
  $rows[] = '';
288
- $rows[] = '# BEGIN WebP Converter';
289
  $rows[] = '# ! --- DO NOT EDIT PREVIOUS LINE --- !';
290
  $rows = array_merge( $rows, array_filter( $rules ) );
291
  $rows[] = '# ! --- DO NOT EDIT NEXT LINE --- !';
292
- $rows[] = '# END WebP Converter';
293
  $rows[] = '';
294
 
295
  return implode( PHP_EOL, $rows );
@@ -307,7 +311,11 @@ class HtaccessLoader extends LoaderAbstract {
307
  $path_file = $path_dir . '/.htaccess';
308
 
309
  $code = ( is_readable( $path_file ) ) ? file_get_contents( $path_file ) ?: '' : '';
310
- $code = preg_replace( '/((:?[\r\n|\r|\n]?)# BEGIN WebP Converter(.*?)# END WebP Converter(:?(:?[\r\n|\r|\n]+)?))/s', '', $code );
 
 
 
 
311
  if ( $rules && $code ) {
312
  $code = PHP_EOL . $code;
313
  }
212
  * @return string Rules for .htaccess file.
213
  */
214
  private function get_mod_headers_rules( array $settings ): string {
215
+ $content = '';
216
+ $extensions = implode( '|', $settings[ SupportedExtensionsOption::OPTION_NAME ] );
217
+ $cache_control = apply_filters(
218
+ 'webpc_htaccess_cache_control_private',
219
+ ( ( ( $_SERVER['X-LSCACHE'] ?? '' ) !== 'on' ) || isset( $_SERVER['HTTP_CDN_LOOP'] ) ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
220
+ );
221
 
222
  $content .= '<IfModule mod_headers.c>' . PHP_EOL;
223
  if ( $extensions ) {
224
  $content .= ' <FilesMatch "(?i)\.(' . $extensions . ')(\.(webp|avif))?$">' . PHP_EOL;
225
  }
226
+ if ( $cache_control ) {
227
  $content .= ' Header always set Cache-Control "private"' . PHP_EOL;
228
  }
229
  $content .= ' Header append Vary "Accept"' . PHP_EOL;
289
 
290
  $rows = [];
291
  $rows[] = '';
292
+ $rows[] = '# BEGIN Converter for Media';
293
  $rows[] = '# ! --- DO NOT EDIT PREVIOUS LINE --- !';
294
  $rows = array_merge( $rows, array_filter( $rules ) );
295
  $rows[] = '# ! --- DO NOT EDIT NEXT LINE --- !';
296
+ $rows[] = '# END Converter for Media';
297
  $rows[] = '';
298
 
299
  return implode( PHP_EOL, $rows );
311
  $path_file = $path_dir . '/.htaccess';
312
 
313
  $code = ( is_readable( $path_file ) ) ? file_get_contents( $path_file ) ?: '' : '';
314
+ $code = preg_replace(
315
+ '/((:?[\r\n|\r|\n]?)# BEGIN (Converter for Media|WebP Converter)(.*?)# END (Converter for Media|WebP Converter)(:?(:?[\r\n|\r|\n]+)?))/s',
316
+ '',
317
+ $code
318
+ );
319
  if ( $rules && $code ) {
320
  $code = PHP_EOL . $code;
321
  }
src/Notice/AvifSupportNotice.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
-
3
- namespace WebpConverter\Notice;
4
-
5
- use WebpConverter\Repository\TokenRepository;
6
- use WebpConverter\Service\OptionsAccessManager;
7
-
8
- /**
9
- * Supports notice displayed as information about AVIF support.
10
- */
11
- class AvifSupportNotice extends NoticeAbstract implements NoticeInterface {
12
-
13
- const NOTICE_OPTION = 'webpc_notice_avif_support';
14
- const NOTICE_VIEW_PATH = 'components/notices/avif-support.php';
15
-
16
- /**
17
- * @var TokenRepository
18
- */
19
- private $token_repository;
20
-
21
- public function __construct( TokenRepository $token_repository = null ) {
22
- $this->token_repository = $token_repository ?: new TokenRepository();
23
- }
24
-
25
- /**
26
- * {@inheritdoc}
27
- */
28
- public function get_option_name(): string {
29
- return self::NOTICE_OPTION;
30
- }
31
-
32
- /**
33
- * {@inheritdoc}
34
- */
35
- public function get_default_value(): string {
36
- return (string) strtotime( sprintf( '+ %s days', rand( 1, 14 ) ) );
37
- }
38
-
39
- /**
40
- * {@inheritdoc}
41
- */
42
- public function is_available(): bool {
43
- return ( basename( $_SERVER['PHP_SELF'] ) === 'index.php' ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
44
- }
45
-
46
- /**
47
- * {@inheritdoc}
48
- */
49
- public function is_active(): bool {
50
- if ( $this->token_repository->get_token()->get_valid_status() ) {
51
- return false;
52
- }
53
-
54
- $option_value = OptionsAccessManager::get_option( $this->get_option_name() );
55
- return ( ( $option_value !== null ) && ( $option_value < time() ) );
56
- }
57
-
58
- /**
59
- * {@inheritdoc}
60
- */
61
- public function get_disable_value(): string {
62
- $is_permanent = ( isset( $_REQUEST['is_permanently'] ) && $_REQUEST['is_permanently'] ); // phpcs:ignore
63
- return (string) strtotime( ( $is_permanent ) ? '+1 year' : '+ 1 month' );
64
- }
65
-
66
- /**
67
- * {@inheritdoc}
68
- */
69
- public function get_output_path(): string {
70
- return self::NOTICE_VIEW_PATH;
71
- }
72
-
73
- /**
74
- * {@inheritdoc}
75
- */
76
- public function get_vars_for_view(): array {
77
- return [
78
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
79
- 'close_action' => self::NOTICE_OPTION,
80
- ];
81
- }
82
-
83
- /**
84
- * {@inheritdoc}
85
- */
86
- public function get_ajax_action_to_disable(): string {
87
- return self::NOTICE_OPTION;
88
- }
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Plugin/Activation/DefaultSettings.php CHANGED
@@ -2,7 +2,6 @@
2
 
3
  namespace WebpConverter\Plugin\Activation;
4
 
5
- use WebpConverter\Notice\AvifSupportNotice;
6
  use WebpConverter\Notice\CloudflareNotice;
7
  use WebpConverter\Notice\LitespeedNotice;
8
  use WebpConverter\Notice\NoticeIntegration;
@@ -37,7 +36,6 @@ class DefaultSettings {
37
  public function add_default_notices_values() {
38
  ( new NoticeIntegration( $this->plugin_info, new WelcomeNotice() ) )->set_default_value();
39
  ( new NoticeIntegration( $this->plugin_info, new ThanksNotice() ) )->set_default_value();
40
- ( new NoticeIntegration( $this->plugin_info, new AvifSupportNotice() ) )->set_default_value();
41
  ( new NoticeIntegration( $this->plugin_info, new CloudflareNotice() ) )->set_default_value();
42
  ( new NoticeIntegration( $this->plugin_info, new LitespeedNotice() ) )->set_default_value();
43
  }
2
 
3
  namespace WebpConverter\Plugin\Activation;
4
 
 
5
  use WebpConverter\Notice\CloudflareNotice;
6
  use WebpConverter\Notice\LitespeedNotice;
7
  use WebpConverter\Notice\NoticeIntegration;
36
  public function add_default_notices_values() {
37
  ( new NoticeIntegration( $this->plugin_info, new WelcomeNotice() ) )->set_default_value();
38
  ( new NoticeIntegration( $this->plugin_info, new ThanksNotice() ) )->set_default_value();
 
39
  ( new NoticeIntegration( $this->plugin_info, new CloudflareNotice() ) )->set_default_value();
40
  ( new NoticeIntegration( $this->plugin_info, new LitespeedNotice() ) )->set_default_value();
41
  }
src/Plugin/Uninstall/PluginSettings.php CHANGED
@@ -4,7 +4,6 @@ namespace WebpConverter\Plugin\Uninstall;
4
 
5
  use WebpConverter\Conversion\Cron\CronStatusManager;
6
  use WebpConverter\Error\ErrorDetectorAggregator;
7
- use WebpConverter\Notice\AvifSupportNotice;
8
  use WebpConverter\Notice\CloudflareNotice;
9
  use WebpConverter\Notice\LitespeedNotice;
10
  use WebpConverter\Notice\ThanksNotice;
@@ -29,7 +28,7 @@ class PluginSettings {
29
  OptionsAccessManager::delete_option( WelcomeNotice::NOTICE_OPTION );
30
  OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OLD_OPTION );
31
  OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OPTION );
32
- OptionsAccessManager::delete_option( AvifSupportNotice::NOTICE_OPTION );
33
  OptionsAccessManager::delete_option( 'webpc_notice_cloudways' );
34
  OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
35
  OptionsAccessManager::delete_option( LitespeedNotice::NOTICE_OPTION );
4
 
5
  use WebpConverter\Conversion\Cron\CronStatusManager;
6
  use WebpConverter\Error\ErrorDetectorAggregator;
 
7
  use WebpConverter\Notice\CloudflareNotice;
8
  use WebpConverter\Notice\LitespeedNotice;
9
  use WebpConverter\Notice\ThanksNotice;
28
  OptionsAccessManager::delete_option( WelcomeNotice::NOTICE_OPTION );
29
  OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OLD_OPTION );
30
  OptionsAccessManager::delete_option( ThanksNotice::NOTICE_OPTION );
31
+ OptionsAccessManager::delete_option( 'webpc_notice_avif_support' );
32
  OptionsAccessManager::delete_option( 'webpc_notice_cloudways' );
33
  OptionsAccessManager::delete_option( CloudflareNotice::NOTICE_OPTION );
34
  OptionsAccessManager::delete_option( LitespeedNotice::NOTICE_OPTION );
src/PluginData.php CHANGED
@@ -23,6 +23,13 @@ class PluginData {
23
  */
24
  private $plugin_settings = null;
25
 
 
 
 
 
 
 
 
26
  /**
27
  * Cached settings of plugin for debug.
28
  *
@@ -37,7 +44,7 @@ class PluginData {
37
  /**
38
  * Returns settings of plugin.
39
  *
40
- * @return mixed[] Settings of plugin.
41
  */
42
  public function get_plugin_settings(): array {
43
  if ( $this->plugin_settings === null ) {
@@ -46,14 +53,26 @@ class PluginData {
46
  return $this->plugin_settings;
47
  }
48
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /**
50
  * Returns settings of plugin for debug.
51
  *
52
- * @return mixed[] Settings of plugin for debug.
53
  */
54
  public function get_debug_settings(): array {
55
  if ( $this->debug_settings === null ) {
56
- $this->debug_settings = $this->settings_object->get_values( true );
57
  }
58
  return $this->debug_settings;
59
  }
@@ -64,7 +83,8 @@ class PluginData {
64
  * @return void
65
  */
66
  public function invalidate_plugin_settings() {
67
- $this->plugin_settings = null;
68
- $this->debug_settings = null;
 
69
  }
70
  }
23
  */
24
  private $plugin_settings = null;
25
 
26
+ /**
27
+ * Cached settings of plugin without sensitive data.
28
+ *
29
+ * @var mixed[]|null
30
+ */
31
+ private $plugin_public_settings = null;
32
+
33
  /**
34
  * Cached settings of plugin for debug.
35
  *
44
  /**
45
  * Returns settings of plugin.
46
  *
47
+ * @return mixed[]
48
  */
49
  public function get_plugin_settings(): array {
50
  if ( $this->plugin_settings === null ) {
53
  return $this->plugin_settings;
54
  }
55
 
56
+ /**
57
+ * Returns settings of plugin without sensitive data.
58
+ *
59
+ * @return mixed[]
60
+ */
61
+ public function get_public_settings(): array {
62
+ if ( $this->plugin_public_settings === null ) {
63
+ $this->plugin_public_settings = $this->settings_object->get_public_values();
64
+ }
65
+ return $this->plugin_public_settings;
66
+ }
67
+
68
  /**
69
  * Returns settings of plugin for debug.
70
  *
71
+ * @return mixed[]
72
  */
73
  public function get_debug_settings(): array {
74
  if ( $this->debug_settings === null ) {
75
+ $this->debug_settings = $this->settings_object->get_values( null, true );
76
  }
77
  return $this->debug_settings;
78
  }
83
  * @return void
84
  */
85
  public function invalidate_plugin_settings() {
86
+ $this->plugin_settings = null;
87
+ $this->plugin_public_settings = null;
88
+ $this->debug_settings = null;
89
  }
90
  }
src/Service/DeactivationModalGenerator.php CHANGED
@@ -6,7 +6,6 @@ use WebpConverter\Error\Notice\LibsNotInstalledNotice;
6
  use WebpConverter\Error\Notice\LibsWithoutWebpSupportNotice;
7
  use WebpConverter\PluginData;
8
  use WebpConverter\PluginInfo;
9
- use WebpConverter\Settings\Option\AccessTokenOption;
10
  use WebpConverter\Settings\Page\PageIntegration;
11
  use WebpConverterVendor\MattPlugins\DeactivationModal;
12
 
@@ -144,13 +143,7 @@ class DeactivationModalGenerator {
144
  new DeactivationModal\Model\FormValue(
145
  'request_plugin_settings',
146
  function () {
147
- $plugin_settings = $this->plugin_data->get_plugin_settings();
148
- $access_token = $plugin_settings[ AccessTokenOption::OPTION_NAME ] ?? '';
149
- if ( $access_token ) {
150
- $plugin_settings[ AccessTokenOption::OPTION_NAME ] = substr( $access_token, 0, 32 ) . str_repeat( '*', 32 );
151
- }
152
-
153
- $settings_json = json_encode( $plugin_settings );
154
  return base64_encode( $settings_json ?: '' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
155
  }
156
  )
6
  use WebpConverter\Error\Notice\LibsWithoutWebpSupportNotice;
7
  use WebpConverter\PluginData;
8
  use WebpConverter\PluginInfo;
 
9
  use WebpConverter\Settings\Page\PageIntegration;
10
  use WebpConverterVendor\MattPlugins\DeactivationModal;
11
 
143
  new DeactivationModal\Model\FormValue(
144
  'request_plugin_settings',
145
  function () {
146
+ $settings_json = json_encode( $this->plugin_data->get_public_settings() );
 
 
 
 
 
 
147
  return base64_encode( $settings_json ?: '' ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
148
  }
149
  )
src/Settings/Option/AccessTokenOption.php CHANGED
@@ -24,15 +24,15 @@ class AccessTokenOption extends OptionAbstract {
24
  /**
25
  * {@inheritdoc}
26
  */
27
- public function get_priority(): int {
28
- return 30;
29
  }
30
 
31
  /**
32
  * {@inheritdoc}
33
  */
34
- public function get_name(): string {
35
- return self::OPTION_NAME;
36
  }
37
 
38
  /**
@@ -64,7 +64,7 @@ class AccessTokenOption extends OptionAbstract {
64
 
65
  return sprintf(
66
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
67
- __( 'Provide a valid value to access %1$sthe PRO functionalities%2$s. You can find out more about it %3$shere%4$s.', 'webp-converter-for-media' ),
68
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-access-token-pro-features' ) ) . '" target="_blank">',
69
  '</a>',
70
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-access-token-upgrade' ) ) . '" target="_blank">',
@@ -77,14 +77,32 @@ class AccessTokenOption extends OptionAbstract {
77
  *
78
  * @return string[]
79
  */
80
- public function get_values( array $settings ): array {
81
  return [];
82
  }
83
 
 
 
 
 
 
 
 
84
  /**
85
  * {@inheritdoc}
86
  */
87
  public function get_default_value( array $settings = null ): string {
88
  return '';
89
  }
 
 
 
 
 
 
 
 
 
 
 
90
  }
24
  /**
25
  * {@inheritdoc}
26
  */
27
+ public function get_name(): string {
28
+ return self::OPTION_NAME;
29
  }
30
 
31
  /**
32
  * {@inheritdoc}
33
  */
34
+ public function get_form_name(): string {
35
+ return OptionAbstract::FORM_TYPE_SIDEBAR;
36
  }
37
 
38
  /**
64
 
65
  return sprintf(
66
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
67
+ __( 'Provide a valid token to access %1$sthe PRO functionalities%2$s. You can find out more about it %3$shere%4$s.', 'webp-converter-for-media' ),
68
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-access-token-pro-features' ) ) . '" target="_blank">',
69
  '</a>',
70
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-access-token-upgrade' ) ) . '" target="_blank">',
77
  *
78
  * @return string[]
79
  */
80
+ public function get_available_values( array $settings ): array {
81
  return [];
82
  }
83
 
84
+ /**
85
+ * {@inheritdoc}
86
+ */
87
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ): string {
88
+ return sanitize_text_field( $current_value );
89
+ }
90
+
91
  /**
92
  * {@inheritdoc}
93
  */
94
  public function get_default_value( array $settings = null ): string {
95
  return '';
96
  }
97
+
98
+ /**
99
+ * {@inheritdoc}
100
+ */
101
+ public function get_public_value( $current_value = null ) {
102
+ if ( $current_value === null ) {
103
+ return $current_value;
104
+ }
105
+
106
+ return substr( $current_value, 0, 32 ) . str_repeat( '*', max( ( strlen( $current_value ) - 32 ), 0 ) );
107
+ }
108
  }
src/Settings/Option/AutoConversionOption.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Settings\Option;
4
+
5
+ /**
6
+ * {@inheritdoc}
7
+ */
8
+ class AutoConversionOption extends OptionAbstract {
9
+
10
+ const OPTION_NAME = 'auto_conversion';
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function get_name(): string {
16
+ return self::OPTION_NAME;
17
+ }
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get_form_name(): string {
23
+ return OptionAbstract::FORM_TYPE_BASIC;
24
+ }
25
+
26
+ /**
27
+ * {@inheritdoc}
28
+ */
29
+ public function get_type(): string {
30
+ return OptionAbstract::OPTION_TYPE_TOGGLE;
31
+ }
32
+
33
+ /**
34
+ * {@inheritdoc}
35
+ */
36
+ public function get_label(): string {
37
+ return __( 'Conversion of new images', 'webp-converter-for-media' );
38
+ }
39
+
40
+ /**
41
+ * {@inheritdoc}
42
+ */
43
+ public function get_info(): string {
44
+ return __( 'Automatically convert new images when uploading to Media Library', 'webp-converter-for-media' );
45
+ }
46
+
47
+ /**
48
+ * {@inheritdoc}
49
+ */
50
+ public function get_available_values( array $settings ) {
51
+ return null;
52
+ }
53
+
54
+ /**
55
+ * {@inheritdoc}
56
+ */
57
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
58
+ return ( $current_value === 'yes' ) ? 'yes' : '';
59
+ }
60
+
61
+ /**
62
+ * {@inheritdoc}
63
+ */
64
+ public function get_default_value( array $settings = null ): string {
65
+ return 'yes';
66
+ }
67
+ }
src/Settings/Option/ConversionMethodOption.php CHANGED
@@ -33,15 +33,15 @@ class ConversionMethodOption extends OptionAbstract {
33
  /**
34
  * {@inheritdoc}
35
  */
36
- public function get_priority(): int {
37
- return 50;
38
  }
39
 
40
  /**
41
  * {@inheritdoc}
42
  */
43
- public function get_name(): string {
44
- return self::OPTION_NAME;
45
  }
46
 
47
  /**
@@ -71,7 +71,7 @@ class ConversionMethodOption extends OptionAbstract {
71
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
72
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
73
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-info' ) ) . '" target="_blank">',
74
- '<span class="dashicons dashicons-arrow-right-alt"></span></a>'
75
  );
76
  }
77
  return $notice;
@@ -82,7 +82,7 @@ class ConversionMethodOption extends OptionAbstract {
82
  *
83
  * @return string[]
84
  */
85
- public function get_values( array $settings ): array {
86
  return $this->methods_integration->get_methods();
87
  }
88
 
@@ -97,6 +97,18 @@ class ConversionMethodOption extends OptionAbstract {
97
  return array_keys( array_diff( $methods, $methods_available ) );
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  /**
101
  * {@inheritdoc}
102
  */
33
  /**
34
  * {@inheritdoc}
35
  */
36
+ public function get_name(): string {
37
+ return self::OPTION_NAME;
38
  }
39
 
40
  /**
41
  * {@inheritdoc}
42
  */
43
+ public function get_form_name(): string {
44
+ return OptionAbstract::FORM_TYPE_ADVANCED;
45
  }
46
 
47
  /**
71
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
72
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
73
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-conversion-method-info' ) ) . '" target="_blank">',
74
+ ' <span class="dashicons dashicons-arrow-right-alt"></span></a>'
75
  );
76
  }
77
  return $notice;
82
  *
83
  * @return string[]
84
  */
85
+ public function get_available_values( array $settings ): array {
86
  return $this->methods_integration->get_methods();
87
  }
88
 
97
  return array_keys( array_diff( $methods, $methods_available ) );
98
  }
99
 
100
+ /**
101
+ * {@inheritdoc}
102
+ */
103
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
104
+ if ( ! array_key_exists( $current_value, $available_values ?: [] )
105
+ || in_array( $current_value, $disabled_values ?: [] ) ) {
106
+ return null;
107
+ }
108
+
109
+ return $current_value;
110
+ }
111
+
112
  /**
113
  * {@inheritdoc}
114
  */
src/Settings/Option/ExtraFeaturesOption.php CHANGED
@@ -18,15 +18,15 @@ class ExtraFeaturesOption extends OptionAbstract {
18
  /**
19
  * {@inheritdoc}
20
  */
21
- public function get_priority(): int {
22
- return 90;
23
  }
24
 
25
  /**
26
  * {@inheritdoc}
27
  */
28
- public function get_name(): string {
29
- return self::OPTION_NAME;
30
  }
31
 
32
  /**
@@ -55,7 +55,7 @@ class ExtraFeaturesOption extends OptionAbstract {
55
  *
56
  * @return string[]
57
  */
58
- public function get_values( array $settings ): array {
59
  return [
60
  self::OPTION_VALUE_ONLY_SMALLER => __(
61
  'Automatic removal of files in output formats larger than original',
@@ -89,6 +89,21 @@ class ExtraFeaturesOption extends OptionAbstract {
89
  return $values;
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  * {@inheritdoc}
94
  *
18
  /**
19
  * {@inheritdoc}
20
  */
21
+ public function get_name(): string {
22
+ return self::OPTION_NAME;
23
  }
24
 
25
  /**
26
  * {@inheritdoc}
27
  */
28
+ public function get_form_name(): string {
29
+ return OptionAbstract::FORM_TYPE_ADVANCED;
30
  }
31
 
32
  /**
55
  *
56
  * @return string[]
57
  */
58
+ public function get_available_values( array $settings ): array {
59
  return [
60
  self::OPTION_VALUE_ONLY_SMALLER => __(
61
  'Automatic removal of files in output formats larger than original',
89
  return $values;
90
  }
91
 
92
+ /**
93
+ * {@inheritdoc}
94
+ */
95
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
96
+ $valid_values = [];
97
+ foreach ( $current_value as $option_value ) {
98
+ if ( array_key_exists( $option_value, $available_values ?: [] )
99
+ && ! in_array( $option_value, $disabled_values ?: [] ) ) {
100
+ $valid_values[] = $option_value;
101
+ }
102
+ }
103
+
104
+ return $valid_values;
105
+ }
106
+
107
  /**
108
  * {@inheritdoc}
109
  *
src/Settings/Option/ImageResizeOption.php CHANGED
@@ -24,15 +24,15 @@ class ImageResizeOption extends OptionAbstract {
24
  /**
25
  * {@inheritdoc}
26
  */
27
- public function get_priority(): int {
28
- return 70;
29
  }
30
 
31
  /**
32
  * {@inheritdoc}
33
  */
34
- public function get_name(): string {
35
- return self::OPTION_NAME;
36
  }
37
 
38
  /**
@@ -57,11 +57,14 @@ class ImageResizeOption extends OptionAbstract {
57
 
58
  if ( ! $this->token_repository->get_token()->get_valid_status() ) {
59
  return sprintf(
60
- /* translators: %1$s: option name, %2$s: open anchor tag, %3$s: close anchor tag */
61
- __( '%1$s (available in %2$sthe PRO version%3$s)', 'webp-converter-for-media' ),
62
  $message,
63
- '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-upgrade' ) ) . '" target="_blank">',
64
- '</a>'
 
 
 
 
65
  );
66
  }
67
  return $message;
@@ -71,23 +74,13 @@ class ImageResizeOption extends OptionAbstract {
71
  * {@inheritdoc}
72
  */
73
  public function get_notice_lines() {
74
- $sizes = wp_get_additional_image_sizes();
75
- usort(
76
- $sizes,
77
- function ( $a, $b ) {
78
- if ( $a['width'] === $a['height'] ) {
79
- return $b['height'] - $a['height'];
80
- }
81
- return $b['width'] - $a['width'];
82
- }
83
- );
84
-
85
  $notice = [
86
  sprintf(
87
  /* translators: %1$s: width value, %2$s: height value */
88
- __( 'Reduce even more the weight of converted images that are larger than their largest image size (thumbnail size) using in your theme. The recommended value for you is %1$s x %2$s pixels.', 'webp-converter-for-media' ),
89
- $sizes[0]['width'] ?? 0,
90
- $sizes[0]['height'] ?? 0
91
  ),
92
  ];
93
 
@@ -96,7 +89,7 @@ class ImageResizeOption extends OptionAbstract {
96
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
97
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
98
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-info' ) ) . '" target="_blank">',
99
- '<span class="dashicons dashicons-arrow-right-alt"></span></a>'
100
  );
101
  }
102
  return $notice;
@@ -107,7 +100,7 @@ class ImageResizeOption extends OptionAbstract {
107
  *
108
  * @return string[]
109
  */
110
- public function get_values( array $settings ): array {
111
  return [];
112
  }
113
 
@@ -116,19 +109,59 @@ class ImageResizeOption extends OptionAbstract {
116
  *
117
  * @return string[]
118
  */
119
- public function get_default_value( array $settings = null ): array {
120
- return [ '', '', '' ];
 
 
 
121
  }
122
 
123
  /**
124
  * {@inheritdoc}
125
- *
126
- * @return string[]
127
  */
128
- public function get_disabled_values( array $settings ): array {
129
- if ( ! $this->token_repository->get_token()->get_valid_status() ) {
130
- return [ 'yes' ];
131
  }
132
- return [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
  }
24
  /**
25
  * {@inheritdoc}
26
  */
27
+ public function get_name(): string {
28
+ return self::OPTION_NAME;
29
  }
30
 
31
  /**
32
  * {@inheritdoc}
33
  */
34
+ public function get_form_name(): string {
35
+ return OptionAbstract::FORM_TYPE_BASIC;
36
  }
37
 
38
  /**
57
 
58
  if ( ! $this->token_repository->get_token()->get_valid_status() ) {
59
  return sprintf(
60
+ '%1$s (%2$s)',
 
61
  $message,
62
+ sprintf(
63
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
64
+ __( 'available in %1$sthe PRO version%2$s', 'webp-converter-for-media' ),
65
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-upgrade' ) ) . '" target="_blank">',
66
+ '</a>'
67
+ )
68
  );
69
  }
70
  return $message;
74
  * {@inheritdoc}
75
  */
76
  public function get_notice_lines() {
77
+ $size = $this->get_max_image_size();
 
 
 
 
 
 
 
 
 
 
78
  $notice = [
79
  sprintf(
80
  /* translators: %1$s: width value, %2$s: height value */
81
+ __( 'Reduce the weight of converted images that are larger than their largest image size (thumbnail size) used in your theme even more. The recommended value for you is %1$s x %2$s pixels.', 'webp-converter-for-media' ),
82
+ $size['width'],
83
+ $size['height']
84
  ),
85
  ];
86
 
89
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
90
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
91
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-image-resize-info' ) ) . '" target="_blank">',
92
+ ' <span class="dashicons dashicons-arrow-right-alt"></span></a>'
93
  );
94
  }
95
  return $notice;
100
  *
101
  * @return string[]
102
  */
103
+ public function get_available_values( array $settings ): array {
104
  return [];
105
  }
106
 
109
  *
110
  * @return string[]
111
  */
112
+ public function get_disabled_values( array $settings ): array {
113
+ if ( ! $this->token_repository->get_token()->get_valid_status() ) {
114
+ return [ 'yes' ];
115
+ }
116
+ return [];
117
  }
118
 
119
  /**
120
  * {@inheritdoc}
 
 
121
  */
122
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
123
+ if ( ! is_array( $current_value ) ) {
124
+ return [ '', '', '' ];
125
  }
126
+
127
+ $value_min = intval( $current_value[1] ?? '' );
128
+ $value_max = intval( $current_value[2] ?? '' );
129
+
130
+ return [
131
+ ( ( $current_value[0] ?? '' ) === 'yes' ) ? 'yes' : '',
132
+ ( $value_min <= 1 ) ? '' : (string) $value_min,
133
+ ( $value_max <= 1 ) ? '' : (string) $value_max,
134
+ ];
135
+ }
136
+
137
+ /**
138
+ * {@inheritdoc}
139
+ *
140
+ * @return mixed[]
141
+ */
142
+ public function get_default_value( array $settings = null ): array {
143
+ $size = $this->get_max_image_size();
144
+ return [ '', $size['width'], $size['height'] ];
145
+ }
146
+
147
+ /**
148
+ * @return int[]
149
+ */
150
+ private function get_max_image_size(): array {
151
+ $sizes = wp_get_additional_image_sizes();
152
+ usort(
153
+ $sizes,
154
+ function ( $a, $b ) {
155
+ if ( $a['width'] === $a['height'] ) {
156
+ return $b['height'] - $a['height'];
157
+ }
158
+ return $b['width'] - $a['width'];
159
+ }
160
+ );
161
+
162
+ return [
163
+ 'width' => $sizes[0]['width'] ?? 0,
164
+ 'height' => $sizes[0]['height'] ?? 0,
165
+ ];
166
  }
167
  }
src/Settings/Option/ImagesQualityOption.php CHANGED
@@ -12,15 +12,15 @@ class ImagesQualityOption extends OptionAbstract {
12
  /**
13
  * {@inheritdoc}
14
  */
15
- public function get_priority(): int {
16
- return 60;
17
  }
18
 
19
  /**
20
  * {@inheritdoc}
21
  */
22
- public function get_name(): string {
23
- return self::OPTION_NAME;
24
  }
25
 
26
  /**
@@ -34,14 +34,7 @@ class ImagesQualityOption extends OptionAbstract {
34
  * {@inheritdoc}
35
  */
36
  public function get_label(): string {
37
- return __( 'Images quality', 'webp-converter-for-media' );
38
- }
39
-
40
- /**
41
- * {@inheritdoc}
42
- */
43
- public function get_info(): string {
44
- return __( 'Adjust the quality of the images being converted. Remember that higher quality also means larger file sizes. The recommended value is 85%.', 'webp-converter-for-media' );
45
  }
46
 
47
  /**
@@ -49,10 +42,10 @@ class ImagesQualityOption extends OptionAbstract {
49
  *
50
  * @return string[]
51
  */
52
- public function get_values( array $settings ): array {
53
  $levels = apply_filters(
54
  'webpc_option_quality_levels',
55
- [ '75', '80', '85', '90', '95', '100' ]
56
  );
57
 
58
  $values = [];
@@ -66,6 +59,17 @@ class ImagesQualityOption extends OptionAbstract {
66
  return $values;
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * {@inheritdoc}
71
  */
12
  /**
13
  * {@inheritdoc}
14
  */
15
+ public function get_name(): string {
16
+ return self::OPTION_NAME;
17
  }
18
 
19
  /**
20
  * {@inheritdoc}
21
  */
22
+ public function get_form_name(): string {
23
+ return OptionAbstract::FORM_TYPE_BASIC;
24
  }
25
 
26
  /**
34
  * {@inheritdoc}
35
  */
36
  public function get_label(): string {
37
+ return __( 'Conversion strategy', 'webp-converter-for-media' );
 
 
 
 
 
 
 
38
  }
39
 
40
  /**
42
  *
43
  * @return string[]
44
  */
45
+ public function get_available_values( array $settings ): array {
46
  $levels = apply_filters(
47
  'webpc_option_quality_levels',
48
+ [ '75', '80', '85', '90', '95' ]
49
  );
50
 
51
  $values = [];
59
  return $values;
60
  }
61
 
62
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
63
+ if ( $current_value === '100' ) {
64
+ return '95';
65
+ } elseif ( ! array_key_exists( $current_value, $available_values ?: [] )
66
+ || in_array( $current_value, $disabled_values ?: [] ) ) {
67
+ return null;
68
+ }
69
+
70
+ return $current_value;
71
+ }
72
+
73
  /**
74
  * {@inheritdoc}
75
  */
src/Settings/Option/LoaderTypeOption.php CHANGED
@@ -15,15 +15,15 @@ class LoaderTypeOption extends OptionAbstract {
15
  /**
16
  * {@inheritdoc}
17
  */
18
- public function get_priority(): int {
19
- return 80;
20
  }
21
 
22
  /**
23
  * {@inheritdoc}
24
  */
25
- public function get_name(): string {
26
- return self::OPTION_NAME;
27
  }
28
 
29
  /**
@@ -52,7 +52,7 @@ class LoaderTypeOption extends OptionAbstract {
52
  *
53
  * @return string[]
54
  */
55
- public function get_values( array $settings ): array {
56
  return [
57
  HtaccessLoader::LOADER_TYPE => sprintf(
58
  /* translators: %s: loader type */
@@ -67,6 +67,18 @@ class LoaderTypeOption extends OptionAbstract {
67
  ];
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * {@inheritdoc}
72
  */
15
  /**
16
  * {@inheritdoc}
17
  */
18
+ public function get_name(): string {
19
+ return self::OPTION_NAME;
20
  }
21
 
22
  /**
23
  * {@inheritdoc}
24
  */
25
+ public function get_form_name(): string {
26
+ return OptionAbstract::FORM_TYPE_ADVANCED;
27
  }
28
 
29
  /**
52
  *
53
  * @return string[]
54
  */
55
+ public function get_available_values( array $settings ): array {
56
  return [
57
  HtaccessLoader::LOADER_TYPE => sprintf(
58
  /* translators: %s: loader type */
67
  ];
68
  }
69
 
70
+ /**
71
+ * {@inheritdoc}
72
+ */
73
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
74
+ if ( ! array_key_exists( $current_value, $available_values ?: [] )
75
+ || in_array( $current_value, $disabled_values ?: [] ) ) {
76
+ return null;
77
+ }
78
+
79
+ return $current_value;
80
+ }
81
+
82
  /**
83
  * {@inheritdoc}
84
  */
src/Settings/Option/OptionAbstract.php CHANGED
@@ -13,6 +13,11 @@ abstract class OptionAbstract implements OptionInterface {
13
  const OPTION_TYPE_INPUT = 'input';
14
  const OPTION_TYPE_TOKEN = 'token';
15
  const OPTION_TYPE_IMAGE_SIZE = 'image_size';
 
 
 
 
 
16
 
17
  /**
18
  * {@inheritdoc}
@@ -38,16 +43,14 @@ abstract class OptionAbstract implements OptionInterface {
38
  /**
39
  * {@inheritdoc}
40
  */
41
- public function get_disabled_values( array $settings ) {
42
- return null;
43
  }
44
 
45
  /**
46
- * @param string|string[] $current_value .
47
- *
48
- * @return string|string[]
49
  */
50
- public function parse_value( $current_value ) {
51
- return $current_value;
52
  }
53
  }
13
  const OPTION_TYPE_INPUT = 'input';
14
  const OPTION_TYPE_TOKEN = 'token';
15
  const OPTION_TYPE_IMAGE_SIZE = 'image_size';
16
+ const OPTION_TYPE_TOGGLE = 'toggle';
17
+ const FORM_TYPE_BASIC = 'basic';
18
+ const FORM_TYPE_ADVANCED = 'settings_advanced';
19
+ const FORM_TYPE_CLOUDFLARE = 'settings_cloudflare';
20
+ const FORM_TYPE_SIDEBAR = 'settings_sidebar';
21
 
22
  /**
23
  * {@inheritdoc}
43
  /**
44
  * {@inheritdoc}
45
  */
46
+ public function get_public_value( $current_value = null ) {
47
+ return $current_value;
48
  }
49
 
50
  /**
51
+ * {@inheritdoc}
 
 
52
  */
53
+ public function get_disabled_values( array $settings ) {
54
+ return null;
55
  }
56
  }
src/Settings/Option/OptionIntegration.php CHANGED
@@ -33,17 +33,18 @@ class OptionIntegration {
33
  public function get_option_data( array $settings, bool $is_debug, bool $is_save ): array {
34
  $option_name = $this->option->get_name();
35
  $option_type = $this->option->get_type();
36
- $values = $this->option->get_values( $settings );
37
  $disabled_values = $this->option->get_disabled_values( $settings );
38
 
39
  if ( $is_debug ) {
40
  $value = $this->option->get_debug_value( $settings );
41
  } else {
42
  $value = ( isset( $settings[ $option_name ] ) || $is_save )
43
- ? $this->get_option_value( $settings[ $option_name ] ?? '', $option_type, $values, $disabled_values )
44
- : $this->option->get_default_value( $settings );
45
  }
46
 
 
47
  return [
48
  'name' => $this->option->get_name(),
49
  'type' => $option_type,
@@ -52,58 +53,8 @@ class OptionIntegration {
52
  'info' => $this->option->get_info(),
53
  'values' => $values,
54
  'disabled' => $disabled_values ?: [],
55
- 'value' => $this->option->parse_value(
56
- ( $value !== null ) ? $value : $this->option->get_default_value( $settings )
57
- ),
58
  ];
59
  }
60
-
61
- /**
62
- * Returns value of option based on plugin settings.
63
- *
64
- * @param mixed $current_value Value from plugin settings.
65
- * @param string $option_type Key of option.
66
- * @param string[]|null $values Values of option.
67
- * @param string[]|null $disabled_values Disabled values of option.
68
- *
69
- * @return string[]|string|null Value of option.
70
- */
71
- private function get_option_value( $current_value, string $option_type, array $values = null, array $disabled_values = null ) {
72
- switch ( $option_type ) {
73
- case OptionAbstract::OPTION_TYPE_CHECKBOX:
74
- $valid_values = [];
75
- foreach ( (array) $current_value as $option_value ) {
76
- if ( array_key_exists( $option_value, $values ?: [] )
77
- && ! in_array( $option_value, $disabled_values ?: [] ) ) {
78
- $valid_values[] = $option_value;
79
- }
80
- }
81
- return $valid_values;
82
- case OptionAbstract::OPTION_TYPE_RADIO:
83
- case OptionAbstract::OPTION_TYPE_QUALITY:
84
- if ( array_key_exists( $current_value, $values ?: [] )
85
- && ! in_array( $current_value, $disabled_values ?: [] ) ) {
86
- return $current_value;
87
- }
88
- return null;
89
- case OptionAbstract::OPTION_TYPE_INPUT:
90
- case OptionAbstract::OPTION_TYPE_TOKEN:
91
- return sanitize_text_field( $current_value );
92
- case OptionAbstract::OPTION_TYPE_IMAGE_SIZE:
93
- if ( ! is_array( $current_value ) ) {
94
- return [ '', '', '' ];
95
- }
96
-
97
- $value_min = intval( $current_value[1] ?? '' );
98
- $value_max = intval( $current_value[2] ?? '' );
99
-
100
- return [
101
- ( ( $current_value[0] ?? '' ) === 'yes' ) ? 'yes' : '',
102
- ( $value_min <= 1 ) ? '' : (string) $value_min,
103
- ( $value_max <= 1 ) ? '' : (string) $value_max,
104
- ];
105
- }
106
-
107
- return null;
108
- }
109
  }
33
  public function get_option_data( array $settings, bool $is_debug, bool $is_save ): array {
34
  $option_name = $this->option->get_name();
35
  $option_type = $this->option->get_type();
36
+ $values = $this->option->get_available_values( $settings );
37
  $disabled_values = $this->option->get_disabled_values( $settings );
38
 
39
  if ( $is_debug ) {
40
  $value = $this->option->get_debug_value( $settings );
41
  } else {
42
  $value = ( isset( $settings[ $option_name ] ) || $is_save )
43
+ ? $this->option->get_valid_value( $settings[ $option_name ] ?? null, $values, $disabled_values )
44
+ : null;
45
  }
46
 
47
+ $value = ( $value !== null ) ? $value : $this->option->get_default_value( $settings );
48
  return [
49
  'name' => $this->option->get_name(),
50
  'type' => $option_type,
53
  'info' => $this->option->get_info(),
54
  'values' => $values,
55
  'disabled' => $disabled_values ?: [],
56
+ 'value' => $value,
57
+ 'value_public' => $this->option->get_public_value( $value ),
 
58
  ];
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
src/Settings/Option/OptionInterface.php CHANGED
@@ -8,18 +8,16 @@ namespace WebpConverter\Settings\Option;
8
  interface OptionInterface {
9
 
10
  /**
11
- * Returns order priority (ascending).
12
  *
13
- * @return int
14
  */
15
- public function get_priority(): int;
16
 
17
  /**
18
- * Returns name of option.
19
- *
20
  * @return string
21
  */
22
- public function get_name(): string;
23
 
24
  /**
25
  * Returns type of field.
@@ -48,45 +46,54 @@ interface OptionInterface {
48
  public function get_info();
49
 
50
  /**
51
- * Returns available values for field.
52
  *
 
 
 
 
 
53
  * @param mixed[] $settings Plugin settings.
54
  *
55
  * @return string[]|null
56
  */
57
- public function get_values( array $settings );
58
 
59
  /**
60
- * Returns default value of field.
61
  *
62
- * @param mixed[]|null $settings Plugin settings.
 
 
63
  *
64
- * @return string|string[]
65
  */
66
- public function get_default_value( array $settings = null );
67
 
68
  /**
69
- * Returns default value of field when debugging.
70
  *
71
- * @param mixed[] $settings Plugin settings.
72
  *
73
  * @return string|string[]
74
  */
75
- public function get_debug_value( array $settings );
76
 
77
  /**
78
- * Returns unavailable values for field.
79
  *
80
- * @param mixed[] $settings Plugin settings.
81
  *
82
- * @return string[]|null
83
  */
84
- public function get_disabled_values( array $settings );
85
 
86
  /**
87
- * @param string|string[] $current_value .
 
 
88
  *
89
  * @return string|string[]
90
  */
91
- public function parse_value( $current_value );
92
  }
8
  interface OptionInterface {
9
 
10
  /**
11
+ * Returns name of option.
12
  *
13
+ * @return string
14
  */
15
+ public function get_name(): string;
16
 
17
  /**
 
 
18
  * @return string
19
  */
20
+ public function get_form_name(): string;
21
 
22
  /**
23
  * Returns type of field.
46
  public function get_info();
47
 
48
  /**
49
+ * @param mixed[] $settings Plugin settings.
50
  *
51
+ * @return string[]|null
52
+ */
53
+ public function get_available_values( array $settings );
54
+
55
+ /**
56
  * @param mixed[] $settings Plugin settings.
57
  *
58
  * @return string[]|null
59
  */
60
+ public function get_disabled_values( array $settings );
61
 
62
  /**
63
+ * Returns verified value of field.
64
  *
65
+ * @param mixed|null $current_value .
66
+ * @param string[]|null $available_values .
67
+ * @param string[]|null $disabled_values .
68
  *
69
+ * @return mixed|null
70
  */
71
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null );
72
 
73
  /**
74
+ * Returns default value of field.
75
  *
76
+ * @param mixed[]|null $settings Plugin settings.
77
  *
78
  * @return string|string[]
79
  */
80
+ public function get_default_value( array $settings = null );
81
 
82
  /**
83
+ * Returns value of field without sensitive data.
84
  *
85
+ * @param mixed|null $current_value .
86
  *
87
+ * @return mixed|null
88
  */
89
+ public function get_public_value( $current_value = null );
90
 
91
  /**
92
+ * Returns default value of field when debugging.
93
+ *
94
+ * @param mixed[] $settings Plugin settings.
95
  *
96
  * @return string|string[]
97
  */
98
+ public function get_debug_value( array $settings );
99
  }
src/Settings/Option/OptionsAggregator.php CHANGED
@@ -20,30 +20,34 @@ class OptionsAggregator {
20
  $token_repository = $token_repository ?: new TokenRepository();
21
  $conversion_method = new ConversionMethodOption( $token_repository );
22
 
23
- $this->set_option( new SupportedExtensionsOption() );
 
24
  $this->set_option( new SupportedDirectoriesOption() );
 
 
 
25
  $this->set_option( new AccessTokenOption( $token_repository ) );
26
- $this->set_option( new OutputFormatsOption( $token_repository, $conversion_method ) );
 
27
  $this->set_option( $conversion_method );
28
- $this->set_option( new ImagesQualityOption() );
29
- $this->set_option( new ImageResizeOption( $token_repository ) );
30
  $this->set_option( new LoaderTypeOption() );
31
  $this->set_option( new ExtraFeaturesOption() );
32
  }
33
 
34
  /**
 
 
35
  * @return OptionInterface[]
36
  */
37
- public function get_options(): array {
38
- $options = apply_filters( 'webpc_settings_options', $this->options );
39
-
40
- usort(
41
- $options,
42
- function ( OptionInterface $option_a, OptionInterface $option_b ) {
43
- return $option_a->get_priority() <=> $option_b->get_priority();
44
  }
45
- );
46
- return $options;
 
47
  }
48
 
49
  /**
20
  $token_repository = $token_repository ?: new TokenRepository();
21
  $conversion_method = new ConversionMethodOption( $token_repository );
22
 
23
+ $this->set_option( new ImagesQualityOption() );
24
+ $this->set_option( new OutputFormatsOption( $token_repository, $conversion_method ) );
25
  $this->set_option( new SupportedDirectoriesOption() );
26
+ $this->set_option( new ImageResizeOption( $token_repository ) );
27
+ $this->set_option( new AutoConversionOption() );
28
+
29
  $this->set_option( new AccessTokenOption( $token_repository ) );
30
+
31
+ $this->set_option( new SupportedExtensionsOption() );
32
  $this->set_option( $conversion_method );
 
 
33
  $this->set_option( new LoaderTypeOption() );
34
  $this->set_option( new ExtraFeaturesOption() );
35
  }
36
 
37
  /**
38
+ * @param string|null $form_name .
39
+ *
40
  * @return OptionInterface[]
41
  */
42
+ public function get_options( string $form_name = null ): array {
43
+ $options = [];
44
+ foreach ( $this->options as $option ) {
45
+ if ( ( $form_name === null ) || ( $form_name === $option->get_form_name() ) ) {
46
+ $options[] = $option;
 
 
47
  }
48
+ }
49
+
50
+ return apply_filters( 'webpc_settings_options', $options );
51
  }
52
 
53
  /**
src/Settings/Option/OutputFormatsOption.php CHANGED
@@ -41,15 +41,15 @@ class OutputFormatsOption extends OptionAbstract {
41
  /**
42
  * {@inheritdoc}
43
  */
44
- public function get_priority(): int {
45
- return 40;
46
  }
47
 
48
  /**
49
  * {@inheritdoc}
50
  */
51
- public function get_name(): string {
52
- return self::OPTION_NAME;
53
  }
54
 
55
  /**
@@ -71,7 +71,7 @@ class OutputFormatsOption extends OptionAbstract {
71
  */
72
  public function get_notice_lines() {
73
  $notice = [
74
- __( 'The AVIF format is a new extension - is the successor to WebP. It allows you to achieve even higher levels of image compression, and the quality of the converted images is better than in WebP.', 'webp-converter-for-media' ),
75
  ];
76
 
77
  if ( $this->token_repository->get_token()->get_token_value() === null ) {
@@ -79,7 +79,7 @@ class OutputFormatsOption extends OptionAbstract {
79
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
80
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
81
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-info' ) ) . '" target="_blank">',
82
- '<span class="dashicons dashicons-arrow-right-alt"></span></a>'
83
  );
84
  }
85
  return $notice;
@@ -90,7 +90,7 @@ class OutputFormatsOption extends OptionAbstract {
90
  *
91
  * @return string[]
92
  */
93
- public function get_values( array $settings ): array {
94
  return $this->formats_integration->get_formats();
95
  }
96
 
@@ -99,23 +99,30 @@ class OutputFormatsOption extends OptionAbstract {
99
  *
100
  * @return string[]
101
  */
102
- public function get_default_value( array $settings = null ): array {
103
  $method = $settings[ ConversionMethodOption::OPTION_NAME ] ?? null;
104
- if ( ! $method ) {
105
  $method = $this->conversion_method_option->get_default_value( $settings );
106
  }
107
- $formats = array_keys( $this->formats_integration->get_available_formats( $method ) );
 
108
 
109
- return ( in_array( WebpFormat::FORMAT_EXTENSION, $formats ) ) ? [ WebpFormat::FORMAT_EXTENSION ] : [];
110
  }
111
 
112
  /**
113
  * {@inheritdoc}
114
- *
115
- * @return string[]
116
  */
117
- public function get_debug_value( array $settings ): array {
118
- return [ WebpFormat::FORMAT_EXTENSION, AvifFormat::FORMAT_EXTENSION ];
 
 
 
 
 
 
 
 
119
  }
120
 
121
  /**
@@ -123,14 +130,22 @@ class OutputFormatsOption extends OptionAbstract {
123
  *
124
  * @return string[]
125
  */
126
- public function get_disabled_values( array $settings ): array {
127
  $method = $settings[ ConversionMethodOption::OPTION_NAME ] ?? null;
128
- if ( ! $method || in_array( $method, $this->conversion_method_option->get_disabled_values( $settings ) ) ) {
129
  $method = $this->conversion_method_option->get_default_value( $settings );
130
  }
131
- $formats = $this->formats_integration->get_formats();
132
- $formats_available = $this->formats_integration->get_available_formats( $method );
133
 
134
- return array_keys( array_diff( $formats, $formats_available ) );
 
 
 
 
 
 
 
 
 
135
  }
136
  }
41
  /**
42
  * {@inheritdoc}
43
  */
44
+ public function get_name(): string {
45
+ return self::OPTION_NAME;
46
  }
47
 
48
  /**
49
  * {@inheritdoc}
50
  */
51
+ public function get_form_name(): string {
52
+ return OptionAbstract::FORM_TYPE_BASIC;
53
  }
54
 
55
  /**
71
  */
72
  public function get_notice_lines() {
73
  $notice = [
74
+ __( 'The AVIF format is a new extension - it is the successor to WebP. It allows you to achieve even higher levels of image compression, and the quality of the converted images is better than in WebP.', 'webp-converter-for-media' ),
75
  ];
76
 
77
  if ( $this->token_repository->get_token()->get_token_value() === null ) {
79
  /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
80
  __( '%1$sUpgrade to PRO%2$s', 'webp-converter-for-media' ),
81
  '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'field-output-formats-info' ) ) . '" target="_blank">',
82
+ ' <span class="dashicons dashicons-arrow-right-alt"></span></a>'
83
  );
84
  }
85
  return $notice;
90
  *
91
  * @return string[]
92
  */
93
+ public function get_available_values( array $settings ): array {
94
  return $this->formats_integration->get_formats();
95
  }
96
 
99
  *
100
  * @return string[]
101
  */
102
+ public function get_disabled_values( array $settings ): array {
103
  $method = $settings[ ConversionMethodOption::OPTION_NAME ] ?? null;
104
+ if ( ! $method || in_array( $method, $this->conversion_method_option->get_disabled_values( $settings ) ) ) {
105
  $method = $this->conversion_method_option->get_default_value( $settings );
106
  }
107
+ $formats = $this->formats_integration->get_formats();
108
+ $formats_available = $this->formats_integration->get_available_formats( $method );
109
 
110
+ return array_keys( array_diff( $formats, $formats_available ) );
111
  }
112
 
113
  /**
114
  * {@inheritdoc}
 
 
115
  */
116
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
117
+ $valid_values = [];
118
+ foreach ( $current_value as $option_value ) {
119
+ if ( array_key_exists( $option_value, $available_values ?: [] )
120
+ && ! in_array( $option_value, $disabled_values ?: [] ) ) {
121
+ $valid_values[] = $option_value;
122
+ }
123
+ }
124
+
125
+ return $valid_values;
126
  }
127
 
128
  /**
130
  *
131
  * @return string[]
132
  */
133
+ public function get_default_value( array $settings = null ): array {
134
  $method = $settings[ ConversionMethodOption::OPTION_NAME ] ?? null;
135
+ if ( ! $method ) {
136
  $method = $this->conversion_method_option->get_default_value( $settings );
137
  }
138
+ $formats = array_keys( $this->formats_integration->get_available_formats( $method ) );
 
139
 
140
+ return ( in_array( WebpFormat::FORMAT_EXTENSION, $formats ) ) ? [ WebpFormat::FORMAT_EXTENSION ] : [];
141
+ }
142
+
143
+ /**
144
+ * {@inheritdoc}
145
+ *
146
+ * @return string[]
147
+ */
148
+ public function get_debug_value( array $settings ): array {
149
+ return [ WebpFormat::FORMAT_EXTENSION, AvifFormat::FORMAT_EXTENSION ];
150
  }
151
  }
src/Settings/Option/SupportedDirectoriesOption.php CHANGED
@@ -14,15 +14,15 @@ class SupportedDirectoriesOption extends OptionAbstract {
14
  /**
15
  * {@inheritdoc}
16
  */
17
- public function get_priority(): int {
18
- return 20;
19
  }
20
 
21
  /**
22
  * {@inheritdoc}
23
  */
24
- public function get_name(): string {
25
- return self::OPTION_NAME;
26
  }
27
 
28
  /**
@@ -51,10 +51,25 @@ class SupportedDirectoriesOption extends OptionAbstract {
51
  *
52
  * @return string[]
53
  */
54
- public function get_values( array $settings ): array {
55
  return ( new DirectoryFactory() )->get_directories();
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * {@inheritdoc}
60
  *
14
  /**
15
  * {@inheritdoc}
16
  */
17
+ public function get_name(): string {
18
+ return self::OPTION_NAME;
19
  }
20
 
21
  /**
22
  * {@inheritdoc}
23
  */
24
+ public function get_form_name(): string {
25
+ return OptionAbstract::FORM_TYPE_BASIC;
26
  }
27
 
28
  /**
51
  *
52
  * @return string[]
53
  */
54
+ public function get_available_values( array $settings ): array {
55
  return ( new DirectoryFactory() )->get_directories();
56
  }
57
 
58
+ /**
59
+ * {@inheritdoc}
60
+ */
61
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
62
+ $valid_values = [];
63
+ foreach ( $current_value as $option_value ) {
64
+ if ( array_key_exists( $option_value, $available_values ?: [] )
65
+ && ! in_array( $option_value, $disabled_values ?: [] ) ) {
66
+ $valid_values[] = $option_value;
67
+ }
68
+ }
69
+
70
+ return $valid_values;
71
+ }
72
+
73
  /**
74
  * {@inheritdoc}
75
  *
src/Settings/Option/SupportedExtensionsOption.php CHANGED
@@ -12,15 +12,15 @@ class SupportedExtensionsOption extends OptionAbstract {
12
  /**
13
  * {@inheritdoc}
14
  */
15
- public function get_priority(): int {
16
- return 10;
17
  }
18
 
19
  /**
20
  * {@inheritdoc}
21
  */
22
- public function get_name(): string {
23
- return self::OPTION_NAME;
24
  }
25
 
26
  /**
@@ -49,7 +49,7 @@ class SupportedExtensionsOption extends OptionAbstract {
49
  *
50
  * @return string[]
51
  */
52
- public function get_values( array $settings ): array {
53
  return [
54
  'jpg' => '.jpg / .jpeg',
55
  'png' => '.png',
@@ -64,11 +64,20 @@ class SupportedExtensionsOption extends OptionAbstract {
64
 
65
  /**
66
  * {@inheritdoc}
67
- *
68
- * @return string[]
69
  */
70
- public function get_default_value( array $settings = null ): array {
71
- return [ 'jpg', 'png' ];
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
 
74
  /**
@@ -76,19 +85,16 @@ class SupportedExtensionsOption extends OptionAbstract {
76
  *
77
  * @return string[]
78
  */
79
- public function get_debug_value( array $settings ): array {
80
- return [ 'png2', 'png' ];
81
  }
82
 
83
  /**
84
- * @param string[] $current_value .
85
  *
86
  * @return string[]
87
  */
88
- public function parse_value( $current_value ): array {
89
- if ( in_array( 'jpg', $current_value ) ) {
90
- $current_value[] = 'jpeg';
91
- }
92
- return $current_value;
93
  }
94
  }
12
  /**
13
  * {@inheritdoc}
14
  */
15
+ public function get_name(): string {
16
+ return self::OPTION_NAME;
17
  }
18
 
19
  /**
20
  * {@inheritdoc}
21
  */
22
+ public function get_form_name(): string {
23
+ return OptionAbstract::FORM_TYPE_ADVANCED;
24
  }
25
 
26
  /**
49
  *
50
  * @return string[]
51
  */
52
+ public function get_available_values( array $settings ): array {
53
  return [
54
  'jpg' => '.jpg / .jpeg',
55
  'png' => '.png',
64
 
65
  /**
66
  * {@inheritdoc}
 
 
67
  */
68
+ public function get_valid_value( $current_value, array $available_values = null, array $disabled_values = null ) {
69
+ $valid_values = [];
70
+ foreach ( $current_value as $option_value ) {
71
+ if ( array_key_exists( $option_value, $available_values ?: [] )
72
+ && ! in_array( $option_value, $disabled_values ?: [] ) ) {
73
+ $valid_values[] = $option_value;
74
+ }
75
+ }
76
+ if ( in_array( 'jpg', $current_value ) ) {
77
+ $valid_values[] = 'jpeg';
78
+ }
79
+
80
+ return $valid_values;
81
  }
82
 
83
  /**
85
  *
86
  * @return string[]
87
  */
88
+ public function get_default_value( array $settings = null ): array {
89
+ return [ 'jpg', 'png', 'webp' ];
90
  }
91
 
92
  /**
93
+ * {@inheritdoc}
94
  *
95
  * @return string[]
96
  */
97
+ public function get_debug_value( array $settings ): array {
98
+ return [ 'png2', 'png' ];
 
 
 
99
  }
100
  }
src/Settings/Page/AdvancedSettingsPage.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace WebpConverter\Settings\Page;
5
+
6
+ use WebpConverter\Settings\Option\OptionAbstract;
7
+ use WebpConverter\Settings\PluginOptions;
8
+
9
+ /**
10
+ * {@inheritdoc}
11
+ */
12
+ class AdvancedSettingsPage extends GeneralSettingsPage {
13
+
14
+ const PAGE_SLUG = 'advanced';
15
+
16
+ /**
17
+ * {@inheritdoc}
18
+ */
19
+ public function get_slug(): string {
20
+ return self::PAGE_SLUG;
21
+ }
22
+
23
+ /**
24
+ * {@inheritdoc}
25
+ */
26
+ public function get_label(): string {
27
+ return __( 'Advanced Settings', 'webp-converter-for-media' );
28
+ }
29
+
30
+ /**
31
+ * {@inheritdoc}
32
+ */
33
+ public function get_template_vars(): array {
34
+ return array_merge(
35
+ parent::get_template_vars(),
36
+ [
37
+ 'form_options' => ( new PluginOptions() )->get_options( OptionAbstract::FORM_TYPE_ADVANCED ),
38
+ 'form_input_value' => OptionAbstract::FORM_TYPE_ADVANCED,
39
+ ]
40
+ );
41
+ }
42
+ }
src/Settings/Page/DebugPage.php CHANGED
@@ -8,16 +8,13 @@ use WebpConverter\Loader\LoaderAbstract;
8
  use WebpConverter\PluginData;
9
  use WebpConverter\PluginInfo;
10
  use WebpConverter\Service\FileLoader;
11
- use WebpConverter\Service\OptionsAccessManager;
12
- use WebpConverter\Service\ViewLoader;
13
- use WebpConverter\Settings\Option\AccessTokenOption;
14
- use WebpConverter\Settings\SettingsSave;
15
 
16
  /**
17
- * Supports debug tab in plugin settings page.
18
  */
19
  class DebugPage extends PageAbstract {
20
 
 
21
  const PAGE_VIEW_PATH = 'views/settings-debug.php';
22
 
23
  /**
@@ -25,84 +22,92 @@ class DebugPage extends PageAbstract {
25
  */
26
  private $plugin_info;
27
 
 
 
 
 
 
28
  /**
29
  * @var FileLoader
30
  */
31
  private $file_loader;
32
 
33
  public function __construct(
34
- PluginInfo $plugin_info, PluginData $plugin_data,
 
35
  FileLoader $file_loader = null
36
  ) {
37
  $this->plugin_info = $plugin_info;
 
38
  $this->file_loader = $file_loader ?: new FileLoader( $plugin_info, $plugin_data );
39
  }
40
 
41
  /**
42
  * {@inheritdoc}
43
  */
44
- public function is_page_active(): bool {
45
- return ( isset( $_GET['action'] ) && ( $_GET['action'] === 'server' ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
46
  }
47
 
48
  /**
49
  * {@inheritdoc}
50
  */
51
- public function show_page_view() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  $uploads_url = apply_filters( 'webpc_dir_url', '', 'uploads' );
53
  $uploads_path = apply_filters( 'webpc_dir_path', '', 'uploads' );
54
  $ver_param = time();
55
 
56
  do_action( LoaderAbstract::ACTION_NAME, true, true );
57
 
58
- ( new ViewLoader( $this->plugin_info ) )->load_view(
59
- self::PAGE_VIEW_PATH,
60
- [
61
- 'settings_url' => PageIntegration::get_settings_page_url(),
62
- 'settings_debug_url' => PageIntegration::get_settings_page_url( 'server' ),
63
- 'size_png_path' => $this->file_loader->get_file_size_by_path(
64
- $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG
65
- ),
66
- 'size_png2_path' => $this->file_loader->get_file_size_by_path(
67
- $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2
68
- ),
69
- 'size_png_url' => $this->file_loader->get_file_size_by_url(
70
- $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
71
- false,
72
- $ver_param
73
- ),
74
- 'size_png2_url' => $this->file_loader->get_file_size_by_url(
75
- $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
76
- false,
77
- $ver_param
78
- ),
79
- 'size_png_as_webp_url' => $this->file_loader->get_file_size_by_url(
80
- $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
81
- true,
82
- $ver_param
83
- ),
84
- 'size_png2_as_webp_url' => $this->file_loader->get_file_size_by_url(
85
- $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
86
- true,
87
- $ver_param
88
- ),
89
- 'plugin_settings' => $this->get_plugin_settings(),
90
- ]
91
- );
92
 
93
  do_action( LoaderAbstract::ACTION_NAME, true );
94
- }
95
-
96
- /**
97
- * @return mixed[]
98
- */
99
- private function get_plugin_settings(): array {
100
- $plugin_settings = OptionsAccessManager::get_option( SettingsSave::SETTINGS_OPTION, [] );
101
- $access_token = $plugin_settings[ AccessTokenOption::OPTION_NAME ] ?? '';
102
- if ( $access_token ) {
103
- $plugin_settings[ AccessTokenOption::OPTION_NAME ] = substr( $access_token, 0, 32 ) . str_repeat( '*', 32 );
104
- }
105
-
106
- return $plugin_settings;
107
  }
108
  }
8
  use WebpConverter\PluginData;
9
  use WebpConverter\PluginInfo;
10
  use WebpConverter\Service\FileLoader;
 
 
 
 
11
 
12
  /**
13
+ * {@inheritdoc}
14
  */
15
  class DebugPage extends PageAbstract {
16
 
17
+ const PAGE_SLUG = 'debug';
18
  const PAGE_VIEW_PATH = 'views/settings-debug.php';
19
 
20
  /**
22
  */
23
  private $plugin_info;
24
 
25
+ /**
26
+ * @var PluginData
27
+ */
28
+ private $plugin_data;
29
+
30
  /**
31
  * @var FileLoader
32
  */
33
  private $file_loader;
34
 
35
  public function __construct(
36
+ PluginInfo $plugin_info,
37
+ PluginData $plugin_data,
38
  FileLoader $file_loader = null
39
  ) {
40
  $this->plugin_info = $plugin_info;
41
+ $this->plugin_data = $plugin_data;
42
  $this->file_loader = $file_loader ?: new FileLoader( $plugin_info, $plugin_data );
43
  }
44
 
45
  /**
46
  * {@inheritdoc}
47
  */
48
+ public function get_slug(): string {
49
+ return self::PAGE_SLUG;
50
  }
51
 
52
  /**
53
  * {@inheritdoc}
54
  */
55
+ public function get_label(): string {
56
+ return __( 'Help Center', 'webp-converter-for-media' );
57
+ }
58
+
59
+ /**
60
+ * {@inheritdoc}
61
+ */
62
+ public function get_template_path(): string {
63
+ return self::PAGE_VIEW_PATH;
64
+ }
65
+
66
+ /**
67
+ * {@inheritdoc}
68
+ */
69
+ public function get_template_vars(): array {
70
  $uploads_url = apply_filters( 'webpc_dir_url', '', 'uploads' );
71
  $uploads_path = apply_filters( 'webpc_dir_path', '', 'uploads' );
72
  $ver_param = time();
73
 
74
  do_action( LoaderAbstract::ACTION_NAME, true, true );
75
 
76
+ $data = [
77
+ 'logo_url' => $this->plugin_info->get_plugin_directory_url() . 'assets/img/logo-headline.png',
78
+ 'errors_messages' => apply_filters( 'webpc_server_errors_messages', [] ),
79
+ 'errors_codes' => apply_filters( 'webpc_server_errors', [] ),
80
+ 'size_png_path' => $this->file_loader->get_file_size_by_path(
81
+ $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG
82
+ ),
83
+ 'size_png2_path' => $this->file_loader->get_file_size_by_path(
84
+ $uploads_path . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2
85
+ ),
86
+ 'size_png_url' => $this->file_loader->get_file_size_by_url(
87
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
88
+ false,
89
+ $ver_param
90
+ ),
91
+ 'size_png2_url' => $this->file_loader->get_file_size_by_url(
92
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
93
+ false,
94
+ $ver_param
95
+ ),
96
+ 'size_png_as_webp_url' => $this->file_loader->get_file_size_by_url(
97
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG,
98
+ true,
99
+ $ver_param
100
+ ),
101
+ 'size_png2_as_webp_url' => $this->file_loader->get_file_size_by_url(
102
+ $uploads_url . RewritesErrorsDetector::PATH_OUTPUT_FILE_PNG2,
103
+ true,
104
+ $ver_param
105
+ ),
106
+ 'plugin_settings' => $this->plugin_data->get_public_settings(),
107
+ 'url_debug_page' => PageIntegration::get_settings_page_url( self::PAGE_SLUG ),
108
+ ];
 
109
 
110
  do_action( LoaderAbstract::ACTION_NAME, true );
111
+ return $data;
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  }
src/Settings/Page/GeneralSettingsPage.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace WebpConverter\Settings\Page;
5
+
6
+ use WebpConverter\Conversion\Endpoint\ImagesCounterEndpoint;
7
+ use WebpConverter\Conversion\Endpoint\PathsEndpoint;
8
+ use WebpConverter\Conversion\Endpoint\RegenerateEndpoint;
9
+ use WebpConverter\Loader\LoaderAbstract;
10
+ use WebpConverter\PluginData;
11
+ use WebpConverter\PluginInfo;
12
+ use WebpConverter\Repository\TokenRepository;
13
+ use WebpConverter\Service\NonceManager;
14
+ use WebpConverter\Settings\Option\OptionAbstract;
15
+ use WebpConverter\Settings\PluginOptions;
16
+ use WebpConverter\Settings\SettingsSave;
17
+ use WebpConverter\WebpConverterConstants;
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ class GeneralSettingsPage extends PageAbstract {
23
+
24
+ const PAGE_VIEW_PATH = 'views/settings.php';
25
+
26
+ /**
27
+ * @var PluginInfo
28
+ */
29
+ private $plugin_info;
30
+
31
+ /**
32
+ * @var PluginData
33
+ */
34
+ private $plugin_data;
35
+
36
+ /**
37
+ * @var TokenRepository
38
+ */
39
+ private $token_repository;
40
+
41
+ public function __construct(
42
+ PluginInfo $plugin_info,
43
+ PluginData $plugin_data,
44
+ TokenRepository $token_repository
45
+ ) {
46
+ $this->plugin_info = $plugin_info;
47
+ $this->plugin_data = $plugin_data;
48
+ $this->token_repository = $token_repository;
49
+ }
50
+
51
+ /**
52
+ * {@inheritdoc}
53
+ */
54
+ public function get_slug() {
55
+ return null;
56
+ }
57
+
58
+ /**
59
+ * {@inheritdoc}
60
+ */
61
+ public function get_label(): string {
62
+ return __( 'General Settings', 'webp-converter-for-media' );
63
+ }
64
+
65
+ /**
66
+ * {@inheritdoc}
67
+ */
68
+ public function get_template_path(): string {
69
+ return self::PAGE_VIEW_PATH;
70
+ }
71
+
72
+ /**
73
+ * {@inheritdoc}
74
+ */
75
+ public function get_template_vars(): array {
76
+ ( new SettingsSave( $this->plugin_data ) )->save_settings();
77
+
78
+ $token_status = $this->token_repository->get_token()->get_valid_status();
79
+ $data = [
80
+ 'logo_url' => $this->plugin_info->get_plugin_directory_url() . 'assets/img/logo-headline.png',
81
+ 'errors_messages' => apply_filters( 'webpc_server_errors_messages', [] ),
82
+ 'errors_codes' => apply_filters( 'webpc_server_errors', [] ),
83
+ 'form_options' => ( new PluginOptions() )->get_options( OptionAbstract::FORM_TYPE_BASIC ),
84
+ 'form_sidebar_options' => ( new PluginOptions() )->get_options( OptionAbstract::FORM_TYPE_SIDEBAR ),
85
+ 'form_input_name' => SettingsSave::FORM_TYPE_PARAM_KEY,
86
+ 'form_input_value' => OptionAbstract::FORM_TYPE_BASIC,
87
+ 'form_sidebar_input_value' => OptionAbstract::FORM_TYPE_SIDEBAR,
88
+ 'nonce_input_name' => SettingsSave::NONCE_PARAM_KEY,
89
+ 'nonce_input_value' => ( new NonceManager() )->generate_nonce( SettingsSave::NONCE_PARAM_VALUE ),
90
+ 'token_valid_status' => $token_status,
91
+ 'api_calculate_url' => ( new ImagesCounterEndpoint( $this->plugin_data, $this->token_repository ) )->get_route_url(),
92
+ 'api_paths_url' => ( new PathsEndpoint( $this->plugin_data, $this->token_repository ) )->get_route_url(),
93
+ 'api_regenerate_url' => ( new RegenerateEndpoint( $this->plugin_data ) )->get_route_url(),
94
+ 'url_debug_page' => PageIntegration::get_settings_page_url( DebugPage::PAGE_SLUG ),
95
+ 'output_formats' => [
96
+ 'webp' => [
97
+ 'label' => 'WebP',
98
+ 'desc' => ( ! $token_status )
99
+ ? __( 'available in the free version', 'webp-converter-for-media' )
100
+ : null,
101
+ ],
102
+ 'avif' => [
103
+ 'label' => 'AVIF',
104
+ 'desc' => ( ! $token_status )
105
+ ? sprintf(
106
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
107
+ __( 'available in %1$sthe PRO version%2$s', 'webp-converter-for-media' ),
108
+ '<a href="' . esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'regeneration-widget-avif-upgrade' ) ) . '" target="_blank">',
109
+ '</a>'
110
+ )
111
+ : null,
112
+ ],
113
+ ],
114
+ ];
115
+
116
+ do_action( LoaderAbstract::ACTION_NAME, true );
117
+ return $data;
118
+ }
119
+ }
src/Settings/Page/PageIntegration.php CHANGED
@@ -6,6 +6,7 @@ use WebpConverter\HookableInterface;
6
  use WebpConverter\Notice\NoticeIntegration;
7
  use WebpConverter\Notice\WelcomeNotice;
8
  use WebpConverter\PluginInfo;
 
9
  use WebpConverter\Settings\AdminAssets;
10
 
11
  /**
@@ -20,8 +21,14 @@ class PageIntegration implements HookableInterface {
20
  */
21
  private $plugin_info;
22
 
23
- public function __construct( PluginInfo $plugin_info ) {
 
 
 
 
 
24
  $this->plugin_info = $plugin_info;
 
25
  }
26
 
27
  /**
@@ -121,24 +128,29 @@ class PageIntegration implements HookableInterface {
121
  * @internal
122
  */
123
  public function load_settings_page() {
 
124
  foreach ( $this->pages as $page ) {
125
- $this->init_page_is_active( $page );
126
- }
127
- }
128
-
129
- /**
130
- * Initializes page loading if is active.
131
- *
132
- * @param PageInterface $page .
133
- *
134
- * @return void
135
- */
136
- private function init_page_is_active( PageInterface $page ) {
137
- if ( ! $page->is_page_active() ) {
138
- return;
 
 
 
 
 
 
139
  }
140
-
141
- $page->show_page_view();
142
  }
143
 
144
  /**
6
  use WebpConverter\Notice\NoticeIntegration;
7
  use WebpConverter\Notice\WelcomeNotice;
8
  use WebpConverter\PluginInfo;
9
+ use WebpConverter\Service\ViewLoader;
10
  use WebpConverter\Settings\AdminAssets;
11
 
12
  /**
21
  */
22
  private $plugin_info;
23
 
24
+ /**
25
+ * @var ViewLoader
26
+ */
27
+ private $view_loader;
28
+
29
+ public function __construct( PluginInfo $plugin_info, ViewLoader $view_loader = null ) {
30
  $this->plugin_info = $plugin_info;
31
+ $this->view_loader = $view_loader ?: new ViewLoader( $plugin_info );
32
  }
33
 
34
  /**
128
  * @internal
129
  */
130
  public function load_settings_page() {
131
+ $current_tab_name = $_GET['action'] ?? null; // phpcs:ignore WordPress.Security
132
  foreach ( $this->pages as $page ) {
133
+ if ( $page->get_slug() === $current_tab_name ) {
134
+ $this->view_loader->load_view(
135
+ $page->get_template_path(),
136
+ array_merge(
137
+ $page->get_template_vars(),
138
+ [
139
+ 'menu_items' => array_map(
140
+ function ( PageInterface $settings_page ) use ( $current_tab_name ) {
141
+ return [
142
+ 'url' => self::get_settings_page_url( $settings_page->get_slug() ),
143
+ 'title' => $settings_page->get_label(),
144
+ 'is_active' => ( $settings_page->get_slug() === $current_tab_name ),
145
+ ];
146
+ },
147
+ $this->pages
148
+ ),
149
+ ]
150
+ )
151
+ );
152
+ }
153
  }
 
 
154
  }
155
 
156
  /**
src/Settings/Page/PageInterface.php CHANGED
@@ -8,16 +8,22 @@ namespace WebpConverter\Settings\Page;
8
  interface PageInterface {
9
 
10
  /**
11
- * Returns status if view is active.
12
- *
13
- * @return bool Is view active?
14
  */
15
- public function is_page_active(): bool;
16
 
17
  /**
18
- * Displays view for plugin settings page.
19
- *
20
- * @return void
21
  */
22
- public function show_page_view();
 
 
 
 
 
 
 
 
 
 
23
  }
8
  interface PageInterface {
9
 
10
  /**
11
+ * @return string|null
 
 
12
  */
13
+ public function get_slug();
14
 
15
  /**
16
+ * @return string
 
 
17
  */
18
+ public function get_label(): string;
19
+
20
+ /**
21
+ * @return string
22
+ */
23
+ public function get_template_path(): string;
24
+
25
+ /**
26
+ * @return mixed[]
27
+ */
28
+ public function get_template_vars(): array;
29
  }
src/Settings/Page/SettingsPage.php DELETED
@@ -1,85 +0,0 @@
1
- <?php
2
-
3
-
4
- namespace WebpConverter\Settings\Page;
5
-
6
- use WebpConverter\Conversion\Endpoint\ImagesCounterEndpoint;
7
- use WebpConverter\Conversion\Endpoint\PathsEndpoint;
8
- use WebpConverter\Conversion\Endpoint\RegenerateEndpoint;
9
- use WebpConverter\Loader\LoaderAbstract;
10
- use WebpConverter\PluginData;
11
- use WebpConverter\PluginInfo;
12
- use WebpConverter\Repository\TokenRepository;
13
- use WebpConverter\Service\NonceManager;
14
- use WebpConverter\Service\ViewLoader;
15
- use WebpConverter\Settings\PluginOptions;
16
- use WebpConverter\Settings\SettingsSave;
17
-
18
- /**
19
- * Supports default tab in plugin settings page.
20
- */
21
- class SettingsPage extends PageAbstract {
22
-
23
- const PAGE_VIEW_PATH = 'views/settings.php';
24
-
25
- /**
26
- * @var PluginInfo
27
- */
28
- private $plugin_info;
29
-
30
- /**
31
- * @var PluginData
32
- */
33
- private $plugin_data;
34
-
35
- /**
36
- * @var TokenRepository
37
- */
38
- private $token_repository;
39
-
40
- public function __construct(
41
- PluginInfo $plugin_info,
42
- PluginData $plugin_data,
43
- TokenRepository $token_repository
44
- ) {
45
- $this->plugin_info = $plugin_info;
46
- $this->plugin_data = $plugin_data;
47
- $this->token_repository = $token_repository;
48
- }
49
-
50
- /**
51
- * {@inheritdoc}
52
- */
53
- public function is_page_active(): bool {
54
- return ( ! isset( $_GET['action'] ) || ( $_GET['action'] !== 'server' ) ); // phpcs:ignore
55
- }
56
-
57
- /**
58
- * {@inheritdoc}
59
- */
60
- public function show_page_view() {
61
- ( new SettingsSave( $this->plugin_data ) )->save_settings();
62
-
63
- ( new ViewLoader( $this->plugin_info ) )->load_view(
64
- self::PAGE_VIEW_PATH,
65
- [
66
- 'errors_messages' => apply_filters( 'webpc_server_errors_messages', [] ),
67
- 'errors_codes' => apply_filters( 'webpc_server_errors', [] ),
68
- 'options' => ( new PluginOptions() )->get_options(),
69
- 'submit_value' => SettingsSave::SUBMIT_VALUE,
70
- 'submit_activate_token' => SettingsSave::SUBMIT_TOKEN_ACTIVATE,
71
- 'submit_deactivate_token' => SettingsSave::SUBMIT_TOKEN_DEACTIVATE,
72
- 'nonce_input_name' => SettingsSave::NONCE_PARAM_KEY,
73
- 'nonce_input_value' => ( new NonceManager() )->generate_nonce( SettingsSave::NONCE_PARAM_VALUE ),
74
- 'token_valid_status' => $this->token_repository->get_token()->get_valid_status(),
75
- 'settings_url' => PageIntegration::get_settings_page_url(),
76
- 'settings_debug_url' => PageIntegration::get_settings_page_url( 'server' ),
77
- 'api_calculate_url' => ( new ImagesCounterEndpoint( $this->plugin_data, $this->token_repository ) )->get_route_url(),
78
- 'api_paths_url' => ( new PathsEndpoint( $this->plugin_data, $this->token_repository ) )->get_route_url(),
79
- 'api_regenerate_url' => ( new RegenerateEndpoint( $this->plugin_data ) )->get_route_url(),
80
- ]
81
- );
82
-
83
- do_action( LoaderAbstract::ACTION_NAME, true );
84
- }
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Settings/PluginOptions.php CHANGED
@@ -23,17 +23,18 @@ class PluginOptions {
23
  /**
24
  * Returns options of plugin settings.
25
  *
 
26
  * @param bool $is_debug Is debugging?
27
  * @param mixed[]|null $posted_settings Settings submitted in form.
28
  *
29
  * @return mixed[] Options of plugin settings.
30
  */
31
- public function get_options( bool $is_debug = false, array $posted_settings = null ): array {
32
  $is_save = ( $posted_settings !== null );
33
  $settings = ( $is_save ) ? $posted_settings : OptionsAccessManager::get_option( SettingsSave::SETTINGS_OPTION, [] );
34
 
35
  $options = [];
36
- foreach ( $this->options_aggregator->get_options() as $option_object ) {
37
  $options[] = ( new OptionIntegration( $option_object ) )->get_option_data( $settings, $is_debug, $is_save );
38
  }
39
  return $options;
@@ -42,16 +43,30 @@ class PluginOptions {
42
  /**
43
  * Returns values of plugin settings.
44
  *
 
45
  * @param bool $is_debug Is debugging?
46
  * @param mixed[]|null $posted_settings Settings submitted in form.
47
  *
48
  * @return mixed[] Values of plugin settings.
49
  */
50
- public function get_values( bool $is_debug = false, array $posted_settings = null ): array {
51
  $values = [];
52
- foreach ( $this->get_options( $is_debug, $posted_settings ) as $option ) {
53
  $values[ $option['name'] ] = $option['value'];
54
  }
55
  return $values;
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
23
  /**
24
  * Returns options of plugin settings.
25
  *
26
+ * @param string|null $form_name .
27
  * @param bool $is_debug Is debugging?
28
  * @param mixed[]|null $posted_settings Settings submitted in form.
29
  *
30
  * @return mixed[] Options of plugin settings.
31
  */
32
+ public function get_options( string $form_name = null, bool $is_debug = false, array $posted_settings = null ): array {
33
  $is_save = ( $posted_settings !== null );
34
  $settings = ( $is_save ) ? $posted_settings : OptionsAccessManager::get_option( SettingsSave::SETTINGS_OPTION, [] );
35
 
36
  $options = [];
37
+ foreach ( $this->options_aggregator->get_options( $form_name ) as $option_object ) {
38
  $options[] = ( new OptionIntegration( $option_object ) )->get_option_data( $settings, $is_debug, $is_save );
39
  }
40
  return $options;
43
  /**
44
  * Returns values of plugin settings.
45
  *
46
+ * @param string|null $form_name .
47
  * @param bool $is_debug Is debugging?
48
  * @param mixed[]|null $posted_settings Settings submitted in form.
49
  *
50
  * @return mixed[] Values of plugin settings.
51
  */
52
+ public function get_values( string $form_name = null, bool $is_debug = false, array $posted_settings = null ): array {
53
  $values = [];
54
+ foreach ( $this->get_options( $form_name, $is_debug, $posted_settings ) as $option ) {
55
  $values[ $option['name'] ] = $option['value'];
56
  }
57
  return $values;
58
  }
59
+
60
+ /**
61
+ * Returns values of plugin settings without sensitive data.
62
+ *
63
+ * @return mixed[] Values of plugin settings.
64
+ */
65
+ public function get_public_values(): array {
66
+ $values = [];
67
+ foreach ( $this->get_options() as $option ) {
68
+ $values[ $option['name'] ] = $option['value_public'];
69
+ }
70
+ return $values;
71
+ }
72
  }
src/Settings/SettingsSave.php CHANGED
@@ -22,12 +22,10 @@ use WebpConverter\Settings\Option\SupportedDirectoriesOption;
22
  */
23
  class SettingsSave {
24
 
25
- const SETTINGS_OPTION = 'webpc_settings';
26
- const SUBMIT_VALUE = 'webpc_save';
27
- const SUBMIT_TOKEN_ACTIVATE = 'webpc_token_activate';
28
- const SUBMIT_TOKEN_DEACTIVATE = 'webpc_token_deactivate';
29
- const NONCE_PARAM_KEY = 'webpc_nonce';
30
- const NONCE_PARAM_VALUE = 'webpc-save';
31
 
32
  /**
33
  * @var PluginData
@@ -51,49 +49,27 @@ class SettingsSave {
51
  */
52
  public function save_settings() {
53
  $post_data = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing
54
- if ( ( ! isset( $post_data[ self::SUBMIT_VALUE ] )
55
- && ! isset( $post_data[ self::SUBMIT_TOKEN_ACTIVATE ] )
56
- && ! isset( $post_data[ self::SUBMIT_TOKEN_DEACTIVATE ] ) )
57
- || ! ( new NonceManager() )
58
- ->verify_nonce( $post_data[ self::NONCE_PARAM_KEY ] ?? '', self::NONCE_PARAM_VALUE ) ) {
59
  return;
60
  }
61
 
62
- $saved_settings = $this->plugin_data->get_plugin_settings();
63
- if ( isset( $post_data[ self::SUBMIT_VALUE ] ) ) {
64
- $plugin_settings = ( new PluginOptions() )->get_values( false, $post_data );
65
- } else {
66
- $plugin_settings = $saved_settings;
67
- }
68
-
69
- if ( isset( $post_data[ self::SUBMIT_TOKEN_ACTIVATE ] ) ) {
70
- $plugin_settings[ AccessTokenOption::OPTION_NAME ] = sanitize_text_field( $post_data[ AccessTokenOption::OPTION_NAME ] ?: '' );
71
- } elseif ( isset( $post_data[ self::SUBMIT_TOKEN_DEACTIVATE ] ) ) {
72
- $plugin_settings[ AccessTokenOption::OPTION_NAME ] = '';
73
- } elseif ( substr( $plugin_settings[ AccessTokenOption::OPTION_NAME ], -32 ) === str_repeat( '*', 32 ) ) {
74
- $plugin_settings[ AccessTokenOption::OPTION_NAME ] = $saved_settings[ AccessTokenOption::OPTION_NAME ];
75
- }
76
 
77
  $token = $this->token_validator->validate_token( $plugin_settings[ AccessTokenOption::OPTION_NAME ] );
78
  if ( $token->get_valid_status() ) {
79
  $plugin_settings[ ConversionMethodOption::OPTION_NAME ] = RemoteMethod::METHOD_NAME;
80
 
81
- if ( isset( $post_data[ self::SUBMIT_TOKEN_ACTIVATE ] ) ) {
82
  $plugin_settings[ OutputFormatsOption::OPTION_NAME ] = [
83
  AvifFormat::FORMAT_EXTENSION,
84
  WebpFormat::FORMAT_EXTENSION,
85
  ];
86
- } elseif ( ! $plugin_settings[ OutputFormatsOption::OPTION_NAME ] ) {
87
- $plugin_settings[ OutputFormatsOption::OPTION_NAME ] = [
88
- WebpFormat::FORMAT_EXTENSION,
89
- ];
90
  }
91
  }
92
 
93
- OptionsAccessManager::update_option(
94
- self::SETTINGS_OPTION,
95
- ( new PluginOptions() )->get_values( false, $plugin_settings )
96
- );
97
  $this->plugin_data->invalidate_plugin_settings();
98
  $this->init_actions_after_save();
99
  }
22
  */
23
  class SettingsSave {
24
 
25
+ const SETTINGS_OPTION = 'webpc_settings';
26
+ const FORM_TYPE_PARAM_KEY = 'webpc_form_type';
27
+ const NONCE_PARAM_KEY = 'webpc_nonce';
28
+ const NONCE_PARAM_VALUE = 'webpc-save';
 
 
29
 
30
  /**
31
  * @var PluginData
49
  */
50
  public function save_settings() {
51
  $post_data = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing
52
+ if ( ! isset( $post_data[ self::FORM_TYPE_PARAM_KEY ] )
53
+ || ! ( new NonceManager() )->verify_nonce( $post_data[ self::NONCE_PARAM_KEY ] ?? '', self::NONCE_PARAM_VALUE ) ) {
 
 
 
54
  return;
55
  }
56
 
57
+ $posted_settings = ( new PluginOptions() )->get_values( $post_data[ self::FORM_TYPE_PARAM_KEY ], false, $post_data );
58
+ $plugin_settings = array_merge( $this->plugin_data->get_plugin_settings(), $posted_settings );
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  $token = $this->token_validator->validate_token( $plugin_settings[ AccessTokenOption::OPTION_NAME ] );
61
  if ( $token->get_valid_status() ) {
62
  $plugin_settings[ ConversionMethodOption::OPTION_NAME ] = RemoteMethod::METHOD_NAME;
63
 
64
+ if ( isset( $posted_settings[ AccessTokenOption::OPTION_NAME ] ) || ! $plugin_settings[ OutputFormatsOption::OPTION_NAME ] ) {
65
  $plugin_settings[ OutputFormatsOption::OPTION_NAME ] = [
66
  AvifFormat::FORMAT_EXTENSION,
67
  WebpFormat::FORMAT_EXTENSION,
68
  ];
 
 
 
 
69
  }
70
  }
71
 
72
+ OptionsAccessManager::update_option( self::SETTINGS_OPTION, $plugin_settings );
 
 
 
73
  $this->plugin_data->invalidate_plugin_settings();
74
  $this->init_actions_after_save();
75
  }
src/WebpConverter.php CHANGED
@@ -40,7 +40,6 @@ class WebpConverter {
40
  ( new ErrorDetectorAggregator( $plugin_info, $plugin_data ) )->init_hooks();
41
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\WelcomeNotice() ) )->init_hooks();
42
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\ThanksNotice() ) )->init_hooks();
43
- ( new Notice\NoticeIntegration( $plugin_info, new Notice\AvifSupportNotice( $token_repository ) ) )->init_hooks();
44
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\CloudflareNotice() ) )->init_hooks();
45
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\LitespeedNotice() ) )->init_hooks();
46
  ( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
@@ -53,7 +52,8 @@ class WebpConverter {
53
  ( new Plugin\Uninstall( $plugin_info ) )->init_hooks();
54
  ( new Plugin\Update( $plugin_info ) )->init_hooks();
55
  ( new Page\PageIntegration( $plugin_info ) )
56
- ->set_page_integration( new Page\SettingsPage( $plugin_info, $plugin_data, $token_repository ) )
 
57
  ->set_page_integration( new Page\DebugPage( $plugin_info, $plugin_data ) )
58
  ->init_hooks();
59
  ( new Service\DeactivationModalGenerator( $plugin_info, $plugin_data ) )->load_modal();
40
  ( new ErrorDetectorAggregator( $plugin_info, $plugin_data ) )->init_hooks();
41
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\WelcomeNotice() ) )->init_hooks();
42
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\ThanksNotice() ) )->init_hooks();
 
43
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\CloudflareNotice() ) )->init_hooks();
44
  ( new Notice\NoticeIntegration( $plugin_info, new Notice\LitespeedNotice() ) )->init_hooks();
45
  ( new Loader\LoaderIntegration( new Loader\HtaccessLoader( $plugin_info, $plugin_data ) ) )->init_hooks();
52
  ( new Plugin\Uninstall( $plugin_info ) )->init_hooks();
53
  ( new Plugin\Update( $plugin_info ) )->init_hooks();
54
  ( new Page\PageIntegration( $plugin_info ) )
55
+ ->set_page_integration( new Page\GeneralSettingsPage( $plugin_info, $plugin_data, $token_repository ) )
56
+ ->set_page_integration( new Page\AdvancedSettingsPage( $plugin_info, $plugin_data, $token_repository ) )
57
  ->set_page_integration( new Page\DebugPage( $plugin_info, $plugin_data ) )
58
  ->init_hooks();
59
  ( new Service\DeactivationModalGenerator( $plugin_info, $plugin_data ) )->load_modal();
templates/components/fields/checkbox.php CHANGED
@@ -4,7 +4,8 @@
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
@@ -12,16 +13,16 @@
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 ); ?>"></label>
25
- <span class="webpField__label"><?php echo wp_kses_post( $label ); ?></span>
26
  </div>
27
  <?php endforeach; ?>
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
13
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
14
  <?php endif; ?>
15
  <?php foreach ( $option['values'] as $value => $label ) : ?>
16
+ <div class="webpcField">
17
  <input type="checkbox"
18
  name="<?php echo esc_attr( $option['name'] ); ?>[]"
19
  value="<?php echo esc_attr( $value ); ?>"
20
  id="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
21
+ class="webpcField__input webpcField__input--checkbox"
22
  <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>
23
  <?php echo ( in_array( $value, $option['value'] ) ) ? 'checked' : ''; ?>
24
  >
25
  <label for="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"></label>
26
+ <span class="webpcField__label"><?php echo wp_kses_post( $label ); ?></span>
27
  </div>
28
  <?php endforeach; ?>
templates/components/fields/image_size.php CHANGED
@@ -4,47 +4,48 @@
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
11
- <div class="webpField">
12
  <input type="checkbox"
13
  name="<?php echo esc_attr( $option['name'] ); ?>[0]"
14
  value="yes"
15
  id="<?php echo esc_attr( $option['name'] ); ?>"
16
- class="webpField__input webpField__input--checkbox"
17
  data-inputs-group-toggle="<?php echo esc_attr( $option['name'] ); ?>"
18
  <?php echo ( ( $option['value'][0] ?? '' ) === 'yes' ) ? 'checked' : ''; ?>
19
  <?php echo ( in_array( 'yes', $option['disabled'] ) ) ? 'disabled' : ''; ?>
20
  >
21
  <label for="<?php echo esc_attr( $option['name'] ); ?>"></label>
22
- <span class="webpField__label"><?php echo wp_kses_post( $option['info'] ); ?></span>
23
  </div>
24
 
25
- <div class="webpField webpField--center">
26
- <span class="webpField__label">
27
  <?php echo esc_html( __( 'Max. width:', 'webp-converter-for-media' ) ); ?>
28
  </span>
29
- <div class="webpInput">
30
  <input type="number" min="0" step="1"
31
  name="<?php echo esc_attr( $option['name'] ); ?>[1]"
32
  value="<?php echo esc_attr( $option['value'][1] ?? '' ); ?>"
33
  id="<?php echo esc_attr( $option['name'] ); ?>"
34
- class="webpInput__field webpInput__field--small"
35
  data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
36
  <?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
37
  >
38
  </div>
39
- <span class="webpField__label">
40
  <?php echo esc_html( __( 'Max. height:', 'webp-converter-for-media' ) ); ?>
41
  </span>
42
- <div class="webpInput">
43
  <input type="number" min="0" step="1"
44
  name="<?php echo esc_attr( $option['name'] ); ?>[2]"
45
  value="<?php echo esc_attr( $option['value'][2] ?? '' ); ?>"
46
  id="<?php echo esc_attr( $option['name'] ); ?>"
47
- class="webpInput__field webpInput__field--small"
48
  data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
49
  <?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
50
  >
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
12
+ <div class="webpcField">
13
  <input type="checkbox"
14
  name="<?php echo esc_attr( $option['name'] ); ?>[0]"
15
  value="yes"
16
  id="<?php echo esc_attr( $option['name'] ); ?>"
17
+ class="webpcField__input webpcField__input--checkbox"
18
  data-inputs-group-toggle="<?php echo esc_attr( $option['name'] ); ?>"
19
  <?php echo ( ( $option['value'][0] ?? '' ) === 'yes' ) ? 'checked' : ''; ?>
20
  <?php echo ( in_array( 'yes', $option['disabled'] ) ) ? 'disabled' : ''; ?>
21
  >
22
  <label for="<?php echo esc_attr( $option['name'] ); ?>"></label>
23
+ <span class="webpcField__label"><?php echo wp_kses_post( $option['info'] ); ?></span>
24
  </div>
25
 
26
+ <div class="webpcField webpcField--center">
27
+ <span class="webpcField__label">
28
  <?php echo esc_html( __( 'Max. width:', 'webp-converter-for-media' ) ); ?>
29
  </span>
30
+ <div class="webpcInput">
31
  <input type="number" min="0" step="1"
32
  name="<?php echo esc_attr( $option['name'] ); ?>[1]"
33
  value="<?php echo esc_attr( $option['value'][1] ?? '' ); ?>"
34
  id="<?php echo esc_attr( $option['name'] ); ?>"
35
+ class="webpcInput__field webpcInput__field--small"
36
  data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
37
  <?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
38
  >
39
  </div>
40
+ <span class="webpcField__label">
41
  <?php echo esc_html( __( 'Max. height:', 'webp-converter-for-media' ) ); ?>
42
  </span>
43
+ <div class="webpcInput">
44
  <input type="number" min="0" step="1"
45
  name="<?php echo esc_attr( $option['name'] ); ?>[2]"
46
  value="<?php echo esc_attr( $option['value'][2] ?? '' ); ?>"
47
  id="<?php echo esc_attr( $option['name'] ); ?>"
48
+ class="webpcInput__field webpcInput__field--small"
49
  data-inputs-group-input="<?php echo esc_attr( $option['name'] ); ?>"
50
  <?php echo ( in_array( 'yes', $option['disabled'] ) || ( $option['value'][0] ?? '' ) !== 'yes' ) ? 'readonly' : ''; ?>
51
  >
templates/components/fields/input.php CHANGED
@@ -4,18 +4,19 @@
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
- <div class="webpInput">
15
  <input type="text"
16
  name="<?php echo esc_attr( $option['name'] ); ?>"
17
  value="<?php echo esc_attr( $option['value'] ); ?>"
18
  id="<?php echo esc_attr( $option['name'] ); ?>"
19
- class="webpInput__field"
20
  >
21
  </div>
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
12
  <?php if ( $option['info'] ) : ?>
13
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
14
  <?php endif; ?>
15
+ <div class="webpcInput">
16
  <input type="text"
17
  name="<?php echo esc_attr( $option['name'] ); ?>"
18
  value="<?php echo esc_attr( $option['value'] ); ?>"
19
  id="<?php echo esc_attr( $option['name'] ); ?>"
20
+ class="webpcInput__field"
21
  >
22
  </div>
templates/components/fields/quality.php CHANGED
@@ -4,28 +4,64 @@
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
11
  <?php if ( $option['info'] ) : ?>
12
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
13
  <?php endif; ?>
14
- <div class="webpPage__quality">
15
- <?php foreach ( $option['values'] as $value => $label ) : ?>
16
- <div class="webpPage__qualityItem">
17
- <input type="radio"
18
- name="<?php echo esc_attr( $option['name'] ); ?>"
19
- value="<?php echo esc_attr( $value ); ?>"
20
- id="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
21
- class="webpPage__qualityItemInput"
22
- <?php echo ( $value == $option['value'] ) ? 'checked' : ''; // phpcs:ignore ?>
23
- <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>>
24
- <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
25
- class="webpPage__qualityItemLabel"
26
- >
27
- <?php echo wp_kses_post( $label ); ?>
28
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  </div>
30
- <?php endforeach; ?>
31
  </div>
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
12
  <?php if ( $option['info'] ) : ?>
13
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
14
  <?php endif; ?>
15
+ <div class="webpcQuality">
16
+ <div class="webpcQuality__items">
17
+ <?php foreach ( $option['values'] as $value => $label ) : ?>
18
+ <div class="webpcQuality__item">
19
+ <input type="radio"
20
+ name="<?php echo esc_attr( $option['name'] ); ?>"
21
+ value="<?php echo esc_attr( $value ); ?>"
22
+ id="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
23
+ class="webpcQuality__itemInput"
24
+ <?php echo ( $value == $option['value'] ) ? 'checked' : ''; // phpcs:ignore ?>>
25
+ <label for="webpc-<?php echo esc_attr( $index ); ?>-<?php echo esc_attr( $value ); ?>"
26
+ class="webpcQuality__itemLabel"></label>
27
+ </div>
28
+ <?php endforeach; ?>
29
+ </div>
30
+ <div class="webpcQuality__texts">
31
+ <div class="webpcQuality__text">
32
+ <?php
33
+ echo wp_kses_post(
34
+ sprintf(
35
+ /* translators: %1$s: Level name */
36
+ __( '%s - maximum reduction of image size with quality loss', 'webp-converter-for-media' ),
37
+ '<strong>' . __( 'Lossy', 'webp-converter-for-media' ) . '</strong>'
38
+ )
39
+ );
40
+ ?>
41
+ </div>
42
+ <div class="webpcQuality__text"></div>
43
+ <div class="webpcQuality__text">
44
+ <?php
45
+ echo wp_kses_post(
46
+ sprintf(
47
+ /* translators: %1$s: Level name */
48
+ __( '%s - reduction of image size without quality loss visible to the eye', 'webp-converter-for-media' ),
49
+ '<strong>' . __( 'Optimal', 'webp-converter-for-media' ) . '</strong>'
50
+ )
51
+ );
52
+ ?>
53
+ </div>
54
+ <div class="webpcQuality__text"></div>
55
+ <div class="webpcQuality__text">
56
+ <?php
57
+ echo wp_kses_post(
58
+ sprintf(
59
+ /* translators: %1$s: Level name */
60
+ __( '%s - minimal reduction of image size without quality loss', 'webp-converter-for-media' ),
61
+ '<strong>' . __( 'Lossless', 'webp-converter-for-media' ) . '</strong>'
62
+ )
63
+ );
64
+ ?>
65
  </div>
66
+ </div>
67
  </div>
templates/components/fields/radio.php CHANGED
@@ -4,7 +4,8 @@
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
@@ -12,16 +13,16 @@
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 ); ?>"></label>
25
- <span class="webpField__label"><?php echo wp_kses_post( $label ); ?></span>
26
  </div>
27
  <?php endforeach; ?>
4
  *
5
  * @var mixed[] $option Data of field.
6
  * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
13
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
14
  <?php endif; ?>
15
  <?php foreach ( $option['values'] as $value => $label ) : ?>
16
+ <div class="webpcField">
17
  <input type="radio"
18
  name="<?php echo esc_attr( $option['name'] ); ?>"
19
  value="<?php echo esc_attr( $value ); ?>"
20
  id="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"
21
+ class="webpcField__input webpcField__input--radio"
22
  <?php echo ( in_array( $value, $option['disabled'] ) ) ? 'disabled' : ''; ?>
23
  <?php echo ( $value == $option['value'] ) ? 'checked' : ''; // phpcs:ignore ?>
24
  >
25
  <label for="<?php echo esc_attr( $option['name'] . '-' . $value ); ?>"></label>
26
+ <span class="webpcField__label"><?php echo wp_kses_post( $label ); ?></span>
27
  </div>
28
  <?php endforeach; ?>
templates/components/fields/toggle.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Field displayed in plugin settings form.
4
+ *
5
+ * @var mixed[] $option Data of field.
6
+ * @var string $index Index of field.
7
+ *
8
+ * @package Converter for Media
9
+ */
10
+
11
+ ?>
12
+ <div class="webpcField">
13
+ <input type="checkbox"
14
+ name="<?php echo esc_attr( $option['name'] ); ?>"
15
+ value="yes"
16
+ id="<?php echo esc_attr( $option['name'] ); ?>"
17
+ class="webpcField__input webpcField__input--toggle"
18
+ <?php echo ( ( $option['value'] === 'yes' ) ) ? 'checked' : ''; ?>
19
+ >
20
+ <label for="<?php echo esc_attr( $option['name'] ); ?>"></label>
21
+ <span class="webpcField__label"><?php echo wp_kses_post( $option['info'] ); ?></span>
22
+ </div>
templates/components/fields/token.php CHANGED
@@ -2,48 +2,30 @@
2
  /**
3
  * Field displayed in plugin settings form.
4
  *
5
- * @var string $submit_activate_token .
6
- * @var string $submit_deactivate_token .
7
- * @var bool $token_valid_status .
8
- * @var string $api_calculate_url URL of REST API endpoint.
9
- * @var mixed[] $option Data of field.
10
- * @var string $index Index of field.
11
- * @package WebP Converter for Media
12
  */
13
 
14
- $token_value = ( $token_valid_status )
15
- ? substr( $option['value'], 0, 32 ) . str_repeat( '*', 32 )
16
- : $option['value'];
17
-
18
  ?>
19
  <?php if ( $option['info'] ) : ?>
20
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
21
  <?php endif; ?>
22
- <div class="webpInput">
23
  <input type="text"
24
- name="<?php echo esc_attr( $option['name'] ); ?>"
25
- value="<?php echo esc_attr( $token_value ); ?>"
26
  id="<?php echo esc_attr( $option['name'] ); ?>"
27
- class="webpInput__field"
28
  <?php echo ( $token_valid_status ) ? 'readonly' : ''; ?>
29
  >
30
- <?php if ( ! $token_valid_status ) : ?>
31
- <button type="submit"
32
- name="<?php echo esc_attr( $submit_activate_token ); ?>"
33
- class="webpInput__button webpButton webpButton--green">
34
- <?php echo esc_html( __( 'Activate Token', 'webp-converter-for-media' ) ); ?>
35
- </button>
36
- <?php else : ?>
37
- <button type="submit"
38
- name="<?php echo esc_attr( $submit_deactivate_token ); ?>"
39
- class="webpInput__button webpButton webpButton--red">
40
- <?php echo esc_html( __( 'Deactivate Token', 'webp-converter-for-media' ) ); ?>
41
- </button>
42
- <?php endif; ?>
43
  </div>
44
  <p data-calculate-widget data-calculate-widget-api="<?php echo esc_url( $api_calculate_url ); ?>">
45
  <?php
46
- echo esc_html( __( 'How many maximum images for conversion are left on my website?', 'webp-converter-for-media' ) );
47
  echo ' ';
48
  echo wp_kses_post(
49
  sprintf(
2
  /**
3
  * Field displayed in plugin settings form.
4
  *
5
+ * @var bool $token_valid_status Status of PRO version.
6
+ * @var string $api_calculate_url URL of REST API endpoint.
7
+ * @var mixed[] $option Data of field.
8
+ * @var string $index Index of field.
9
+ *
10
+ * @package Converter for Media
 
11
  */
12
 
 
 
 
 
13
  ?>
14
  <?php if ( $option['info'] ) : ?>
15
  <p><?php echo wp_kses_post( $option['info'] ); ?></p>
16
  <?php endif; ?>
17
+ <div class="webpcInput">
18
  <input type="text"
19
+ name="<?php echo esc_attr( ( $token_valid_status ) ? '' : $option['name'] ); ?>"
20
+ value="<?php echo esc_attr( $option['value_public'] ); ?>"
21
  id="<?php echo esc_attr( $option['name'] ); ?>"
22
+ class="webpcInput__field"
23
  <?php echo ( $token_valid_status ) ? 'readonly' : ''; ?>
24
  >
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  </div>
26
  <p data-calculate-widget data-calculate-widget-api="<?php echo esc_url( $api_calculate_url ); ?>">
27
  <?php
28
+ echo esc_html( __( 'How many images to convert are remaining on my website?', 'webp-converter-for-media' ) );
29
  echo ' ';
30
  echo wp_kses_post(
31
  sprintf(
templates/components/notices/avif-support.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * Notice displayed in admin panel.
4
- *
5
- * @var string $ajax_url URL of admin-ajax.
6
- * @var string $close_action Action using in WP Ajax.
7
- * @package WebP Converter for Media
8
- */
9
-
10
- use WebpConverter\WebpConverterConstants;
11
-
12
- ?>
13
- <div class="notice notice-success is-dismissible"
14
- data-notice="webp-converter-for-media"
15
- data-notice-action="<?php echo esc_attr( $close_action ); ?>"
16
- data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
17
- >
18
- <div class="webpContent webpContent--notice webpContent--author">
19
- <h4>
20
- <?php echo esc_html( __( 'Hello, I am glad that you are with us and use our Converter for Media plugin!', 'webp-converter-for-media' ) ); ?>
21
- </h4>
22
- <p>
23
- <?php
24
- echo wp_kses_post(
25
- implode(
26
- ' ',
27
- [
28
- __( 'Especially for the users of our plugin, we have prepared a novelty - support for the AVIF format.', 'webp-converter-for-media' ),
29
- __( 'The AVIF format is a new extension - is the successor to WebP. It allows you to achieve even higher levels of image compression, and the quality of the converted images is better than in WebP.', 'webp-converter-for-media' ),
30
-
31
- ]
32
- )
33
- );
34
- ?>
35
- </p>
36
- <div class="webpContent__buttons">
37
- <a href="<?php echo esc_url( sprintf( WebpConverterConstants::UPGRADE_PRO_PREFIX_URL, 'admin-notice-avif-support' ) ); ?>"
38
- target="_blank"
39
- class="webpContent__button webpButton webpButton--blue webpButton--bg"
40
- >
41
- <?php echo esc_html( __( 'Find out more', 'webp-converter-for-media' ) ); ?>
42
- </a>
43
- <button type="button" data-permanently
44
- class="webpContent__button webpButton webpButton--gray webpButton--bg"
45
- >
46
- <?php echo esc_html( __( 'Hide, do not show again', 'webp-converter-for-media' ) ); ?>
47
- </button>
48
- </div>
49
- </div>
50
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/notices/clear-cache.php CHANGED
@@ -6,7 +6,8 @@
6
  * @var string $close_action Action using in WP Ajax.
7
  * @var string $service_name .
8
  * @var string[] $steps Instructions to follow.
9
- * @package WebP Converter for Media
 
10
  */
11
 
12
  ?>
@@ -15,7 +16,7 @@
15
  data-notice-action="<?php echo esc_attr( $close_action ); ?>"
16
  data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
17
  >
18
- <div class="webpContent webpContent--notice">
19
  <p>
20
  <?php
21
  echo esc_html(
@@ -29,14 +30,14 @@
29
  </p>
30
  <ul>
31
  <?php foreach ( $steps as $step_index => $step_message ) : ?>
32
- <li>
33
- <?php echo wp_kses_post( ( $step_index + 1 ) . '. ' . $step_message ); ?>
34
- </li>
35
  <?php endforeach; ?>
36
  </ul>
37
- <div class="webpContent__buttons">
38
  <button type="button" data-permanently
39
- class="webpContent__button webpButton webpButton--blue webpButton--bg"
40
  >
41
  <?php echo esc_html( __( 'Done', 'webp-converter-for-media' ) ); ?>
42
  </button>
6
  * @var string $close_action Action using in WP Ajax.
7
  * @var string $service_name .
8
  * @var string[] $steps Instructions to follow.
9
+ *
10
+ * @package Converter for Media
11
  */
12
 
13
  ?>
16
  data-notice-action="<?php echo esc_attr( $close_action ); ?>"
17
  data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
18
  >
19
+ <div class="webpcContent webpcContent--notice">
20
  <p>
21
  <?php
22
  echo esc_html(
30
  </p>
31
  <ul>
32
  <?php foreach ( $steps as $step_index => $step_message ) : ?>
33
+ <li>
34
+ <?php echo wp_kses_post( ( $step_index + 1 ) . '. ' . $step_message ); ?>
35
+ </li>
36
  <?php endforeach; ?>
37
  </ul>
38
+ <div class="webpcContent__buttons">
39
  <button type="button" data-permanently
40
+ class="webpcContent__button webpcButton webpcButton--blue webpcButton--bg"
41
  >
42
  <?php echo esc_html( __( 'Done', 'webp-converter-for-media' ) ); ?>
43
  </button>
templates/components/notices/thanks.php CHANGED
@@ -4,7 +4,8 @@
4
  *
5
  * @var string $ajax_url URL of admin-ajax.
6
  * @var string $close_action Action using in WP Ajax.
7
- * @package WebP Converter for Media
 
8
  */
9
 
10
  ?>
@@ -13,7 +14,7 @@
13
  data-notice-action="<?php echo esc_attr( $close_action ); ?>"
14
  data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
15
  >
16
- <div class="webpContent webpContent--notice">
17
  <h4>
18
  <?php echo esc_html( __( 'Thank you for using our plugin Converter for Media!', 'webp-converter-for-media' ) ); ?>
19
  </h4>
@@ -24,15 +25,15 @@
24
  );
25
  ?>
26
  </p>
27
- <div class="webpContent__buttons">
28
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post"
29
  target="_blank"
30
- class="webpContent__button webpButton webpButton--blue webpButton--bg"
31
  >
32
  <?php echo esc_html( __( 'Add plugin review', 'webp-converter-for-media' ) ); ?>
33
  </a>
34
  <button type="button" data-permanently
35
- class="webpContent__button webpButton webpButton--gray webpButton--bg"
36
  >
37
  <?php echo esc_html( __( 'Hide, do not show again', 'webp-converter-for-media' ) ); ?>
38
  </button>
4
  *
5
  * @var string $ajax_url URL of admin-ajax.
6
  * @var string $close_action Action using in WP Ajax.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
14
  data-notice-action="<?php echo esc_attr( $close_action ); ?>"
15
  data-notice-url="<?php echo esc_url( $ajax_url ); ?>"
16
  >
17
+ <div class="webpcContent webpcContent--notice">
18
  <h4>
19
  <?php echo esc_html( __( 'Thank you for using our plugin Converter for Media!', 'webp-converter-for-media' ) ); ?>
20
  </h4>
25
  );
26
  ?>
27
  </p>
28
+ <div class="webpcContent__buttons">
29
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post"
30
  target="_blank"
31
+ class="webpcContent__button webpcButton webpcButton--blue webpcButton--bg"
32
  >
33
  <?php echo esc_html( __( 'Add plugin review', 'webp-converter-for-media' ) ); ?>
34
  </a>
35
  <button type="button" data-permanently
36
+ class="webpcContent__button webpcButton webpcButton--gray webpcButton--bg"
37
  >
38
  <?php echo esc_html( __( 'Hide, do not show again', 'webp-converter-for-media' ) ); ?>
39
  </button>
templates/components/notices/welcome.php CHANGED
@@ -3,14 +3,15 @@
3
  * Notice displayed in admin panel.
4
  *
5
  * @var string $settings_url URL of plugin settings page (default view).
6
- * @package WebP Converter for Media
 
7
  */
8
 
9
  ?>
10
  <div class="notice notice-success"
11
  data-notice="webp-converter-for-media"
12
  >
13
- <div class="webpContent webpContent--notice">
14
  <h4>
15
  <?php echo esc_html( __( 'Thank you for installing our plugin Converter for Media!', 'webp-converter-for-media' ) ); ?>
16
  </h4>
@@ -18,17 +19,16 @@
18
  <?php
19
  echo wp_kses_post(
20
  sprintf(
21
- /* translators: %1$s: br tag, %2$s: icon heart */
22
- __( 'Would you like to speed up your website using our plugin? %1$sGo to plugin settings and convert all your images to WebP with one click! Thank you for being with us! %2$s', 'webp-converter-for-media' ),
23
- '<br>',
24
  '<span class="dashicons dashicons-heart"></span>'
25
  )
26
  );
27
  ?>
28
  </p>
29
- <div class="webpContent__buttons">
30
  <a href="<?php echo esc_url( $settings_url ); ?>"
31
- class="webpContent__button webpButton webpButton--green"
32
  >
33
  <?php echo esc_html( __( 'Speed up my website', 'webp-converter-for-media' ) ); ?>
34
  </a>
3
  * Notice displayed in admin panel.
4
  *
5
  * @var string $settings_url URL of plugin settings page (default view).
6
+ *
7
+ * @package Converter for Media
8
  */
9
 
10
  ?>
11
  <div class="notice notice-success"
12
  data-notice="webp-converter-for-media"
13
  >
14
+ <div class="webpcContent webpcContent--notice">
15
  <h4>
16
  <?php echo esc_html( __( 'Thank you for installing our plugin Converter for Media!', 'webp-converter-for-media' ) ); ?>
17
  </h4>
19
  <?php
20
  echo wp_kses_post(
21
  sprintf(
22
+ /* translators: %s: icon heart */
23
+ __( 'Go to the plugin settings and optimize all your images with one click! Thank you for being with us! %s', 'webp-converter-for-media' ),
 
24
  '<span class="dashicons dashicons-heart"></span>'
25
  )
26
  );
27
  ?>
28
  </p>
29
+ <div class="webpcContent__buttons">
30
  <a href="<?php echo esc_url( $settings_url ); ?>"
31
+ class="webpcContent__button webpcButton webpcButton--blue webpcButton--bg"
32
  >
33
  <?php echo esc_html( __( 'Speed up my website', 'webp-converter-for-media' ) ); ?>
34
  </a>
templates/components/server/debug.php CHANGED
@@ -8,8 +8,9 @@
8
  * @var string $size_png2_url Size of file.
9
  * @var string $size_png_as_webp_url Size of file.
10
  * @var string $size_png2_as_webp_url Size of file.
11
- * @var mixed[] $plugin_settings .
12
- * @package WebP Converter for Media
 
13
  */
14
 
15
  ?>
8
  * @var string $size_png2_url Size of file.
9
  * @var string $size_png_as_webp_url Size of file.
10
  * @var string $size_png2_as_webp_url Size of file.
11
+ * @var mixed[] $plugin_settings Option keys with values.
12
+ *
13
+ * @package Converter for Media
14
  */
15
 
16
  ?>
templates/components/server/filters.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Information about using filters displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
@@ -12,13 +12,13 @@
12
  <tr>
13
  <td class="e">webpc_site_root</td>
14
  <td class="v">
15
- <?php echo esc_html( apply_filters( 'webpc_site_root', '-' ) ); ?>
16
  </td>
17
  </tr>
18
  <tr>
19
  <td class="e">webpc_site_url</td>
20
  <td class="v">
21
- <?php echo esc_html( apply_filters( 'webpc_site_url', get_home_url() ) ); ?>
22
  </td>
23
  </tr>
24
  <tr>
@@ -48,19 +48,19 @@
48
  <tr>
49
  <td class="e">webpc_htaccess_rewrite_root</td>
50
  <td class="v">
51
- <?php echo esc_html( apply_filters( 'webpc_htaccess_rewrite_root', '-' ) ); ?>
52
  </td>
53
  </tr>
54
  <tr>
55
  <td class="e">webpc_htaccess_rewrite_path</td>
56
  <td class="v">
57
- <?php echo esc_html( apply_filters( 'webpc_htaccess_rewrite_path', '-' ) ); ?>
58
  </td>
59
  </tr>
60
  <tr>
61
  <td class="e">webpc_uploads_prefix</td>
62
  <td class="v">
63
- <?php echo esc_html( apply_filters( 'webpc_uploads_prefix', '-' ) ); ?>
64
  </td>
65
  </tr>
66
  </tbody>
2
  /**
3
  * Information about using filters displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
12
  <tr>
13
  <td class="e">webpc_site_root</td>
14
  <td class="v">
15
+ <?php echo esc_html( apply_filters( 'webpc_site_root', '' ) ?: '-' ); ?>
16
  </td>
17
  </tr>
18
  <tr>
19
  <td class="e">webpc_site_url</td>
20
  <td class="v">
21
+ <?php echo esc_html( apply_filters( 'webpc_site_url', get_site_url() ) ); ?>
22
  </td>
23
  </tr>
24
  <tr>
48
  <tr>
49
  <td class="e">webpc_htaccess_rewrite_root</td>
50
  <td class="v">
51
+ <?php echo esc_html( apply_filters( 'webpc_htaccess_rewrite_root', '' ) ?: '-' ); ?>
52
  </td>
53
  </tr>
54
  <tr>
55
  <td class="e">webpc_htaccess_rewrite_path</td>
56
  <td class="v">
57
+ <?php echo esc_html( apply_filters( 'webpc_htaccess_rewrite_path', '' ) ?: '-' ); ?>
58
  </td>
59
  </tr>
60
  <tr>
61
  <td class="e">webpc_uploads_prefix</td>
62
  <td class="v">
63
+ <?php echo esc_html( apply_filters( 'webpc_uploads_prefix', '' ) ?: '-' ); ?>
64
  </td>
65
  </tr>
66
  </tbody>
templates/components/server/gd.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Information about GD library displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
2
  /**
3
  * Information about GD library displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
templates/components/server/imagick.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Information about Imagick library displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
2
  /**
3
  * Information about Imagick library displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
templates/components/server/options.php CHANGED
@@ -2,12 +2,11 @@
2
  /**
3
  * Information about plugin options displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  use WebpConverter\Conversion\Cron\CronStatusManager;
9
  use WebpConverter\Notice\CloudflareNotice;
10
- use WebpConverter\Notice\CloudwaysNotice;
11
  use WebpConverter\Notice\LitespeedNotice;
12
  use WebpConverter\Service\OptionsAccessManager;
13
 
2
  /**
3
  * Information about plugin options displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  use WebpConverter\Conversion\Cron\CronStatusManager;
9
  use WebpConverter\Notice\CloudflareNotice;
 
10
  use WebpConverter\Notice\LitespeedNotice;
11
  use WebpConverter\Service\OptionsAccessManager;
12
 
templates/components/server/php.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Information about PHP configuration displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
2
  /**
3
  * Information about PHP configuration displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
templates/components/server/wordpress.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Information about WordPress config displayed in server configuration widget.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
2
  /**
3
  * Information about WordPress config displayed in server configuration widget.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
templates/components/widgets/about.php CHANGED
@@ -1,27 +1,16 @@
1
  <?php
2
  /**
3
- * Widget displayed information about plugin operation on plugin settings page.
4
  *
5
- * @package WebP Converter for Media
6
  */
7
 
8
  ?>
9
- <div class="webpPage__widget">
10
- <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
11
- <?php echo esc_html( __( 'How does this work?', 'webp-converter-for-media' ) ); ?>
12
  </h3>
13
- <div class="webpContent">
14
- <p>
15
- <?php
16
- echo wp_kses_post(
17
- sprintf(
18
- /* translators: %1$s: button label */
19
- __( 'By adding images to your Media Library, they are automatically converted and saved in the separate directory. Images are converted using a selected conversion method. After installing the plugin, you need to convert all images once using the "%1$s" button.', 'webp-converter-for-media' ),
20
- __( 'Regenerate All', 'webp-converter-for-media' )
21
- )
22
- );
23
- ?>
24
- </p>
25
  <p>
26
  <?php
27
  echo wp_kses_post(
@@ -36,17 +25,10 @@
36
  );
37
  ?>
38
  </p>
39
- <p>
40
- <?php
41
- echo wp_kses_post(
42
- __( 'Image URLs are modified using the module mod_rewrite on the server, i.e. the same, thanks to which we can use friendly links in WordPress. Additionally, the MIME type of the sent file is modified.', 'webp-converter-for-media' )
43
- );
44
- ?>
45
- </p>
46
  <p class="center">
47
  <a href="https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/"
48
  target="_blank"
49
- class="webpButton webpButton--blue"
50
  >
51
  <?php echo esc_html( __( 'Find out more', 'webp-converter-for-media' ) ); ?>
52
  </a>
1
  <?php
2
  /**
3
+ * Widget displayed on plugin settings page.
4
  *
5
+ * @package Converter for Media
6
  */
7
 
8
  ?>
9
+ <div class="webpcPage__widget">
10
+ <h3 class="webpcPage__widgetTitle">
11
+ <?php echo esc_html( __( 'How does it work?', 'webp-converter-for-media' ) ); ?>
12
  </h3>
13
+ <div class="webpcContent">
 
 
 
 
 
 
 
 
 
 
 
14
  <p>
15
  <?php
16
  echo wp_kses_post(
25
  );
26
  ?>
27
  </p>
 
 
 
 
 
 
 
28
  <p class="center">
29
  <a href="https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/"
30
  target="_blank"
31
+ class="webpcButton webpcButton--blue"
32
  >
33
  <?php echo esc_html( __( 'Find out more', 'webp-converter-for-media' ) ); ?>
34
  </a>
templates/components/widgets/donate.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * Widget displayed information about about donation on plugin settings page.
4
- *
5
- * @package WebP Converter for Media
6
- */
7
-
8
- ?>
9
- <div class="webpPage__widget">
10
- <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
11
- <?php echo esc_html( __( 'I love what I do!', 'webp-converter-for-media' ) ); ?>
12
- </h3>
13
- <div class="webpContent">
14
- <p>
15
- <?php
16
- echo wp_kses_post(
17
- __( 'However, working on plugins and technical support requires many hours of work. If you want to appreciate it, you can provide me a coffee.', 'webp-converter-for-media' )
18
- );
19
- ?>
20
- </p>
21
- <p>
22
- <?php
23
- echo wp_kses_post(
24
- __( 'If every plugin user did it, I could devote myself fully to working on this plugin. Thanks everyone!', 'webp-converter-for-media' )
25
- );
26
- ?>
27
- </p>
28
- <p class="center">
29
- <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=widget-donate"
30
- target="_blank"
31
- class="webpButton webpButton--blue dashicons-heart"
32
- >
33
- <?php echo esc_html( __( 'Provide me a coffee', 'webp-converter-for-media' ) ); ?>
34
- </a>
35
- </p>
36
- </div>
37
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/components/widgets/errors.php CHANGED
@@ -1,19 +1,20 @@
1
  <?php
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>
1
  <?php
2
  /**
3
+ * Widget displayed on plugin settings page.
4
  *
5
+ * @var string[][] $errors_messages Arrays with array of paragraphs.
6
+ * @var string[] $errors_codes List of server configuration errors.
7
+ *
8
+ * @package Converter for Media
9
  */
10
 
11
  ?>
12
  <?php if ( $errors_messages ) : ?>
13
+ <div class="webpcPage__widget">
14
+ <h3 class="webpcPage__widgetTitle webpcPage__widgetTitle--error">
15
  <?php echo esc_html( __( 'Server configuration error', 'webp-converter-for-media' ) ); ?>
16
  </h3>
17
+ <div class="webpcContent webpcContent--wide">
18
  <?php foreach ( $errors_messages as $error_index => $error_lines ) : ?>
19
  <?php if ( $error_index > 0 ) : ?>
20
  <p>---</p>
templates/components/widgets/menu.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Widget displayed on plugin settings page.
4
+ *
5
+ * @var string[][] $menu_items Tabs on plugin settings page.
6
+ *
7
+ * @package Converter for Media
8
+ */
9
+
10
+ ?>
11
+ <div class="webpcMenu">
12
+ <div class="webpcMenu__wrapper">
13
+ <div class="webpcMenu__items">
14
+ <?php foreach ( $menu_items as $menu_item ) : ?>
15
+ <div class="webpcMenu__item">
16
+ <a href="<?php echo esc_attr( $menu_item['url'] ); ?>"
17
+ class="webpcMenu__itemLink <?php echo ( $menu_item['is_active'] ) ? 'webpcMenu__itemLink--active' : ''; ?>">
18
+ <?php echo esc_attr( $menu_item['title'] ); ?>
19
+ </a>
20
+ </div>
21
+ <?php endforeach; ?>
22
+ </div>
23
+ </div>
24
+ </div>
templates/components/widgets/options-sidebar.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Widget displayed in sidebar on plugin settings page.
4
+ *
5
+ * @var mixed[] $form_sidebar_options Settings options in sidebar.
6
+ * @var string $form_input_name Name of hidden field with form ID.
7
+ * @var string $form_sidebar_input_value ID of settings form.
8
+ * @var string $nonce_input_name Name of hidden field with WordPress Nonce value.
9
+ * @var string $nonce_input_value WordPress Nonce value.
10
+ * @var bool $token_valid_status Status of PRO version.
11
+ * @var string $api_calculate_url URL of REST API endpoint.
12
+ *
13
+ * @package Converter for Media
14
+ */
15
+
16
+ ?>
17
+ <div class="webpcPage__widget webpcPage__widget--border">
18
+ <h3 class="webpcPage__widgetTitle webpcPage__widgetTitle--logo">
19
+ <?php echo esc_html( __( 'PRO version', 'webp-converter-for-media' ) ); ?>
20
+ </h3>
21
+ <form method="post" action="" class="webpcContent">
22
+ <input type="hidden" name="<?php echo esc_attr( $form_input_name ); ?>"
23
+ value="<?php echo esc_attr( $form_sidebar_input_value ); ?>">
24
+ <input type="hidden" name="<?php echo esc_attr( $nonce_input_name ); ?>"
25
+ value="<?php echo esc_attr( $nonce_input_value ); ?>">
26
+ <?php foreach ( $form_sidebar_options as $index => $option ) : ?>
27
+ <div class="webpcPage__widgetRow">
28
+ <ul class="webpcPage__widgetColumns">
29
+ <li class="webpcPage__widgetColumn">
30
+ <h4><?php echo esc_html( $option['label'] ); ?></h4>
31
+ <?php include dirname( __DIR__ ) . '/fields/' . $option['type'] . '.php'; ?>
32
+ </li>
33
+ <?php if ( $option['notice_lines'] ) : ?>
34
+ <li class="webpcPage__widgetColumn">
35
+ <div class="webpcPage__widgetNotice">
36
+ <?php foreach ( $option['notice_lines'] as $line ) : ?>
37
+ <p><?php echo wp_kses_post( $line ); ?></p>
38
+ <?php endforeach; ?>
39
+ </div>
40
+ </li>
41
+ <?php endif; ?>
42
+ </ul>
43
+ </div>
44
+ <?php endforeach; ?>
45
+ <div class="webpcPage__widgetRow">
46
+ <?php if ( ! $token_valid_status ) : ?>
47
+ <button type="submit" class="webpcButton webpcButton--blue webpcButton--bg">
48
+ <?php echo esc_html( __( 'Activate Token', 'webp-converter-for-media' ) ); ?>
49
+ </button>
50
+ <?php else : ?>
51
+ <button type="submit" class="webpcButton webpcButton--red">
52
+ <?php echo esc_html( __( 'Deactivate Token', 'webp-converter-for-media' ) ); ?>
53
+ </button>
54
+ <?php endif; ?>
55
+ </div>
56
+ </form>
57
+ </div>
templates/components/widgets/options.php CHANGED
@@ -1,35 +1,35 @@
1
  <?php
2
  /**
3
- * Widget displayed settings form on plugin settings page.
4
  *
5
- * @var mixed[] $options Options of plugin settings.
6
- * @var string $submit_value Value of submit button.
7
- * @var string $submit_activate_token .
8
- * @var string $submit_deactivate_token .
9
- * @var string $nonce_input_name .
10
- * @var string $nonce_input_value .
11
- * @var bool $token_valid_status .
12
- * @var string $settings_debug_url URL of plugin settings page (debug view).
13
- * @var string $api_calculate_url URL of REST API endpoint.
14
- * @package WebP Converter for Media
15
  */
16
 
17
  ?>
18
- <div class="webpPage__widget">
19
- <h3 class="webpPage__widgetTitle">
20
- <?php echo esc_html( __( 'Settings', 'webp-converter-for-media' ) ); ?>
21
- </h3>
22
- <div class="webpContent">
23
- <?php foreach ( $options as $index => $option ) : ?>
24
- <div class="webpPage__widgetRow">
25
- <ul class="webpPage__widgetColumns">
26
- <li class="webpPage__widgetColumn">
 
27
  <h4><?php echo esc_html( $option['label'] ); ?></h4>
28
  <?php include dirname( __DIR__ ) . '/fields/' . $option['type'] . '.php'; ?>
29
  </li>
30
  <?php if ( $option['notice_lines'] ) : ?>
31
- <li class="webpPage__widgetColumn">
32
- <div class="webpPage__widgetColumnNotice">
33
  <?php foreach ( $option['notice_lines'] as $line ) : ?>
34
  <p><?php echo wp_kses_post( $line ); ?></p>
35
  <?php endforeach; ?>
@@ -39,35 +39,10 @@
39
  </ul>
40
  </div>
41
  <?php endforeach; ?>
42
- <div class="webpPage__widgetRow">
43
- <input type="hidden"
44
- name="<?php echo esc_attr( $nonce_input_name ); ?>"
45
- value="<?php echo esc_attr( $nonce_input_value ); ?>"
46
- >
47
- <button type="submit"
48
- name="<?php echo esc_attr( $submit_value ); ?>"
49
- class="webpButton webpButton--green"
50
- >
51
  <?php echo esc_html( __( 'Save Changes', 'webp-converter-for-media' ) ); ?>
52
  </button>
53
  </div>
54
- <div class="webpPage__widgetRow">
55
- <p>
56
- <?php
57
- echo wp_kses_post(
58
- sprintf(
59
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag, %5$s: open anchor tag, %6$s: close anchor tag */
60
- __( 'If you have a problem %1$scheck our FAQ%2$s first. If you did not find help there, please %3$scheck support forum%4$s for any similar problem or contact us. Before you contact us, %5$scheck the configuration%6$s of your server.', 'webp-converter-for-media' ),
61
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
62
- '</a>',
63
- '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
64
- '</a>',
65
- '<a href="' . $settings_debug_url . '">',
66
- '</a>'
67
- )
68
- );
69
- ?>
70
- </p>
71
- </div>
72
- </div>
73
  </div>
1
  <?php
2
  /**
3
+ * Widget displayed in main container on plugin settings page.
4
  *
5
+ * @var mixed[] $form_options Settings options in main container.
6
+ * @var string $form_input_name Name of hidden field with form ID.
7
+ * @var string $form_input_value ID of settings form in main container.
8
+ * @var string $nonce_input_name Name of hidden field with WordPress Nonce value.
9
+ * @var string $nonce_input_value WordPress Nonce value.
10
+ * @var bool $token_valid_status Status of PRO version.
11
+ * @var string $api_calculate_url URL of REST API endpoint.
12
+ *
13
+ * @package Converter for Media
 
14
  */
15
 
16
  ?>
17
+ <div class="webpcPage__widget">
18
+ <form method="post" action="" class="webpcContent">
19
+ <input type="hidden" name="<?php echo esc_attr( $form_input_name ); ?>"
20
+ value="<?php echo esc_attr( $form_input_value ); ?>">
21
+ <input type="hidden" name="<?php echo esc_attr( $nonce_input_name ); ?>"
22
+ value="<?php echo esc_attr( $nonce_input_value ); ?>">
23
+ <?php foreach ( $form_options as $index => $option ) : ?>
24
+ <div class="webpcPage__widgetRow">
25
+ <ul class="webpcPage__widgetColumns">
26
+ <li class="webpcPage__widgetColumn">
27
  <h4><?php echo esc_html( $option['label'] ); ?></h4>
28
  <?php include dirname( __DIR__ ) . '/fields/' . $option['type'] . '.php'; ?>
29
  </li>
30
  <?php if ( $option['notice_lines'] ) : ?>
31
+ <li class="webpcPage__widgetColumn">
32
+ <div class="webpcPage__widgetNotice">
33
  <?php foreach ( $option['notice_lines'] as $line ) : ?>
34
  <p><?php echo wp_kses_post( $line ); ?></p>
35
  <?php endforeach; ?>
39
  </ul>
40
  </div>
41
  <?php endforeach; ?>
42
+ <div class="webpcPage__widgetRow">
43
+ <button type="submit" class="webpcButton webpcButton--blue webpcButton--bg">
 
 
 
 
 
 
 
44
  <?php echo esc_html( __( 'Save Changes', 'webp-converter-for-media' ) ); ?>
45
  </button>
46
  </div>
47
+ </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </div>
templates/components/widgets/regenerate.php CHANGED
@@ -1,133 +1,183 @@
1
  <?php
2
  /**
3
- * Widget allows regeneration images on plugin settings page.
4
  *
5
- * @var bool $token_valid_status .
6
- * @var string $api_paths_url URL of REST API endpoint.
7
- * @var string $api_regenerate_url URL of REST API endpoint.
8
- * @package WebP Converter for Media
 
 
9
  */
10
 
11
- use WebpConverter\WebpConverterConstants;
12
-
13
  ?>
14
- <div class="webpPage__widget">
15
- <h3 class="webpPage__widgetTitle">
16
- <?php echo esc_html( __( 'Regenerate images', 'webp-converter-for-media' ) ); ?>
17
  </h3>
18
- <div class="webpLoader webpContent"
 
19
  data-api-paths="<?php echo esc_url( $api_paths_url ); ?>"
20
  data-api-regenerate="<?php echo esc_url( $api_regenerate_url ); ?>"
21
  data-api-error-message="<?php echo esc_html( __( 'An error occurred while connecting to REST API. Please try again.', 'webp-converter-for-media' ) ); ?>"
22
  >
23
- <div class="webpPage__widgetRow">
24
  <p>
25
- <?php echo wp_kses_post( __( 'Convert all existing images with just one click! This tool uses the WordPress REST API by downloading addresses of all images and converting all files gradually. This is a process that can take anywhere from several minutes to many hours depending on the number of files. During this process, please do not close your browser window.', 'webp-converter-for-media' ) ); ?>
26
  </p>
27
- <p>
28
- <?php echo wp_kses_post( __( 'This operation should be performed only once after installing the plugin. New images from the Media Library will be converted automatically. For other images, e.g. from the /themes or /uploads directory that are not from the Media Library, you must start manual conversion after adding new images.', 'webp-converter-for-media' ) ); ?>
29
- </p>
30
- <div class="webpLoader__status" hidden>
31
- <div class="webpLoader__bar">
32
- <div class="webpLoader__barProgress" data-percent="0">
33
- <div class="webpLoader__barCount"></div>
34
- </div>
35
- <div class="webpLoader__progress">
36
- <?php
37
- echo sprintf(
38
- /* translators: %s progress value */
39
- wp_kses_post( __( 'Saving the weight of your images: %s', 'webp-converter-for-media' ) ),
40
- '<span class="webpLoader__progressValue webpLoader__progressValue--size">0 kB</span>'
41
- );
42
- ?>
43
- <br>
44
- <?php
45
- echo sprintf(
46
- /* translators: %s images count */
47
- wp_kses_post( __( 'Successfully converted files: %s', 'webp-converter-for-media' ) ),
48
- '<span class="webpLoader__progressValue webpLoader__progressValue--successful">0</span>'
49
- );
50
- ?>
51
- <br>
52
- <?php
53
- echo sprintf(
54
- /* translators: %s images count */
55
- wp_kses_post( __( 'Failed or skipped file conversion attempts: %s', 'webp-converter-for-media' ) ),
56
- '<span class="webpLoader__progressValue webpLoader__progressValue--failed">0 </span>'
57
- );
58
- ?>
59
- </div>
60
- </div>
61
- <div class="webpLoader__success" hidden>
62
- <div class="webpLoader__successContent">
63
- <?php echo wp_kses_post( __( 'The process was completed successfully. Your images have been converted!', 'webp-converter-for-media' ) ); ?>
64
- <?php echo wp_kses_post( __( 'Please flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ) ); ?>
65
- <br>
66
- <?php
67
- echo wp_kses_post(
68
- sprintf(
69
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
70
- __( 'Do you want to know how a plugin works and how to check if it is working properly? Read %1$sour manual%2$s.', 'webp-converter-for-media' ),
71
- '<a href="https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/" target="_blank">',
72
- '</a>'
73
- )
74
- );
75
- ?>
76
- </div>
77
- </div>
78
- <?php if ( ! $token_valid_status ) : ?>
79
- <div class="webpLoader__popup webpPopup" hidden>
80
- <div class="webpPopup__inner">
81
- <div class="webpPopup__image"></div>
82
- <div class="webpPopup__content">
83
- <p>
84
  <?php
85
  echo wp_kses_post(
86
  sprintf(
87
- /* translators: %s break line tag */
88
- __( 'Hello, my name is Mateusz! %sI am glad you managed to reduce the weight of your website. Did you know that you can achieve even better image optimization results? Check how much you can reduce the weight of images on your website by also using the AVIF format.', 'webp-converter-for-media' ),
89
  '<br>'
90
  )
91
  );
92
  ?>
93
- </p>
94
- <p>
95
- <a href="<?php echo esc_url( sprintf( WebpConverterConstants::OPTIMIZATION_TEST_PREFIX_URL, 'regeneration-notice-upgrade' ) ); ?>"
96
- target="_blank"
97
- class="webpButton webpButton--blue dashicons-external"
98
- >
99
- <?php echo wp_kses_post( __( 'Test image optimization', 'webp-converter-for-media' ) ); ?>
100
- </a>
101
- </p>
102
  </div>
103
  </div>
 
 
 
 
 
104
  </div>
105
- <?php endif; ?>
106
- <div class="webpLoader__errors" hidden>
107
- <div class="webpLoader__errorsTitle">
108
- <?php echo esc_html( __( 'Additional informations about process:', 'webp-converter-for-media' ) ); ?>
109
- </div>
110
- <div class="webpLoader__errorsContent"></div>
111
- </div>
112
  </div>
113
  </div>
114
- <div class="webpPage__widgetRow">
115
- <div class="webpField">
116
  <input type="checkbox"
117
  name="regenerate_force"
118
  value="1"
119
  id="webpc-regenerate-force"
120
- class="webpField__input webpField__input--toggle">
121
  <label for="webpc-regenerate-force"></label>
122
- <span class="webpField__label">
123
- <?php echo esc_html( __( 'Force convert all images again', 'webp-converter-for-media' ) ); ?>
124
  </span>
125
  </div>
126
  <button type="button"
127
- class="webpLoader__button webpButton webpButton--green"
128
- <?php echo ( apply_filters( 'webpc_server_errors', [], true ) ) ? 'disabled' : ''; ?>>
129
- <?php echo esc_html( __( 'Regenerate All', 'webp-converter-for-media' ) ); ?>
 
130
  </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  </div>
132
  </div>
133
  </div>
1
  <?php
2
  /**
3
+ * Widget displayed on plugin settings page.
4
  *
5
+ * @var string $api_calculate_url URL of REST API endpoint.
6
+ * @var string $api_paths_url URL of REST API endpoint.
7
+ * @var string $api_regenerate_url URL of REST API endpoint.
8
+ * @var string[][] $output_formats Data about output formats for regeneration.
9
+ *
10
+ * @package Converter for Media
11
  */
12
 
 
 
13
  ?>
14
+ <div class="webpcPage__widget">
15
+ <h3 class="webpcPage__widgetTitle">
16
+ <?php echo esc_html( __( 'Bulk Optimization of Images', 'webp-converter-for-media' ) ); ?>
17
  </h3>
18
+ <div class="webpcLoader webpcContent"
19
+ data-api-calculate="<?php echo esc_url( $api_calculate_url ); ?>"
20
  data-api-paths="<?php echo esc_url( $api_paths_url ); ?>"
21
  data-api-regenerate="<?php echo esc_url( $api_regenerate_url ); ?>"
22
  data-api-error-message="<?php echo esc_html( __( 'An error occurred while connecting to REST API. Please try again.', 'webp-converter-for-media' ) ); ?>"
23
  >
24
+ <div class="webpcPage__widgetRow">
25
  <p>
26
+ <?php echo wp_kses_post( __( 'Optimize all your images with just one click!', 'webp-converter-for-media' ) ); ?>
27
  </p>
28
+ </div>
29
+ <div class="webpcPage__widgetRow">
30
+ <div class="webpcPage__widgetNotice">
31
+ <p>
32
+ <?php
33
+ echo wp_kses_post(
34
+ sprintf(
35
+ /* translators: %1$s: open strong tag, %2$s: close strong tag */
36
+ __( 'Converting images to WebP and AVIF simultaneously guarantees the lowest weight of your images and compatibility with all browsers. By using the AVIF format you will reduce the weight of the images even more compared to WebP.', 'webp-converter-for-media' ),
37
+ '<strong>',
38
+ '</strong>'
39
+ )
40
+ );
41
+ ?>
42
+ </p>
43
+ </div>
44
+ </div>
45
+ <div class="webpcPage__widgetRow">
46
+ <div class="webpcLoader__columns">
47
+ <?php foreach ( $output_formats as $format_key => $format_data ) : ?>
48
+ <div class="webpcLoader__column"
49
+ data-counter="<?php echo esc_attr( $format_key ); ?>">
50
+ <div class="webpcLoader__columnInner">
51
+ <svg class="webpcLoader__columnCircle" viewBox="0 0 200 200"
52
+ preserveAspectRatio="xMinYMin meet">
53
+ <g>
54
+ <circle cx="50%" cy="50%" r="95" />
55
+ </g>
56
+ </svg>
57
+ <div class="webpcLoader__columnOverlay">
58
+ <div class="webpcLoader__columnOverlayTitle">
59
+ <?php
60
+ echo wp_kses_post(
61
+ sprintf(
62
+ /* translators: %1$s: percent value, %2$s: output format */
63
+ __( '%1$s converted to %2$s', 'webp-converter-for-media' ),
64
+ '<strong><span data-counter-percent>0</span>%</strong>',
65
+ esc_html( $format_data['label'] )
66
+ )
67
+ );
68
+ ?>
69
+ </div>
70
+ <div class="webpcLoader__columnOverlayDesc webpcLoader__columnOverlayDesc--active">
71
+ <?php
72
+ echo wp_kses_post(
73
+ sprintf(
74
+ /* translators: %s: images count */
75
+ __( '%s images remaining', 'webp-converter-for-media' ),
76
+ '<span data-counter-left>0</span>'
77
+ )
78
+ );
79
+ ?>
80
+ </div>
81
+ <div class="webpcLoader__columnOverlayDesc webpcLoader__columnOverlayDesc--loading">
 
 
 
82
  <?php
83
  echo wp_kses_post(
84
  sprintf(
85
+ /* translators: %s: break line tag */
86
+ __( 'Calculating, %splease wait', 'webp-converter-for-media' ),
87
  '<br>'
88
  )
89
  );
90
  ?>
91
+ </div>
 
 
 
 
 
 
 
 
92
  </div>
93
  </div>
94
+ <?php if ( $format_data['desc'] ) : ?>
95
+ <div class="webpcLoader__columnDesc">
96
+ <?php echo wp_kses_post( $format_data['desc'] ); ?>
97
+ </div>
98
+ <?php endif; ?>
99
  </div>
100
+ <?php endforeach; ?>
 
 
 
 
 
 
101
  </div>
102
  </div>
103
+ <div class="webpcPage__widgetRow">
104
+ <div class="webpcField">
105
  <input type="checkbox"
106
  name="regenerate_force"
107
  value="1"
108
  id="webpc-regenerate-force"
109
+ class="webpcField__input webpcField__input--toggle">
110
  <label for="webpc-regenerate-force"></label>
111
+ <span class="webpcField__label">
112
+ <?php echo esc_html( __( 'Force the conversion of all images again', 'webp-converter-for-media' ) ); ?>
113
  </span>
114
  </div>
115
  <button type="button"
116
+ class="webpcLoader__button webpcButton webpcButton--blue webpcButton--bg"
117
+ <?php echo ( apply_filters( 'webpc_server_errors', [], true ) ) ? 'disabled' : ''; ?>
118
+ data-submit>
119
+ <?php echo esc_html( __( 'Start Bulk Optimization', 'webp-converter-for-media' ) ); ?>
120
  </button>
121
+ <div class="webpcLoader__status" data-status hidden>
122
+ <div class="webpcLoader__statusContent webpcLoader__statusContent--small">
123
+ <?php echo wp_kses_post( __( 'This is a process that can take anywhere from several minutes to many hours, depending on the number of files. During this process, please do not close your browser window.', 'webp-converter-for-media' ) ); ?>
124
+ </div>
125
+ <div class="webpcLoader__statusProgress" data-status-progress data-percent="0">
126
+ <div class="webpcLoader__statusProgressCount"></div>
127
+ </div>
128
+ <div class="webpcLoader__statusContent">
129
+ <?php
130
+ echo sprintf(
131
+ /* translators: %s progress value */
132
+ wp_kses_post( __( 'Saving the weight of your images: %s', 'webp-converter-for-media' ) ),
133
+ '<strong data-status-count-size>0 kB</strong>'
134
+ );
135
+ ?>
136
+ <br>
137
+ <?php
138
+ echo sprintf(
139
+ /* translators: %s images count */
140
+ wp_kses_post( __( 'Successfully converted files: %s', 'webp-converter-for-media' ) ),
141
+ '<strong data-status-count-success>0</strong>'
142
+ );
143
+ ?>
144
+ <br>
145
+ <?php
146
+ echo sprintf(
147
+ /* translators: %s images count */
148
+ wp_kses_post( __( 'Failed or skipped file conversion attempts: %s', 'webp-converter-for-media' ) ),
149
+ '<strong data-status-count-error>0</strong>'
150
+ );
151
+ ?>
152
+ </div>
153
+ </div>
154
+ <div class="webpcLoader__success" data-success hidden>
155
+ <div class="webpcLoader__successInner">
156
+ <div class="webpcLoader__successContent">
157
+ <?php echo wp_kses_post( __( 'The process was completed successfully. Your images have been converted!', 'webp-converter-for-media' ) ); ?>
158
+ <?php echo wp_kses_post( __( 'Please flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ) ); ?>
159
+ <br>
160
+ <?php
161
+ echo wp_kses_post(
162
+ sprintf(
163
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
164
+ __( 'Do you want to know how a plugin works and how to check if it is working properly? Read %1$sour manual%2$s.', 'webp-converter-for-media' ),
165
+ '<a href="https://wordpress.org/support/topic/how-can-i-check-if-the-plugin-is-working-properly/" target="_blank">',
166
+ '</a>'
167
+ )
168
+ );
169
+ ?>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ <div class="webpcLoader__errors" data-errors hidden>
174
+ <div class="webpcLoader__errorsInner">
175
+ <div class="webpcLoader__errorsTitle">
176
+ <?php echo esc_html( __( 'Additional informations about process:', 'webp-converter-for-media' ) ); ?>
177
+ </div>
178
+ <div class="webpcLoader__errorsContent" data-errors-output></div>
179
+ </div>
180
+ </div>
181
  </div>
182
  </div>
183
  </div>
templates/components/widgets/server.php CHANGED
@@ -1,45 +1,48 @@
1
  <?php
2
  /**
3
- * Widget displayed server configuration on plugin settings page.
4
  *
5
- * @var string $settings_url URL of plugin settings page.
6
  * @var string $size_png_path Size of file.
7
  * @var string $size_png2_path Size of file.
8
  * @var string $size_png_url Size of file.
9
  * @var string $size_png2_url Size of file.
10
  * @var string $size_png_as_webp_url Size of file.
11
  * @var string $size_png2_as_webp_url Size of file.
12
- * @var mixed[] $plugin_settings .
13
- * @package WebP Converter for Media
 
14
  */
15
 
16
  ?>
17
- <div class="webpPage__widget">
18
- <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
19
- <?php echo esc_html( __( 'Your server configuration', 'webp-converter-for-media' ) ); ?>
20
- </h3>
21
- <div class="webpContent">
22
- <div class="webpPage__widgetRow">
23
  <p>
24
  <?php
25
  echo wp_kses_post(
26
  sprintf(
27
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag */
28
- __( 'Please compare your configuration with the configuration that is given in the technical requirements in %1$sthe plugin FAQ%2$s. If your server does not meet the technical requirements, please contact your server Administrator.', 'webp-converter-for-media' ),
29
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
 
 
 
 
30
  '</a>'
31
  )
32
  );
33
  ?>
34
  </p>
35
- <a href="<?php echo esc_url( $settings_url ); ?>"
36
- class="webpLoader__button webpButton webpButton--blue"
37
- >
38
- <?php echo esc_html( __( 'Back to settings', 'webp-converter-for-media' ) ); ?>
39
- </a>
 
 
40
  </div>
41
- <div class="webpPage__widgetRow">
42
- <div class="webpServerInfo">
43
  <?php
44
  require_once dirname( __DIR__ ) . '/server/debug.php';
45
  require_once dirname( __DIR__ ) . '/server/filters.php';
@@ -51,12 +54,5 @@
51
  ?>
52
  </div>
53
  </div>
54
- <div class="webpPage__widgetRow">
55
- <a href="<?php echo esc_url( $settings_url ); ?>"
56
- class="webpLoader__button webpButton webpButton--blue"
57
- >
58
- <?php echo esc_html( __( 'Back to settings', 'webp-converter-for-media' ) ); ?>
59
- </a>
60
- </div>
61
  </div>
62
  </div>
1
  <?php
2
  /**
3
+ * Widget displayed on plugin settings page.
4
  *
 
5
  * @var string $size_png_path Size of file.
6
  * @var string $size_png2_path Size of file.
7
  * @var string $size_png_url Size of file.
8
  * @var string $size_png2_url Size of file.
9
  * @var string $size_png_as_webp_url Size of file.
10
  * @var string $size_png2_as_webp_url Size of file.
11
+ * @var mixed[] $plugin_settings Option keys with values.
12
+ *
13
+ * @package Converter for Media
14
  */
15
 
16
  ?>
17
+ <div class="webpcPage__widget">
18
+ <div class="webpcContent">
19
+ <div class="webpcPage__widgetRow">
 
 
 
20
  <p>
21
  <?php
22
  echo wp_kses_post(
23
  sprintf(
24
+ /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
25
+ __( 'Please %1$scheck our FAQ%2$s before adding a thread with technical problem. If you do not find help there, %3$scheck support forum%4$s for similar problems. If you do not find a solution, please %5$scontact us%6$s.', 'webp-converter-for-media' ),
26
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
27
+ '</a>',
28
+ '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
29
+ '</a>',
30
+ '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
31
  '</a>'
32
  )
33
  );
34
  ?>
35
  </p>
36
+ <p>
37
+ <?php
38
+ echo wp_kses_post(
39
+ __( 'Please attach to your message the configuration of your server (which is available below), e.g. as a screenshot.', 'webp-converter-for-media' )
40
+ );
41
+ ?>
42
+ </p>
43
  </div>
44
+ <div class="webpcPage__widgetRow">
45
+ <div class="webpcServerInfo">
46
  <?php
47
  require_once dirname( __DIR__ ) . '/server/debug.php';
48
  require_once dirname( __DIR__ ) . '/server/filters.php';
54
  ?>
55
  </div>
56
  </div>
 
 
 
 
 
 
 
57
  </div>
58
  </div>
templates/components/widgets/support.php CHANGED
@@ -1,63 +1,30 @@
1
  <?php
2
  /**
3
- * Widget displayed information about support forum on plugin settings page.
4
  *
5
- * @var string $settings_debug_url URL of plugin settings page (debug view).
6
- * @package WebP Converter for Media
 
7
  */
8
 
9
  ?>
10
- <div class="webpPage__widget">
11
- <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
12
  <?php echo esc_html( __( 'We are waiting for your message', 'webp-converter-for-media' ) ); ?>
13
  </h3>
14
- <div class="webpContent">
15
- <p>
16
- <?php
17
- echo wp_kses_post(
18
- __( 'Do you have a technical problem? Please contact us. We will be happy to help you. Or maybe you have an idea for a new feature? Please let us know about it by filling the support form. We will try to add it!', 'webp-converter-for-media' )
19
- );
20
- ?>
21
- </p>
22
- <p>
23
- <?php
24
- echo wp_kses_post(
25
- sprintf(
26
- /* translators: %1$s: open anchor tag, %2$s: close anchor tag, %3$s: open anchor tag, %4$s: close anchor tag */
27
- __( 'Please %1$scheck our FAQ%2$s before adding a thread with technical problem. If you do not find help there, %3$scheck support forum%4$s for similar problems. Before you contact us check the configuration of your server and attach it in your message, e.g. as a screenshot.', 'webp-converter-for-media' ),
28
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
29
- '</a>',
30
- '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
31
- '</a>'
32
- )
33
- );
34
- ?>
35
- </p>
36
- <p class="center">
37
- <a href="<?php echo esc_url( $settings_debug_url ); ?>"
38
- class="webpButton webpButton--blue dashicons-admin-tools"
39
- >
40
- <?php echo esc_html( __( 'Server configuration', 'webp-converter-for-media' ) ); ?>
41
- </a>
42
- <br>
43
- <a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank"
44
- class="webpButton webpButton--blue"
45
- >
46
- <?php echo esc_html( __( 'Get help', 'webp-converter-for-media' ) ); ?>
47
- </a>
48
- </p>
49
  <p>
50
  <?php
51
- echo wp_kses_post(
52
- __( 'Do you like our plugin? Could you rate him? Please let us know what you think about our plugin. It is important that we can develop this tool. Thank you for all the ratings, reviews and donates.', 'webp-converter-for-media' )
53
  );
54
  ?>
55
  </p>
56
  <p class="center">
57
- <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post"
58
- target="_blank" class="webpButton webpButton--blue"
59
  >
60
- <?php echo esc_html( __( 'Add review', 'webp-converter-for-media' ) ); ?>
61
  </a>
62
  </p>
63
  </div>
1
  <?php
2
  /**
3
+ * Widget displayed on plugin settings page.
4
  *
5
+ * @var string $url_debug_page URL of debug tag in settings page.
6
+ *
7
+ * @package Converter for Media
8
  */
9
 
10
  ?>
11
+ <div class="webpcPage__widget">
12
+ <h3 class="webpcPage__widgetTitle">
13
  <?php echo esc_html( __( 'We are waiting for your message', 'webp-converter-for-media' ) ); ?>
14
  </h3>
15
+ <div class="webpcContent">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <p>
17
  <?php
18
+ echo esc_html(
19
+ __( 'Do you have any technical problems or an idea for a new feature? Feel free to contact us.', 'webp-converter-for-media' )
20
  );
21
  ?>
22
  </p>
23
  <p class="center">
24
+ <a href="<?php echo esc_attr( $url_debug_page ); ?>"
25
+ class="webpcButton webpcButton--blue"
26
  >
27
+ <?php echo esc_html( __( 'Help Center', 'webp-converter-for-media' ) ); ?>
28
  </a>
29
  </p>
30
  </div>
templates/views/settings-debug.php CHANGED
@@ -2,37 +2,63 @@
2
  /**
3
  * Debug tab of plugin settings page.
4
  *
5
- * @var string $settings_url URL of plugin settings page (default view).
6
- * @var string $size_png_path Size of file.
7
- * @var string $size_png2_path Size of file.
8
- * @var string $size_png_url Size of file.
9
- * @var string $size_png2_url Size of file.
10
- * @var string $size_png_as_webp_url Size of file.
11
- * @var string $size_png2_as_webp_url Size of file.
12
- * @var mixed[] $plugin_settings .
13
- * @package WebP Converter for Media
 
 
 
 
 
14
  */
15
 
16
  ?>
17
  <div class="wrap">
18
  <hr class="wp-header-end">
19
- <div class="webpPage">
20
- <h1 class="webpPage__headline"><?php echo esc_html( 'Converter for Media' ); ?></h1>
21
- <div class="webpPage__inner">
22
- <ul class="webpPage__columns">
23
- <li class="webpPage__column webpPage__column--large">
 
 
24
  <?php
 
 
25
  require_once dirname( __DIR__ ) . '/components/widgets/server.php';
26
  ?>
27
  </li>
28
- <li class="webpPage__column webpPage__column--small">
29
  <?php
30
  require_once dirname( __DIR__ ) . '/components/widgets/about.php';
31
  require_once dirname( __DIR__ ) . '/components/widgets/support.php';
32
- require_once dirname( __DIR__ ) . '/components/widgets/donate.php';
33
  ?>
34
  </li>
35
  </ul>
36
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  </div>
38
  </div>
2
  /**
3
  * Debug tab of plugin settings page.
4
  *
5
+ * @var string $logo_url Plugin logo.
6
+ * @var string[][] $menu_items Tabs on plugin settings page.
7
+ * @var string[][] $errors_messages Arrays with array of paragraphs.
8
+ * @var string[] $errors_codes List of server configuration errors.
9
+ * @var string $size_png_path Size of file.
10
+ * @var string $size_png2_path Size of file.
11
+ * @var string $size_png_url Size of file.
12
+ * @var string $size_png2_url Size of file.
13
+ * @var string $size_png_as_webp_url Size of file.
14
+ * @var string $size_png2_as_webp_url Size of file.
15
+ * @var mixed[] $plugin_settings Option keys with values.
16
+ * @var string $url_debug_page URL of debug tag in settings page.
17
+ *
18
+ * @package Converter for Media
19
  */
20
 
21
  ?>
22
  <div class="wrap">
23
  <hr class="wp-header-end">
24
+ <div class="webpcPage">
25
+ <div class="webpcPage__headline">
26
+ <img src="<?php echo esc_attr( $logo_url ); ?>" alt="<?php echo esc_attr( 'Converter for Media' ); ?>">
27
+ </div>
28
+ <div class="webpcPage__inner">
29
+ <ul class="webpcPage__columns">
30
+ <li class="webpcPage__column webpcPage__column--large">
31
  <?php
32
+ require_once dirname( __DIR__ ) . '/components/widgets/errors.php';
33
+ require_once dirname( __DIR__ ) . '/components/widgets/menu.php';
34
  require_once dirname( __DIR__ ) . '/components/widgets/server.php';
35
  ?>
36
  </li>
37
+ <li class="webpcPage__column webpcPage__column--small">
38
  <?php
39
  require_once dirname( __DIR__ ) . '/components/widgets/about.php';
40
  require_once dirname( __DIR__ ) . '/components/widgets/support.php';
 
41
  ?>
42
  </li>
43
  </ul>
44
  </div>
45
+ <div class="webpcPage__footer">
46
+ <div class="webpcPage__footerLogo"></div>
47
+ <div class="webpcPage__footerContent">
48
+ <?php
49
+ echo wp_kses_post(
50
+ sprintf(
51
+ /* translators: %1$s: br tag, %2$s: icon heart */
52
+ __( 'Created with %1$s by %2$s - if you like our plugin, please %3$srate one%4$s%5$s', 'webp-converter-for-media' ),
53
+ '<span class="webpcPage__footerIcon webpcPage__footerIcon--heart"></span>',
54
+ '<a href="https://mattplugins.com/?utm_source=webp-converter-for-media&utm_campaign=website-check&utm_medium=plugin-settings-footer" target="_blank">matt plugins</a>',
55
+ '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post" target="_blank">',
56
+ ' <span class="webpcPage__footerIcon webpcPage__footerIcon--stars"></span>',
57
+ '</a>'
58
+ )
59
+ );
60
+ ?>
61
+ </div>
62
+ </div>
63
  </div>
64
  </div>
templates/views/settings.php CHANGED
@@ -2,55 +2,80 @@
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 $submit_activate_token .
10
- * @var string $submit_deactivate_token .
11
- * @var string $nonce_input_name .
12
- * @var string $nonce_input_value .
13
- * @var bool $token_valid_status .
14
- * @var string $settings_url URL of plugin settings page (default view).
15
- * @var string $settings_debug_url URL of plugin settings page (debug view).
16
- * @var string $api_calculate_url URL of REST API endpoint.
17
- * @var string $api_paths_url URL of REST API endpoint.
18
- * @var string $api_regenerate_url URL of REST API endpoint.
19
- * @package WebP Converter for Media
 
 
 
 
20
  */
21
 
22
  ?>
23
  <div class="wrap">
24
  <hr class="wp-header-end">
25
- <form method="post" action="<?php echo esc_url( $settings_url ); ?>" class="webpPage">
26
- <h1 class="webpPage__headline"><?php echo esc_html( 'Converter for Media' ); ?></h1>
27
- <div class="webpPage__inner">
28
- <ul class="webpPage__columns">
29
- <li class="webpPage__column webpPage__column--large">
30
- <?php if ( isset( $_POST[ $submit_value ] ) ) : // phpcs:ignore ?>
31
- <div class="webpPage__alert">
 
 
 
 
 
 
32
  <?php echo esc_html( __( 'Changes were successfully saved!', 'webp-converter-for-media' ) ); ?>
33
  <?php echo esc_html( __( 'Please flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ) ); ?>
34
  </div>
35
- <?php elseif ( isset( $_POST[ $submit_activate_token ] ) && $token_valid_status ) : // phpcs:ignore ?>
36
- <div class="webpPage__alert">
37
- <?php echo esc_html( __( 'The access token has been activated!', 'webp-converter-for-media' ) ); ?>
38
- </div>
39
  <?php endif; ?>
40
  <?php
41
  require_once dirname( __DIR__ ) . '/components/widgets/errors.php';
 
42
  require_once dirname( __DIR__ ) . '/components/widgets/options.php';
43
  require_once dirname( __DIR__ ) . '/components/widgets/regenerate.php';
44
  ?>
45
  </li>
46
- <li class="webpPage__column webpPage__column--small">
47
  <?php
 
48
  require_once dirname( __DIR__ ) . '/components/widgets/about.php';
49
  require_once dirname( __DIR__ ) . '/components/widgets/support.php';
50
- require_once dirname( __DIR__ ) . '/components/widgets/donate.php';
51
  ?>
52
  </li>
53
  </ul>
54
  </div>
55
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  </div>
2
  /**
3
  * Main tab of plugin settings page.
4
  *
5
+ * @var string $logo_url Plugin logo.
6
+ * @var string[][] $menu_items Tabs on plugin settings page.
7
+ * @var string[][] $errors_messages Arrays with array of paragraphs.
8
+ * @var string[] $errors_codes List of server configuration errors.
9
+ * @var mixed[] $form_options Settings options in main container.
10
+ * @var mixed[] $form_sidebar_options Settings options in sidebar.
11
+ * @var string $form_input_name Name of hidden field with form ID.
12
+ * @var string $form_input_value ID of settings form in main container.
13
+ * @var string $form_sidebar_input_value ID of settings form in sidebar.
14
+ * @var string $nonce_input_name Name of hidden field with WordPress Nonce value.
15
+ * @var string $nonce_input_value WordPress Nonce value.
16
+ * @var bool $token_valid_status Status of PRO version.
17
+ * @var string $api_calculate_url URL of REST API endpoint.
18
+ * @var string|null $api_paths_url URL of REST API endpoint.
19
+ * @var string|null $api_regenerate_url URL of REST API endpoint.
20
+ * @var string $url_debug_page URL of debug tag in settings page.
21
+ * @var string[][] $output_formats Data about output formats for regeneration.
22
+ *
23
+ * @package Converter for Media
24
  */
25
 
26
  ?>
27
  <div class="wrap">
28
  <hr class="wp-header-end">
29
+ <div class="webpcPage">
30
+ <div class="webpcPage__headline">
31
+ <img src="<?php echo esc_attr( $logo_url ); ?>" alt="<?php echo esc_attr( 'Converter for Media' ); ?>">
32
+ </div>
33
+ <div class="webpcPage__inner">
34
+ <ul class="webpcPage__columns">
35
+ <li class="webpcPage__column webpcPage__column--large">
36
+ <?php if ( ( ( $_POST[ $form_input_name ] ?? '' ) === $form_sidebar_input_value ) && $token_valid_status ) : // phpcs:ignore ?>
37
+ <div class="webpcPage__alert">
38
+ <?php echo esc_html( __( 'The access token has been activated!', 'webp-converter-for-media' ) ); ?>
39
+ </div>
40
+ <?php elseif ( isset( $_POST[ $form_input_name ] ) ) : // phpcs:ignore ?>
41
+ <div class="webpcPage__alert">
42
  <?php echo esc_html( __( 'Changes were successfully saved!', 'webp-converter-for-media' ) ); ?>
43
  <?php echo esc_html( __( 'Please flush cache if you use caching plugin or caching via hosting.', 'webp-converter-for-media' ) ); ?>
44
  </div>
 
 
 
 
45
  <?php endif; ?>
46
  <?php
47
  require_once dirname( __DIR__ ) . '/components/widgets/errors.php';
48
+ require_once dirname( __DIR__ ) . '/components/widgets/menu.php';
49
  require_once dirname( __DIR__ ) . '/components/widgets/options.php';
50
  require_once dirname( __DIR__ ) . '/components/widgets/regenerate.php';
51
  ?>
52
  </li>
53
+ <li class="webpcPage__column webpcPage__column--small">
54
  <?php
55
+ require_once dirname( __DIR__ ) . '/components/widgets/options-sidebar.php';
56
  require_once dirname( __DIR__ ) . '/components/widgets/about.php';
57
  require_once dirname( __DIR__ ) . '/components/widgets/support.php';
 
58
  ?>
59
  </li>
60
  </ul>
61
  </div>
62
+ <div class="webpcPage__footer">
63
+ <div class="webpcPage__footerLogo"></div>
64
+ <div class="webpcPage__footerContent">
65
+ <?php
66
+ echo wp_kses_post(
67
+ sprintf(
68
+ /* translators: %1$s: br tag, %2$s: icon heart */
69
+ __( 'Created with %1$s by %2$s - if you like our plugin, please %3$srate one%4$s%5$s', 'webp-converter-for-media' ),
70
+ '<span class="webpcPage__footerIcon webpcPage__footerIcon--heart"></span>',
71
+ '<a href="https://mattplugins.com/?utm_source=webp-converter-for-media&utm_campaign=website-check&utm_medium=plugin-settings-footer" target="_blank">matt plugins</a>',
72
+ '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post" target="_blank">',
73
+ ' <span class="webpcPage__footerIcon webpcPage__footerIcon--stars"></span>',
74
+ '</a>'
75
+ )
76
+ );
77
+ ?>
78
+ </div>
79
+ </div>
80
+ </div>
81
  </div>
vendor/composer/autoload_classmap.php CHANGED
@@ -121,7 +121,6 @@ return array(
121
  'WebpConverter\\Loader\\LoaderInterface' => $baseDir . '/src/Loader/LoaderInterface.php',
122
  'WebpConverter\\Loader\\PassthruLoader' => $baseDir . '/src/Loader/PassthruLoader.php',
123
  'WebpConverter\\Model\\Token' => $baseDir . '/src/Model/Token.php',
124
- 'WebpConverter\\Notice\\AvifSupportNotice' => $baseDir . '/src/Notice/AvifSupportNotice.php',
125
  'WebpConverter\\Notice\\CloudflareNotice' => $baseDir . '/src/Notice/CloudflareNotice.php',
126
  'WebpConverter\\Notice\\LitespeedNotice' => $baseDir . '/src/Notice/LitespeedNotice.php',
127
  'WebpConverter\\Notice\\NoticeAbstract' => $baseDir . '/src/Notice/NoticeAbstract.php',
@@ -159,6 +158,7 @@ return array(
159
  'WebpConverter\\Service\\WpCliManager' => $baseDir . '/src/Service/WpCliManager.php',
160
  'WebpConverter\\Settings\\AdminAssets' => $baseDir . '/src/Settings/AdminAssets.php',
161
  'WebpConverter\\Settings\\Option\\AccessTokenOption' => $baseDir . '/src/Settings/Option/AccessTokenOption.php',
 
162
  'WebpConverter\\Settings\\Option\\ConversionMethodOption' => $baseDir . '/src/Settings/Option/ConversionMethodOption.php',
163
  'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => $baseDir . '/src/Settings/Option/ExtraFeaturesOption.php',
164
  'WebpConverter\\Settings\\Option\\ImageResizeOption' => $baseDir . '/src/Settings/Option/ImageResizeOption.php',
@@ -171,11 +171,12 @@ return array(
171
  'WebpConverter\\Settings\\Option\\OutputFormatsOption' => $baseDir . '/src/Settings/Option/OutputFormatsOption.php',
172
  'WebpConverter\\Settings\\Option\\SupportedDirectoriesOption' => $baseDir . '/src/Settings/Option/SupportedDirectoriesOption.php',
173
  'WebpConverter\\Settings\\Option\\SupportedExtensionsOption' => $baseDir . '/src/Settings/Option/SupportedExtensionsOption.php',
 
174
  'WebpConverter\\Settings\\Page\\DebugPage' => $baseDir . '/src/Settings/Page/DebugPage.php',
 
175
  'WebpConverter\\Settings\\Page\\PageAbstract' => $baseDir . '/src/Settings/Page/PageAbstract.php',
176
  'WebpConverter\\Settings\\Page\\PageIntegration' => $baseDir . '/src/Settings/Page/PageIntegration.php',
177
  'WebpConverter\\Settings\\Page\\PageInterface' => $baseDir . '/src/Settings/Page/PageInterface.php',
178
- 'WebpConverter\\Settings\\Page\\SettingsPage' => $baseDir . '/src/Settings/Page/SettingsPage.php',
179
  'WebpConverter\\Settings\\PluginOptions' => $baseDir . '/src/Settings/PluginOptions.php',
180
  'WebpConverter\\Settings\\SettingsSave' => $baseDir . '/src/Settings/SettingsSave.php',
181
  'WebpConverter\\WebpConverter' => $baseDir . '/src/WebpConverter.php',
121
  'WebpConverter\\Loader\\LoaderInterface' => $baseDir . '/src/Loader/LoaderInterface.php',
122
  'WebpConverter\\Loader\\PassthruLoader' => $baseDir . '/src/Loader/PassthruLoader.php',
123
  'WebpConverter\\Model\\Token' => $baseDir . '/src/Model/Token.php',
 
124
  'WebpConverter\\Notice\\CloudflareNotice' => $baseDir . '/src/Notice/CloudflareNotice.php',
125
  'WebpConverter\\Notice\\LitespeedNotice' => $baseDir . '/src/Notice/LitespeedNotice.php',
126
  'WebpConverter\\Notice\\NoticeAbstract' => $baseDir . '/src/Notice/NoticeAbstract.php',
158
  'WebpConverter\\Service\\WpCliManager' => $baseDir . '/src/Service/WpCliManager.php',
159
  'WebpConverter\\Settings\\AdminAssets' => $baseDir . '/src/Settings/AdminAssets.php',
160
  'WebpConverter\\Settings\\Option\\AccessTokenOption' => $baseDir . '/src/Settings/Option/AccessTokenOption.php',
161
+ 'WebpConverter\\Settings\\Option\\AutoConversionOption' => $baseDir . '/src/Settings/Option/AutoConversionOption.php',
162
  'WebpConverter\\Settings\\Option\\ConversionMethodOption' => $baseDir . '/src/Settings/Option/ConversionMethodOption.php',
163
  'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => $baseDir . '/src/Settings/Option/ExtraFeaturesOption.php',
164
  'WebpConverter\\Settings\\Option\\ImageResizeOption' => $baseDir . '/src/Settings/Option/ImageResizeOption.php',
171
  'WebpConverter\\Settings\\Option\\OutputFormatsOption' => $baseDir . '/src/Settings/Option/OutputFormatsOption.php',
172
  'WebpConverter\\Settings\\Option\\SupportedDirectoriesOption' => $baseDir . '/src/Settings/Option/SupportedDirectoriesOption.php',
173
  'WebpConverter\\Settings\\Option\\SupportedExtensionsOption' => $baseDir . '/src/Settings/Option/SupportedExtensionsOption.php',
174
+ 'WebpConverter\\Settings\\Page\\AdvancedSettingsPage' => $baseDir . '/src/Settings/Page/AdvancedSettingsPage.php',
175
  'WebpConverter\\Settings\\Page\\DebugPage' => $baseDir . '/src/Settings/Page/DebugPage.php',
176
+ 'WebpConverter\\Settings\\Page\\GeneralSettingsPage' => $baseDir . '/src/Settings/Page/GeneralSettingsPage.php',
177
  'WebpConverter\\Settings\\Page\\PageAbstract' => $baseDir . '/src/Settings/Page/PageAbstract.php',
178
  'WebpConverter\\Settings\\Page\\PageIntegration' => $baseDir . '/src/Settings/Page/PageIntegration.php',
179
  'WebpConverter\\Settings\\Page\\PageInterface' => $baseDir . '/src/Settings/Page/PageInterface.php',
 
180
  'WebpConverter\\Settings\\PluginOptions' => $baseDir . '/src/Settings/PluginOptions.php',
181
  'WebpConverter\\Settings\\SettingsSave' => $baseDir . '/src/Settings/SettingsSave.php',
182
  'WebpConverter\\WebpConverter' => $baseDir . '/src/WebpConverter.php',
vendor/composer/autoload_static.php CHANGED
@@ -136,7 +136,6 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
136
  'WebpConverter\\Loader\\LoaderInterface' => __DIR__ . '/../..' . '/src/Loader/LoaderInterface.php',
137
  'WebpConverter\\Loader\\PassthruLoader' => __DIR__ . '/../..' . '/src/Loader/PassthruLoader.php',
138
  'WebpConverter\\Model\\Token' => __DIR__ . '/../..' . '/src/Model/Token.php',
139
- 'WebpConverter\\Notice\\AvifSupportNotice' => __DIR__ . '/../..' . '/src/Notice/AvifSupportNotice.php',
140
  'WebpConverter\\Notice\\CloudflareNotice' => __DIR__ . '/../..' . '/src/Notice/CloudflareNotice.php',
141
  'WebpConverter\\Notice\\LitespeedNotice' => __DIR__ . '/../..' . '/src/Notice/LitespeedNotice.php',
142
  'WebpConverter\\Notice\\NoticeAbstract' => __DIR__ . '/../..' . '/src/Notice/NoticeAbstract.php',
@@ -174,6 +173,7 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
174
  'WebpConverter\\Service\\WpCliManager' => __DIR__ . '/../..' . '/src/Service/WpCliManager.php',
175
  'WebpConverter\\Settings\\AdminAssets' => __DIR__ . '/../..' . '/src/Settings/AdminAssets.php',
176
  'WebpConverter\\Settings\\Option\\AccessTokenOption' => __DIR__ . '/../..' . '/src/Settings/Option/AccessTokenOption.php',
 
177
  'WebpConverter\\Settings\\Option\\ConversionMethodOption' => __DIR__ . '/../..' . '/src/Settings/Option/ConversionMethodOption.php',
178
  'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => __DIR__ . '/../..' . '/src/Settings/Option/ExtraFeaturesOption.php',
179
  'WebpConverter\\Settings\\Option\\ImageResizeOption' => __DIR__ . '/../..' . '/src/Settings/Option/ImageResizeOption.php',
@@ -186,11 +186,12 @@ class ComposerStaticInit74037c5a08f9b99adcf3f4137c88ddde
186
  'WebpConverter\\Settings\\Option\\OutputFormatsOption' => __DIR__ . '/../..' . '/src/Settings/Option/OutputFormatsOption.php',
187
  'WebpConverter\\Settings\\Option\\SupportedDirectoriesOption' => __DIR__ . '/../..' . '/src/Settings/Option/SupportedDirectoriesOption.php',
188
  'WebpConverter\\Settings\\Option\\SupportedExtensionsOption' => __DIR__ . '/../..' . '/src/Settings/Option/SupportedExtensionsOption.php',
 
189
  'WebpConverter\\Settings\\Page\\DebugPage' => __DIR__ . '/../..' . '/src/Settings/Page/DebugPage.php',
 
190
  'WebpConverter\\Settings\\Page\\PageAbstract' => __DIR__ . '/../..' . '/src/Settings/Page/PageAbstract.php',
191
  'WebpConverter\\Settings\\Page\\PageIntegration' => __DIR__ . '/../..' . '/src/Settings/Page/PageIntegration.php',
192
  'WebpConverter\\Settings\\Page\\PageInterface' => __DIR__ . '/../..' . '/src/Settings/Page/PageInterface.php',
193
- 'WebpConverter\\Settings\\Page\\SettingsPage' => __DIR__ . '/../..' . '/src/Settings/Page/SettingsPage.php',
194
  'WebpConverter\\Settings\\PluginOptions' => __DIR__ . '/../..' . '/src/Settings/PluginOptions.php',
195
  'WebpConverter\\Settings\\SettingsSave' => __DIR__ . '/../..' . '/src/Settings/SettingsSave.php',
196
  'WebpConverter\\WebpConverter' => __DIR__ . '/../..' . '/src/WebpConverter.php',
136
  'WebpConverter\\Loader\\LoaderInterface' => __DIR__ . '/../..' . '/src/Loader/LoaderInterface.php',
137
  'WebpConverter\\Loader\\PassthruLoader' => __DIR__ . '/../..' . '/src/Loader/PassthruLoader.php',
138
  'WebpConverter\\Model\\Token' => __DIR__ . '/../..' . '/src/Model/Token.php',
 
139
  'WebpConverter\\Notice\\CloudflareNotice' => __DIR__ . '/../..' . '/src/Notice/CloudflareNotice.php',
140
  'WebpConverter\\Notice\\LitespeedNotice' => __DIR__ . '/../..' . '/src/Notice/LitespeedNotice.php',
141
  'WebpConverter\\Notice\\NoticeAbstract' => __DIR__ . '/../..' . '/src/Notice/NoticeAbstract.php',
173
  'WebpConverter\\Service\\WpCliManager' => __DIR__ . '/../..' . '/src/Service/WpCliManager.php',
174
  'WebpConverter\\Settings\\AdminAssets' => __DIR__ . '/../..' . '/src/Settings/AdminAssets.php',
175
  'WebpConverter\\Settings\\Option\\AccessTokenOption' => __DIR__ . '/../..' . '/src/Settings/Option/AccessTokenOption.php',
176
+ 'WebpConverter\\Settings\\Option\\AutoConversionOption' => __DIR__ . '/../..' . '/src/Settings/Option/AutoConversionOption.php',
177
  'WebpConverter\\Settings\\Option\\ConversionMethodOption' => __DIR__ . '/../..' . '/src/Settings/Option/ConversionMethodOption.php',
178
  'WebpConverter\\Settings\\Option\\ExtraFeaturesOption' => __DIR__ . '/../..' . '/src/Settings/Option/ExtraFeaturesOption.php',
179
  'WebpConverter\\Settings\\Option\\ImageResizeOption' => __DIR__ . '/../..' . '/src/Settings/Option/ImageResizeOption.php',
186
  'WebpConverter\\Settings\\Option\\OutputFormatsOption' => __DIR__ . '/../..' . '/src/Settings/Option/OutputFormatsOption.php',
187
  'WebpConverter\\Settings\\Option\\SupportedDirectoriesOption' => __DIR__ . '/../..' . '/src/Settings/Option/SupportedDirectoriesOption.php',
188
  'WebpConverter\\Settings\\Option\\SupportedExtensionsOption' => __DIR__ . '/../..' . '/src/Settings/Option/SupportedExtensionsOption.php',
189
+ 'WebpConverter\\Settings\\Page\\AdvancedSettingsPage' => __DIR__ . '/../..' . '/src/Settings/Page/AdvancedSettingsPage.php',
190
  'WebpConverter\\Settings\\Page\\DebugPage' => __DIR__ . '/../..' . '/src/Settings/Page/DebugPage.php',
191
+ 'WebpConverter\\Settings\\Page\\GeneralSettingsPage' => __DIR__ . '/../..' . '/src/Settings/Page/GeneralSettingsPage.php',
192
  'WebpConverter\\Settings\\Page\\PageAbstract' => __DIR__ . '/../..' . '/src/Settings/Page/PageAbstract.php',
193
  'WebpConverter\\Settings\\Page\\PageIntegration' => __DIR__ . '/../..' . '/src/Settings/Page/PageIntegration.php',
194
  'WebpConverter\\Settings\\Page\\PageInterface' => __DIR__ . '/../..' . '/src/Settings/Page/PageInterface.php',
 
195
  'WebpConverter\\Settings\\PluginOptions' => __DIR__ . '/../..' . '/src/Settings/PluginOptions.php',
196
  'WebpConverter\\Settings\\SettingsSave' => __DIR__ . '/../..' . '/src/Settings/SettingsSave.php',
197
  'WebpConverter\\WebpConverter' => __DIR__ . '/../..' . '/src/WebpConverter.php',
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => 'e20410dbd02e27eabf4a85dd6fd5dbdf0063ed69',
9
  'name' => 'gbiorczyk/webp-converter-for-media',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => 'e20410dbd02e27eabf4a85dd6fd5dbdf0063ed69',
20
  'dev_requirement' => false,
21
  ),
22
  'matt-plugins/deactivation-modal' => array(
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '56c4c1fb7171d43cab629c52ce1d8a7f6f69f7f9',
9
  'name' => 'gbiorczyk/webp-converter-for-media',
10
  'dev' => false,
11
  ),
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '56c4c1fb7171d43cab629c52ce1d8a7f6f69f7f9',
20
  'dev_requirement' => false,
21
  ),
22
  'matt-plugins/deactivation-modal' => array(
webp-converter-for-media.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Converter for Media
5
  * Description: Speed up your website by using our WebP & AVIF Converter (formerly WebP Converter for Media). Serve WebP and AVIF images instead of standard formats JPEG, PNG and GIF just now!
6
- * Version: 4.5.1
7
  * Author: Mateusz Gbiorczyk - Optimize Images by convert AVIF & WebP
8
  * Author URI: https://mattplugins.com/
9
  * Text Domain: webp-converter-for-media
@@ -13,5 +13,5 @@
13
  require_once __DIR__ . '/vendor/autoload.php';
14
 
15
  new WebpConverter\WebpConverter(
16
- new WebpConverter\PluginInfo( __FILE__, '4.5.1' )
17
  );
3
  /**
4
  * Plugin Name: Converter for Media
5
  * Description: Speed up your website by using our WebP & AVIF Converter (formerly WebP Converter for Media). Serve WebP and AVIF images instead of standard formats JPEG, PNG and GIF just now!
6
+ * Version: 5.0.0
7
  * Author: Mateusz Gbiorczyk - Optimize Images by convert AVIF & WebP
8
  * Author URI: https://mattplugins.com/
9
  * Text Domain: webp-converter-for-media
13
  require_once __DIR__ . '/vendor/autoload.php';
14
 
15
  new WebpConverter\WebpConverter(
16
+ new WebpConverter\PluginInfo( __FILE__, '5.0.0' )
17
  );