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

Version Description

(2020-12-12) = * [Added] Escaping functions for translated phrases * [Added] Error codes in error messages on plugin settings page * [Added] Modal when deactivating plugin

Download this release

Release Info

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

Code changes from version 1.5.1 to 1.6.0

Files changed (47) hide show
  1. app/Admin/Modal.php +32 -0
  2. app/Admin/Notice.php +1 -0
  3. app/Admin/Plugin.php +2 -2
  4. app/Admin/_Core.php +1 -0
  5. app/Plugin/Uninstall.php +1 -0
  6. app/Regenerate/Endpoints.php +3 -0
  7. app/Regenerate/Skip.php +1 -1
  8. app/Settings/Errors.php +3 -0
  9. app/Settings/Page.php +1 -0
  10. public/build/css/styles.css +1 -1
  11. public/build/js/scripts.js +1 -1
  12. readme.txt +30 -24
  13. resources/components/errors/bypassing-apache.php +2 -2
  14. resources/components/errors/libs-not-installed.php +2 -2
  15. resources/components/errors/libs-without-webp-support.php +2 -2
  16. resources/components/errors/path-htaccess-not-writable.php +2 -2
  17. resources/components/errors/path-uploads-unavailable.php +2 -2
  18. resources/components/errors/path-webp-duplicated.php +2 -2
  19. resources/components/errors/path-webp-not-writable.php +2 -2
  20. resources/components/errors/rest-api-disabled.php +2 -2
  21. resources/components/errors/rewrites-cached.php +2 -2
  22. resources/components/errors/rewrites-not-working.php +2 -2
  23. resources/components/errors/settings-incorrect.php +2 -2
  24. resources/components/fields/checkbox.php +13 -6
  25. resources/components/fields/quality.php +11 -4
  26. resources/components/fields/radio.php +13 -6
  27. resources/components/notices/thanks.php +8 -8
  28. resources/components/notices/welcome.php +5 -5
  29. resources/components/widgets/about.php +7 -7
  30. resources/components/widgets/donate.php +6 -4
  31. resources/components/widgets/errors.php +12 -2
  32. resources/components/widgets/options.php +7 -5
  33. resources/components/widgets/regenerate.php +23 -19
  34. resources/components/widgets/server.php +10 -10
  35. resources/components/widgets/support.php +10 -10
  36. resources/views/deactivation-modal.php +81 -0
  37. resources/views/settings.php +5 -3
  38. vendor/autoload.php +7 -7
  39. vendor/composer/ClassLoader.php +445 -445
  40. vendor/composer/LICENSE +21 -21
  41. vendor/composer/autoload_classmap.php +9 -9
  42. vendor/composer/autoload_namespaces.php +9 -9
  43. vendor/composer/autoload_psr4.php +10 -10
  44. vendor/composer/autoload_real.php +55 -52
  45. vendor/composer/autoload_static.php +31 -31
  46. vendor/composer/installed.json +1 -0
  47. webp-converter-for-media.php +2 -2
app/Admin/Modal.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WebpConverter\Admin;
4
+
5
+ use WebpConverter\Admin\Assets;
6
+
7
+ class Modal
8
+ {
9
+ public function __construct()
10
+ {
11
+ add_action('admin_init', [$this, 'showDeactivationModal']);
12
+ }
13
+
14
+ /* ---
15
+ Functions
16
+ --- */
17
+
18
+ public function showDeactivationModal()
19
+ {
20
+ if (basename(($_SERVER['SCRIPT_FILENAME'] ?? ''), '.php') !== 'plugins') {
21
+ return;
22
+ }
23
+
24
+ new Assets();
25
+ add_action('admin_footer', ['WebpConverter\Admin\Modal', 'loadDeactivationModal']);
26
+ }
27
+
28
+ public static function loadDeactivationModal()
29
+ {
30
+ require_once WEBPC_PATH . 'resources/views/deactivation-modal.php';
31
+ }
32
+ }
app/Admin/Notice.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace WebpConverter\Admin;
4
 
 
5
  use WebpConverter\Plugin\Activation;
6
 
7
  class Notice
2
 
3
  namespace WebpConverter\Admin;
4
 
5
+ use WebpConverter\Admin\Assets;
6
  use WebpConverter\Plugin\Activation;
7
 
8
  class Notice
app/Admin/Plugin.php CHANGED
@@ -18,7 +18,7 @@
18
  public function addLinkToSettings($links)
19
  {
20
  array_unshift($links, sprintf(
21
- __('%sSettings%s', 'webp-converter-for-media'),
22
  '<a href="' . menu_page_url('webpc_admin_page', false) . '">',
23
  '</a>'
24
  ));
@@ -28,7 +28,7 @@
28
  public function addLinkToDonate($links)
29
  {
30
  $links[] = sprintf(
31
- __('%sProvide us a coffee%s', 'webp-converter-for-media'),
32
  '<a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=plugin-links" target="_blank">',
33
  '</a>'
34
  );
18
  public function addLinkToSettings($links)
19
  {
20
  array_unshift($links, sprintf(
21
+ esc_html(__('%sSettings%s', 'webp-converter-for-media')),
22
  '<a href="' . menu_page_url('webpc_admin_page', false) . '">',
23
  '</a>'
24
  ));
28
  public function addLinkToDonate($links)
29
  {
30
  $links[] = sprintf(
31
+ esc_html(__('%sProvide us a coffee%s', 'webp-converter-for-media')),
32
  '<a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=plugin-links" target="_blank">',
33
  '</a>'
34
  );
app/Admin/_Core.php CHANGED
@@ -6,6 +6,7 @@
6
  {
7
  public function __construct()
8
  {
 
9
  new Notice();
10
  new Plugin();
11
  }
6
  {
7
  public function __construct()
8
  {
9
+ new Modal();
10
  new Notice();
11
  new Plugin();
12
  }
app/Plugin/Uninstall.php CHANGED
@@ -20,6 +20,7 @@
20
  public static function removePluginSettings()
21
  {
22
  delete_option(Activation::NEW_INSTALLATION_OPTION);
 
23
  delete_option(Save::SETTINGS_OPTION);
24
  delete_option(Notice::NOTICE_THANKS_OPTION);
25
  delete_option(Update::VERSION_OPTION);
20
  public static function removePluginSettings()
21
  {
22
  delete_option(Activation::NEW_INSTALLATION_OPTION);
23
+ delete_option(Errors::ERRORS_CACHE_OPTION);
24
  delete_option(Save::SETTINGS_OPTION);
25
  delete_option(Notice::NOTICE_THANKS_OPTION);
26
  delete_option(Update::VERSION_OPTION);
app/Regenerate/Endpoints.php CHANGED
@@ -2,6 +2,9 @@
2
 
3
  namespace WebpConverter\Regenerate;
4
 
 
 
 
5
  class Endpoints
6
  {
7
  const ROUTE_NAMESPACE = 'webp-converter/v1';
2
 
3
  namespace WebpConverter\Regenerate;
4
 
5
+ use WebpConverter\Regenerate\Paths;
6
+ use WebpConverter\Regenerate\Regenerate;
7
+
8
  class Endpoints
9
  {
10
  const ROUTE_NAMESPACE = 'webp-converter/v1';
app/Regenerate/Skip.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace WebpConverter\Regenerate;
4
 
5
- use WebpConverter\Convert\Directory as Directory;
6
 
7
  class Skip
8
  {
2
 
3
  namespace WebpConverter\Regenerate;
4
 
5
+ use WebpConverter\Convert\Directory;
6
 
7
  class Skip
8
  {
app/Settings/Errors.php CHANGED
@@ -13,6 +13,7 @@
13
  const PATH_SOURCE_FILE_PNG2 = '/public/img/icon-test.png2';
14
  const PATH_OUTPUT_FILE_PNG = '/webp-converter-for-media-test.png';
15
  const PATH_OUTPUT_FILE_PNG2 = '/webp-converter-for-media-test.png2';
 
16
 
17
  private $cache = null;
18
  private $filePath = WEBPC_PATH . '/resources/components/errors/%s.php';
@@ -44,6 +45,8 @@
44
  $list[$error] = ob_get_contents();
45
  ob_end_clean();
46
  }
 
 
47
  return $list;
48
  }
49
 
13
  const PATH_SOURCE_FILE_PNG2 = '/public/img/icon-test.png2';
14
  const PATH_OUTPUT_FILE_PNG = '/webp-converter-for-media-test.png';
15
  const PATH_OUTPUT_FILE_PNG2 = '/webp-converter-for-media-test.png2';
16
+ const ERRORS_CACHE_OPTION = 'webpc_errors_cache';
17
 
18
  private $cache = null;
19
  private $filePath = WEBPC_PATH . '/resources/components/errors/%s.php';
45
  $list[$error] = ob_get_contents();
46
  ob_end_clean();
47
  }
48
+
49
+ update_option(self::ERRORS_CACHE_OPTION, array_keys($list));
50
  return $list;
51
  }
52
 
app/Settings/Page.php CHANGED
@@ -4,6 +4,7 @@
4
 
5
  use WebpConverter\Admin\Assets;
6
  use WebpConverter\Plugin\Activation;
 
7
 
8
  class Page
9
  {
4
 
5
  use WebpConverter\Admin\Assets;
6
  use WebpConverter\Plugin\Activation;
7
+ use WebpConverter\Settings\Save;
8
 
9
  class Page
10
  {
public/build/css/styles.css CHANGED
@@ -1 +1 @@
1
- @keyframes dotsLoading{0%,to{content:"..."}25%{content:"\A0.."}50%{content:".\A0."}75%{content:"..\A0"}}@font-face{font-family:Exo\ 2;src:url(../../fonts/Exo2/Exo2-Regular.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-Regular.woff) format("woff"),url(../../fonts/Exo2/Exo2-Regular.ttf) format("truetype");font-weight:400;font-style:"normal"}@font-face{font-family:Exo\ 2;src:url(../../fonts/Exo2/Exo2-SemiBold.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-SemiBold.woff) format("woff"),url(../../fonts/Exo2/Exo2-SemiBold.ttf) format("truetype");font-weight:500;font-style:"normal"}.webpPage{margin:20px 0 0;padding:0 20px 0 0;font-family:Exo\ 2,sans-serif;color:#444;overflow:hidden}.webpPage *,.webpPage :after,.webpPage :before{margin:0;padding:0;box-sizing:border-box}.webpPage [hidden]{display:none!important}.webpPage__alert{margin-bottom:30px;padding:15px 20px;font-size:14px;line-height:1.64;color:#fff;background-color:#46b450}.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{padding:14px 30px;font-weight:400;font-size:16px;line-height:1.5;color:#fff;background-color:#0073aa}.webpPage__widgetTitle--second{background-color:#a0a5aa}.webpPage__widgetTitle--error{background-color:#dc3232}.webpPage__widgetTable{width:100%;margin:5px 0;border-spacing:0}.webpPage__widgetTable td{padding:5px 0;vertical-align:top}.webpPage__widgetTable td:first-child{width:22px;padding-right:30px}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__checkbox{display:none!important}.webpPage__checkbox[type=checkbox]+label:after{content:"\F147"}.webpPage__checkbox[type=radio]+label:after{content:"\F335"}.webpPage__checkbox+label{position:relative;display:inline-block}.webpPage__checkbox+label:after,.webpPage__checkbox+label:before{content:"";display:flex;align-items:center;justify-content:center;width:22px;height:22px}.webpPage__checkbox+label:before{border:1px solid #b4b9be}.webpPage__checkbox+label:after{position:absolute;top:0;left:0;font-family:dashicons;font-size:20px;line-height:1;color:#46b450;transform:scale(0);transition:transform .3s}.webpPage__checkbox[disabled]+label{opacity:.25;pointer-events:none}.webpPage__checkbox:checked+label:after{transform:scale(1)}.webpPage__checkboxLabel{display:inline-block;max-width:650px;font-size:14px;line-height:1.64}.webpPage__quality{display:flex;flex-wrap:wrap;margin:10px 0;border:1px solid #a0a5aa}.webpPage__qualityItem{flex:1;margin-left:-1px;text-align:center;border-left:1px solid #a0a5aa}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{position:relative;display:block;padding:14px 20px;font-size:14px;line-height:1.64;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{margin:-1px;padding:15px 21px;color:#fff;background-color:#46b450}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}.notice[data-notice=webp-converter]{margin-top:20px;padding:0}.webpButton{position:relative;display:inline-block;min-width:180px;padding:9px 30px;font-weight:500;font-size:14px;line-height:1.63;text-align:center;text-decoration:none;background-color:#fff;text-decoration:none!important;opacity:1!important;box-sizing:border-box;box-shadow:none!important;outline:none!important;border:1px solid transparent;transition:color .3s!important;z-index:10;cursor:pointer}p>.webpButton{margin:6px 0}.webpButton:before{float:left;margin-right:10px;font-family:dashicons;font-size:20px;line-height:1.1}.webpButton:after{content:"";position:absolute;top:0;left:0;width:0;height:100%;transition:width .3s;z-index:-1}.webpButton:hover:after{width:100%}.webpButton[disabled]{pointer-events:none;opacity:.5!important}.webpButton--blue:hover,.webpButton--green:hover{color:#fff!important}.webpButton--blue{color:#0073aa!important;border-color:#0073aa}.webpButton--blue:after{background-color:#0073aa}.webpButton--green{color:#46b450!important;border-color:#46b450}.webpButton--green:after{background-color:#46b450}.webpContent{font-family:Exo\ 2,sans-serif;padding:20px 30px}.webpContent p{max-width:800px;font-size:14px;line-height:1.64}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{color:#0073aa;text-decoration:underline;box-shadow:none;outline:none;transition:opacity .3s}.webpContent a:hover{opacity:.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6{font-weight:500;font-size:16px;line-height:1.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6,.webpContent p{margin:10px 0 0;padding:4px 0}.webpContent h1:first-child,.webpContent h2:first-child,.webpContent h3:first-child,.webpContent h4:first-child,.webpContent h5:first-child,.webpContent h6:first-child,.webpContent p:first-child{margin-top:0}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{margin-top:0;font-size:12px;line-height:1.67}.webpContent--notice h1+p,.webpContent--notice h2+p,.webpContent--notice h3+p,.webpContent--notice h4+p,.webpContent--notice h5+p,.webpContent--notice h6+p{font-size:14px;line-height:1.64}.webpContent__buttons{margin-top:-10px;padding:10px 0;overflow:hidden}.webpContent__button{float:left;margin:20px 20px 0 0}.webpContent__button:last-child{margin-right:0}.webpLoader__status{position:relative;padding:20px 0 10px}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{position:relative;font-size:0;line-height:0;height:20px}.webpLoader__barProgress:before{content:"";position:absolute;top:0;left:0;width:0;height:100%;background-color:#46b450;transition:width .3s}.webpLoader__barProgress--error:before{background-color:#dc3232}.webpLoader__barProgress[data-percent="0"]:before{width:0}.webpLoader__barProgress[data-percent="1"]:before{width:1%}.webpLoader__barProgress[data-percent="2"]:before{width:2%}.webpLoader__barProgress[data-percent="3"]:before{width:3%}.webpLoader__barProgress[data-percent="4"]:before{width:4%}.webpLoader__barProgress[data-percent="5"]:before{width:5%}.webpLoader__barProgress[data-percent="6"]:before{width:6%}.webpLoader__barProgress[data-percent="7"]:before{width:7%}.webpLoader__barProgress[data-percent="8"]:before{width:8%}.webpLoader__barProgress[data-percent="9"]:before{width:9%}.webpLoader__barProgress[data-percent="10"]:before{width:10%}.webpLoader__barProgress[data-percent="11"]:before{width:11%}.webpLoader__barProgress[data-percent="12"]:before{width:12%}.webpLoader__barProgress[data-percent="13"]:before{width:13%}.webpLoader__barProgress[data-percent="14"]:before{width:14%}.webpLoader__barProgress[data-percent="15"]:before{width:15%}.webpLoader__barProgress[data-percent="16"]:before{width:16%}.webpLoader__barProgress[data-percent="17"]:before{width:17%}.webpLoader__barProgress[data-percent="18"]:before{width:18%}.webpLoader__barProgress[data-percent="19"]:before{width:19%}.webpLoader__barProgress[data-percent="20"]:before{width:20%}.webpLoader__barProgress[data-percent="21"]:before{width:21%}.webpLoader__barProgress[data-percent="22"]:before{width:22%}.webpLoader__barProgress[data-percent="23"]:before{width:23%}.webpLoader__barProgress[data-percent="24"]:before{width:24%}.webpLoader__barProgress[data-percent="25"]:before{width:25%}.webpLoader__barProgress[data-percent="26"]:before{width:26%}.webpLoader__barProgress[data-percent="27"]:before{width:27%}.webpLoader__barProgress[data-percent="28"]:before{width:28%}.webpLoader__barProgress[data-percent="29"]:before{width:29%}.webpLoader__barProgress[data-percent="30"]:before{width:30%}.webpLoader__barProgress[data-percent="31"]:before{width:31%}.webpLoader__barProgress[data-percent="32"]:before{width:32%}.webpLoader__barProgress[data-percent="33"]:before{width:33%}.webpLoader__barProgress[data-percent="34"]:before{width:34%}.webpLoader__barProgress[data-percent="35"]:before{width:35%}.webpLoader__barProgress[data-percent="36"]:before{width:36%}.webpLoader__barProgress[data-percent="37"]:before{width:37%}.webpLoader__barProgress[data-percent="38"]:before{width:38%}.webpLoader__barProgress[data-percent="39"]:before{width:39%}.webpLoader__barProgress[data-percent="40"]:before{width:40%}.webpLoader__barProgress[data-percent="41"]:before{width:41%}.webpLoader__barProgress[data-percent="42"]:before{width:42%}.webpLoader__barProgress[data-percent="43"]:before{width:43%}.webpLoader__barProgress[data-percent="44"]:before{width:44%}.webpLoader__barProgress[data-percent="45"]:before{width:45%}.webpLoader__barProgress[data-percent="46"]:before{width:46%}.webpLoader__barProgress[data-percent="47"]:before{width:47%}.webpLoader__barProgress[data-percent="48"]:before{width:48%}.webpLoader__barProgress[data-percent="49"]:before{width:49%}.webpLoader__barProgress[data-percent="50"]:before{width:50%}.webpLoader__barProgress[data-percent="51"]:before{width:51%}.webpLoader__barProgress[data-percent="52"]:before{width:52%}.webpLoader__barProgress[data-percent="53"]:before{width:53%}.webpLoader__barProgress[data-percent="54"]:before{width:54%}.webpLoader__barProgress[data-percent="55"]:before{width:55%}.webpLoader__barProgress[data-percent="56"]:before{width:56%}.webpLoader__barProgress[data-percent="57"]:before{width:57%}.webpLoader__barProgress[data-percent="58"]:before{width:58%}.webpLoader__barProgress[data-percent="59"]:before{width:59%}.webpLoader__barProgress[data-percent="60"]:before{width:60%}.webpLoader__barProgress[data-percent="61"]:before{width:61%}.webpLoader__barProgress[data-percent="62"]:before{width:62%}.webpLoader__barProgress[data-percent="63"]:before{width:63%}.webpLoader__barProgress[data-percent="64"]:before{width:64%}.webpLoader__barProgress[data-percent="65"]:before{width:65%}.webpLoader__barProgress[data-percent="66"]:before{width:66%}.webpLoader__barProgress[data-percent="67"]:before{width:67%}.webpLoader__barProgress[data-percent="68"]:before{width:68%}.webpLoader__barProgress[data-percent="69"]:before{width:69%}.webpLoader__barProgress[data-percent="70"]:before{width:70%}.webpLoader__barProgress[data-percent="71"]:before{width:71%}.webpLoader__barProgress[data-percent="72"]:before{width:72%}.webpLoader__barProgress[data-percent="73"]:before{width:73%}.webpLoader__barProgress[data-percent="74"]:before{width:74%}.webpLoader__barProgress[data-percent="75"]:before{width:75%}.webpLoader__barProgress[data-percent="76"]:before{width:76%}.webpLoader__barProgress[data-percent="77"]:before{width:77%}.webpLoader__barProgress[data-percent="78"]:before{width:78%}.webpLoader__barProgress[data-percent="79"]:before{width:79%}.webpLoader__barProgress[data-percent="80"]:before{width:80%}.webpLoader__barProgress[data-percent="81"]:before{width:81%}.webpLoader__barProgress[data-percent="82"]:before{width:82%}.webpLoader__barProgress[data-percent="83"]:before{width:83%}.webpLoader__barProgress[data-percent="84"]:before{width:84%}.webpLoader__barProgress[data-percent="85"]:before{width:85%}.webpLoader__barProgress[data-percent="86"]:before{width:86%}.webpLoader__barProgress[data-percent="87"]:before{width:87%}.webpLoader__barProgress[data-percent="88"]:before{width:88%}.webpLoader__barProgress[data-percent="89"]:before{width:89%}.webpLoader__barProgress[data-percent="90"]:before{width:90%}.webpLoader__barProgress[data-percent="91"]:before{width:91%}.webpLoader__barProgress[data-percent="92"]:before{width:92%}.webpLoader__barProgress[data-percent="93"]:before{width:93%}.webpLoader__barProgress[data-percent="94"]:before{width:94%}.webpLoader__barProgress[data-percent="95"]:before{width:95%}.webpLoader__barProgress[data-percent="96"]:before{width:96%}.webpLoader__barProgress[data-percent="97"]:before{width:97%}.webpLoader__barProgress[data-percent="98"]:before{width:98%}.webpLoader__barProgress[data-percent="99"]:before{width:99%}.webpLoader__barProgress[data-percent="100"]:before{width:100%}.webpLoader__barCount{position:relative;display:inline-block;padding:0 5px;font-family:monospace;font-size:12px;line-height:20px;color:#fff;background-color:#46b450}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#dc3232}.webpLoader__barCount:after{content:"...";margin-left:5px;animation:dotsLoading 1s linear infinite}.webpLoader__barProgress--error .webpLoader__barCount:after,.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:after{display:none}.webpLoader__barProgress[data-percent="0"] .webpLoader__barCount:before{content:"0%"}.webpLoader__barProgress[data-percent="1"] .webpLoader__barCount:before{content:"1%"}.webpLoader__barProgress[data-percent="2"] .webpLoader__barCount:before{content:"2%"}.webpLoader__barProgress[data-percent="3"] .webpLoader__barCount:before{content:"3%"}.webpLoader__barProgress[data-percent="4"] .webpLoader__barCount:before{content:"4%"}.webpLoader__barProgress[data-percent="5"] .webpLoader__barCount:before{content:"5%"}.webpLoader__barProgress[data-percent="6"] .webpLoader__barCount:before{content:"6%"}.webpLoader__barProgress[data-percent="7"] .webpLoader__barCount:before{content:"7%"}.webpLoader__barProgress[data-percent="8"] .webpLoader__barCount:before{content:"8%"}.webpLoader__barProgress[data-percent="9"] .webpLoader__barCount:before{content:"9%"}.webpLoader__barProgress[data-percent="10"] .webpLoader__barCount:before{content:"10%"}.webpLoader__barProgress[data-percent="11"] .webpLoader__barCount:before{content:"11%"}.webpLoader__barProgress[data-percent="12"] .webpLoader__barCount:before{content:"12%"}.webpLoader__barProgress[data-percent="13"] .webpLoader__barCount:before{content:"13%"}.webpLoader__barProgress[data-percent="14"] .webpLoader__barCount:before{content:"14%"}.webpLoader__barProgress[data-percent="15"] .webpLoader__barCount:before{content:"15%"}.webpLoader__barProgress[data-percent="16"] .webpLoader__barCount:before{content:"16%"}.webpLoader__barProgress[data-percent="17"] .webpLoader__barCount:before{content:"17%"}.webpLoader__barProgress[data-percent="18"] .webpLoader__barCount:before{content:"18%"}.webpLoader__barProgress[data-percent="19"] .webpLoader__barCount:before{content:"19%"}.webpLoader__barProgress[data-percent="20"] .webpLoader__barCount:before{content:"20%"}.webpLoader__barProgress[data-percent="21"] .webpLoader__barCount:before{content:"21%"}.webpLoader__barProgress[data-percent="22"] .webpLoader__barCount:before{content:"22%"}.webpLoader__barProgress[data-percent="23"] .webpLoader__barCount:before{content:"23%"}.webpLoader__barProgress[data-percent="24"] .webpLoader__barCount:before{content:"24%"}.webpLoader__barProgress[data-percent="25"] .webpLoader__barCount:before{content:"25%"}.webpLoader__barProgress[data-percent="26"] .webpLoader__barCount:before{content:"26%"}.webpLoader__barProgress[data-percent="27"] .webpLoader__barCount:before{content:"27%"}.webpLoader__barProgress[data-percent="28"] .webpLoader__barCount:before{content:"28%"}.webpLoader__barProgress[data-percent="29"] .webpLoader__barCount:before{content:"29%"}.webpLoader__barProgress[data-percent="30"] .webpLoader__barCount:before{content:"30%"}.webpLoader__barProgress[data-percent="31"] .webpLoader__barCount:before{content:"31%"}.webpLoader__barProgress[data-percent="32"] .webpLoader__barCount:before{content:"32%"}.webpLoader__barProgress[data-percent="33"] .webpLoader__barCount:before{content:"33%"}.webpLoader__barProgress[data-percent="34"] .webpLoader__barCount:before{content:"34%"}.webpLoader__barProgress[data-percent="35"] .webpLoader__barCount:before{content:"35%"}.webpLoader__barProgress[data-percent="36"] .webpLoader__barCount:before{content:"36%"}.webpLoader__barProgress[data-percent="37"] .webpLoader__barCount:before{content:"37%"}.webpLoader__barProgress[data-percent="38"] .webpLoader__barCount:before{content:"38%"}.webpLoader__barProgress[data-percent="39"] .webpLoader__barCount:before{content:"39%"}.webpLoader__barProgress[data-percent="40"] .webpLoader__barCount:before{content:"40%"}.webpLoader__barProgress[data-percent="41"] .webpLoader__barCount:before{content:"41%"}.webpLoader__barProgress[data-percent="42"] .webpLoader__barCount:before{content:"42%"}.webpLoader__barProgress[data-percent="43"] .webpLoader__barCount:before{content:"43%"}.webpLoader__barProgress[data-percent="44"] .webpLoader__barCount:before{content:"44%"}.webpLoader__barProgress[data-percent="45"] .webpLoader__barCount:before{content:"45%"}.webpLoader__barProgress[data-percent="46"] .webpLoader__barCount:before{content:"46%"}.webpLoader__barProgress[data-percent="47"] .webpLoader__barCount:before{content:"47%"}.webpLoader__barProgress[data-percent="48"] .webpLoader__barCount:before{content:"48%"}.webpLoader__barProgress[data-percent="49"] .webpLoader__barCount:before{content:"49%"}.webpLoader__barProgress[data-percent="50"] .webpLoader__barCount:before{content:"50%"}.webpLoader__barProgress[data-percent="51"] .webpLoader__barCount:before{content:"51%"}.webpLoader__barProgress[data-percent="52"] .webpLoader__barCount:before{content:"52%"}.webpLoader__barProgress[data-percent="53"] .webpLoader__barCount:before{content:"53%"}.webpLoader__barProgress[data-percent="54"] .webpLoader__barCount:before{content:"54%"}.webpLoader__barProgress[data-percent="55"] .webpLoader__barCount:before{content:"55%"}.webpLoader__barProgress[data-percent="56"] .webpLoader__barCount:before{content:"56%"}.webpLoader__barProgress[data-percent="57"] .webpLoader__barCount:before{content:"57%"}.webpLoader__barProgress[data-percent="58"] .webpLoader__barCount:before{content:"58%"}.webpLoader__barProgress[data-percent="59"] .webpLoader__barCount:before{content:"59%"}.webpLoader__barProgress[data-percent="60"] .webpLoader__barCount:before{content:"60%"}.webpLoader__barProgress[data-percent="61"] .webpLoader__barCount:before{content:"61%"}.webpLoader__barProgress[data-percent="62"] .webpLoader__barCount:before{content:"62%"}.webpLoader__barProgress[data-percent="63"] .webpLoader__barCount:before{content:"63%"}.webpLoader__barProgress[data-percent="64"] .webpLoader__barCount:before{content:"64%"}.webpLoader__barProgress[data-percent="65"] .webpLoader__barCount:before{content:"65%"}.webpLoader__barProgress[data-percent="66"] .webpLoader__barCount:before{content:"66%"}.webpLoader__barProgress[data-percent="67"] .webpLoader__barCount:before{content:"67%"}.webpLoader__barProgress[data-percent="68"] .webpLoader__barCount:before{content:"68%"}.webpLoader__barProgress[data-percent="69"] .webpLoader__barCount:before{content:"69%"}.webpLoader__barProgress[data-percent="70"] .webpLoader__barCount:before{content:"70%"}.webpLoader__barProgress[data-percent="71"] .webpLoader__barCount:before{content:"71%"}.webpLoader__barProgress[data-percent="72"] .webpLoader__barCount:before{content:"72%"}.webpLoader__barProgress[data-percent="73"] .webpLoader__barCount:before{content:"73%"}.webpLoader__barProgress[data-percent="74"] .webpLoader__barCount:before{content:"74%"}.webpLoader__barProgress[data-percent="75"] .webpLoader__barCount:before{content:"75%"}.webpLoader__barProgress[data-percent="76"] .webpLoader__barCount:before{content:"76%"}.webpLoader__barProgress[data-percent="77"] .webpLoader__barCount:before{content:"77%"}.webpLoader__barProgress[data-percent="78"] .webpLoader__barCount:before{content:"78%"}.webpLoader__barProgress[data-percent="79"] .webpLoader__barCount:before{content:"79%"}.webpLoader__barProgress[data-percent="80"] .webpLoader__barCount:before{content:"80%"}.webpLoader__barProgress[data-percent="81"] .webpLoader__barCount:before{content:"81%"}.webpLoader__barProgress[data-percent="82"] .webpLoader__barCount:before{content:"82%"}.webpLoader__barProgress[data-percent="83"] .webpLoader__barCount:before{content:"83%"}.webpLoader__barProgress[data-percent="84"] .webpLoader__barCount:before{content:"84%"}.webpLoader__barProgress[data-percent="85"] .webpLoader__barCount:before{content:"85%"}.webpLoader__barProgress[data-percent="86"] .webpLoader__barCount:before{content:"86%"}.webpLoader__barProgress[data-percent="87"] .webpLoader__barCount:before{content:"87%"}.webpLoader__barProgress[data-percent="88"] .webpLoader__barCount:before{content:"88%"}.webpLoader__barProgress[data-percent="89"] .webpLoader__barCount:before{content:"89%"}.webpLoader__barProgress[data-percent="90"] .webpLoader__barCount:before{content:"90%"}.webpLoader__barProgress[data-percent="91"] .webpLoader__barCount:before{content:"91%"}.webpLoader__barProgress[data-percent="92"] .webpLoader__barCount:before{content:"92%"}.webpLoader__barProgress[data-percent="93"] .webpLoader__barCount:before{content:"93%"}.webpLoader__barProgress[data-percent="94"] .webpLoader__barCount:before{content:"94%"}.webpLoader__barProgress[data-percent="95"] .webpLoader__barCount:before{content:"95%"}.webpLoader__barProgress[data-percent="96"] .webpLoader__barCount:before{content:"96%"}.webpLoader__barProgress[data-percent="97"] .webpLoader__barCount:before{content:"97%"}.webpLoader__barProgress[data-percent="98"] .webpLoader__barCount:before{content:"98%"}.webpLoader__barProgress[data-percent="99"] .webpLoader__barCount:before{content:"99%"}.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:before{content:"100%"}.webpLoader__size{margin-bottom:-10px;padding:4px 0;font-size:14px;line-height:1.64}.webpLoader__sizeProgress{font-weight:500}.webpLoader__success{position:relative;margin-top:20px;padding:4px 0 4px 20px}.webpLoader__success:before{content:"";position:absolute;top:0;left:0;width:2px;height:100%;background-color:#46b450}.webpLoader__successContent{font-weight:500;font-size:14px;line-height:1.64;color:#46b450}.webpLoader__successContent a{color:inherit}.webpLoader__errors{margin-top:20px;border-left:2px solid #a0a5aa}.webpLoader__errorsTitle{display:inline-block;padding:4px 22px;font-size:14px;line-height:1.64;color:#fff;background-color:#a0a5aa}.webpLoader__errorsContent{padding:14px 0 14px 20px;font-size:12px;line-height:1.75}.webpLoader__errorsContentMessage{font-weight:500;color:#dc3232;font-size:14px;line-height:1.64}.webpLoader__button--disabled{pointer-events:none;opacity:.25!important}.webpPopup{margin-top:20px}.webpPopup__inner{display:flex;flex-wrap:wrap;background-color:#fff}.webpPopup__image{width:152px;background-image:url(../../img/author.jpg);background-position:50%;background-size:cover;background-repeat:no-repeat}.webpPopup__content{flex:1;padding:10px 20px;border:1px solid #a0a5aa;border-left:0}.webpServerInfo{color:#222;text-align:center}.webpServerInfo pre{margin:0;font-family:monospace}.webpServerInfo h1,.webpServerInfo h2{display:none}.webpServerInfo p{max-width:100%}.webpServerInfo table{border-collapse:collapse;border:0;width:100%;margin:10px auto}.webpServerInfo td,.webpServerInfo th{border:1px solid #666;vertical-align:baseline;padding:4px 5px;font-size:12px;line-height:1.67;text-align:center}.webpServerInfo .p{text-align:left}.webpServerInfo .e{background-color:#ccf;width:300px;font-weight:700}.webpServerInfo .h{background-color:#99c;font-weight:700}.webpServerInfo .v{background-color:#ddd;max-width:300px;overflow-x:auto;word-wrap:break-word}.webpServerInfo .v i{color:#999}.webpServerInfo img{float:right;border:0}@media screen and (max-width:1024px){.webpPage__column--large{width:100%}.webpPage__column--small{width:100%;margin-top:40px}.webpPage__widget+.webpPage__widget{margin-top:40px}}@media screen and (max-width:782px){.webpPage{padding-right:10px}.webpPopup__inner{display:block;border:1px solid #a0a5aa}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border:0}}@media screen and (max-width:768px){.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #a0a5aa}}
1
+ @keyframes dotsLoading{0%,to{content:"..."}25%{content:"\A0.."}50%{content:".\A0."}75%{content:"..\A0"}}@font-face{font-family:Exo\ 2;src:url(../../fonts/Exo2/Exo2-Regular.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-Regular.woff) format("woff"),url(../../fonts/Exo2/Exo2-Regular.ttf) format("truetype");font-weight:400;font-style:"normal"}@font-face{font-family:Exo\ 2;src:url(../../fonts/Exo2/Exo2-SemiBold.woff2) format("woff2"),url(../../fonts/Exo2/Exo2-SemiBold.woff) format("woff"),url(../../fonts/Exo2/Exo2-SemiBold.ttf) format("truetype");font-weight:500;font-style:"normal"}.webpModal [hidden]{display:none!important}.webpModal *,.webpModal :after,.webpModal :before{margin:0;padding:0;box-sizing:border-box}.webpModal__outer{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.75);z-index:9999}.webpModal__form{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:600px;max-width:calc(100vw - 40px);padding:20px 30px;font-family:Exo\ 2,sans-serif;font-size:0;background-color:#fff}.webpModal__headline{padding:4px 0;font-weight:500;font-size:16px;line-height:1.5}.webpModal__desc{padding:4px 0;font-size:14px;line-height:1.64}.webpModal__table{margin-top:10px}.webpModal__textarea{display:none;width:100%;margin-top:10px;padding:4px 10px;font-size:14px;line-height:1.64;border:1px solid #b4b9be!important;border-radius:0}.webpModal__textarea[placeholder]{display:block}.webpModal__textarea[placeholder=""]{display:none}.webpModal__buttons{display:flex;flex-wrap:wrap;align-items:center;margin:5px -5px 0;padding:5px 0}.webpModal__button{width:50%;padding:5px}.webpModal__buttonInner{width:100%}.webpPage{margin:20px 0 0;padding:0 20px 0 0;font-family:Exo\ 2,sans-serif;color:#444;overflow:hidden}.webpPage *,.webpPage :after,.webpPage :before{margin:0;padding:0;box-sizing:border-box}.webpPage [hidden]{display:none!important}.webpPage__alert{margin-bottom:30px;padding:15px 20px;font-size:14px;line-height:1.64;color:#fff;background-color:#46b450}.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{padding:14px 30px;font-weight:400;font-size:16px;line-height:1.5;color:#fff;background-color:#0073aa}.webpPage__widgetTitle--second{background-color:#a0a5aa}.webpPage__widgetTitle--error{background-color:#dc3232}.webpPage__widgetRow{padding-bottom:10px}.webpPage__widgetRow:last-child{padding-bottom:0}.webpPage__widgetRow .webpButton{margin:10px 0}.webpPage__quality{display:flex;flex-wrap:wrap;margin:10px 0;border:1px solid #a0a5aa}.webpPage__qualityItem{flex:1;margin-left:-1px;text-align:center;border-left:1px solid #a0a5aa}.webpPage__qualityItemInput{display:none!important}.webpPage__qualityItemLabel{position:relative;display:block;padding:14px 20px;font-size:14px;line-height:1.64;transition:color .3s,background-color .3s}.webpPage__qualityItemInput:checked+.webpPage__qualityItemLabel{margin:-1px;padding:15px 21px;color:#fff;background-color:#46b450}.webpPage__qualityItemInput[disabled]+.webpPage__qualityItemLabel{opacity:0;pointer-events:none}.notice[data-notice=webp-converter]{margin-top:20px;padding:0}.webpButton{position:relative;display:inline-block;min-width:180px;padding:9px 30px;font-weight:500;font-size:14px;line-height:1.63;text-align:center;text-decoration:none;background-color:#fff;text-decoration:none!important;opacity:1!important;box-sizing:border-box;box-shadow:none!important;outline:none!important;border:1px solid transparent;transition:color .3s!important;z-index:10;cursor:pointer}p>.webpButton{margin:6px 0}.webpButton:before{float:left;margin-right:10px;font-family:dashicons;font-size:20px;line-height:1.1}.webpButton:after{content:"";position:absolute;top:0;left:0;width:0;height:100%;transition:width .3s;z-index:-1}.webpButton:hover:after{width:100%}.webpButton[disabled]{pointer-events:none;opacity:.5!important}.webpButton--blue:hover,.webpButton--green:hover{color:#fff!important}.webpButton--blue{color:#0073aa!important;border-color:#0073aa}.webpButton--blue:after{background-color:#0073aa}.webpButton--green{color:#46b450!important;border-color:#46b450}.webpButton--green:after{background-color:#46b450}.webpCheckbox__input{display:none!important}.webpCheckbox__input[type=checkbox]+label:after{content:"\F147"}.webpCheckbox__input[type=radio]+label:after{content:"\F335"}.webpCheckbox__input+label{position:relative;display:inline-block}.webpCheckbox__input+label:after,.webpCheckbox__input+label:before{content:"";display:flex;align-items:center;justify-content:center;width:22px;height:22px}.webpCheckbox__input+label:before{border:1px solid #b4b9be}.webpCheckbox__input+label:after{position:absolute;top:0;left:0;font-family:dashicons;font-size:20px;line-height:1;color:#46b450;transform:scale(0);transition:transform .3s}.webpCheckbox__input[disabled]+label{opacity:.25;pointer-events:none}.webpCheckbox__input:checked+label:after{transform:scale(1)}.webpCheckbox__label{display:inline-block;max-width:650px;font-size:14px;line-height:1.64}.webpContent{font-family:Exo\ 2,sans-serif;padding:20px 30px}.webpContent p{max-width:800px;font-size:14px;line-height:1.64}.webpContent p.center{text-align:center}.webpContent--wide p{max-width:100%}.webpContent a{color:#0073aa;text-decoration:underline;box-shadow:none;outline:none;transition:opacity .3s}.webpContent a:hover{opacity:.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6{font-weight:500;font-size:16px;line-height:1.5}.webpContent h1,.webpContent h2,.webpContent h3,.webpContent h4,.webpContent h5,.webpContent h6,.webpContent p{margin:10px 0 0;padding:4px 0}.webpContent h1:first-child,.webpContent h2:first-child,.webpContent h3:first-child,.webpContent h4:first-child,.webpContent h5:first-child,.webpContent h6:first-child,.webpContent p:first-child{margin-top:0}.webpContent h1+p,.webpContent h2+p,.webpContent h3+p,.webpContent h4+p,.webpContent h5+p,.webpContent h6+p{margin-top:0;font-size:12px;line-height:1.67}.webpContent--notice h1+p,.webpContent--notice h2+p,.webpContent--notice h3+p,.webpContent--notice h4+p,.webpContent--notice h5+p,.webpContent--notice h6+p{font-size:14px;line-height:1.64}.webpContent__buttons{margin-top:-10px;padding:10px 0;overflow:hidden}.webpContent__button{float:left;margin:20px 20px 0 0}.webpContent__button:last-child{margin-right:0}.webpLoader__status{position:relative;padding:20px 0 10px}.webpLoader__bar--hidden{display:none}.webpLoader__barProgress{position:relative;font-size:0;line-height:0;height:20px}.webpLoader__barProgress:before{content:"";position:absolute;top:0;left:0;width:0;height:100%;background-color:#46b450;transition:width .3s}.webpLoader__barProgress--error:before{background-color:#dc3232}.webpLoader__barProgress[data-percent="0"]:before{width:0}.webpLoader__barProgress[data-percent="1"]:before{width:1%}.webpLoader__barProgress[data-percent="2"]:before{width:2%}.webpLoader__barProgress[data-percent="3"]:before{width:3%}.webpLoader__barProgress[data-percent="4"]:before{width:4%}.webpLoader__barProgress[data-percent="5"]:before{width:5%}.webpLoader__barProgress[data-percent="6"]:before{width:6%}.webpLoader__barProgress[data-percent="7"]:before{width:7%}.webpLoader__barProgress[data-percent="8"]:before{width:8%}.webpLoader__barProgress[data-percent="9"]:before{width:9%}.webpLoader__barProgress[data-percent="10"]:before{width:10%}.webpLoader__barProgress[data-percent="11"]:before{width:11%}.webpLoader__barProgress[data-percent="12"]:before{width:12%}.webpLoader__barProgress[data-percent="13"]:before{width:13%}.webpLoader__barProgress[data-percent="14"]:before{width:14%}.webpLoader__barProgress[data-percent="15"]:before{width:15%}.webpLoader__barProgress[data-percent="16"]:before{width:16%}.webpLoader__barProgress[data-percent="17"]:before{width:17%}.webpLoader__barProgress[data-percent="18"]:before{width:18%}.webpLoader__barProgress[data-percent="19"]:before{width:19%}.webpLoader__barProgress[data-percent="20"]:before{width:20%}.webpLoader__barProgress[data-percent="21"]:before{width:21%}.webpLoader__barProgress[data-percent="22"]:before{width:22%}.webpLoader__barProgress[data-percent="23"]:before{width:23%}.webpLoader__barProgress[data-percent="24"]:before{width:24%}.webpLoader__barProgress[data-percent="25"]:before{width:25%}.webpLoader__barProgress[data-percent="26"]:before{width:26%}.webpLoader__barProgress[data-percent="27"]:before{width:27%}.webpLoader__barProgress[data-percent="28"]:before{width:28%}.webpLoader__barProgress[data-percent="29"]:before{width:29%}.webpLoader__barProgress[data-percent="30"]:before{width:30%}.webpLoader__barProgress[data-percent="31"]:before{width:31%}.webpLoader__barProgress[data-percent="32"]:before{width:32%}.webpLoader__barProgress[data-percent="33"]:before{width:33%}.webpLoader__barProgress[data-percent="34"]:before{width:34%}.webpLoader__barProgress[data-percent="35"]:before{width:35%}.webpLoader__barProgress[data-percent="36"]:before{width:36%}.webpLoader__barProgress[data-percent="37"]:before{width:37%}.webpLoader__barProgress[data-percent="38"]:before{width:38%}.webpLoader__barProgress[data-percent="39"]:before{width:39%}.webpLoader__barProgress[data-percent="40"]:before{width:40%}.webpLoader__barProgress[data-percent="41"]:before{width:41%}.webpLoader__barProgress[data-percent="42"]:before{width:42%}.webpLoader__barProgress[data-percent="43"]:before{width:43%}.webpLoader__barProgress[data-percent="44"]:before{width:44%}.webpLoader__barProgress[data-percent="45"]:before{width:45%}.webpLoader__barProgress[data-percent="46"]:before{width:46%}.webpLoader__barProgress[data-percent="47"]:before{width:47%}.webpLoader__barProgress[data-percent="48"]:before{width:48%}.webpLoader__barProgress[data-percent="49"]:before{width:49%}.webpLoader__barProgress[data-percent="50"]:before{width:50%}.webpLoader__barProgress[data-percent="51"]:before{width:51%}.webpLoader__barProgress[data-percent="52"]:before{width:52%}.webpLoader__barProgress[data-percent="53"]:before{width:53%}.webpLoader__barProgress[data-percent="54"]:before{width:54%}.webpLoader__barProgress[data-percent="55"]:before{width:55%}.webpLoader__barProgress[data-percent="56"]:before{width:56%}.webpLoader__barProgress[data-percent="57"]:before{width:57%}.webpLoader__barProgress[data-percent="58"]:before{width:58%}.webpLoader__barProgress[data-percent="59"]:before{width:59%}.webpLoader__barProgress[data-percent="60"]:before{width:60%}.webpLoader__barProgress[data-percent="61"]:before{width:61%}.webpLoader__barProgress[data-percent="62"]:before{width:62%}.webpLoader__barProgress[data-percent="63"]:before{width:63%}.webpLoader__barProgress[data-percent="64"]:before{width:64%}.webpLoader__barProgress[data-percent="65"]:before{width:65%}.webpLoader__barProgress[data-percent="66"]:before{width:66%}.webpLoader__barProgress[data-percent="67"]:before{width:67%}.webpLoader__barProgress[data-percent="68"]:before{width:68%}.webpLoader__barProgress[data-percent="69"]:before{width:69%}.webpLoader__barProgress[data-percent="70"]:before{width:70%}.webpLoader__barProgress[data-percent="71"]:before{width:71%}.webpLoader__barProgress[data-percent="72"]:before{width:72%}.webpLoader__barProgress[data-percent="73"]:before{width:73%}.webpLoader__barProgress[data-percent="74"]:before{width:74%}.webpLoader__barProgress[data-percent="75"]:before{width:75%}.webpLoader__barProgress[data-percent="76"]:before{width:76%}.webpLoader__barProgress[data-percent="77"]:before{width:77%}.webpLoader__barProgress[data-percent="78"]:before{width:78%}.webpLoader__barProgress[data-percent="79"]:before{width:79%}.webpLoader__barProgress[data-percent="80"]:before{width:80%}.webpLoader__barProgress[data-percent="81"]:before{width:81%}.webpLoader__barProgress[data-percent="82"]:before{width:82%}.webpLoader__barProgress[data-percent="83"]:before{width:83%}.webpLoader__barProgress[data-percent="84"]:before{width:84%}.webpLoader__barProgress[data-percent="85"]:before{width:85%}.webpLoader__barProgress[data-percent="86"]:before{width:86%}.webpLoader__barProgress[data-percent="87"]:before{width:87%}.webpLoader__barProgress[data-percent="88"]:before{width:88%}.webpLoader__barProgress[data-percent="89"]:before{width:89%}.webpLoader__barProgress[data-percent="90"]:before{width:90%}.webpLoader__barProgress[data-percent="91"]:before{width:91%}.webpLoader__barProgress[data-percent="92"]:before{width:92%}.webpLoader__barProgress[data-percent="93"]:before{width:93%}.webpLoader__barProgress[data-percent="94"]:before{width:94%}.webpLoader__barProgress[data-percent="95"]:before{width:95%}.webpLoader__barProgress[data-percent="96"]:before{width:96%}.webpLoader__barProgress[data-percent="97"]:before{width:97%}.webpLoader__barProgress[data-percent="98"]:before{width:98%}.webpLoader__barProgress[data-percent="99"]:before{width:99%}.webpLoader__barProgress[data-percent="100"]:before{width:100%}.webpLoader__barCount{position:relative;display:inline-block;padding:0 5px;font-family:monospace;font-size:12px;line-height:20px;color:#fff;background-color:#46b450}.webpLoader__barProgress--error .webpLoader__barCount{background-color:#dc3232}.webpLoader__barCount:after{content:"...";margin-left:5px;animation:dotsLoading 1s linear infinite}.webpLoader__barProgress--error .webpLoader__barCount:after,.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:after{display:none}.webpLoader__barProgress[data-percent="0"] .webpLoader__barCount:before{content:"0%"}.webpLoader__barProgress[data-percent="1"] .webpLoader__barCount:before{content:"1%"}.webpLoader__barProgress[data-percent="2"] .webpLoader__barCount:before{content:"2%"}.webpLoader__barProgress[data-percent="3"] .webpLoader__barCount:before{content:"3%"}.webpLoader__barProgress[data-percent="4"] .webpLoader__barCount:before{content:"4%"}.webpLoader__barProgress[data-percent="5"] .webpLoader__barCount:before{content:"5%"}.webpLoader__barProgress[data-percent="6"] .webpLoader__barCount:before{content:"6%"}.webpLoader__barProgress[data-percent="7"] .webpLoader__barCount:before{content:"7%"}.webpLoader__barProgress[data-percent="8"] .webpLoader__barCount:before{content:"8%"}.webpLoader__barProgress[data-percent="9"] .webpLoader__barCount:before{content:"9%"}.webpLoader__barProgress[data-percent="10"] .webpLoader__barCount:before{content:"10%"}.webpLoader__barProgress[data-percent="11"] .webpLoader__barCount:before{content:"11%"}.webpLoader__barProgress[data-percent="12"] .webpLoader__barCount:before{content:"12%"}.webpLoader__barProgress[data-percent="13"] .webpLoader__barCount:before{content:"13%"}.webpLoader__barProgress[data-percent="14"] .webpLoader__barCount:before{content:"14%"}.webpLoader__barProgress[data-percent="15"] .webpLoader__barCount:before{content:"15%"}.webpLoader__barProgress[data-percent="16"] .webpLoader__barCount:before{content:"16%"}.webpLoader__barProgress[data-percent="17"] .webpLoader__barCount:before{content:"17%"}.webpLoader__barProgress[data-percent="18"] .webpLoader__barCount:before{content:"18%"}.webpLoader__barProgress[data-percent="19"] .webpLoader__barCount:before{content:"19%"}.webpLoader__barProgress[data-percent="20"] .webpLoader__barCount:before{content:"20%"}.webpLoader__barProgress[data-percent="21"] .webpLoader__barCount:before{content:"21%"}.webpLoader__barProgress[data-percent="22"] .webpLoader__barCount:before{content:"22%"}.webpLoader__barProgress[data-percent="23"] .webpLoader__barCount:before{content:"23%"}.webpLoader__barProgress[data-percent="24"] .webpLoader__barCount:before{content:"24%"}.webpLoader__barProgress[data-percent="25"] .webpLoader__barCount:before{content:"25%"}.webpLoader__barProgress[data-percent="26"] .webpLoader__barCount:before{content:"26%"}.webpLoader__barProgress[data-percent="27"] .webpLoader__barCount:before{content:"27%"}.webpLoader__barProgress[data-percent="28"] .webpLoader__barCount:before{content:"28%"}.webpLoader__barProgress[data-percent="29"] .webpLoader__barCount:before{content:"29%"}.webpLoader__barProgress[data-percent="30"] .webpLoader__barCount:before{content:"30%"}.webpLoader__barProgress[data-percent="31"] .webpLoader__barCount:before{content:"31%"}.webpLoader__barProgress[data-percent="32"] .webpLoader__barCount:before{content:"32%"}.webpLoader__barProgress[data-percent="33"] .webpLoader__barCount:before{content:"33%"}.webpLoader__barProgress[data-percent="34"] .webpLoader__barCount:before{content:"34%"}.webpLoader__barProgress[data-percent="35"] .webpLoader__barCount:before{content:"35%"}.webpLoader__barProgress[data-percent="36"] .webpLoader__barCount:before{content:"36%"}.webpLoader__barProgress[data-percent="37"] .webpLoader__barCount:before{content:"37%"}.webpLoader__barProgress[data-percent="38"] .webpLoader__barCount:before{content:"38%"}.webpLoader__barProgress[data-percent="39"] .webpLoader__barCount:before{content:"39%"}.webpLoader__barProgress[data-percent="40"] .webpLoader__barCount:before{content:"40%"}.webpLoader__barProgress[data-percent="41"] .webpLoader__barCount:before{content:"41%"}.webpLoader__barProgress[data-percent="42"] .webpLoader__barCount:before{content:"42%"}.webpLoader__barProgress[data-percent="43"] .webpLoader__barCount:before{content:"43%"}.webpLoader__barProgress[data-percent="44"] .webpLoader__barCount:before{content:"44%"}.webpLoader__barProgress[data-percent="45"] .webpLoader__barCount:before{content:"45%"}.webpLoader__barProgress[data-percent="46"] .webpLoader__barCount:before{content:"46%"}.webpLoader__barProgress[data-percent="47"] .webpLoader__barCount:before{content:"47%"}.webpLoader__barProgress[data-percent="48"] .webpLoader__barCount:before{content:"48%"}.webpLoader__barProgress[data-percent="49"] .webpLoader__barCount:before{content:"49%"}.webpLoader__barProgress[data-percent="50"] .webpLoader__barCount:before{content:"50%"}.webpLoader__barProgress[data-percent="51"] .webpLoader__barCount:before{content:"51%"}.webpLoader__barProgress[data-percent="52"] .webpLoader__barCount:before{content:"52%"}.webpLoader__barProgress[data-percent="53"] .webpLoader__barCount:before{content:"53%"}.webpLoader__barProgress[data-percent="54"] .webpLoader__barCount:before{content:"54%"}.webpLoader__barProgress[data-percent="55"] .webpLoader__barCount:before{content:"55%"}.webpLoader__barProgress[data-percent="56"] .webpLoader__barCount:before{content:"56%"}.webpLoader__barProgress[data-percent="57"] .webpLoader__barCount:before{content:"57%"}.webpLoader__barProgress[data-percent="58"] .webpLoader__barCount:before{content:"58%"}.webpLoader__barProgress[data-percent="59"] .webpLoader__barCount:before{content:"59%"}.webpLoader__barProgress[data-percent="60"] .webpLoader__barCount:before{content:"60%"}.webpLoader__barProgress[data-percent="61"] .webpLoader__barCount:before{content:"61%"}.webpLoader__barProgress[data-percent="62"] .webpLoader__barCount:before{content:"62%"}.webpLoader__barProgress[data-percent="63"] .webpLoader__barCount:before{content:"63%"}.webpLoader__barProgress[data-percent="64"] .webpLoader__barCount:before{content:"64%"}.webpLoader__barProgress[data-percent="65"] .webpLoader__barCount:before{content:"65%"}.webpLoader__barProgress[data-percent="66"] .webpLoader__barCount:before{content:"66%"}.webpLoader__barProgress[data-percent="67"] .webpLoader__barCount:before{content:"67%"}.webpLoader__barProgress[data-percent="68"] .webpLoader__barCount:before{content:"68%"}.webpLoader__barProgress[data-percent="69"] .webpLoader__barCount:before{content:"69%"}.webpLoader__barProgress[data-percent="70"] .webpLoader__barCount:before{content:"70%"}.webpLoader__barProgress[data-percent="71"] .webpLoader__barCount:before{content:"71%"}.webpLoader__barProgress[data-percent="72"] .webpLoader__barCount:before{content:"72%"}.webpLoader__barProgress[data-percent="73"] .webpLoader__barCount:before{content:"73%"}.webpLoader__barProgress[data-percent="74"] .webpLoader__barCount:before{content:"74%"}.webpLoader__barProgress[data-percent="75"] .webpLoader__barCount:before{content:"75%"}.webpLoader__barProgress[data-percent="76"] .webpLoader__barCount:before{content:"76%"}.webpLoader__barProgress[data-percent="77"] .webpLoader__barCount:before{content:"77%"}.webpLoader__barProgress[data-percent="78"] .webpLoader__barCount:before{content:"78%"}.webpLoader__barProgress[data-percent="79"] .webpLoader__barCount:before{content:"79%"}.webpLoader__barProgress[data-percent="80"] .webpLoader__barCount:before{content:"80%"}.webpLoader__barProgress[data-percent="81"] .webpLoader__barCount:before{content:"81%"}.webpLoader__barProgress[data-percent="82"] .webpLoader__barCount:before{content:"82%"}.webpLoader__barProgress[data-percent="83"] .webpLoader__barCount:before{content:"83%"}.webpLoader__barProgress[data-percent="84"] .webpLoader__barCount:before{content:"84%"}.webpLoader__barProgress[data-percent="85"] .webpLoader__barCount:before{content:"85%"}.webpLoader__barProgress[data-percent="86"] .webpLoader__barCount:before{content:"86%"}.webpLoader__barProgress[data-percent="87"] .webpLoader__barCount:before{content:"87%"}.webpLoader__barProgress[data-percent="88"] .webpLoader__barCount:before{content:"88%"}.webpLoader__barProgress[data-percent="89"] .webpLoader__barCount:before{content:"89%"}.webpLoader__barProgress[data-percent="90"] .webpLoader__barCount:before{content:"90%"}.webpLoader__barProgress[data-percent="91"] .webpLoader__barCount:before{content:"91%"}.webpLoader__barProgress[data-percent="92"] .webpLoader__barCount:before{content:"92%"}.webpLoader__barProgress[data-percent="93"] .webpLoader__barCount:before{content:"93%"}.webpLoader__barProgress[data-percent="94"] .webpLoader__barCount:before{content:"94%"}.webpLoader__barProgress[data-percent="95"] .webpLoader__barCount:before{content:"95%"}.webpLoader__barProgress[data-percent="96"] .webpLoader__barCount:before{content:"96%"}.webpLoader__barProgress[data-percent="97"] .webpLoader__barCount:before{content:"97%"}.webpLoader__barProgress[data-percent="98"] .webpLoader__barCount:before{content:"98%"}.webpLoader__barProgress[data-percent="99"] .webpLoader__barCount:before{content:"99%"}.webpLoader__barProgress[data-percent="100"] .webpLoader__barCount:before{content:"100%"}.webpLoader__size{margin-bottom:-10px;padding:4px 0;font-size:14px;line-height:1.64}.webpLoader__sizeProgress{font-weight:500}.webpLoader__success{position:relative;margin-top:20px;padding:4px 0 4px 20px}.webpLoader__success:before{content:"";position:absolute;top:0;left:0;width:2px;height:100%;background-color:#46b450}.webpLoader__successContent{font-weight:500;font-size:14px;line-height:1.64;color:#46b450}.webpLoader__successContent a{color:inherit}.webpLoader__errors{margin-top:20px;border-left:2px solid #a0a5aa}.webpLoader__errorsTitle{display:inline-block;padding:4px 22px;font-size:14px;line-height:1.64;color:#fff;background-color:#a0a5aa}.webpLoader__errorsContent{padding:14px 0 14px 20px;font-size:12px;line-height:1.75}.webpLoader__errorsContentMessage{font-weight:500;color:#dc3232;font-size:14px;line-height:1.64}.webpLoader__button--disabled{pointer-events:none;opacity:.25!important}.webpPopup{margin-top:20px}.webpPopup__inner{display:flex;flex-wrap:wrap;background-color:#fff}.webpPopup__image{width:152px;background-image:url(../../img/author.jpg);background-position:50%;background-size:cover;background-repeat:no-repeat}.webpPopup__content{flex:1;padding:10px 20px;border:1px solid #a0a5aa;border-left:0}.webpServerInfo{color:#222;text-align:center}.webpServerInfo pre{margin:0;font-family:monospace}.webpServerInfo h1,.webpServerInfo h2{display:none}.webpServerInfo p{max-width:100%}.webpServerInfo table{border-collapse:collapse;border:0;width:100%;margin:10px auto}.webpServerInfo td,.webpServerInfo th{border:1px solid #666;vertical-align:baseline;padding:4px 5px;font-size:12px;line-height:1.67;text-align:center}.webpServerInfo .p{text-align:left}.webpServerInfo .e{background-color:#ccf;width:300px;font-weight:700}.webpServerInfo .h{background-color:#99c;font-weight:700}.webpServerInfo .v{background-color:#ddd;max-width:300px;overflow-x:auto;word-wrap:break-word}.webpServerInfo .v i{color:#999}.webpServerInfo img{float:right;border:0}.webpTable{width:100%;margin:5px 0;border-spacing:0}.webpTable td{padding:5px 0;vertical-align:top}.webpTable td:first-child{width:22px;padding-right:30px}@media screen and (max-width:1024px){.webpPage__column--large{width:100%}.webpPage__column--small{width:100%;margin-top:40px}.webpPage__widget+.webpPage__widget{margin-top:40px}}@media screen and (max-width:782px){.webpModal__button{width:100%}.webpPage{padding-right:10px}.webpPopup__inner{display:block;border:1px solid #a0a5aa}.webpPopup__image{height:152px;margin:20px auto 0}.webpPopup__content{border:0}}@media screen and (max-width:768px){.webpPage__quality{display:block}.webpPage__qualityItem{border-left:0}.webpPage__qualityItem+.webpPage__qualityItem{border-top:1px solid #a0a5aa}}
public/build/js/scripts.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(s,i,function(t){return e[t]}.bind(null,i));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){r(1),e.exports=r(2)},function(e,t,r){"use strict";function s(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}r.r(t);var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setVars()&&this.setEvents()}var t,r,i;return t=e,(r=[{key:"setVars",value:function(){if(this.notice=document.querySelector(".notice[data-notice=webp-converter]"),this.notice)return this.settings={isHidden:!1,ajaxUrl:this.notice.getAttribute("data-url")},!0}},{key:"setEvents",value:function(){window.addEventListener("load",this.getButtons.bind(this))}},{key:"getButtons",value:function(){this.buttonClose=this.notice.querySelector(".notice-dismiss"),this.buttonPermanently=this.notice.querySelector("[data-permanently]"),this.setButtonsEvents()}},{key:"setButtonsEvents",value:function(){var e=this;this.buttonClose.addEventListener("click",(function(){e.hideNotice(!1)})),this.buttonPermanently.addEventListener("click",(function(t){t.preventDefault(),e.hideNotice(!0)}))}},{key:"hideNotice",value:function(e){this.settings.isHidden||(this.settings.isHidden=!0,jQuery.ajax(this.settings.ajaxUrl,{type:"POST",data:{action:"webpc_notice",is_permanently:e?1:0}}),this.buttonClose.click())}}])&&s(t.prototype,r),i&&s(t,i),e}();function n(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setVars()&&this.setEvents()}var t,r,s;return t=e,(r=[{key:"setVars",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.progressSize=this.section.querySelector(".webpLoader__sizeProgress"),this.errors=this.section.querySelector(".webpLoader__errors"),this.errorsInner=this.errors.querySelector(".webpLoader__errorsContentList"),this.errorsMessage=this.errors.querySelector(".webpLoader__errorsContentMessage"),this.success=this.section.querySelector(".webpLoader__success"),this.succesPopup=this.section.querySelector(".webpLoader__popup"),this.inputOptions=this.section.querySelectorAll('input[type="checkbox"]'),this.button=this.section.querySelector(".webpLoader__button"),this.data={count:0,max:0,items:[],size:{before:0,after:0},errors:[]},this.settings={isDisabled:!1,ajax:{urlPaths:this.section.getAttribute("data-api-paths"),urlRegenerate:this.section.getAttribute("data-api-regenerate"),errorMessage:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"]},this.atts={progress:"data-percent"},this.classes={progressError:"webpLoader__barProgress--error",buttonDisabled:"webpLoader__button--disabled"},!0}},{key:"setEvents",value:function(){this.button.addEventListener("click",this.initRegenerate.bind(this))}},{key:"initRegenerate",value:function(e){if(e.preventDefault(),!this.settings.isDisabled){this.settings.isDisabled=!0,this.button.classList.add(this.classes.buttonDisabled);for(var t=this.inputOptions.length,r=0;r<t;r++)this.inputOptions[r].setAttribute("disabled",!0);this.wrapper.removeAttribute("hidden"),this.getImagesList()}}},{key:"getImagesList",value:function(){var e=this;jQuery.ajax(this.settings.ajax.urlPaths,{type:"POST",data:this.getDataForPathsRequest()}).done((function(t){e.data.items=t,e.data.max=t.length,e.regenerateNextImages()})).fail((function(){e.progress.classList.add(e.classes.progressError),e.errorsMessage.removeAttribute("hidden"),e.errors.removeAttribute("hidden")}))}},{key:"getDataForPathsRequest",value:function(){for(var e={},t=this.inputOptions.length,r=0;r<t;r++)e[this.inputOptions[r].getAttribute("name")]=this.inputOptions[r].checked?1:0;return e}},{key:"regenerateNextImages",value:function(){if(0===this.data.max&&this.updateProgress(),!(this.data.count>=this.data.max)){var e=this.data.items[this.data.count];this.data.count++,this.sendRequest(e)}}},{key:"sendRequest",value:function(e){var t=this;jQuery.ajax(this.settings.ajax.urlRegenerate,{type:"POST",data:{paths:e}}).done((function(e){t.updateErrors(e.errors),t.updateSize(e),t.updateProgress(),t.regenerateNextImages()})).fail((function(){var r=JSON.stringify(e),s=t.settings.ajax.errorMessage.replace("%s","<code>".concat(r,"</code>"));t.updateErrors([s]),t.regenerateNextImages()}))}},{key:"updateErrors",value:function(e){0!==e.length&&(this.data.errors=this.data.errors.concat(e),this.errorsInner.innerHTML=this.data.errors.join("<br>"),this.errors.removeAttribute("hidden"))}},{key:"updateSize",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 s=Math.round(100*(1-t.after/t.before));s<0&&(s=0);var i=-1;do{i++,r/=1024}while(r>1024);var n=r.toFixed(2),a=this.settings.units[i],o="".concat(n," ").concat(a," (").concat(s,"%)");this.progressSize.innerHTML=o}}},{key:"updateProgress",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.succesPopup.removeAttribute("hidden")),this.progress.setAttribute(this.atts.progress,e)}}])&&n(t.prototype,r),s&&n(t,s),e}();new function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new i,new a}},function(e,t){}]);
1
+ !function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=0)}([function(t,e,r){r(1),t.exports=r(2)},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}r.r(e);var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setVars()&&this.setEvents()}var e,r,i;return e=t,(r=[{key:"setVars",value:function(){if(this.buttonOpen=document.querySelector('[data-slug="webp-converter-for-media"] a[id="deactivate-webp-converter-for-media"'),this.modal=document.querySelector(".webpModal"),this.buttonOpen&&this.modal)return this.outer=this.modal.querySelector(".webpModal__outer"),this.form=this.outer.querySelector(".webpModal__form"),this.formOptions=this.form.querySelectorAll('[name="webpc_reason"]'),this.formComment=this.form.querySelector('[name="webpc_comment"]'),this.buttonSubmit=this.form.querySelector('button[type="submit"]'),this.buttonCancel=this.form.querySelector('button[type="button"]'),this.events={openModal:this.openModal.bind(this)},this.atts={optionPlaceholder:"data-placeholder"},!0}},{key:"setEvents",value:function(){var t=this;this.buttonOpen.addEventListener("click",this.events.openModal),this.buttonSubmit.addEventListener("click",this.submitForm.bind(this)),this.buttonCancel.addEventListener("click",this.cancelForm.bind(this)),this.outer.addEventListener("click",this.closeModal.bind(this)),this.form.addEventListener("click",(function(t){t.stopPropagation()}));for(var e=this.formOptions.length,r=function(e){t.formOptions[e].addEventListener("change",(function(){t.setCurrentOption(e)}))},n=0;n<e;n++)r(n)}},{key:"openModal",value:function(t){t.preventDefault(),this.buttonOpen.removeEventListener("click",this.events.openModal),this.modal.removeAttribute("hidden")}},{key:"closeModal",value:function(){this.modal.setAttribute("hidden","hidden")}},{key:"submitForm",value:function(t){var e=this;t.preventDefault(),this.closeModal(),setTimeout((function(){var t=new FormData(e.form),r=e.form.getAttribute("action"),n=new XMLHttpRequest;n.open("POST",r,!0),n.send(t),e.buttonOpen.click()}),0)}},{key:"cancelForm",value:function(t){var e=this;t.preventDefault(),this.closeModal(),setTimeout((function(){e.buttonOpen.click()}),0)}},{key:"setCurrentOption",value:function(t){this.formComment.value="";var e=this.formOptions[t].getAttribute(this.atts.optionPlaceholder);this.formComment.setAttribute("placeholder",e)}}])&&n(e.prototype,r),i&&n(e,i),t}();function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setVars()&&this.setEvents()}var e,r,n;return e=t,(r=[{key:"setVars",value:function(){if(this.notice=document.querySelector(".notice[data-notice=webp-converter]"),this.notice)return this.settings={isHidden:!1,ajaxUrl:this.notice.getAttribute("data-url")},!0}},{key:"setEvents",value:function(){window.addEventListener("load",this.getButtons.bind(this))}},{key:"getButtons",value:function(){this.buttonClose=this.notice.querySelector(".notice-dismiss"),this.buttonPermanently=this.notice.querySelector("[data-permanently]"),this.setButtonsEvents()}},{key:"setButtonsEvents",value:function(){var t=this;this.buttonClose.addEventListener("click",(function(){t.hideNotice(!1)})),this.buttonPermanently.addEventListener("click",(function(e){e.preventDefault(),t.hideNotice(!0)}))}},{key:"hideNotice",value:function(t){this.settings.isHidden||(this.settings.isHidden=!0,jQuery.ajax(this.settings.ajaxUrl,{type:"POST",data:{action:"webpc_notice",is_permanently:t?1:0}}),this.buttonClose.click())}}])&&s(e.prototype,r),n&&s(e,n),t}();function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setVars()&&this.setEvents()}var e,r,n;return e=t,(r=[{key:"setVars",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.progressSize=this.section.querySelector(".webpLoader__sizeProgress"),this.errors=this.section.querySelector(".webpLoader__errors"),this.errorsInner=this.errors.querySelector(".webpLoader__errorsContentList"),this.errorsMessage=this.errors.querySelector(".webpLoader__errorsContentMessage"),this.success=this.section.querySelector(".webpLoader__success"),this.succesPopup=this.section.querySelector(".webpLoader__popup"),this.inputOptions=this.section.querySelectorAll('input[type="checkbox"]'),this.button=this.section.querySelector(".webpLoader__button"),this.data={count:0,max:0,items:[],size:{before:0,after:0},errors:[]},this.settings={isDisabled:!1,ajax:{urlPaths:this.section.getAttribute("data-api-paths"),urlRegenerate:this.section.getAttribute("data-api-regenerate"),errorMessage:this.section.getAttribute("data-api-error-message")},units:["kB","MB","GB"]},this.atts={progress:"data-percent"},this.classes={progressError:"webpLoader__barProgress--error",buttonDisabled:"webpLoader__button--disabled"},!0}},{key:"setEvents",value:function(){this.button.addEventListener("click",this.initRegenerate.bind(this))}},{key:"initRegenerate",value:function(t){if(t.preventDefault(),!this.settings.isDisabled){this.settings.isDisabled=!0,this.button.classList.add(this.classes.buttonDisabled);for(var e=this.inputOptions.length,r=0;r<e;r++)this.inputOptions[r].setAttribute("disabled",!0);this.wrapper.removeAttribute("hidden"),this.getImagesList()}}},{key:"getImagesList",value:function(){var t=this;jQuery.ajax(this.settings.ajax.urlPaths,{type:"POST",data:this.getDataForPathsRequest()}).done((function(e){t.data.items=e,t.data.max=e.length,t.regenerateNextImages()})).fail((function(){t.progress.classList.add(t.classes.progressError),t.errorsMessage.removeAttribute("hidden"),t.errors.removeAttribute("hidden")}))}},{key:"getDataForPathsRequest",value:function(){for(var t={},e=this.inputOptions.length,r=0;r<e;r++)t[this.inputOptions[r].getAttribute("name")]=this.inputOptions[r].checked?1:0;return t}},{key:"regenerateNextImages",value:function(){if(0===this.data.max&&this.updateProgress(),!(this.data.count>=this.data.max)){var t=this.data.items[this.data.count];this.data.count++,this.sendRequest(t)}}},{key:"sendRequest",value:function(t){var e=this;jQuery.ajax(this.settings.ajax.urlRegenerate,{type:"POST",data:{paths:t}}).done((function(t){e.updateErrors(t.errors),e.updateSize(t),e.updateProgress(),e.regenerateNextImages()})).fail((function(){var r=JSON.stringify(t),n=e.settings.ajax.errorMessage.replace("%s","<code>".concat(r,"</code>"));e.updateErrors([n]),e.regenerateNextImages()}))}},{key:"updateErrors",value:function(t){0!==t.length&&(this.data.errors=this.data.errors.concat(t),this.errorsInner.innerHTML=this.data.errors.join("<br>"),this.errors.removeAttribute("hidden"))}},{key:"updateSize",value:function(t){var e=this.data.size;e.before+=t.size.before,e.after+=t.size.after;var r=e.before-e.after;if(r<0&&(r=0),0!==r){var n=Math.round(100*(1-e.after/e.before));n<0&&(n=0);var i=-1;do{i++,r/=1024}while(r>1024);var s=r.toFixed(2),o=this.settings.units[i],a="".concat(s," ").concat(o," (").concat(n,"%)");this.progressSize.innerHTML=a}}},{key:"updateProgress",value:function(){var t=this.data.max>0?Math.floor(this.data.count/this.data.max*100):100;t>100&&(t=100),100===t&&(this.success.removeAttribute("hidden"),this.succesPopup.removeAttribute("hidden")),this.progress.setAttribute(this.atts.progress,t)}}])&&a(e.prototype,r),n&&a(e,n),t}();new function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),new i,new o,new u}},function(t,e){}]);
readme.txt CHANGED
@@ -396,9 +396,9 @@ If you are using a CDN server, find one that automatically converts images to We
396
  = Configuration for Apache =
397
 
398
  In the case of Apache, when saving the settings, .htaccess files will be generated automatically in the following locations:
399
- - `/wp-content/.htaccess`
400
- - `/wp-content/uploads/.htaccess`
401
- - `/wp-content/uploads-webpc/.htaccess`
402
 
403
  If these files are missing or empty, try disabling and re-enabling the plugin or saving the plugin settings again. Also check the write permissions of the directories where these files are located.
404
 
@@ -407,34 +407,35 @@ If your server is a combination of Apache and Nginx, remember that the image fil
407
  = Configuration for Nginx =
408
 
409
  Please edit the configuration file:
410
- - `/etc/nginx/mime.types`
411
 
412
- and add this code line:
 
 
413
 
414
  `types {`
415
- ` # ...`
416
- ` image/webp webp;`
417
- `}`
 
418
 
419
- Then find the configuration file in one of the paths *(remember to select configuration file used by your vhost)*:
420
- - `/etc/nginx/sites-enabled/`
421
- - `/etc/nginx/conf.d/`
422
 
423
- and add below code in this file *(add these lines to very beginning of file if possible - if they will be at the bottom, other rules may block the rules for WebP from working)*:
 
 
424
 
425
  `server {`
426
- ` location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {`
427
- ` if ($http_accept !~* "image/webp") {`
428
- ` break;`
429
- ` }`
430
- ` add_header Vary Accept;`
431
- ` expires 365d;`
432
- ` try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;`
433
- ` }`
434
- ` # ...`
435
- `}`
436
-
437
- After making changes, remember to restart the machine: `systemctl restart nginx`.
438
 
439
  = Configuration for Multisite Network =
440
 
@@ -492,6 +493,11 @@ This is all very important to us and allows us to do even better things for you!
492
 
493
  == Changelog ==
494
 
 
 
 
 
 
495
  = 1.5.1 (2020-11-02) =
496
  * `[Changed]` Error messages related to non-working redirects from .htaccess file
497
 
396
  = Configuration for Apache =
397
 
398
  In the case of Apache, when saving the settings, .htaccess files will be generated automatically in the following locations:
399
+ * `/wp-content/.htaccess`
400
+ * `/wp-content/uploads/.htaccess`
401
+ * `/wp-content/uploads-webpc/.htaccess`
402
 
403
  If these files are missing or empty, try disabling and re-enabling the plugin or saving the plugin settings again. Also check the write permissions of the directories where these files are located.
404
 
407
  = Configuration for Nginx =
408
 
409
  Please edit the configuration file:
 
410
 
411
+ `/etc/nginx/mime.types`
412
+
413
+ and add this code:
414
 
415
  `types {`
416
+ ` # ...
417
+
418
+ image/webp webp;
419
+ }`
420
 
421
+ Then please find your configuration file in the path *(default is default file)*:
 
 
422
 
423
+ `/etc/nginx/sites-available/`
424
+
425
+ and add below code in this file:
426
 
427
  `server {`
428
+ ` # ...
429
+
430
+ location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {
431
+ if ($http_accept !~* "image/webp") {
432
+ break;
433
+ }
434
+ add_header Vary Accept;
435
+ expires 365d;
436
+ try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;
437
+ }
438
+ }`
 
439
 
440
  = Configuration for Multisite Network =
441
 
493
 
494
  == Changelog ==
495
 
496
+ = 1.6.0 (2020-12-12) =
497
+ * `[Added]` Escaping functions for translated phrases
498
+ * `[Added]` Error codes in error messages on plugin settings page
499
+ * `[Added]` Modal when deactivating plugin
500
+
501
  = 1.5.1 (2020-11-02) =
502
  * `[Changed]` Error messages related to non-working redirects from .htaccess file
503
 
resources/components/errors/bypassing-apache.php CHANGED
@@ -1,5 +1,5 @@
1
  <p>
2
- <?= sprintf(
3
  __('Requests to images are processed by your server bypassing Apache. When loading images, rules from the .htaccess file are not executed. Occasionally, this only applies to known file extensions: .jpg, .png, etc. and when e.g. .png2 extension is loaded, then the redirections from the .htaccess file work, because the server does not understand this format and does not treat it as image files. Check the redirects for %s.png file%s %s(for which the redirection does not work)%s and for %s.png2 file%s %s(for which the redirection works correctly)%s. %sChange the server settings to stop ignoring the rules from the .htaccess file. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<a href="' . WEBPC_URL . 'public/img/debug/icon-before.png" target="_blank">',
5
  '</a>',
@@ -10,5 +10,5 @@
10
  '<em>',
11
  '</em>',
12
  '<br><br>'
13
- ); ?>
14
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('Requests to images are processed by your server bypassing Apache. When loading images, rules from the .htaccess file are not executed. Occasionally, this only applies to known file extensions: .jpg, .png, etc. and when e.g. .png2 extension is loaded, then the redirections from the .htaccess file work, because the server does not understand this format and does not treat it as image files. Check the redirects for %s.png file%s %s(for which the redirection does not work)%s and for %s.png2 file%s %s(for which the redirection works correctly)%s. %sChange the server settings to stop ignoring the rules from the .htaccess file. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<a href="' . WEBPC_URL . 'public/img/debug/icon-before.png" target="_blank">',
5
  '</a>',
10
  '<em>',
11
  '</em>',
12
  '<br><br>'
13
+ )); ?>
14
  </p>
resources/components/errors/libs-not-installed.php CHANGED
@@ -1,5 +1,5 @@
1
  <p>
2
- <?= sprintf(
3
  __('On your server is not installed %sGD%s or %sImagick%s library. Please read %sthe plugin FAQ%s and check your server configuration %shere%s. Compare it with the configuration given in the requirements of plugin in the FAQ. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>',
@@ -9,5 +9,5 @@
9
  '</a>',
10
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
11
  '</a>'
12
- ); ?>
13
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('On your server is not installed %sGD%s or %sImagick%s library. Please read %sthe plugin FAQ%s and check your server configuration %shere%s. Compare it with the configuration given in the requirements of plugin in the FAQ. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>',
9
  '</a>',
10
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
11
  '</a>'
12
+ )); ?>
13
  </p>
resources/components/errors/libs-without-webp-support.php CHANGED
@@ -1,5 +1,5 @@
1
  <p>
2
- <?= sprintf(
3
  __('On your server installed GD or Imagick library %sdoes not support WebP format%s. Please read %sthe plugin FAQ%s and check your server configuration %shere%s. Compare it with the configuration given in the requirements of plugin in the FAQ. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>',
@@ -7,5 +7,5 @@
7
  '</a>',
8
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
9
  '</a>'
10
- ); ?>
11
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('On your server installed GD or Imagick library %sdoes not support WebP format%s. Please read %sthe plugin FAQ%s and check your server configuration %shere%s. Compare it with the configuration given in the requirements of plugin in the FAQ. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>',
7
  '</a>',
8
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
9
  '</a>'
10
+ )); ?>
11
  </p>
resources/components/errors/path-htaccess-not-writable.php CHANGED
@@ -1,8 +1,8 @@
1
  <p>
2
- <?= sprintf(
3
  __('Unable to create or edit .htaccess file %s(function is_readable() or is_writable() returns false)%s. Change directory permissions. The current using path of file is: %s. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>' . apply_filters('webpc_uploads_path', '') . '/.htaccess</strong>'
7
- ); ?>
8
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('Unable to create or edit .htaccess file %s(function is_readable() or is_writable() returns false)%s. Change directory permissions. The current using path of file is: %s. Please contact your server administrator.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>' . apply_filters('webpc_uploads_path', '') . '/.htaccess</strong>'
7
+ )); ?>
8
  </p>
resources/components/errors/path-uploads-unavailable.php CHANGED
@@ -1,10 +1,10 @@
1
  <p>
2
- <?= sprintf(
3
  __('The path for /uploads files does not exist %s(function is_dir() returns false)%s. Use filters %s or %s to set the correct path. The current using path is: %s. Please read the plugin FAQ to learn more.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>webpc_uploads_root</strong>',
7
  '<strong>webpc_uploads_path</strong>',
8
  '<strong>' . apply_filters('webpc_uploads_path', '') . '</strong>'
9
- ); ?>
10
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('The path for /uploads files does not exist %s(function is_dir() returns false)%s. Use filters %s or %s to set the correct path. The current using path is: %s. Please read the plugin FAQ to learn more.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>webpc_uploads_root</strong>',
7
  '<strong>webpc_uploads_path</strong>',
8
  '<strong>' . apply_filters('webpc_uploads_path', '') . '</strong>'
9
+ )); ?>
10
  </p>
resources/components/errors/path-webp-duplicated.php CHANGED
@@ -1,8 +1,8 @@
1
  <p>
2
- <?= sprintf(
3
  __('The paths for /uploads files and for saving converted WebP files are the same. Change them using filters %s or %s. The current path for them is: %s.', 'webp-converter-for-media'),
4
  '<strong>webpc_uploads_path</strong>',
5
  '<strong>webpc_uploads_webp</strong>',
6
  '<strong>' . apply_filters('webpc_uploads_path', '') . '</strong>'
7
- ); ?>
8
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('The paths for /uploads files and for saving converted WebP files are the same. Change them using filters %s or %s. The current path for them is: %s.', 'webp-converter-for-media'),
4
  '<strong>webpc_uploads_path</strong>',
5
  '<strong>webpc_uploads_webp</strong>',
6
  '<strong>' . apply_filters('webpc_uploads_path', '') . '</strong>'
7
+ )); ?>
8
  </p>
resources/components/errors/path-webp-not-writable.php CHANGED
@@ -1,10 +1,10 @@
1
  <p>
2
- <?= sprintf(
3
  __('The path for saving converted WebP files does not exist and cannot be created %s(function is_writable() returns false)%s. Use filters %s or %s to set the correct path. The current using path is: %s. Please read the plugin FAQ to learn more.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>webpc_uploads_root</strong>',
7
  '<strong>webpc_uploads_webp</strong>',
8
  '<strong>' . apply_filters('webpc_uploads_webp', '') . '</strong>'
9
- ); ?>
10
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('The path for saving converted WebP files does not exist and cannot be created %s(function is_writable() returns false)%s. Use filters %s or %s to set the correct path. The current using path is: %s. Please read the plugin FAQ to learn more.', 'webp-converter-for-media'),
4
  '<em>',
5
  '</em>',
6
  '<strong>webpc_uploads_root</strong>',
7
  '<strong>webpc_uploads_webp</strong>',
8
  '<strong>' . apply_filters('webpc_uploads_webp', '') . '</strong>'
9
+ )); ?>
10
  </p>
resources/components/errors/rest-api-disabled.php CHANGED
@@ -1,8 +1,8 @@
1
  <p>
2
- <?= sprintf(
3
  __('The REST API on your website is not available. Please verify this and try again. Pay special attention to the filters: %s, %s and %s.', 'webp-converter-for-media'),
4
  '<a href="https://developer.wordpress.org/reference/hooks/rest_enabled/" target="_blank">rest_enabled</a>',
5
  '<a href="https://developer.wordpress.org/reference/hooks/rest_jsonp_enabled/" target="_blank">rest_jsonp_enabled</a>',
6
  '<a href="https://developer.wordpress.org/reference/hooks/rest_authentication_errors/" target="_blank">rest_authentication_errors</a>'
7
- ); ?>
8
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('The REST API on your website is not available. Please verify this and try again. Pay special attention to the filters: %s, %s and %s.', 'webp-converter-for-media'),
4
  '<a href="https://developer.wordpress.org/reference/hooks/rest_enabled/" target="_blank">rest_enabled</a>',
5
  '<a href="https://developer.wordpress.org/reference/hooks/rest_jsonp_enabled/" target="_blank">rest_jsonp_enabled</a>',
6
  '<a href="https://developer.wordpress.org/reference/hooks/rest_authentication_errors/" target="_blank">rest_authentication_errors</a>'
7
+ )); ?>
8
  </p>
resources/components/errors/rewrites-cached.php CHANGED
@@ -1,6 +1,6 @@
1
  <p>
2
- <?= sprintf(
3
  __('Your server uses the cache for HTTP requests. The rules from .htaccess file or from Nginx configuration are not executed every time when the image is loaded, but the last redirect from cache is performed. With each request to image, your server should execute the rules from .htaccess file or from Nginx configuration. Now it only does this the first time and then uses cache. This means that if your server redirected image to WebP format the first time, it does so on every request. It should check the rules from .htaccess file or from Nginx configuration each time during request to image and redirect only when the conditions are met. %sIf you have enabled caching HTTP reverse proxy or another HTTP caching, you must disable it. Otherwise the plugin cannot work properly. In this case, please contact your server administrator.', 'webp-converter-for-media'),
4
  '<br><br>'
5
- ); ?>
6
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('Your server uses the cache for HTTP requests. The rules from .htaccess file or from Nginx configuration are not executed every time when the image is loaded, but the last redirect from cache is performed. With each request to image, your server should execute the rules from .htaccess file or from Nginx configuration. Now it only does this the first time and then uses cache. This means that if your server redirected image to WebP format the first time, it does so on every request. It should check the rules from .htaccess file or from Nginx configuration each time during request to image and redirect only when the conditions are met. %sIf you have enabled caching HTTP reverse proxy or another HTTP caching, you must disable it. Otherwise the plugin cannot work properly. In this case, please contact your server administrator.', 'webp-converter-for-media'),
4
  '<br><br>'
5
+ )); ?>
6
  </p>
resources/components/errors/rewrites-not-working.php CHANGED
@@ -1,8 +1,8 @@
1
  <p>
2
- <?= sprintf(
3
  __('Redirects on your server are not working. Check the correct configuration for you in %sthe plugin FAQ%s. If your configuration is correct, it means that your server does not support redirects from the .htaccess file or requests to images are processed by your server bypassing Apache. %sIn this case, please contact your server administrator.', 'webp-converter-for-media'),
4
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
5
  '</a>',
6
  '<br><br>'
7
- ); ?>
8
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('Redirects on your server are not working. Check the correct configuration for you in %sthe plugin FAQ%s. If your configuration is correct, it means that your server does not support redirects from the .htaccess file or requests to images are processed by your server bypassing Apache. %sIn this case, please contact your server administrator.', 'webp-converter-for-media'),
4
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
5
  '</a>',
6
  '<br><br>'
7
+ )); ?>
8
  </p>
resources/components/errors/settings-incorrect.php CHANGED
@@ -1,7 +1,7 @@
1
  <p>
2
- <?= sprintf(
3
  __('%sThe plugin settings are incorrect!%s Check them out and save them again. Please remember that you must have at least one supported files extension, at least one supported directory and selected conversion method and level of images quality.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>'
6
- ); ?>
7
  </p>
1
  <p>
2
+ <?= wp_kses_post(sprintf(
3
  __('%sThe plugin settings are incorrect!%s Check them out and save them again. Please remember that you must have at least one supported files extension, at least one supported directory and selected conversion method and level of images quality.', 'webp-converter-for-media'),
4
  '<strong>',
5
  '</strong>'
6
+ )); ?>
7
  </p>
resources/components/fields/checkbox.php CHANGED
@@ -1,20 +1,27 @@
1
  <?php if ($option['info']) : ?>
2
- <p><?= $option['info']; ?></p>
3
  <?php endif; ?>
4
- <table class="webpPage__widgetTable">
5
  <?php
6
  foreach ($option['values'] as $value => $label) :
7
  $isChecked = (isset($values[$option['name']]) && in_array($value, $values[$option['name']]));
8
  ?>
9
  <tr>
10
  <td>
11
- <input type="checkbox" name="<?= $option['name']; ?>[]" value="<?= $value; ?>"
12
- id="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__checkbox" <?= $isChecked ? 'checked' : ''; ?>
 
 
 
 
13
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
14
- <label for="webpc-<?= $index; ?>-<?= $value; ?>"></label>
15
  </td>
16
  <td>
17
- <label for="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__checkboxLabel"><?= $label; ?></label>
 
 
 
18
  </td>
19
  </tr>
20
  <?php endforeach; ?>
1
  <?php if ($option['info']) : ?>
2
+ <p><?= wp_kses_post($option['info']); ?></p>
3
  <?php endif; ?>
4
+ <table class="webpTable">
5
  <?php
6
  foreach ($option['values'] as $value => $label) :
7
  $isChecked = (isset($values[$option['name']]) && in_array($value, $values[$option['name']]));
8
  ?>
9
  <tr>
10
  <td>
11
+ <input type="checkbox"
12
+ name="<?= esc_attr($option['name']); ?>[]"
13
+ value="<?= esc_attr($value); ?>"
14
+ id="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
15
+ class="webpCheckbox__input"
16
+ <?= $isChecked ? 'checked' : ''; ?>
17
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
18
+ <label for="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"></label>
19
  </td>
20
  <td>
21
+ <label for="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
22
+ class="webpCheckbox__label">
23
+ <?= wp_kses_post($label); ?>
24
+ </label>
25
  </td>
26
  </tr>
27
  <?php endforeach; ?>
resources/components/fields/quality.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php if ($option['info']) : ?>
2
- <p><?= $option['info']; ?></p>
3
  <?php endif; ?>
4
  <div class="webpPage__quality">
5
  <?php
@@ -7,10 +7,17 @@
7
  $isChecked = (isset($values[$option['name']]) && ($value == $values[$option['name']]));
8
  ?>
9
  <div class="webpPage__qualityItem">
10
- <input type="radio" name="<?= $option['name']; ?>" value="<?= $value; ?>"
11
- id="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__qualityItemInput" <?= $isChecked ? 'checked' : ''; ?>
 
 
 
 
12
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
13
- <label for="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__qualityItemLabel"><?= $label; ?></label>
 
 
 
14
  </div>
15
  <?php endforeach; ?>
16
  </div>
1
  <?php if ($option['info']) : ?>
2
+ <p><?= wp_kses_post($option['info']); ?></p>
3
  <?php endif; ?>
4
  <div class="webpPage__quality">
5
  <?php
7
  $isChecked = (isset($values[$option['name']]) && ($value == $values[$option['name']]));
8
  ?>
9
  <div class="webpPage__qualityItem">
10
+ <input type="radio"
11
+ name="<?= esc_attr($option['name']); ?>"
12
+ value="<?= esc_attr($value); ?>"
13
+ id="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
14
+ class="webpPage__qualityItemInput"
15
+ <?= $isChecked ? 'checked' : ''; ?>
16
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
17
+ <label for="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
18
+ class="webpPage__qualityItemLabel">
19
+ <?= wp_kses_post($label); ?>
20
+ </label>
21
  </div>
22
  <?php endforeach; ?>
23
  </div>
resources/components/fields/radio.php CHANGED
@@ -1,20 +1,27 @@
1
  <?php if ($option['info']) : ?>
2
- <p><?= $option['info']; ?></p>
3
  <?php endif; ?>
4
- <table class="webpPage__widgetTable">
5
  <?php
6
  foreach ($option['values'] as $value => $label) :
7
  $isChecked = (isset($values[$option['name']]) && ($value === $values[$option['name']]));
8
  ?>
9
  <tr>
10
  <td>
11
- <input type="radio" name="<?= $option['name']; ?>" value="<?= $value; ?>"
12
- id="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__checkbox" <?= $isChecked ? 'checked' : ''; ?>
 
 
 
 
13
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
14
- <label for="webpc-<?= $index; ?>-<?= $value; ?>"></label>
15
  </td>
16
  <td>
17
- <label for="webpc-<?= $index; ?>-<?= $value; ?>" class="webpPage__checkboxLabel"><?= $label; ?></label>
 
 
 
18
  </td>
19
  </tr>
20
  <?php endforeach; ?>
1
  <?php if ($option['info']) : ?>
2
+ <p><?= wp_kses_post($option['info']); ?></p>
3
  <?php endif; ?>
4
+ <table class="webpTable">
5
  <?php
6
  foreach ($option['values'] as $value => $label) :
7
  $isChecked = (isset($values[$option['name']]) && ($value === $values[$option['name']]));
8
  ?>
9
  <tr>
10
  <td>
11
+ <input type="radio"
12
+ name="<?= esc_attr($option['name']); ?>"
13
+ value="<?= esc_attr($value); ?>"
14
+ id="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
15
+ class="webpCheckbox__input"
16
+ <?= $isChecked ? 'checked' : ''; ?>
17
  <?= (in_array($value, $option['disabled'])) ? 'disabled' : ''; ?>>
18
+ <label for="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"></label>
19
  </td>
20
  <td>
21
+ <label for="webpc-<?= esc_attr($index); ?>-<?= esc_attr($value); ?>"
22
+ class="webpCheckbox__label">
23
+ <?= wp_kses_post($label); ?>
24
+ </label>
25
  </td>
26
  </tr>
27
  <?php endforeach; ?>
resources/components/notices/thanks.php CHANGED
@@ -1,31 +1,31 @@
1
  <div class="notice notice-success is-dismissible" data-notice="webp-converter" data-url="<?= admin_url('admin-ajax.php'); ?>">
2
  <div class="webpContent webpContent--notice">
3
  <h4>
4
- <?= __('Thank you for using our plugin WebP Converter for Media!', 'webp-converter-for-media'); ?>
5
  </h4>
6
  <p>
7
- <?= sprintf(
8
  __('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. If you have a technical problem, please before you add a review %scheck our FAQ%s or contact us if you did not find help there. We will try to help you!', 'webp-converter-for-media'),
9
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
10
  '</a>'
11
- ); ?>
12
  </p>
13
  <div class="webpContent__buttons">
14
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/#new-post" target="_blank"
15
  class="webpContent__button webpButton webpButton--green">
16
- <?= __('Get help', 'webp-converter-for-media'); ?>
17
  </a>
18
- <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/#new-post" target="_blank"
19
  class="webpContent__button webpButton webpButton--green">
20
- <?= __('Add review', 'webp-converter-for-media'); ?>
21
  </a>
22
  <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=notice-thanks" target="_blank"
23
  class="webpContent__button webpButton webpButton--green dashicons-heart">
24
- <?= __('Provide us a coffee', 'webp-converter-for-media'); ?>
25
  </a>
26
  <a href="#" target="_blank" data-permanently
27
  class="webpContent__button webpButton webpButton--blue">
28
- <?= __('I added review, do not show again', 'webp-converter-for-media'); ?>
29
  </a>
30
  </div>
31
  </div>
1
  <div class="notice notice-success is-dismissible" data-notice="webp-converter" data-url="<?= admin_url('admin-ajax.php'); ?>">
2
  <div class="webpContent webpContent--notice">
3
  <h4>
4
+ <?= esc_html(__('Thank you for using our plugin WebP Converter for Media!', 'webp-converter-for-media')); ?>
5
  </h4>
6
  <p>
7
+ <?= wp_kses_post(sprintf(
8
  __('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. If you have a technical problem, please before you add a review %scheck our FAQ%s or contact us if you did not find help there. We will try to help you!', 'webp-converter-for-media'),
9
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
10
  '</a>'
11
+ )); ?>
12
  </p>
13
  <div class="webpContent__buttons">
14
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/#new-post" target="_blank"
15
  class="webpContent__button webpButton webpButton--green">
16
+ <?= esc_html(__('Get help', 'webp-converter-for-media')); ?>
17
  </a>
18
+ <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post" target="_blank"
19
  class="webpContent__button webpButton webpButton--green">
20
+ <?= esc_html(__('Add review', 'webp-converter-for-media')); ?>
21
  </a>
22
  <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=notice-thanks" target="_blank"
23
  class="webpContent__button webpButton webpButton--green dashicons-heart">
24
+ <?= esc_html(__('Provide us a coffee', 'webp-converter-for-media')); ?>
25
  </a>
26
  <a href="#" target="_blank" data-permanently
27
  class="webpContent__button webpButton webpButton--blue">
28
+ <?= esc_html(__('I added review, do not show again', 'webp-converter-for-media')); ?>
29
  </a>
30
  </div>
31
  </div>
resources/components/notices/welcome.php CHANGED
@@ -1,19 +1,19 @@
1
  <div class="notice notice-success">
2
  <div class="webpContent webpContent--notice">
3
  <h4>
4
- <?= __('Thank you for installing our plugin WebP Converter for Media!', 'webp-converter-for-media'); ?>
5
  </h4>
6
  <p>
7
- <?= sprintf(
8
  __('Would you like to speed up your website using our plugin? %sGo to plugin settings and convert all your images to WebP with one click! Thank you for being with us! %s', 'webp-converter-for-media'),
9
  '<br>',
10
  '<span class="dashicons dashicons-heart"></span>'
11
- ); ?>
12
  </p>
13
  <div class="webpContent__buttons">
14
- <a href="<?= menu_page_url('webpc_admin_page', false); ?>"
15
  class="webpContent__button webpButton webpButton--green">
16
- <?= __('Speed up my website', 'webp-converter-for-media'); ?>
17
  </a>
18
  </div>
19
  </div>
1
  <div class="notice notice-success">
2
  <div class="webpContent webpContent--notice">
3
  <h4>
4
+ <?= esc_html(__('Thank you for installing our plugin WebP Converter for Media!', 'webp-converter-for-media')); ?>
5
  </h4>
6
  <p>
7
+ <?= wp_kses_post(sprintf(
8
  __('Would you like to speed up your website using our plugin? %sGo to plugin settings and convert all your images to WebP with one click! Thank you for being with us! %s', 'webp-converter-for-media'),
9
  '<br>',
10
  '<span class="dashicons dashicons-heart"></span>'
11
+ )); ?>
12
  </p>
13
  <div class="webpContent__buttons">
14
+ <a href="<?= esc_url(menu_page_url('webpc_admin_page', false)); ?>"
15
  class="webpContent__button webpButton webpButton--green">
16
+ <?= esc_html(__('Speed up my website', 'webp-converter-for-media')); ?>
17
  </a>
18
  </div>
19
  </div>
resources/components/widgets/about.php CHANGED
@@ -4,25 +4,25 @@
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
- <?= sprintf(
8
  __('By adding images to your media library, they are automatically converted and saved in a separate directory. Images are converted using %sGD%s or %sImagick%s native extension for PHP.', 'webp-converter-for-media'),
9
  '<strong>', '</strong>', '<strong>', '</strong>'
10
- ); ?>
11
  </p>
12
  <p>
13
- <?= sprintf(
14
  __('When the browser tries to download an image file, the server verifies if it supports image/webp files and if the file exists. If everything is OK, instead of the original image, the browser will receive its equivalent in WebP format.', 'webp-converter-for-media'),
15
  '<strong>', '</strong>'
16
- ); ?>
17
  </p>
18
  <p>
19
- <?= __('The plugin does not change file URLs, so there are no problems with saving the page to the cache and the page generation time does not increase.', 'webp-converter-for-media'); ?>
20
  </p>
21
  <p>
22
- <?= sprintf(
23
  __('Image URLs are modified using the module %smod_rewrite%s 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 to %simage/webp%s.', 'webp-converter-for-media'),
24
  '<strong>', '</strong>', '<strong>', '</strong>'
25
- ); ?>
26
  </p>
27
  </div>
28
  </div>
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
+ <?= wp_kses_post(sprintf(
8
  __('By adding images to your media library, they are automatically converted and saved in a separate directory. Images are converted using %sGD%s or %sImagick%s native extension for PHP.', 'webp-converter-for-media'),
9
  '<strong>', '</strong>', '<strong>', '</strong>'
10
+ )); ?>
11
  </p>
12
  <p>
13
+ <?= wp_kses_post(sprintf(
14
  __('When the browser tries to download an image file, the server verifies if it supports image/webp files and if the file exists. If everything is OK, instead of the original image, the browser will receive its equivalent in WebP format.', 'webp-converter-for-media'),
15
  '<strong>', '</strong>'
16
+ )); ?>
17
  </p>
18
  <p>
19
+ <?= wp_kses_post(__('The plugin does not change file URLs, so there are no problems with saving the page to the cache and the page generation time does not increase.', 'webp-converter-for-media')); ?>
20
  </p>
21
  <p>
22
+ <?= wp_kses_post(sprintf(
23
  __('Image URLs are modified using the module %smod_rewrite%s 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 to %simage/webp%s.', 'webp-converter-for-media'),
24
  '<strong>', '</strong>', '<strong>', '</strong>'
25
+ )); ?>
26
  </p>
27
  </div>
28
  </div>
resources/components/widgets/donate.php CHANGED
@@ -1,14 +1,16 @@
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
3
- <?= __('We love what we do!', 'webp-converter-for-media'); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
- <?= __('However, working on plugins and technical support requires many hours of work. If you want to appreciate it, you can provide us a coffee. Thanks everyone!', 'webp-converter-for-media'); ?>
8
  </p>
9
  <p class="center">
10
- <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=widget-donate" target="_blank" class="webpButton webpButton--blue dashicons-heart">
11
- <?= __('Provide us a coffee', 'webp-converter-for-media'); ?>
 
 
12
  </a>
13
  </p>
14
  </div>
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
3
+ <?= esc_html(__('We love what we do!', 'webp-converter-for-media')); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
+ <?= wp_kses_post(__('However, working on plugins and technical support requires many hours of work. If you want to appreciate it, you can provide us a coffee. Thanks everyone!', 'webp-converter-for-media')); ?>
8
  </p>
9
  <p class="center">
10
+ <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=widget-donate"
11
+ target="_blank"
12
+ class="webpButton webpButton--blue dashicons-heart">
13
+ <?= esc_html(__('Provide us a coffee', 'webp-converter-for-media')); ?>
14
  </a>
15
  </p>
16
  </div>
resources/components/widgets/errors.php CHANGED
@@ -1,8 +1,18 @@
1
  <?php if ($errors = apply_filters('webpc_server_errors', [])) : ?>
2
  <div class="webpPage__widget">
3
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--error">
4
- <?= __('Server configuration error', 'webp-converter-for-media'); ?>
5
  </h3>
6
- <div class="webpContent webpContent--wide"><?= implode(PHP_EOL, $errors); ?></div>
 
 
 
 
 
 
 
 
 
 
7
  </div>
8
  <?php endif; ?>
1
  <?php if ($errors = apply_filters('webpc_server_errors', [])) : ?>
2
  <div class="webpPage__widget">
3
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--error">
4
+ <?= esc_html(__('Server configuration error', 'webp-converter-for-media')); ?>
5
  </h3>
6
+ <div class="webpContent webpContent--wide">
7
+ <?= implode(PHP_EOL, $errors); ?>
8
+ <p>
9
+ <?= sprintf(
10
+ __('%sError codes:%s %s', 'webp-converter-for-media'),
11
+ '<strong>',
12
+ '</strong>',
13
+ implode(', ', array_keys($errors))
14
+ ); ?>
15
+ </p>
16
+ </div>
17
  </div>
18
  <?php endif; ?>
resources/components/widgets/options.php CHANGED
@@ -1,21 +1,23 @@
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle">
3
- <?= __('Settings', 'webp-converter-for-media'); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <?php foreach ($options as $index => $option) : ?>
7
  <div class="webpPage__widgetRow">
8
- <h4><?= $option['label']; ?></h4>
9
  <?php include WEBPC_PATH . '/resources/components/fields/' . $option['type'] . '.php'; ?>
10
  </div>
11
  <?php endforeach; ?>
12
  <div class="webpPage__widgetRow">
13
  <button type="submit" name="webpc_save"
14
- class="webpButton webpButton--green"><?= __('Save Changes', 'webp-converter-for-media'); ?></button>
 
 
15
  </div>
16
  <div class="webpPage__widgetRow">
17
  <p>
18
- <?= sprintf(
19
  __('If you have a problem %scheck our FAQ%s first. If you did not find help there, please %scheck support forum%s for any similar problem or contact us. Before you contact us %scheck the configuration%s of your server.', 'webp-converter-for-media'),
20
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
21
  '</a>',
@@ -23,7 +25,7 @@
23
  '</a>',
24
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
25
  '</a>'
26
- ); ?>
27
  </p>
28
  </div>
29
  </div>
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle">
3
+ <?= esc_html(__('Settings', 'webp-converter-for-media')); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <?php foreach ($options as $index => $option) : ?>
7
  <div class="webpPage__widgetRow">
8
+ <h4><?= esc_html($option['label']); ?></h4>
9
  <?php include WEBPC_PATH . '/resources/components/fields/' . $option['type'] . '.php'; ?>
10
  </div>
11
  <?php endforeach; ?>
12
  <div class="webpPage__widgetRow">
13
  <button type="submit" name="webpc_save"
14
+ class="webpButton webpButton--green">
15
+ <?= esc_html(__('Save Changes', 'webp-converter-for-media')); ?>
16
+ </button>
17
  </div>
18
  <div class="webpPage__widgetRow">
19
  <p>
20
+ <?= wp_kses_post(sprintf(
21
  __('If you have a problem %scheck our FAQ%s first. If you did not find help there, please %scheck support forum%s for any similar problem or contact us. Before you contact us %scheck the configuration%s of your server.', 'webp-converter-for-media'),
22
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
23
  '</a>',
25
  '</a>',
26
  '<a href="' . sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)) . '">',
27
  '</a>'
28
+ )); ?>
29
  </p>
30
  </div>
31
  </div>
resources/components/widgets/regenerate.php CHANGED
@@ -4,18 +4,18 @@
4
  ?>
5
  <div class="webpPage__widget">
6
  <h3 class="webpPage__widgetTitle">
7
- <?= __('Regenerate images', 'webp-converter-for-media'); ?>
8
  </h3>
9
  <div class="webpLoader webpContent"
10
- data-api-paths="<?= $apiPaths; ?>"
11
- data-api-regenerate="<?= $apiRegenerate; ?>"
12
- data-api-error-message="<?= __('An unknown error occurred while converting the images: %s', 'webp-converter-for-media'); ?>">
13
  <div class="webpPage__widgetRow">
14
  <p>
15
- <?= __('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 may take a few or more than ten minutes depending on the number of files. During this process, please do not close your browser window.', 'webp-converter-for-media'); ?>
16
  </p>
17
  <p>
18
- <?= __('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'); ?>
19
  </p>
20
  <div class="webpLoader__status" hidden>
21
  <div class="webpLoader__bar">
@@ -24,56 +24,60 @@
24
  </div>
25
  <div class="webpLoader__size">
26
  <?= sprintf(
27
- __('Saving the weight of your images: %s', 'webp-converter-for-media'),
28
  '<span class="webpLoader__sizeProgress">0 kB</span>'
29
  ); ?>
30
  </div>
31
  </div>
32
  <div class="webpLoader__success" hidden>
33
  <div class="webpLoader__successContent">
34
- <?= __('The process was completed successfully. Your images have been converted!', 'webp-converter-for-media'); ?>
35
  <br>
36
- <?= sprintf(
37
  __('Do you want to know how a plugin works and how to check if it is working properly? Read our %splugin FAQ%s.', 'webp-converter-for-media'),
38
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
39
  '</a>'
40
- ); ?>
41
  </div>
42
  </div>
43
  <div class="webpLoader__popup webpPopup" hidden>
44
  <div class="webpPopup__inner">
45
  <div class="webpPopup__image"></div>
46
  <div class="webpPopup__content">
47
- <p><?= __('Hi, I\'m Mateusz! I\'m glad you managed to reduce the weight of your website. If you would like to support me in developing this plugin, I will be very grateful to you!', 'webp-converter-for-media'); ?></p>
48
  <p>
49
- <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=notice-regenerate" target="_blank" class="webpButton webpButton--blue dashicons-coffee">
50
- <?= __('Provide me a coffee', 'webp-converter-for-media'); ?>
 
 
51
  </a>
52
  </p>
53
  </div>
54
  </div>
55
  </div>
56
  <div class="webpLoader__errors" hidden>
57
- <div class="webpLoader__errorsTitle"><?= __('Additional informations about process:', 'webp-converter-for-media'); ?></div>
 
 
58
  <div class="webpLoader__errorsContent">
59
  <div class="webpLoader__errorsContentList"></div>
60
  <div class="webpLoader__errorsContentMessage" hidden>
61
- <?= __('An error occurred while connecting to REST API. Please try again.', 'webp-converter-for-media'); ?>
62
  </div>
63
  </div>
64
  </div>
65
  </div>
66
  </div>
67
  <div class="webpPage__widgetRow">
68
- <table class="webpPage__widgetTable">
69
  <tr>
70
  <td>
71
  <input type="checkbox" name="regenerate_force" value="1"
72
- id="webpc-regenerate-force" class="webpPage__checkbox">
73
  <label for="webpc-regenerate-force"></label>
74
  </td>
75
  <td>
76
- <label for="webpc-regenerate-force" class="webpPage__checkboxLabel">
77
  <?= __('Force convert all images again', 'webp-converter-for-media'); ?>
78
  </label>
79
  </td>
@@ -82,7 +86,7 @@
82
  <button type="button" target="_blank"
83
  class="webpLoader__button webpButton webpButton--green"
84
  <?= (apply_filters('webpc_server_errors', [])) ? 'disabled' : ''; ?>>
85
- <?= __('Regenerate All', 'webp-converter-for-media'); ?>
86
  </button>
87
  </div>
88
  </div>
4
  ?>
5
  <div class="webpPage__widget">
6
  <h3 class="webpPage__widgetTitle">
7
+ <?= esc_html(__('Regenerate images', 'webp-converter-for-media')); ?>
8
  </h3>
9
  <div class="webpLoader webpContent"
10
+ data-api-paths="<?= esc_url($apiPaths); ?>"
11
+ data-api-regenerate="<?= esc_url($apiRegenerate); ?>"
12
+ data-api-error-message="<?= esc_attr(__('An unknown error occurred while converting the images: %s', 'webp-converter-for-media')); ?>">
13
  <div class="webpPage__widgetRow">
14
  <p>
15
+ <?= 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 may take a few or more than ten minutes depending on the number of files. During this process, please do not close your browser window.', 'webp-converter-for-media')); ?>
16
  </p>
17
  <p>
18
+ <?= 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')); ?>
19
  </p>
20
  <div class="webpLoader__status" hidden>
21
  <div class="webpLoader__bar">
24
  </div>
25
  <div class="webpLoader__size">
26
  <?= sprintf(
27
+ wp_kses_post(__('Saving the weight of your images: %s', 'webp-converter-for-media')),
28
  '<span class="webpLoader__sizeProgress">0 kB</span>'
29
  ); ?>
30
  </div>
31
  </div>
32
  <div class="webpLoader__success" hidden>
33
  <div class="webpLoader__successContent">
34
+ <?= wp_kses_post(__('The process was completed successfully. Your images have been converted!', 'webp-converter-for-media')); ?>
35
  <br>
36
+ <?= wp_kses_post(sprintf(
37
  __('Do you want to know how a plugin works and how to check if it is working properly? Read our %splugin FAQ%s.', 'webp-converter-for-media'),
38
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
39
  '</a>'
40
+ )); ?>
41
  </div>
42
  </div>
43
  <div class="webpLoader__popup webpPopup" hidden>
44
  <div class="webpPopup__inner">
45
  <div class="webpPopup__image"></div>
46
  <div class="webpPopup__content">
47
+ <p><?= wp_kses_post(__('Hi, I\'m Mateusz! I\'m glad you managed to reduce the weight of your website. If you would like to support me in developing this plugin, I will be very grateful to you!', 'webp-converter-for-media')); ?></p>
48
  <p>
49
+ <a href="https://ko-fi.com/gbiorczyk/?utm_source=webp-converter-for-media&utm_medium=notice-regenerate"
50
+ target="_blank"
51
+ class="webpButton webpButton--blue dashicons-coffee">
52
+ <?= wp_kses_post(__('Provide me a coffee', 'webp-converter-for-media')); ?>
53
  </a>
54
  </p>
55
  </div>
56
  </div>
57
  </div>
58
  <div class="webpLoader__errors" hidden>
59
+ <div class="webpLoader__errorsTitle">
60
+ <?= esc_html(__('Additional informations about process:', 'webp-converter-for-media')); ?>
61
+ </div>
62
  <div class="webpLoader__errorsContent">
63
  <div class="webpLoader__errorsContentList"></div>
64
  <div class="webpLoader__errorsContentMessage" hidden>
65
+ <?= wp_kses_post(__('An error occurred while connecting to REST API. Please try again.', 'webp-converter-for-media')); ?>
66
  </div>
67
  </div>
68
  </div>
69
  </div>
70
  </div>
71
  <div class="webpPage__widgetRow">
72
+ <table class="webpTable">
73
  <tr>
74
  <td>
75
  <input type="checkbox" name="regenerate_force" value="1"
76
+ id="webpc-regenerate-force" class="webpCheckbox__input">
77
  <label for="webpc-regenerate-force"></label>
78
  </td>
79
  <td>
80
+ <label for="webpc-regenerate-force" class="webpCheckbox__label">
81
  <?= __('Force convert all images again', 'webp-converter-for-media'); ?>
82
  </label>
83
  </td>
86
  <button type="button" target="_blank"
87
  class="webpLoader__button webpButton webpButton--green"
88
  <?= (apply_filters('webpc_server_errors', [])) ? 'disabled' : ''; ?>>
89
+ <?= esc_html(__('Regenerate All', 'webp-converter-for-media')); ?>
90
  </button>
91
  </div>
92
  </div>
resources/components/widgets/server.php CHANGED
@@ -4,26 +4,26 @@
4
  ?>
5
  <div class="webpPage__widget">
6
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
7
- <?= __('Your server configuration', 'webp-converter-for-media'); ?>
8
  </h3>
9
  <div class="webpContent">
10
  <div class="webpPage__widgetRow">
11
  <p>
12
- <?= sprintf(__('Please compare your configuration with the configuration that is given in the technical requirements in %sthe plugin FAQ%s. If your server does not meet the technical requirements, please contact your server Administrator.', 'webp-converter-for-media'),
13
- '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
14
- '</a>'
15
- ); ?>
16
  </p>
17
- <a href="<?= $pageUrl; ?>" class="webpLoader__button webpButton webpButton--blue">
18
- <?= __('Back to settings', 'webp-converter-for-media'); ?>
19
  </a>
20
  </div>
21
  <div class="webpPage__widgetRow">
22
- <div class="webpServerInfo"><?= $info; ?></div>
23
  </div>
24
  <div class="webpPage__widgetRow">
25
- <a href="<?= $pageUrl; ?>" class="webpLoader__button webpButton webpButton--blue">
26
- <?= __('Back to settings', 'webp-converter-for-media'); ?>
27
  </a>
28
  </div>
29
  </div>
4
  ?>
5
  <div class="webpPage__widget">
6
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
7
+ <?= esc_html(__('Your server configuration', 'webp-converter-for-media')); ?>
8
  </h3>
9
  <div class="webpContent">
10
  <div class="webpPage__widgetRow">
11
  <p>
12
+ <?= wp_kses_post(sprintf(__('Please compare your configuration with the configuration that is given in the technical requirements in %sthe plugin FAQ%s. If your server does not meet the technical requirements, please contact your server Administrator.', 'webp-converter-for-media'),
13
+ '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
14
+ '</a>'
15
+ )); ?>
16
  </p>
17
+ <a href="<?= esc_url($pageUrl); ?>" class="webpLoader__button webpButton webpButton--blue">
18
+ <?= esc_html(__('Back to settings', 'webp-converter-for-media')); ?>
19
  </a>
20
  </div>
21
  <div class="webpPage__widgetRow">
22
+ <div class="webpServerInfo"><?= wp_kses_post($info); ?></div>
23
  </div>
24
  <div class="webpPage__widgetRow">
25
+ <a href="<?= esc_url($pageUrl); ?>" class="webpLoader__button webpButton webpButton--blue">
26
+ <?= esc_html(__('Back to settings', 'webp-converter-for-media')); ?>
27
  </a>
28
  </div>
29
  </div>
resources/components/widgets/support.php CHANGED
@@ -1,35 +1,35 @@
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
3
- <?= __('We are waiting for your message', 'webp-converter-for-media'); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
- <?= __('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'); ?>
8
  </p>
9
  <p>
10
- <?= sprintf(
11
  __('Please %scheck our FAQ%s before adding a thread with technical problem. If you do not find help there, %scheck support forum%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'),
12
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
13
  '</a>',
14
  '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
15
  '</a>'
16
- ); ?>
17
  </p>
18
  <p class="center">
19
- <a href="<?= sprintf('%s&action=server', menu_page_url('webpc_admin_page', false)); ?>" class="webpButton webpButton--blue dashicons-admin-tools">
20
- <?= __('Server configuration', 'webp-converter-for-media'); ?>
21
  </a>
22
  <br>
23
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank" class="webpButton webpButton--blue">
24
- <?= __('Get help', 'webp-converter-for-media'); ?>
25
  </a>
26
  </p>
27
  <p>
28
- <?= __('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'); ?>
29
  </p>
30
  <p class="center">
31
- <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/#new-post" target="_blank" class="webpButton webpButton--blue">
32
- <?= __('Add review', 'webp-converter-for-media'); ?>
33
  </a>
34
  </p>
35
  </div>
1
  <div class="webpPage__widget">
2
  <h3 class="webpPage__widgetTitle webpPage__widgetTitle--second">
3
+ <?= esc_html(__('We are waiting for your message', 'webp-converter-for-media')); ?>
4
  </h3>
5
  <div class="webpContent">
6
  <p>
7
+ <?= wp_kses_post(__('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')); ?>
8
  </p>
9
  <p>
10
+ <?= wp_kses_post(sprintf(
11
  __('Please %scheck our FAQ%s before adding a thread with technical problem. If you do not find help there, %scheck support forum%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'),
12
  '<a href="https://wordpress.org/plugins/webp-converter-for-media/#faq" target="_blank">',
13
  '</a>',
14
  '<a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank">',
15
  '</a>'
16
+ )); ?>
17
  </p>
18
  <p class="center">
19
+ <a href="<?= esc_url(sprintf('%s&action=server', menu_page_url('webpc_admin_page', false))); ?>" class="webpButton webpButton--blue dashicons-admin-tools">
20
+ <?= esc_html(__('Server configuration', 'webp-converter-for-media')); ?>
21
  </a>
22
  <br>
23
  <a href="https://wordpress.org/support/plugin/webp-converter-for-media/" target="_blank" class="webpButton webpButton--blue">
24
+ <?= esc_html(__('Get help', 'webp-converter-for-media')); ?>
25
  </a>
26
  </p>
27
  <p>
28
+ <?= wp_kses_post(__('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')); ?>
29
  </p>
30
  <p class="center">
31
+ <a href="https://wordpress.org/support/plugin/webp-converter-for-media/reviews/?rate=5#new-post" target="_blank" class="webpButton webpButton--blue">
32
+ <?= esc_html(__('Add review', 'webp-converter-for-media')); ?>
33
  </a>
34
  </p>
35
  </div>
resources/views/deactivation-modal.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WebpConverter\Settings\Errors;
4
+
5
+ $errors = implode(', ', get_option(Errors::ERRORS_CACHE_OPTION, []));
6
+ $items = [
7
+ [
8
+ 'key' => 'server_config',
9
+ 'label' => __('I have "Server configuration error" in plugin settings', 'webp-converter-for-media'),
10
+ 'placeholder' => esc_attr(__('What is your error? Have you been looking for solution to this issue?', 'webp-converter-for-media')),
11
+ ],
12
+ [
13
+ 'key' => 'website_broken',
14
+ 'label' => __('This plugin broke my website', 'webp-converter-for-media'),
15
+ 'placeholder' => esc_attr(__('What exactly happened?', 'webp-converter-for-media')),
16
+ ],
17
+ [
18
+ 'key' => 'better_plugin',
19
+ 'label' => __('I found a better plugin', 'webp-converter-for-media'),
20
+ 'placeholder' => esc_attr(__('What is name of this plugin? Why is it better?', 'webp-converter-for-media')),
21
+ ],
22
+ [
23
+ 'key' => 'misunderstanding',
24
+ 'label' => __('I do not understand how the plugin works', 'webp-converter-for-media'),
25
+ 'placeholder' => esc_attr(__('What is non-understandable to you? Did you search for this in plugin FAQ?', 'webp-converter-for-media')),
26
+ ],
27
+ [
28
+ 'key' => 'temporary_deactivation',
29
+ 'label' => __('This is a temporary deactivation', 'webp-converter-for-media'),
30
+ 'placeholder' => '',
31
+ ],
32
+ [
33
+ 'key' => 'other',
34
+ 'label' => __('Other reason', 'webp-converter-for-media'),
35
+ 'placeholder' => esc_attr(__('What is reason? What can we improve for you?', 'webp-converter-for-media')),
36
+ ],
37
+ ];
38
+
39
+ ?>
40
+ <div class="webpModal" hidden>
41
+ <div class="webpModal__outer">
42
+ <form action="https://feedback.gbiorczyk.pl/" method="POST" class="webpModal__form">
43
+ <h2 class="webpModal__headline">
44
+ <?= esc_html(__('We are sorry that you are leaving our plugin WebP Converter for Media', 'webp-converter-for-media')); ?>
45
+ </h2>
46
+ <div class="webpModal__desc">
47
+ <?= esc_html(__('Can you please take a moment to tell us why you are deactivating this plugin (your answer is completely anonymous)?', 'webp-converter-for-media')); ?>
48
+ </div>
49
+ <table class="webpModal__table webpTable">
50
+ <?php foreach ($items as $index => $item) : ?>
51
+ <tr>
52
+ <td>
53
+ <input type="radio" name="webpc_reason" value="<?= esc_attr($item['key']); ?>"
54
+ id="webpc-option<?= $index; ?>" class="webpCheckbox__input"
55
+ data-placeholder="<?= esc_attr($item['placeholder']); ?>">
56
+ <label for="webpc-option<?= $index; ?>"></label>
57
+ </td>
58
+ <td>
59
+ <label for="webpc-option<?= $index; ?>"
60
+ class="webpCheckbox__label"><?= esc_html($item['label']); ?></label>
61
+ </td>
62
+ </tr>
63
+ <?php endforeach; ?>
64
+ </table>
65
+ <textarea class="webpModal__textarea" name="webpc_comment" rows="2"></textarea>
66
+ <ul class="webpModal__buttons">
67
+ <li class="webpModal__button">
68
+ <button type="submit" class="webpModal__buttonInner webpButton webpButton--green">
69
+ <?= esc_html(__('Submit and Deactivate', 'webp-converter-for-media')); ?>
70
+ </button>
71
+ </li>
72
+ <li class="webpModal__button">
73
+ <button type="button" class="webpModal__buttonInner webpButton webpButton--blue">
74
+ <?= esc_html(__('Skip and Deactivate', 'webp-converter-for-media')); ?>
75
+ </button>
76
+ </li>
77
+ </ul>
78
+ <input type="hidden" name="webpc_error_codes" value="<?= esc_attr($errors); ?>">
79
+ </form>
80
+ </div>
81
+ </div>
resources/views/settings.php CHANGED
@@ -4,13 +4,15 @@
4
  $values = apply_filters('webpc_get_values', []);
5
  ?>
6
  <div class="wrap">
7
- <h1><?= __('WebP Converter for Media', 'webp-converter-for-media'); ?></h1>
8
- <form method="post" action="<?= $path; ?>" class="webpPage">
9
  <div class="webpPage__inner">
10
  <ul class="webpPage__columns">
11
  <li class="webpPage__column webpPage__column--large">
12
  <?php if ($_POST) : ?>
13
- <div class="webpPage__alert"><?= __('Changes were successfully saved!', 'webp-converter-for-media'); ?></div>
 
 
14
  <?php endif; ?>
15
  <?php
16
  if (isset($_GET['action']) && ($_GET['action'] === 'server')) {
4
  $values = apply_filters('webpc_get_values', []);
5
  ?>
6
  <div class="wrap">
7
+ <h1><?= esc_html(__('WebP Converter for Media', 'webp-converter-for-media')); ?></h1>
8
+ <form method="post" action="<?= esc_url($path); ?>" class="webpPage">
9
  <div class="webpPage__inner">
10
  <ul class="webpPage__columns">
11
  <li class="webpPage__column webpPage__column--large">
12
  <?php if ($_POST) : ?>
13
+ <div class="webpPage__alert">
14
+ <?= esc_html(__('Changes were successfully saved!', 'webp-converter-for-media')); ?>
15
+ </div>
16
  <?php endif; ?>
17
  <?php
18
  if (isset($_GET['action']) && ($_GET['action'] === 'server')) {
vendor/autoload.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInitc7630a1e95e3685c63366f7308da5ca6::getLoader();
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit88991bcbd0ccbed597697ff83d9e0d23::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -1,445 +1,445 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
- *
18
- * $loader = new \Composer\Autoload\ClassLoader();
19
- *
20
- * // register classes with namespaces
21
- * $loader->add('Symfony\Component', __DIR__.'/component');
22
- * $loader->add('Symfony', __DIR__.'/framework');
23
- *
24
- * // activate the autoloader
25
- * $loader->register();
26
- *
27
- * // to enable searching the include path (eg. for PEAR packages)
28
- * $loader->setUseIncludePath(true);
29
- *
30
- * In this example, if you try to use a class in the Symfony\Component
31
- * namespace or one of its children (Symfony\Component\Console for instance),
32
- * the autoloader will first look for the class under the component/
33
- * directory, and it will then fallback to the framework/ directory if not
34
- * found before giving up.
35
- *
36
- * This class is loosely based on the Symfony UniversalClassLoader.
37
- *
38
- * @author Fabien Potencier <fabien@symfony.com>
39
- * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
- */
43
- class ClassLoader
44
- {
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
- private $classMapAuthoritative = false;
57
- private $missingClasses = array();
58
- private $apcuPrefix;
59
-
60
- public function getPrefixes()
61
- {
62
- if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
- }
65
-
66
- return array();
67
- }
68
-
69
- public function getPrefixesPsr4()
70
- {
71
- return $this->prefixDirsPsr4;
72
- }
73
-
74
- public function getFallbackDirs()
75
- {
76
- return $this->fallbackDirsPsr0;
77
- }
78
-
79
- public function getFallbackDirsPsr4()
80
- {
81
- return $this->fallbackDirsPsr4;
82
- }
83
-
84
- public function getClassMap()
85
- {
86
- return $this->classMap;
87
- }
88
-
89
- /**
90
- * @param array $classMap Class to filename map
91
- */
92
- public function addClassMap(array $classMap)
93
- {
94
- if ($this->classMap) {
95
- $this->classMap = array_merge($this->classMap, $classMap);
96
- } else {
97
- $this->classMap = $classMap;
98
- }
99
- }
100
-
101
- /**
102
- * Registers a set of PSR-0 directories for a given prefix, either
103
- * appending or prepending to the ones previously set for this prefix.
104
- *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
108
- */
109
- public function add($prefix, $paths, $prepend = false)
110
- {
111
- if (!$prefix) {
112
- if ($prepend) {
113
- $this->fallbackDirsPsr0 = array_merge(
114
- (array) $paths,
115
- $this->fallbackDirsPsr0
116
- );
117
- } else {
118
- $this->fallbackDirsPsr0 = array_merge(
119
- $this->fallbackDirsPsr0,
120
- (array) $paths
121
- );
122
- }
123
-
124
- return;
125
- }
126
-
127
- $first = $prefix[0];
128
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
-
131
- return;
132
- }
133
- if ($prepend) {
134
- $this->prefixesPsr0[$first][$prefix] = array_merge(
135
- (array) $paths,
136
- $this->prefixesPsr0[$first][$prefix]
137
- );
138
- } else {
139
- $this->prefixesPsr0[$first][$prefix] = array_merge(
140
- $this->prefixesPsr0[$first][$prefix],
141
- (array) $paths
142
- );
143
- }
144
- }
145
-
146
- /**
147
- * Registers a set of PSR-4 directories for a given namespace, either
148
- * appending or prepending to the ones previously set for this namespace.
149
- *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
- *
154
- * @throws \InvalidArgumentException
155
- */
156
- public function addPsr4($prefix, $paths, $prepend = false)
157
- {
158
- if (!$prefix) {
159
- // Register directories for the root namespace.
160
- if ($prepend) {
161
- $this->fallbackDirsPsr4 = array_merge(
162
- (array) $paths,
163
- $this->fallbackDirsPsr4
164
- );
165
- } else {
166
- $this->fallbackDirsPsr4 = array_merge(
167
- $this->fallbackDirsPsr4,
168
- (array) $paths
169
- );
170
- }
171
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
- // Register directories for a new namespace.
173
- $length = strlen($prefix);
174
- if ('\\' !== $prefix[$length - 1]) {
175
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
- }
177
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
- } elseif ($prepend) {
180
- // Prepend directories for an already registered namespace.
181
- $this->prefixDirsPsr4[$prefix] = array_merge(
182
- (array) $paths,
183
- $this->prefixDirsPsr4[$prefix]
184
- );
185
- } else {
186
- // Append directories for an already registered namespace.
187
- $this->prefixDirsPsr4[$prefix] = array_merge(
188
- $this->prefixDirsPsr4[$prefix],
189
- (array) $paths
190
- );
191
- }
192
- }
193
-
194
- /**
195
- * Registers a set of PSR-0 directories for a given prefix,
196
- * replacing any others previously set for this prefix.
197
- *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
200
- */
201
- public function set($prefix, $paths)
202
- {
203
- if (!$prefix) {
204
- $this->fallbackDirsPsr0 = (array) $paths;
205
- } else {
206
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
- }
208
- }
209
-
210
- /**
211
- * Registers a set of PSR-4 directories for a given namespace,
212
- * replacing any others previously set for this namespace.
213
- *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
- *
217
- * @throws \InvalidArgumentException
218
- */
219
- public function setPsr4($prefix, $paths)
220
- {
221
- if (!$prefix) {
222
- $this->fallbackDirsPsr4 = (array) $paths;
223
- } else {
224
- $length = strlen($prefix);
225
- if ('\\' !== $prefix[$length - 1]) {
226
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
- }
228
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
- }
231
- }
232
-
233
- /**
234
- * Turns on searching the include path for class files.
235
- *
236
- * @param bool $useIncludePath
237
- */
238
- public function setUseIncludePath($useIncludePath)
239
- {
240
- $this->useIncludePath = $useIncludePath;
241
- }
242
-
243
- /**
244
- * Can be used to check if the autoloader uses the include path to check
245
- * for classes.
246
- *
247
- * @return bool
248
- */
249
- public function getUseIncludePath()
250
- {
251
- return $this->useIncludePath;
252
- }
253
-
254
- /**
255
- * Turns off searching the prefix and fallback directories for classes
256
- * that have not been registered with the class map.
257
- *
258
- * @param bool $classMapAuthoritative
259
- */
260
- public function setClassMapAuthoritative($classMapAuthoritative)
261
- {
262
- $this->classMapAuthoritative = $classMapAuthoritative;
263
- }
264
-
265
- /**
266
- * Should class lookup fail if not found in the current class map?
267
- *
268
- * @return bool
269
- */
270
- public function isClassMapAuthoritative()
271
- {
272
- return $this->classMapAuthoritative;
273
- }
274
-
275
- /**
276
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
- *
278
- * @param string|null $apcuPrefix
279
- */
280
- public function setApcuPrefix($apcuPrefix)
281
- {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
- }
284
-
285
- /**
286
- * The APCu prefix in use, or null if APCu caching is not enabled.
287
- *
288
- * @return string|null
289
- */
290
- public function getApcuPrefix()
291
- {
292
- return $this->apcuPrefix;
293
- }
294
-
295
- /**
296
- * Registers this instance as an autoloader.
297
- *
298
- * @param bool $prepend Whether to prepend the autoloader or not
299
- */
300
- public function register($prepend = false)
301
- {
302
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
- }
304
-
305
- /**
306
- * Unregisters this instance as an autoloader.
307
- */
308
- public function unregister()
309
- {
310
- spl_autoload_unregister(array($this, 'loadClass'));
311
- }
312
-
313
- /**
314
- * Loads the given class or interface.
315
- *
316
- * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
- */
319
- public function loadClass($class)
320
- {
321
- if ($file = $this->findFile($class)) {
322
- includeFile($file);
323
-
324
- return true;
325
- }
326
- }
327
-
328
- /**
329
- * Finds the path to the file where the class is defined.
330
- *
331
- * @param string $class The name of the class
332
- *
333
- * @return string|false The path if found, false otherwise
334
- */
335
- public function findFile($class)
336
- {
337
- // class map lookup
338
- if (isset($this->classMap[$class])) {
339
- return $this->classMap[$class];
340
- }
341
- if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
- return false;
343
- }
344
- if (null !== $this->apcuPrefix) {
345
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
- if ($hit) {
347
- return $file;
348
- }
349
- }
350
-
351
- $file = $this->findFileWithExtension($class, '.php');
352
-
353
- // Search for Hack files if we are running on HHVM
354
- if (false === $file && defined('HHVM_VERSION')) {
355
- $file = $this->findFileWithExtension($class, '.hh');
356
- }
357
-
358
- if (null !== $this->apcuPrefix) {
359
- apcu_add($this->apcuPrefix.$class, $file);
360
- }
361
-
362
- if (false === $file) {
363
- // Remember that this class does not exist.
364
- $this->missingClasses[$class] = true;
365
- }
366
-
367
- return $file;
368
- }
369
-
370
- private function findFileWithExtension($class, $ext)
371
- {
372
- // PSR-4 lookup
373
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
-
375
- $first = $class[0];
376
- if (isset($this->prefixLengthsPsr4[$first])) {
377
- $subPath = $class;
378
- while (false !== $lastPos = strrpos($subPath, '\\')) {
379
- $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath . '\\';
381
- if (isset($this->prefixDirsPsr4[$search])) {
382
- $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
- foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
- if (file_exists($file = $dir . $pathEnd)) {
385
- return $file;
386
- }
387
- }
388
- }
389
- }
390
- }
391
-
392
- // PSR-4 fallback dirs
393
- foreach ($this->fallbackDirsPsr4 as $dir) {
394
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
- return $file;
396
- }
397
- }
398
-
399
- // PSR-0 lookup
400
- if (false !== $pos = strrpos($class, '\\')) {
401
- // namespaced class name
402
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
- } else {
405
- // PEAR-like class name
406
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
- }
408
-
409
- if (isset($this->prefixesPsr0[$first])) {
410
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
- if (0 === strpos($class, $prefix)) {
412
- foreach ($dirs as $dir) {
413
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
- return $file;
415
- }
416
- }
417
- }
418
- }
419
- }
420
-
421
- // PSR-0 fallback dirs
422
- foreach ($this->fallbackDirsPsr0 as $dir) {
423
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
- return $file;
425
- }
426
- }
427
-
428
- // PSR-0 include paths.
429
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
- return $file;
431
- }
432
-
433
- return false;
434
- }
435
- }
436
-
437
- /**
438
- * Scope isolated include.
439
- *
440
- * Prevents access to $this/self from included files.
441
- */
442
- function includeFile($file)
443
- {
444
- include $file;
445
- }
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+ private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
+
60
+ public function getPrefixes()
61
+ {
62
+ if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ public function getPrefixesPsr4()
70
+ {
71
+ return $this->prefixDirsPsr4;
72
+ }
73
+
74
+ public function getFallbackDirs()
75
+ {
76
+ return $this->fallbackDirsPsr0;
77
+ }
78
+
79
+ public function getFallbackDirsPsr4()
80
+ {
81
+ return $this->fallbackDirsPsr4;
82
+ }
83
+
84
+ public function getClassMap()
85
+ {
86
+ return $this->classMap;
87
+ }
88
+
89
+ /**
90
+ * @param array $classMap Class to filename map
91
+ */
92
+ public function addClassMap(array $classMap)
93
+ {
94
+ if ($this->classMap) {
95
+ $this->classMap = array_merge($this->classMap, $classMap);
96
+ } else {
97
+ $this->classMap = $classMap;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Registers a set of PSR-0 directories for a given prefix, either
103
+ * appending or prepending to the ones previously set for this prefix.
104
+ *
105
+ * @param string $prefix The prefix
106
+ * @param array|string $paths The PSR-0 root directories
107
+ * @param bool $prepend Whether to prepend the directories
108
+ */
109
+ public function add($prefix, $paths, $prepend = false)
110
+ {
111
+ if (!$prefix) {
112
+ if ($prepend) {
113
+ $this->fallbackDirsPsr0 = array_merge(
114
+ (array) $paths,
115
+ $this->fallbackDirsPsr0
116
+ );
117
+ } else {
118
+ $this->fallbackDirsPsr0 = array_merge(
119
+ $this->fallbackDirsPsr0,
120
+ (array) $paths
121
+ );
122
+ }
123
+
124
+ return;
125
+ }
126
+
127
+ $first = $prefix[0];
128
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
+
131
+ return;
132
+ }
133
+ if ($prepend) {
134
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
135
+ (array) $paths,
136
+ $this->prefixesPsr0[$first][$prefix]
137
+ );
138
+ } else {
139
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
140
+ $this->prefixesPsr0[$first][$prefix],
141
+ (array) $paths
142
+ );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Registers a set of PSR-4 directories for a given namespace, either
148
+ * appending or prepending to the ones previously set for this namespace.
149
+ *
150
+ * @param string $prefix The prefix/namespace, with trailing '\\'
151
+ * @param array|string $paths The PSR-4 base directories
152
+ * @param bool $prepend Whether to prepend the directories
153
+ *
154
+ * @throws \InvalidArgumentException
155
+ */
156
+ public function addPsr4($prefix, $paths, $prepend = false)
157
+ {
158
+ if (!$prefix) {
159
+ // Register directories for the root namespace.
160
+ if ($prepend) {
161
+ $this->fallbackDirsPsr4 = array_merge(
162
+ (array) $paths,
163
+ $this->fallbackDirsPsr4
164
+ );
165
+ } else {
166
+ $this->fallbackDirsPsr4 = array_merge(
167
+ $this->fallbackDirsPsr4,
168
+ (array) $paths
169
+ );
170
+ }
171
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
+ // Register directories for a new namespace.
173
+ $length = strlen($prefix);
174
+ if ('\\' !== $prefix[$length - 1]) {
175
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
+ }
177
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
+ } elseif ($prepend) {
180
+ // Prepend directories for an already registered namespace.
181
+ $this->prefixDirsPsr4[$prefix] = array_merge(
182
+ (array) $paths,
183
+ $this->prefixDirsPsr4[$prefix]
184
+ );
185
+ } else {
186
+ // Append directories for an already registered namespace.
187
+ $this->prefixDirsPsr4[$prefix] = array_merge(
188
+ $this->prefixDirsPsr4[$prefix],
189
+ (array) $paths
190
+ );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Registers a set of PSR-0 directories for a given prefix,
196
+ * replacing any others previously set for this prefix.
197
+ *
198
+ * @param string $prefix The prefix
199
+ * @param array|string $paths The PSR-0 base directories
200
+ */
201
+ public function set($prefix, $paths)
202
+ {
203
+ if (!$prefix) {
204
+ $this->fallbackDirsPsr0 = (array) $paths;
205
+ } else {
206
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Registers a set of PSR-4 directories for a given namespace,
212
+ * replacing any others previously set for this namespace.
213
+ *
214
+ * @param string $prefix The prefix/namespace, with trailing '\\'
215
+ * @param array|string $paths The PSR-4 base directories
216
+ *
217
+ * @throws \InvalidArgumentException
218
+ */
219
+ public function setPsr4($prefix, $paths)
220
+ {
221
+ if (!$prefix) {
222
+ $this->fallbackDirsPsr4 = (array) $paths;
223
+ } else {
224
+ $length = strlen($prefix);
225
+ if ('\\' !== $prefix[$length - 1]) {
226
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
+ }
228
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Turns on searching the include path for class files.
235
+ *
236
+ * @param bool $useIncludePath
237
+ */
238
+ public function setUseIncludePath($useIncludePath)
239
+ {
240
+ $this->useIncludePath = $useIncludePath;
241
+ }
242
+
243
+ /**
244
+ * Can be used to check if the autoloader uses the include path to check
245
+ * for classes.
246
+ *
247
+ * @return bool
248
+ */
249
+ public function getUseIncludePath()
250
+ {
251
+ return $this->useIncludePath;
252
+ }
253
+
254
+ /**
255
+ * Turns off searching the prefix and fallback directories for classes
256
+ * that have not been registered with the class map.
257
+ *
258
+ * @param bool $classMapAuthoritative
259
+ */
260
+ public function setClassMapAuthoritative($classMapAuthoritative)
261
+ {
262
+ $this->classMapAuthoritative = $classMapAuthoritative;
263
+ }
264
+
265
+ /**
266
+ * Should class lookup fail if not found in the current class map?
267
+ *
268
+ * @return bool
269
+ */
270
+ public function isClassMapAuthoritative()
271
+ {
272
+ return $this->classMapAuthoritative;
273
+ }
274
+
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
+ /**
296
+ * Registers this instance as an autoloader.
297
+ *
298
+ * @param bool $prepend Whether to prepend the autoloader or not
299
+ */
300
+ public function register($prepend = false)
301
+ {
302
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
+ }
304
+
305
+ /**
306
+ * Unregisters this instance as an autoloader.
307
+ */
308
+ public function unregister()
309
+ {
310
+ spl_autoload_unregister(array($this, 'loadClass'));
311
+ }
312
+
313
+ /**
314
+ * Loads the given class or interface.
315
+ *
316
+ * @param string $class The name of the class
317
+ * @return bool|null True if loaded, null otherwise
318
+ */
319
+ public function loadClass($class)
320
+ {
321
+ if ($file = $this->findFile($class)) {
322
+ includeFile($file);
323
+
324
+ return true;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Finds the path to the file where the class is defined.
330
+ *
331
+ * @param string $class The name of the class
332
+ *
333
+ * @return string|false The path if found, false otherwise
334
+ */
335
+ public function findFile($class)
336
+ {
337
+ // class map lookup
338
+ if (isset($this->classMap[$class])) {
339
+ return $this->classMap[$class];
340
+ }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
+ return false;
343
+ }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
+
351
+ $file = $this->findFileWithExtension($class, '.php');
352
+
353
+ // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
+ $file = $this->findFileWithExtension($class, '.hh');
356
+ }
357
+
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
+ // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
+ }
366
+
367
+ return $file;
368
+ }
369
+
370
+ private function findFileWithExtension($class, $ext)
371
+ {
372
+ // PSR-4 lookup
373
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
+
375
+ $first = $class[0];
376
+ if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath . '\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
+ if (file_exists($file = $dir . $pathEnd)) {
385
+ return $file;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ // PSR-4 fallback dirs
393
+ foreach ($this->fallbackDirsPsr4 as $dir) {
394
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
+ return $file;
396
+ }
397
+ }
398
+
399
+ // PSR-0 lookup
400
+ if (false !== $pos = strrpos($class, '\\')) {
401
+ // namespaced class name
402
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
+ } else {
405
+ // PEAR-like class name
406
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
+ }
408
+
409
+ if (isset($this->prefixesPsr0[$first])) {
410
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
+ if (0 === strpos($class, $prefix)) {
412
+ foreach ($dirs as $dir) {
413
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
+ return $file;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ // PSR-0 fallback dirs
422
+ foreach ($this->fallbackDirsPsr0 as $dir) {
423
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
+ return $file;
425
+ }
426
+ }
427
+
428
+ // PSR-0 include paths.
429
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
+ return $file;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Scope isolated include.
439
+ *
440
+ * Prevents access to $this/self from included files.
441
+ */
442
+ function includeFile($file)
443
+ {
444
+ include $file;
445
+ }
vendor/composer/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
-
2
- Copyright (c) Nils Adermann, Jordi Boggiano
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
-
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_namespaces.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_psr4.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'WebpConverter\\' => array($baseDir . '/app'),
10
- );
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'WebpConverter\\' => array($baseDir . '/app'),
10
+ );
vendor/composer/autoload_real.php CHANGED
@@ -1,52 +1,55 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInitc7630a1e95e3685c63366f7308da5ca6
6
- {
7
- private static $loader;
8
-
9
- public static function loadClassLoader($class)
10
- {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
- require __DIR__ . '/ClassLoader.php';
13
- }
14
- }
15
-
16
- public static function getLoader()
17
- {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInitc7630a1e95e3685c63366f7308da5ca6', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc7630a1e95e3685c63366f7308da5ca6', 'loadClassLoader'));
25
-
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
- if ($useStaticLoader) {
28
- require_once __DIR__ . '/autoload_static.php';
29
-
30
- call_user_func(\Composer\Autoload\ComposerStaticInitc7630a1e95e3685c63366f7308da5ca6::getInitializer($loader));
31
- } else {
32
- $map = require __DIR__ . '/autoload_namespaces.php';
33
- foreach ($map as $namespace => $path) {
34
- $loader->set($namespace, $path);
35
- }
36
-
37
- $map = require __DIR__ . '/autoload_psr4.php';
38
- foreach ($map as $namespace => $path) {
39
- $loader->setPsr4($namespace, $path);
40
- }
41
-
42
- $classMap = require __DIR__ . '/autoload_classmap.php';
43
- if ($classMap) {
44
- $loader->addClassMap($classMap);
45
- }
46
- }
47
-
48
- $loader->register(true);
49
-
50
- return $loader;
51
- }
52
- }
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit88991bcbd0ccbed597697ff83d9e0d23
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
+ public static function getLoader()
20
+ {
21
+ if (null !== self::$loader) {
22
+ return self::$loader;
23
+ }
24
+
25
+ spl_autoload_register(array('ComposerAutoloaderInit88991bcbd0ccbed597697ff83d9e0d23', 'loadClassLoader'), true, true);
26
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit88991bcbd0ccbed597697ff83d9e0d23', 'loadClassLoader'));
28
+
29
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
+ if ($useStaticLoader) {
31
+ require_once __DIR__ . '/autoload_static.php';
32
+
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit88991bcbd0ccbed597697ff83d9e0d23::getInitializer($loader));
34
+ } else {
35
+ $map = require __DIR__ . '/autoload_namespaces.php';
36
+ foreach ($map as $namespace => $path) {
37
+ $loader->set($namespace, $path);
38
+ }
39
+
40
+ $map = require __DIR__ . '/autoload_psr4.php';
41
+ foreach ($map as $namespace => $path) {
42
+ $loader->setPsr4($namespace, $path);
43
+ }
44
+
45
+ $classMap = require __DIR__ . '/autoload_classmap.php';
46
+ if ($classMap) {
47
+ $loader->addClassMap($classMap);
48
+ }
49
+ }
50
+
51
+ $loader->register(true);
52
+
53
+ return $loader;
54
+ }
55
+ }
vendor/composer/autoload_static.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- // autoload_static.php @generated by Composer
4
-
5
- namespace Composer\Autoload;
6
-
7
- class ComposerStaticInitc7630a1e95e3685c63366f7308da5ca6
8
- {
9
- public static $prefixLengthsPsr4 = array (
10
- 'W' =>
11
- array (
12
- 'WebpConverter\\' => 14,
13
- ),
14
- );
15
-
16
- public static $prefixDirsPsr4 = array (
17
- 'WebpConverter\\' =>
18
- array (
19
- 0 => __DIR__ . '/../..' . '/app',
20
- ),
21
- );
22
-
23
- public static function getInitializer(ClassLoader $loader)
24
- {
25
- return \Closure::bind(function () use ($loader) {
26
- $loader->prefixLengthsPsr4 = ComposerStaticInitc7630a1e95e3685c63366f7308da5ca6::$prefixLengthsPsr4;
27
- $loader->prefixDirsPsr4 = ComposerStaticInitc7630a1e95e3685c63366f7308da5ca6::$prefixDirsPsr4;
28
-
29
- }, null, ClassLoader::class);
30
- }
31
- }
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInit88991bcbd0ccbed597697ff83d9e0d23
8
+ {
9
+ public static $prefixLengthsPsr4 = array (
10
+ 'W' =>
11
+ array (
12
+ 'WebpConverter\\' => 14,
13
+ ),
14
+ );
15
+
16
+ public static $prefixDirsPsr4 = array (
17
+ 'WebpConverter\\' =>
18
+ array (
19
+ 0 => __DIR__ . '/../..' . '/app',
20
+ ),
21
+ );
22
+
23
+ public static function getInitializer(ClassLoader $loader)
24
+ {
25
+ return \Closure::bind(function () use ($loader) {
26
+ $loader->prefixLengthsPsr4 = ComposerStaticInit88991bcbd0ccbed597697ff83d9e0d23::$prefixLengthsPsr4;
27
+ $loader->prefixDirsPsr4 = ComposerStaticInit88991bcbd0ccbed597697ff83d9e0d23::$prefixDirsPsr4;
28
+
29
+ }, null, ClassLoader::class);
30
+ }
31
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1 @@
 
1
+ []
webp-converter-for-media.php CHANGED
@@ -3,13 +3,13 @@
3
  /*
4
  Plugin Name: WebP Converter for Media
5
  Description: Speed up your website by serving WebP images instead of standard formats JPEG, PNG and GIF.
6
- Version: 1.5.1
7
  Author: Mateusz Gbiorczyk
8
  Author URI: https://gbiorczyk.pl/
9
  Text Domain: webp-converter-for-media
10
  */
11
 
12
- define('WEBPC_VERSION', '1.5.1');
13
  define('WEBPC_FILE', __FILE__);
14
  define('WEBPC_NAME', plugin_basename(__FILE__));
15
  define('WEBPC_PATH', plugin_dir_path(__FILE__));
3
  /*
4
  Plugin Name: WebP Converter for Media
5
  Description: Speed up your website by serving WebP images instead of standard formats JPEG, PNG and GIF.
6
+ Version: 1.6.0
7
  Author: Mateusz Gbiorczyk
8
  Author URI: https://gbiorczyk.pl/
9
  Text Domain: webp-converter-for-media
10
  */
11
 
12
+ define('WEBPC_VERSION', '1.6.0');
13
  define('WEBPC_FILE', __FILE__);
14
  define('WEBPC_NAME', plugin_basename(__FILE__));
15
  define('WEBPC_PATH', plugin_dir_path(__FILE__));