WebP Express - Version 0.13.2

Version Description

(released: 16 may 2019)

  • Fixed Fatal error on image upload in combination with the Enable Media Replace plugin. Thanks to Alexander Graef from Germany for reporting.
  • It seems we finally nailed the blank settings page bug. Thanks to all involved, especially Richard Spenceley from the UK
Download this release

Release Info

Developer rosell.dk
Plugin Icon 128x128 WebP Express
Version 0.13.2
Comparing to
See all releases

Code changes from version 0.13.1 to 0.13.2

Files changed (102) hide show
  1. .gitignore +0 -4
  2. README.md +4 -0
  3. README.txt +25 -4
  4. composer.lock +286 -0
  5. lib/classes/HandleUploadHooks.php +1 -1
  6. lib/classes/TestRun.php +2 -1
  7. lib/options/options/alter-html/alter-html-options.inc +1 -1
  8. vendor/autoload.php +7 -0
  9. vendor/composer/ClassLoader.php +445 -0
  10. vendor/composer/LICENSE +21 -0
  11. vendor/composer/autoload_classmap.php +40 -0
  12. vendor/composer/autoload_namespaces.php +9 -0
  13. vendor/composer/autoload_psr4.php +12 -0
  14. vendor/composer/autoload_real.php +52 -0
  15. vendor/composer/autoload_static.php +79 -0
  16. vendor/composer/installed.json +276 -0
  17. vendor/rosell-dk/dom-util-for-webp/.php_cs.dist +19 -0
  18. vendor/rosell-dk/dom-util-for-webp/README.md +156 -0
  19. vendor/rosell-dk/dom-util-for-webp/composer.json +58 -0
  20. vendor/rosell-dk/dom-util-for-webp/phpunit.xml.dist +30 -0
  21. vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php +212 -0
  22. vendor/rosell-dk/dom-util-for-webp/src/PictureTags.php +202 -0
  23. vendor/rosell-dk/dom-util-for-webp/src/simple_html_dom/simple_html_dom.inc +2930 -0
  24. vendor/rosell-dk/webp-convert-cloud-service/.gitignore +6 -0
  25. vendor/rosell-dk/webp-convert-cloud-service/.php_cs.dist +19 -0
  26. vendor/rosell-dk/webp-convert-cloud-service/LICENSE +9 -0
  27. vendor/rosell-dk/webp-convert-cloud-service/README.md +83 -0
  28. vendor/rosell-dk/webp-convert-cloud-service/composer.json +58 -0
  29. vendor/rosell-dk/webp-convert-cloud-service/docs/api.md +103 -0
  30. vendor/rosell-dk/webp-convert-cloud-service/docs/development.md +51 -0
  31. vendor/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php +99 -0
  32. vendor/rosell-dk/webp-convert-cloud-service/src/Serve.php +142 -0
  33. vendor/rosell-dk/webp-convert-cloud-service/src/WebPConvertCloudService.php +113 -0
  34. vendor/rosell-dk/webp-convert-cloud-service/tests/WebPConvertCloudServiceTest.php +21 -0
  35. vendor/rosell-dk/webp-convert/.gitattributes +4 -0
  36. vendor/rosell-dk/webp-convert/.gitignore +7 -0
  37. vendor/rosell-dk/webp-convert/.php_cs.dist +19 -0
  38. vendor/rosell-dk/webp-convert/.travis.yml +18 -0
  39. vendor/rosell-dk/webp-convert/BACKERS.md +26 -0
  40. vendor/rosell-dk/webp-convert/LICENSE +9 -0
  41. vendor/rosell-dk/webp-convert/README.md +98 -0
  42. vendor/rosell-dk/webp-convert/build-scripts/PHPMerger.php +77 -0
  43. vendor/rosell-dk/webp-convert/build-scripts/build-all +2 -0
  44. vendor/rosell-dk/webp-convert/build-scripts/build-webp-on-demand.php +89 -0
  45. vendor/rosell-dk/webp-convert/build-scripts/generate-require-all.php +83 -0
  46. vendor/rosell-dk/webp-convert/build/webp-convert.inc +3089 -0
  47. vendor/rosell-dk/webp-convert/build/webp-on-demand-1.inc +295 -0
  48. vendor/rosell-dk/webp-convert/build/webp-on-demand-2.inc +2795 -0
  49. vendor/rosell-dk/webp-convert/composer.json +66 -0
  50. vendor/rosell-dk/webp-convert/docs/api/convert-and-serve.md +162 -0
  51. vendor/rosell-dk/webp-convert/docs/api/convert.md +94 -0
  52. vendor/rosell-dk/webp-convert/docs/converters.md +236 -0
  53. vendor/rosell-dk/webp-convert/docs/development.md +51 -0
  54. vendor/rosell-dk/webp-convert/docs/webp-on-demand/tweaks.md +167 -0
  55. vendor/rosell-dk/webp-convert/docs/webp-on-demand/webp-on-demand.md +133 -0
  56. vendor/rosell-dk/webp-convert/docs/webp-on-demand/without-composer.md +45 -0
  57. vendor/rosell-dk/webp-convert/phpunit.xml.dist +30 -0
  58. vendor/rosell-dk/webp-convert/src/Converters/Binaries/cwebp-fbsd +0 -0
  59. vendor/rosell-dk/webp-convert/src/Converters/Binaries/cwebp-linux +0 -0
  60. vendor/rosell-dk/webp-convert/src/Converters/Binaries/cwebp-mac12 +0 -0
  61. vendor/rosell-dk/webp-convert/src/Converters/Binaries/cwebp-sol +0 -0
  62. vendor/rosell-dk/webp-convert/src/Converters/Binaries/cwebp.exe +0 -0
  63. vendor/rosell-dk/webp-convert/src/Converters/ConverterHelper.php +461 -0
  64. vendor/rosell-dk/webp-convert/src/Converters/Cwebp.php +394 -0
  65. vendor/rosell-dk/webp-convert/src/Converters/Ewww.php +319 -0
  66. vendor/rosell-dk/webp-convert/src/Converters/Exceptions/ConversionDeclinedException.php +10 -0
  67. vendor/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterFailedException.php +10 -0
  68. vendor/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterNotOperationalException.php +10 -0
  69. vendor/rosell-dk/webp-convert/src/Converters/Gd.php +175 -0
  70. vendor/rosell-dk/webp-convert/src/Converters/Gmagick.php +88 -0
  71. vendor/rosell-dk/webp-convert/src/Converters/Imagick.php +123 -0
  72. vendor/rosell-dk/webp-convert/src/Converters/Imagickbinary.php +155 -0
  73. vendor/rosell-dk/webp-convert/src/Converters/Wpc.php +347 -0
  74. vendor/rosell-dk/webp-convert/src/Exceptions/ConverterNotFoundException.php +10 -0
  75. vendor/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFileException.php +10 -0
  76. vendor/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFolderException.php +10 -0
  77. vendor/rosell-dk/webp-convert/src/Exceptions/InvalidFileExtensionException.php +10 -0
  78. vendor/rosell-dk/webp-convert/src/Exceptions/TargetNotFoundException.php +10 -0
  79. vendor/rosell-dk/webp-convert/src/Exceptions/WebPConvertBaseException.php +7 -0
  80. vendor/rosell-dk/webp-convert/src/Loggers/BaseLogger.php +26 -0
  81. vendor/rosell-dk/webp-convert/src/Loggers/BufferLogger.php +58 -0
  82. vendor/rosell-dk/webp-convert/src/Loggers/EchoLogger.php +23 -0
  83. vendor/rosell-dk/webp-convert/src/Loggers/VoidLogger.php +14 -0
  84. vendor/rosell-dk/webp-convert/src/Serve/Report.php +189 -0
  85. vendor/rosell-dk/webp-convert/src/Serve/ServeBase.php +224 -0
  86. vendor/rosell-dk/webp-convert/src/Serve/ServeConverted.php +312 -0
  87. vendor/rosell-dk/webp-convert/src/Serve/ServeExistingOrHandOver.php +40 -0
  88. vendor/rosell-dk/webp-convert/src/WebPConvert.php +27 -0
  89. vendor/rosell-dk/webp-convert/src/require-all.inc +27 -0
  90. vendor/rosell-dk/webp-convert/tests/Converters/CwebpTest.php +110 -0
  91. vendor/rosell-dk/webp-convert/tests/Converters/EwwwTest.php +51 -0
  92. vendor/rosell-dk/webp-convert/tests/Converters/GdTest.php +69 -0
  93. vendor/rosell-dk/webp-convert/tests/Converters/ImagickTest.php +66 -0
  94. vendor/rosell-dk/webp-convert/tests/Converters/WPCTest.php +37 -0
  95. vendor/rosell-dk/webp-convert/tests/Serve/ServeConvertedTest.php +85 -0
  96. vendor/rosell-dk/webp-convert/tests/WebPConvertTest.php +206 -0
  97. vendor/rosell-dk/webp-convert/tests/images/pre-converted/test-bigger.webp +0 -0
  98. vendor/rosell-dk/webp-convert/tests/images/pre-converted/test.webp +0 -0
  99. vendor/rosell-dk/webp-convert/tests/images/test.jpg +0 -0
  100. vendor/rosell-dk/webp-convert/tests/test.jpg +0 -0
  101. vendor/rosell-dk/webp-convert/tests/test.png +0 -0
  102. webp-express.php +1 -1
.gitignore DELETED
@@ -1,4 +0,0 @@
1
- composer.lock
2
- composer.phar
3
- /vendor
4
- .vscode
README.md CHANGED
@@ -597,6 +597,10 @@ Here are my current plans ahead: 0.13 might be bulk conversion and addition of a
597
598
If you wish to affect priorities, it is certainly possible. You can try to argue your case in the forum or you can simply let the money do the talking. By donating as little as a cup of coffee on [ko-fi.com/rosell](https://ko-fi.com/rosell), you can leave a wish. I shall take these wishes into account when prioritizing between new features.
599
600
## Changes in 0.13.1
601
- Fixed several bugs.
602
597
598
If you wish to affect priorities, it is certainly possible. You can try to argue your case in the forum or you can simply let the money do the talking. By donating as little as a cup of coffee on [ko-fi.com/rosell](https://ko-fi.com/rosell), you can leave a wish. I shall take these wishes into account when prioritizing between new features.
599
600
+ ## Changes in 0.13.2
601
+ - Fixed Fatal error on image upload in combination with the [Enable Media Replace](https://de.wordpress.org/plugins/enable-media-replace/) plugin. Thanks to Alexander Graef from Germany for reporting.
602
+ - It seems we finally nailed the blank settings page bug. Thanks to all involved, especially Richard Spenceley from the UK
603
+
604
## Changes in 0.13.1
605
- Fixed several bugs.
606
README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://ko-fi.com/rosell
4
Tags: webp, images, performance
5
Requires at least: 4.0
6
Tested up to: 5.2
7
- Stable tag: 0.13.1
8
Requires PHP: 5.6
9
License: GPLv3
10
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -604,8 +604,15 @@ Easy enough! - [Go here!](https://ko-fi.com/rosell). Or [here](https://buymeacof
604
605
== Changelog ==
606
607
= 0.13.1 =
608
*(released: 10 may 2019)*
609
* Fixed critical bug which could result in update failures in the Gutenberg editor. Thanks to Andrei Glingeanu from Moldova for his part in solving this.
610
* Fixed bug that caused the Bulk convert to start over. Thanks to Bas van Dijk, presumably from the Netherlands, for finding the root cause.
611
* On Nginx (in some configurations), the script that triggered conversion were exiting prematurely. Thanks to Sam Benson from the UK for fixing this.
@@ -618,6 +625,7 @@ For more info, see the closed issues on the 0.13.1 milestone on the github repos
618
619
= 0.13.0 =
620
*(released: 21 mar 2019)*
621
* Bulk Conversion
622
* Fixed problems with Gd converter and PNG
623
* Optinally auto convert upon media upload
@@ -627,14 +635,17 @@ For more info, see the closed issues on the 0.13.0 milestone on the github repos
627
628
= 0.12.2 =
629
*(released 8 mar 2019)*
630
* Fixed bug: On some nginx configurations, the newly added protection against directly calling the converter scripts were triggering also when it should not.
631
632
= 0.12.1 =
633
*(released 7 mar 2019)*
634
* Fixed bug: Alter HTML crashed when HTML was larger than 600kb and "image urls" where selected
635
636
= 0.12.0 =
637
*(released 5 mar 2019)*
638
* Multisite support (!)
639
* A new operation mode: "No conversion", if you do not want to use WebP Express for converting. Replaces the old "Just redirect" mode
640
* Added capability testing of .htaccess. The .htaccess rules are now tailored to the capabilities on the system. For example, on some platforms the filename of a requested image is passed to the converter script through the query string, but on platforms that supports passing it through an environment variable, that method is used instead
@@ -645,6 +656,7 @@ For more info, see the closed issues on the 0.12.0 milestone on the github repos
645
646
= 0.11.3 =
647
*(released 18 feb 2019)*
648
* Fixed bug: Alter HTML caused media library not to display images on some systems. Alter HTML is now disabled in admin mode.
649
* Alter HTML (picture tags) could produce the source tags with "src" attribute. But source tags inside picture tags must use "srcset" attribute. Fixed.
650
* Alter HTML (image urls): srcsets containing "x" descriptors wasn't handled (ie, srcset="image.jpg 1x")
@@ -654,11 +666,13 @@ For more info, see the closed issues on the 0.12.0 milestone on the github repos
654
655
= 0.11.2 =
656
*(released 14 feb 2019)*
657
* Fixed bug which caused Alter HTML to fail miserably on some setups
658
* AlterHTML now also looks for lazy load attributes in DIV and LI tags.
659
660
= 0.11.1 =
661
*(released 6 feb 2019)*
662
* Fixed bug which caused the new "Convert non-existing webp-files upon request" not to work on all setups
663
664
= 0.11.0 =
@@ -670,6 +684,7 @@ For more info, see the closed issues on the 0.11.0 milestone on the github repos
670
671
= 0.10.0 =
672
*(released 7 jan 2019)*
673
* Introduced "Operation modes" in order to keep setting screens simple but still allow tweaking
674
* WebP Express can now be used in conjunction with Cache Enabler and ShortPixel
675
* Cache-Control header is now added in *.htaccess*, when redirecting directly to existing webp
@@ -678,6 +693,7 @@ For more info, see the closed issues on the 0.10.0 milestone on the github repos
678
679
= 0.9.1 =
680
*(released 28 dec 2018)*
681
* Fixed critical bug causing blank page on options page
682
683
= 0.9.0 =
@@ -690,10 +706,12 @@ For more info, see the closed issues on the 0.9.0 milestone on the github reposi
690
691
= 0.8.1 =
692
*(released 11 dec 2018)*
693
* Fixed javascript bug
694
695
= 0.8.0 =
696
*(released 11 dec 2018)*
697
* New conversion method, which calls imagick binary directly. This will make WebP express work out of the box on more systems
698
* Made sure not to trigger LFI warning i Wordfence (to activate, click the force .htaccess button)
699
* Imagick can now be configured to set quality to auto on systems where the auto option isn't generally available
@@ -763,14 +781,17 @@ For older releases, check out changelog.txt
763
764
== Upgrade Notice ==
765
766
= 0.13.1 =
767
- * Fixed several bugs. You should update...
768
769
= 0.13.0 =
770
- * Bulk Conversion, fixed problem with Gd converter and PNGs and more...
771
772
= 0.12.2 =
773
- * Fixed bug: On some nginx configurations, the newly added protection against directly calling the converter scripts were triggering also when it should not.
774
775
= 0.12.1 =
776
Fixed bug: Alter HTML crashed when HTML was larger than 600kb and "image urls" where selected
4
Tags: webp, images, performance
5
Requires at least: 4.0
6
Tested up to: 5.2
7
+ Stable tag: 0.13.2
8
Requires PHP: 5.6
9
License: GPLv3
10
License URI: https://www.gnu.org/licenses/gpl-3.0.html
604
605
== Changelog ==
606
607
+ = 0.13.2 =
608
+ *(released: 16 may 2019)*
609
+
610
+ * Fixed Fatal error on image upload in combination with the [Enable Media Replace](https://de.wordpress.org/plugins/enable-media-replace/) plugin. Thanks to Alexander Graef from Germany for reporting.
611
+ * It seems we finally nailed the blank settings page bug. Thanks to all involved, especially Richard Spenceley from the UK
612
+
613
= 0.13.1 =
614
*(released: 10 may 2019)*
615
+
616
* Fixed critical bug which could result in update failures in the Gutenberg editor. Thanks to Andrei Glingeanu from Moldova for his part in solving this.
617
* Fixed bug that caused the Bulk convert to start over. Thanks to Bas van Dijk, presumably from the Netherlands, for finding the root cause.
618
* On Nginx (in some configurations), the script that triggered conversion were exiting prematurely. Thanks to Sam Benson from the UK for fixing this.
625
626
= 0.13.0 =
627
*(released: 21 mar 2019)*
628
+
629
* Bulk Conversion
630
* Fixed problems with Gd converter and PNG
631
* Optinally auto convert upon media upload
635
636
= 0.12.2 =
637
*(released 8 mar 2019)*
638
+
639
* Fixed bug: On some nginx configurations, the newly added protection against directly calling the converter scripts were triggering also when it should not.
640
641
= 0.12.1 =
642
*(released 7 mar 2019)*
643
+
644
* Fixed bug: Alter HTML crashed when HTML was larger than 600kb and "image urls" where selected
645
646
= 0.12.0 =
647
*(released 5 mar 2019)*
648
+
649
* Multisite support (!)
650
* A new operation mode: "No conversion", if you do not want to use WebP Express for converting. Replaces the old "Just redirect" mode
651
* Added capability testing of .htaccess. The .htaccess rules are now tailored to the capabilities on the system. For example, on some platforms the filename of a requested image is passed to the converter script through the query string, but on platforms that supports passing it through an environment variable, that method is used instead
656
657
= 0.11.3 =
658
*(released 18 feb 2019)*
659
+
660
* Fixed bug: Alter HTML caused media library not to display images on some systems. Alter HTML is now disabled in admin mode.
661
* Alter HTML (picture tags) could produce the source tags with "src" attribute. But source tags inside picture tags must use "srcset" attribute. Fixed.
662
* Alter HTML (image urls): srcsets containing "x" descriptors wasn't handled (ie, srcset="image.jpg 1x")
666
667
= 0.11.2 =
668
*(released 14 feb 2019)*
669
+
670
* Fixed bug which caused Alter HTML to fail miserably on some setups
671
* AlterHTML now also looks for lazy load attributes in DIV and LI tags.
672
673
= 0.11.1 =
674
*(released 6 feb 2019)*
675
+
676
* Fixed bug which caused the new "Convert non-existing webp-files upon request" not to work on all setups
677
678
= 0.11.0 =
684
685
= 0.10.0 =
686
*(released 7 jan 2019)*
687
+
688
* Introduced "Operation modes" in order to keep setting screens simple but still allow tweaking
689
* WebP Express can now be used in conjunction with Cache Enabler and ShortPixel
690
* Cache-Control header is now added in *.htaccess*, when redirecting directly to existing webp
693
694
= 0.9.1 =
695
*(released 28 dec 2018)*
696
+
697
* Fixed critical bug causing blank page on options page
698
699
= 0.9.0 =
706
707
= 0.8.1 =
708
*(released 11 dec 2018)*
709
+
710
* Fixed javascript bug
711
712
= 0.8.0 =
713
*(released 11 dec 2018)*
714
+
715
* New conversion method, which calls imagick binary directly. This will make WebP express work out of the box on more systems
716
* Made sure not to trigger LFI warning i Wordfence (to activate, click the force .htaccess button)
717
* Imagick can now be configured to set quality to auto on systems where the auto option isn't generally available
781
782
== Upgrade Notice ==
783
784
+ = 0.13.2 =
785
+ Fixed critical error on upload (can occur in combination with some plugins), and it seems we finally nailed the blank settings page bug.
786
+
787
= 0.13.1 =
788
+ Fixed several bugs. You should update...
789
790
= 0.13.0 =
791
+ Bulk Conversion, fixed problem with Gd converter and PNGs and more...
792
793
= 0.12.2 =
794
+ Fixed bug: On some nginx configurations, the newly added protection against directly calling the converter scripts were triggering also when it should not.
795
796
= 0.12.1 =
797
Fixed bug: Alter HTML crashed when HTML was larger than 600kb and "image urls" where selected
composer.lock ADDED
@@ -0,0 +1,286 @@
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "b5e5a83c346324652e5f6cb8edf61e11",
8
+ "packages": [
9
+ {
10
+ "name": "rosell-dk/dom-util-for-webp",
11
+ "version": "0.3.0",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://github.com/rosell-dk/dom-util-for-webp.git",
15
+ "reference": "c9cebf304553695fb6f7cf5634da51172e8e4aba"
16
+ },
17
+ "dist": {
18
+ "type": "zip",
19
+ "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/c9cebf304553695fb6f7cf5634da51172e8e4aba",
20
+ "reference": "c9cebf304553695fb6f7cf5634da51172e8e4aba",
21
+ "shasum": ""
22
+ },
23
+ "require-dev": {
24
+ "friendsofphp/php-cs-fixer": "^2.11",
25
+ "phpunit/phpunit": "5.7.27",
26
+ "squizlabs/php_codesniffer": "3.*"
27
+ },
28
+ "type": "library",
29
+ "extra": {
30
+ "scripts-descriptions": {
31
+ "ci": "Run tests before CI",
32
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
33
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
34
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
35
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
36
+ "test": "Launches the preconfigured PHPUnit"
37
+ }
38
+ },
39
+ "autoload": {
40
+ "psr-4": {
41
+ "DOMUtilForWebP\\": "src/"
42
+ }
43
+ },
44
+ "notification-url": "https://packagist.org/downloads/",
45
+ "license": [
46
+ "MIT"
47
+ ],
48
+ "authors": [
49
+ {
50
+ "name": "Bjørn Rosell",
51
+ "homepage": "https://www.bitwise-it.dk/contact",
52
+ "role": "Project Author"
53
+ }
54
+ ],
55
+ "description": "Replace image URLs found in HTML",
56
+ "keywords": [
57
+ "Webp",
58
+ "html",
59
+ "images",
60
+ "replace"
61
+ ],
62
+ "time": "2019-03-07T09:15:07+00:00"
63
+ },
64
+ {
65
+ "name": "rosell-dk/webp-convert",
66
+ "version": "1.3.9",
67
+ "source": {
68
+ "type": "git",
69
+ "url": "https://github.com/rosell-dk/webp-convert.git",
70
+ "reference": "3680c278f08748054b4ab3ea7855be8984f008aa"
71
+ },
72
+ "dist": {
73
+ "type": "zip",
74
+ "url": "https://api.github.com/repos/rosell-dk/webp-convert/zipball/3680c278f08748054b4ab3ea7855be8984f008aa",
75
+ "reference": "3680c278f08748054b4ab3ea7855be8984f008aa",
76
+ "shasum": ""
77
+ },
78
+ "require-dev": {
79
+ "friendsofphp/php-cs-fixer": "^2.11",
80
+ "phpunit/phpunit": "5.7.27",
81
+ "squizlabs/php_codesniffer": "3.*"
82
+ },
83
+ "type": "library",
84
+ "extra": {
85
+ "scripts-descriptions": {
86
+ "ci": "Run tests before CI",
87
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
88
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
89
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
90
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
91
+ "test": "Launches the preconfigured PHPUnit"
92
+ }
93
+ },
94
+ "autoload": {
95
+ "psr-4": {
96
+ "WebPConvert\\": "src/"
97
+ }
98
+ },
99
+ "autoload-dev": {
100
+ "psr-4": {
101
+ "WebPConvert\\Tests\\": "tests/"
102
+ }
103
+ },
104
+ "scripts": {
105
+ "ci": [
106
+ "@build",
107
+ "@test",
108
+ "@phpcs-all",
109
+ "@composer validate --no-check-all --strict"
110
+ ],
111
+ "build": [
112
+ "@build-wod",
113
+ "@build-require-all"
114
+ ],
115
+ "cs-fix-all": [
116
+ "php-cs-fixer fix src"
117
+ ],
118
+ "cs-fix": [
119
+ "php-cs-fixer fix"
120
+ ],
121
+ "cs-dry": [
122
+ "php-cs-fixer fix --dry-run --diff"
123
+ ],
124
+ "test": [
125
+ "phpunit"
126
+ ],
127
+ "phpcs": [
128
+ "phpcs --standard=PSR2"
129
+ ],
130
+ "phpcs-all": [
131
+ "phpcs --standard=PSR2 src"
132
+ ],
133
+ "phpcbf": [
134
+ "phpcbf --standard=PSR2"
135
+ ],
136
+ "build-wod": [
137
+ "php build-scripts/build-webp-on-demand.php"
138
+ ],
139
+ "build-require-all": [
140
+ "php build-scripts/generate-require-all.php"
141
+ ]
142
+ },
143
+ "license": [
144
+ "MIT"
145
+ ],
146
+ "authors": [
147
+ {
148
+ "name": "Bjørn Rosell",
149
+ "homepage": "https://www.bitwise-it.dk/contact",
150
+ "role": "Project Author"
151
+ },
152
+ {
153
+ "name": "Martin Folkers",
154
+ "homepage": "https://twobrain.io",
155
+ "role": "Collaborator"
156
+ }
157
+ ],
158
+ "description": "Convert JPEG & PNG to WebP with PHP",
159
+ "keywords": [
160
+ "cwebp",
161
+ "gd",
162
+ "image conversion",
163
+ "images",
164
+ "imagick",
165
+ "jpg",
166
+ "jpg2webp",
167
+ "png",
168
+ "png2webp",
169
+ "webp"
170
+ ],
171
+ "support": {
172
+ "source": "https://github.com/rosell-dk/webp-convert/tree/1.3.9",
173
+ "issues": "https://github.com/rosell-dk/webp-convert/issues"
174
+ },
175
+ "time": "2019-03-21T07:34:21+00:00"
176
+ },
177
+ {
178
+ "name": "rosell-dk/webp-convert-cloud-service",
179
+ "version": "1.0.0",
180
+ "source": {
181
+ "type": "git",
182
+ "url": "https://github.com/rosell-dk/webp-convert-cloud-service.git",
183
+ "reference": "e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37"
184
+ },
185
+ "dist": {
186
+ "type": "zip",
187
+ "url": "https://api.github.com/repos/rosell-dk/webp-convert-cloud-service/zipball/e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37",
188
+ "reference": "e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37",
189
+ "shasum": ""
190
+ },
191
+ "require": {
192
+ "rosell-dk/webp-convert": "^1.2.1"
193
+ },
194
+ "require-dev": {
195
+ "friendsofphp/php-cs-fixer": "^2.11",
196
+ "phpunit/phpunit": "5.7.27",
197
+ "squizlabs/php_codesniffer": "3.*"
198
+ },
199
+ "type": "library",
200
+ "extra": {
201
+ "scripts-descriptions": {
202
+ "ci": "Run tests before CI",
203
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
204
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
205
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
206
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
207
+ "test": "Launches the preconfigured PHPUnit"
208
+ }
209
+ },
210
+ "autoload": {
211
+ "psr-4": {
212
+ "WebPConvertCloudService\\": "src/"
213
+ }
214
+ },
215
+ "autoload-dev": {
216
+ "psr-4": {
217
+ "WebPConvertCloudService\\Tests\\": "tests/"
218
+ }
219
+ },
220
+ "scripts": {
221
+ "ci": [
222
+ "@test",
223
+ "@phpcs-all",
224
+ "@composer validate --no-check-all --strict"
225
+ ],
226
+ "cs-fix-all": [
227
+ "php-cs-fixer fix src"
228
+ ],
229
+ "cs-fix": [
230
+ "php-cs-fixer fix"
231
+ ],
232
+ "cs-dry": [
233
+ "php-cs-fixer fix --dry-run --diff"
234
+ ],
235
+ "test": [
236
+ "phpunit tests/"
237
+ ],
238
+ "phpcs": [
239
+ "phpcs --standard=PSR2"
240
+ ],
241
+ "phpcs-all": [
242
+ "phpcs --standard=PSR2 src"
243
+ ],
244
+ "phpcbf": [
245
+ "phpcbf --standard=PSR2"
246
+ ]
247
+ },
248
+ "license": [
249
+ "MIT"
250
+ ],
251
+ "authors": [
252
+ {
253
+ "name": "Bjørn Rosell",
254
+ "homepage": "https://www.bitwise-it.dk/contact",
255
+ "role": "Project Author"
256
+ }
257
+ ],
258
+ "description": "Cloud service for converting JPEG & PNG to WebP",
259
+ "keywords": [
260
+ "cwebp",
261
+ "gd",
262
+ "image conversion",
263
+ "images",
264
+ "imagick",
265
+ "jpg",
266
+ "jpg2webp",
267
+ "png",
268
+ "png2webp",
269
+ "webp"
270
+ ],
271
+ "support": {
272
+ "source": "https://github.com/rosell-dk/webp-convert-cloud-service/tree/1.0.0",
273
+ "issues": "https://github.com/rosell-dk/webp-convert-cloud-service/issues"
274
+ },
275
+ "time": "2018-11-09T11:17:43+00:00"
276
+ }
277
+ ],
278
+ "packages-dev": [],
279
+ "aliases": [],
280
+ "minimum-stability": "stable",
281
+ "stability-flags": [],
282
+ "prefer-stable": false,
283
+ "prefer-lowest": false,
284
+ "platform": [],
285
+ "platform-dev": []
286
+ }
lib/classes/HandleUploadHooks.php CHANGED
@@ -56,7 +56,7 @@ class HandleUploadHooks
56
* hook: handle_upload
57
* $filename is ie "/var/www/webp-express-tests/we0/wordpress/uploads-moved/image4-10-150x150.jpg"
58
*/
59
- public static function handleUpload($filearray, $overrides, $ignore = false)
60
{
61
$filename = $filearray['file'];
62
self::convertIf($filename);
56
* hook: handle_upload
57
* $filename is ie "/var/www/webp-express-tests/we0/wordpress/uploads-moved/image4-10-150x150.jpg"
58
*/
59
+ public static function handleUpload($filearray, $overrides = false, $ignore = false)
60
{
61
$filename = $filearray['file'];
62
self::convertIf($filename);
lib/classes/TestRun.php CHANGED
@@ -7,7 +7,8 @@ use \WebPExpress\ConvertersHelper;
7
use \WebPExpress\Paths;
8
use \WebPExpress\FileHelper;
9
10
- include_once __DIR__ . '/../../vendor/autoload.php';
11
use \WebPConvert\Converters\ConverterHelper;
12
13
/**
7
use \WebPExpress\Paths;
8
use \WebPExpress\FileHelper;
9
10
+ include_once WEBPEXPRESS_PLUGIN_DIR . '/vendor/autoload.php';
11
+
12
use \WebPConvert\Converters\ConverterHelper;
13
14
/**
lib/options/options/alter-html/alter-html-options.inc CHANGED
@@ -123,7 +123,7 @@
123
'If you enable this option, a small script will be added which detects if picture tags are supported and loads ' .
124
'<a href="https://github.com/scottjehl/picturefill" target="_blank">picturefill.js</a> if not. ' .
125
'It is recommended to activate this option, unless your theme or another plugin adds such a script. ' .
126
- 'Picture tag support is currently <a href="https://caniuse.com/#feat=picture" target="_blank">~88%</a>'
127
);
128
?>
129
</div></li>
123
'If you enable this option, a small script will be added which detects if picture tags are supported and loads ' .
124
'<a href="https://github.com/scottjehl/picturefill" target="_blank">picturefill.js</a> if not. ' .
125
'It is recommended to activate this option, unless your theme or another plugin adds such a script. ' .
126
+ 'Picture tag support is currently <a href="https://caniuse.com/#feat=picture" target="_blank">~93%</a>'
127
);
128
?>
129
</div></li>
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit9a5d1d521aac5c1f4f08f3a90858f030::getLoader();
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +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
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +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
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,40 @@
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
+ 'DOMUtilForWebP\\ImageUrlReplacer' => $vendorDir . '/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php',
10
+ 'DOMUtilForWebP\\PictureTags' => $vendorDir . '/rosell-dk/dom-util-for-webp/src/PictureTags.php',
11
+ 'WebPConvertCloudService\\AccessCheck' => $vendorDir . '/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php',
12
+ 'WebPConvertCloudService\\Serve' => $vendorDir . '/rosell-dk/webp-convert-cloud-service/src/Serve.php',
13
+ 'WebPConvertCloudService\\WebPConvertCloudService' => $vendorDir . '/rosell-dk/webp-convert-cloud-service/src/WebPConvertCloudService.php',
14
+ 'WebPConvert\\Converters\\ConverterHelper' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/ConverterHelper.php',
15
+ 'WebPConvert\\Converters\\Cwebp' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Cwebp.php',
16
+ 'WebPConvert\\Converters\\Ewww' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Ewww.php',
17
+ 'WebPConvert\\Converters\\Exceptions\\ConversionDeclinedException' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConversionDeclinedException.php',
18
+ 'WebPConvert\\Converters\\Exceptions\\ConverterFailedException' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterFailedException.php',
19
+ 'WebPConvert\\Converters\\Exceptions\\ConverterNotOperationalException' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterNotOperationalException.php',
20
+ 'WebPConvert\\Converters\\Gd' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Gd.php',
21
+ 'WebPConvert\\Converters\\Gmagick' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Gmagick.php',
22
+ 'WebPConvert\\Converters\\Imagick' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Imagick.php',
23
+ 'WebPConvert\\Converters\\ImagickBinary' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Imagickbinary.php',
24
+ 'WebPConvert\\Converters\\Wpc' => $vendorDir . '/rosell-dk/webp-convert/src/Converters/Wpc.php',
25
+ 'WebPConvert\\Exceptions\\ConverterNotFoundException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/ConverterNotFoundException.php',
26
+ 'WebPConvert\\Exceptions\\CreateDestinationFileException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFileException.php',
27
+ 'WebPConvert\\Exceptions\\CreateDestinationFolderException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFolderException.php',
28
+ 'WebPConvert\\Exceptions\\InvalidFileExtensionException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/InvalidFileExtensionException.php',
29
+ 'WebPConvert\\Exceptions\\TargetNotFoundException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/TargetNotFoundException.php',
30
+ 'WebPConvert\\Exceptions\\WebPConvertBaseException' => $vendorDir . '/rosell-dk/webp-convert/src/Exceptions/WebPConvertBaseException.php',
31
+ 'WebPConvert\\Loggers\\BaseLogger' => $vendorDir . '/rosell-dk/webp-convert/src/Loggers/BaseLogger.php',
32
+ 'WebPConvert\\Loggers\\BufferLogger' => $vendorDir . '/rosell-dk/webp-convert/src/Loggers/BufferLogger.php',
33
+ 'WebPConvert\\Loggers\\EchoLogger' => $vendorDir . '/rosell-dk/webp-convert/src/Loggers/EchoLogger.php',
34
+ 'WebPConvert\\Loggers\\VoidLogger' => $vendorDir . '/rosell-dk/webp-convert/src/Loggers/VoidLogger.php',
35
+ 'WebPConvert\\Serve\\Report' => $vendorDir . '/rosell-dk/webp-convert/src/Serve/Report.php',
36
+ 'WebPConvert\\Serve\\ServeBase' => $vendorDir . '/rosell-dk/webp-convert/src/Serve/ServeBase.php',
37
+ 'WebPConvert\\Serve\\ServeConverted' => $vendorDir . '/rosell-dk/webp-convert/src/Serve/ServeConverted.php',
38
+ 'WebPConvert\\Serve\\ServeExistingOrHandOver' => $vendorDir . '/rosell-dk/webp-convert/src/Serve/ServeExistingOrHandOver.php',
39
+ 'WebPConvert\\WebPConvert' => $vendorDir . '/rosell-dk/webp-convert/src/WebPConvert.php',
40
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +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
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,12 @@
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
+ 'WebPConvert\\' => array($vendorDir . '/rosell-dk/webp-convert/src'),
10
+ 'WebPConvertCloudService\\' => array($vendorDir . '/rosell-dk/webp-convert-cloud-service/src'),
11
+ 'DOMUtilForWebP\\' => array($vendorDir . '/rosell-dk/dom-util-for-webp/src'),
12
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,52 @@
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit9a5d1d521aac5c1f4f08f3a90858f030
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('ComposerAutoloaderInit9a5d1d521aac5c1f4f08f3a90858f030', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit9a5d1d521aac5c1f4f08f3a90858f030', '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\ComposerStaticInit9a5d1d521aac5c1f4f08f3a90858f030::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
+ }
vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,79 @@
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInit9a5d1d521aac5c1f4f08f3a90858f030
8
+ {
9
+ public static $prefixLengthsPsr4 = array (
10
+ 'W' =>
11
+ array (
12
+ 'WebPConvert\\' => 12,
13
+ 'WebPConvertCloudService\\' => 24,
14
+ ),
15
+ 'D' =>
16
+ array (
17
+ 'DOMUtilForWebP\\' => 15,
18
+ ),
19
+ );
20
+
21
+ public static $prefixDirsPsr4 = array (
22
+ 'WebPConvert\\' =>
23
+ array (
24
+ 0 => __DIR__ . '/..' . '/rosell-dk/webp-convert/src',
25
+ ),
26
+ 'WebPConvertCloudService\\' =>
27
+ array (
28
+ 0 => __DIR__ . '/..' . '/rosell-dk/webp-convert-cloud-service/src',
29
+ ),
30
+ 'DOMUtilForWebP\\' =>
31
+ array (
32
+ 0 => __DIR__ . '/..' . '/rosell-dk/dom-util-for-webp/src',
33
+ ),
34
+ );
35
+
36
+ public static $classMap = array (
37
+ 'DOMUtilForWebP\\ImageUrlReplacer' => __DIR__ . '/..' . '/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php',
38
+ 'DOMUtilForWebP\\PictureTags' => __DIR__ . '/..' . '/rosell-dk/dom-util-for-webp/src/PictureTags.php',
39
+ 'WebPConvertCloudService\\AccessCheck' => __DIR__ . '/..' . '/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php',
40
+ 'WebPConvertCloudService\\Serve' => __DIR__ . '/..' . '/rosell-dk/webp-convert-cloud-service/src/Serve.php',
41
+ 'WebPConvertCloudService\\WebPConvertCloudService' => __DIR__ . '/..' . '/rosell-dk/webp-convert-cloud-service/src/WebPConvertCloudService.php',
42
+ 'WebPConvert\\Converters\\ConverterHelper' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/ConverterHelper.php',
43
+ 'WebPConvert\\Converters\\Cwebp' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Cwebp.php',
44
+ 'WebPConvert\\Converters\\Ewww' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Ewww.php',
45
+ 'WebPConvert\\Converters\\Exceptions\\ConversionDeclinedException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConversionDeclinedException.php',
46
+ 'WebPConvert\\Converters\\Exceptions\\ConverterFailedException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterFailedException.php',
47
+ 'WebPConvert\\Converters\\Exceptions\\ConverterNotOperationalException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Exceptions/ConverterNotOperationalException.php',
48
+ 'WebPConvert\\Converters\\Gd' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Gd.php',
49
+ 'WebPConvert\\Converters\\Gmagick' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Gmagick.php',
50
+ 'WebPConvert\\Converters\\Imagick' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Imagick.php',
51
+ 'WebPConvert\\Converters\\ImagickBinary' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Imagickbinary.php',
52
+ 'WebPConvert\\Converters\\Wpc' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Converters/Wpc.php',
53
+ 'WebPConvert\\Exceptions\\ConverterNotFoundException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/ConverterNotFoundException.php',
54
+ 'WebPConvert\\Exceptions\\CreateDestinationFileException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFileException.php',
55
+ 'WebPConvert\\Exceptions\\CreateDestinationFolderException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/CreateDestinationFolderException.php',
56
+ 'WebPConvert\\Exceptions\\InvalidFileExtensionException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/InvalidFileExtensionException.php',
57
+ 'WebPConvert\\Exceptions\\TargetNotFoundException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/TargetNotFoundException.php',
58
+ 'WebPConvert\\Exceptions\\WebPConvertBaseException' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Exceptions/WebPConvertBaseException.php',
59
+ 'WebPConvert\\Loggers\\BaseLogger' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Loggers/BaseLogger.php',
60
+ 'WebPConvert\\Loggers\\BufferLogger' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Loggers/BufferLogger.php',
61
+ 'WebPConvert\\Loggers\\EchoLogger' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Loggers/EchoLogger.php',
62
+ 'WebPConvert\\Loggers\\VoidLogger' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Loggers/VoidLogger.php',
63
+ 'WebPConvert\\Serve\\Report' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Serve/Report.php',
64
+ 'WebPConvert\\Serve\\ServeBase' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Serve/ServeBase.php',
65
+ 'WebPConvert\\Serve\\ServeConverted' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Serve/ServeConverted.php',
66
+ 'WebPConvert\\Serve\\ServeExistingOrHandOver' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/Serve/ServeExistingOrHandOver.php',
67
+ 'WebPConvert\\WebPConvert' => __DIR__ . '/..' . '/rosell-dk/webp-convert/src/WebPConvert.php',
68
+ );
69
+
70
+ public static function getInitializer(ClassLoader $loader)
71
+ {
72
+ return \Closure::bind(function () use ($loader) {
73
+ $loader->prefixLengthsPsr4 = ComposerStaticInit9a5d1d521aac5c1f4f08f3a90858f030::$prefixLengthsPsr4;
74
+ $loader->prefixDirsPsr4 = ComposerStaticInit9a5d1d521aac5c1f4f08f3a90858f030::$prefixDirsPsr4;
75
+ $loader->classMap = ComposerStaticInit9a5d1d521aac5c1f4f08f3a90858f030::$classMap;
76
+
77
+ }, null, ClassLoader::class);
78
+ }
79
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,276 @@
1
+ [
2
+ {
3
+ "name": "rosell-dk/dom-util-for-webp",
4
+ "version": "0.3.0",
5
+ "version_normalized": "0.3.0.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/rosell-dk/dom-util-for-webp.git",
9
+ "reference": "c9cebf304553695fb6f7cf5634da51172e8e4aba"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/c9cebf304553695fb6f7cf5634da51172e8e4aba",
14
+ "reference": "c9cebf304553695fb6f7cf5634da51172e8e4aba",
15
+ "shasum": ""
16
+ },
17
+ "require-dev": {
18
+ "friendsofphp/php-cs-fixer": "^2.11",
19
+ "phpunit/phpunit": "5.7.27",
20
+ "squizlabs/php_codesniffer": "3.*"
21
+ },
22
+ "time": "2019-03-07T09:15:07+00:00",
23
+ "type": "library",
24
+ "extra": {
25
+ "scripts-descriptions": {
26
+ "ci": "Run tests before CI",
27
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
28
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
29
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
30
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
31
+ "test": "Launches the preconfigured PHPUnit"
32
+ }
33
+ },
34
+ "installation-source": "dist",
35
+ "autoload": {
36
+ "psr-4": {
37
+ "DOMUtilForWebP\\": "src/"
38
+ }
39
+ },
40
+ "notification-url": "https://packagist.org/downloads/",
41
+ "license": [
42
+ "MIT"
43
+ ],
44
+ "authors": [
45
+ {
46
+ "name": "Bjørn Rosell",
47
+ "homepage": "https://www.bitwise-it.dk/contact",
48
+ "role": "Project Author"
49
+ }
50
+ ],
51
+ "description": "Replace image URLs found in HTML",
52
+ "keywords": [
53
+ "Webp",
54
+ "html",
55
+ "images",
56
+ "replace"
57
+ ]
58
+ },
59
+ {
60
+ "name": "rosell-dk/webp-convert",
61
+ "version": "1.3.9",
62
+ "version_normalized": "1.3.9.0",
63
+ "source": {
64
+ "type": "git",
65
+ "url": "https://github.com/rosell-dk/webp-convert.git",
66
+ "reference": "3680c278f08748054b4ab3ea7855be8984f008aa"
67
+ },
68
+ "dist": {
69
+ "type": "zip",
70
+ "url": "https://api.github.com/repos/rosell-dk/webp-convert/zipball/3680c278f08748054b4ab3ea7855be8984f008aa",
71
+ "reference": "3680c278f08748054b4ab3ea7855be8984f008aa",
72
+ "shasum": ""
73
+ },
74
+ "require-dev": {
75
+ "friendsofphp/php-cs-fixer": "^2.11",
76
+ "phpunit/phpunit": "5.7.27",
77
+ "squizlabs/php_codesniffer": "3.*"
78
+ },
79
+ "time": "2019-03-21T07:34:21+00:00",
80
+ "type": "library",
81
+ "extra": {
82
+ "scripts-descriptions": {
83
+ "ci": "Run tests before CI",
84
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
85
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
86
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
87
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
88
+ "test": "Launches the preconfigured PHPUnit"
89
+ }
90
+ },
91
+ "installation-source": "source",
92
+ "autoload": {
93
+ "psr-4": {
94
+ "WebPConvert\\": "src/"
95
+ }
96
+ },
97
+ "autoload-dev": {
98
+ "psr-4": {
99
+ "WebPConvert\\Tests\\": "tests/"
100
+ }
101
+ },
102
+ "scripts": {
103
+ "ci": [
104
+ "@build",
105
+ "@test",
106
+ "@phpcs-all",
107
+ "@composer validate --no-check-all --strict"
108
+ ],
109
+ "build": [
110
+ "@build-wod",
111
+ "@build-require-all"
112
+ ],
113
+ "cs-fix-all": [
114
+ "php-cs-fixer fix src"
115
+ ],
116
+ "cs-fix": [
117
+ "php-cs-fixer fix"
118
+ ],
119
+ "cs-dry": [
120
+ "php-cs-fixer fix --dry-run --diff"
121
+ ],
122
+ "test": [
123
+ "phpunit"
124
+ ],
125
+ "phpcs": [
126
+ "phpcs --standard=PSR2"
127
+ ],
128
+ "phpcs-all": [
129
+ "phpcs --standard=PSR2 src"
130
+ ],
131
+ "phpcbf": [
132
+ "phpcbf --standard=PSR2"
133
+ ],
134
+ "build-wod": [
135
+ "php build-scripts/build-webp-on-demand.php"
136
+ ],
137
+ "build-require-all": [
138
+ "php build-scripts/generate-require-all.php"
139
+ ]
140
+ },
141
+ "license": [
142
+ "MIT"
143
+ ],
144
+ "authors": [
145
+ {
146
+ "name": "Bjørn Rosell",
147
+ "homepage": "https://www.bitwise-it.dk/contact",
148
+ "role": "Project Author"
149
+ },
150
+ {
151
+ "name": "Martin Folkers",
152
+ "homepage": "https://twobrain.io",
153
+ "role": "Collaborator"
154
+ }
155
+ ],
156
+ "description": "Convert JPEG & PNG to WebP with PHP",
157
+ "keywords": [
158
+ "cwebp",
159
+ "gd",
160
+ "image conversion",
161
+ "images",
162
+ "imagick",
163
+ "jpg",
164
+ "jpg2webp",
165
+ "png",
166
+ "png2webp",
167
+ "webp"
168
+ ],
169
+ "support": {
170
+ "source": "https://github.com/rosell-dk/webp-convert/tree/1.3.9",
171
+ "issues": "https://github.com/rosell-dk/webp-convert/issues"
172
+ }
173
+ },
174
+ {
175
+ "name": "rosell-dk/webp-convert-cloud-service",
176
+ "version": "1.0.0",
177
+ "version_normalized": "1.0.0.0",
178
+ "source": {
179
+ "type": "git",
180
+ "url": "https://github.com/rosell-dk/webp-convert-cloud-service.git",
181
+ "reference": "e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37"
182
+ },
183
+ "dist": {
184
+ "type": "zip",
185
+ "url": "https://api.github.com/repos/rosell-dk/webp-convert-cloud-service/zipball/e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37",
186
+ "reference": "e250d49f4cb0fd0c07becbfa0abb7a1a31d03e37",
187
+ "shasum": ""
188
+ },
189
+ "require": {
190
+ "rosell-dk/webp-convert": "^1.2.1"
191
+ },
192
+ "require-dev": {
193
+ "friendsofphp/php-cs-fixer": "^2.11",
194
+ "phpunit/phpunit": "5.7.27",
195
+ "squizlabs/php_codesniffer": "3.*"
196
+ },
197
+ "time": "2018-11-09T11:17:43+00:00",
198
+ "type": "library",
199
+ "extra": {
200
+ "scripts-descriptions": {
201
+ "ci": "Run tests before CI",
202
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
203
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
204
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
205
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
206
+ "test": "Launches the preconfigured PHPUnit"
207
+ }
208
+ },
209
+ "installation-source": "source",
210
+ "autoload": {
211
+ "psr-4": {
212
+ "WebPConvertCloudService\\": "src/"
213
+ }
214
+ },
215
+ "autoload-dev": {
216
+ "psr-4": {
217
+ "WebPConvertCloudService\\Tests\\": "tests/"
218
+ }
219
+ },
220
+ "scripts": {
221
+ "ci": [
222
+ "@test",
223
+ "@phpcs-all",
224
+ "@composer validate --no-check-all --strict"
225
+ ],
226
+ "cs-fix-all": [
227
+ "php-cs-fixer fix src"
228
+ ],
229
+ "cs-fix": [
230
+ "php-cs-fixer fix"
231
+ ],
232
+ "cs-dry": [
233
+ "php-cs-fixer fix --dry-run --diff"
234
+ ],
235
+ "test": [
236
+ "phpunit tests/"
237
+ ],
238
+ "phpcs": [
239
+ "phpcs --standard=PSR2"
240
+ ],
241
+ "phpcs-all": [
242
+ "phpcs --standard=PSR2 src"
243
+ ],
244
+ "phpcbf": [
245
+ "phpcbf --standard=PSR2"
246
+ ]
247
+ },
248
+ "license": [
249
+ "MIT"
250
+ ],
251
+ "authors": [
252
+ {
253
+ "name": "Bjørn Rosell",
254
+ "homepage": "https://www.bitwise-it.dk/contact",
255
+ "role": "Project Author"
256
+ }
257
+ ],
258
+ "description": "Cloud service for converting JPEG & PNG to WebP",
259
+ "keywords": [
260
+ "cwebp",
261
+ "gd",
262
+ "image conversion",
263
+ "images",
264
+ "imagick",
265
+ "jpg",
266
+ "jpg2webp",
267
+ "png",
268
+ "png2webp",
269
+ "webp"
270
+ ],
271
+ "support": {
272
+ "source": "https://github.com/rosell-dk/webp-convert-cloud-service/tree/1.0.0",
273
+ "issues": "https://github.com/rosell-dk/webp-convert-cloud-service/issues"
274
+ }
275
+ }
276
+ ]
vendor/rosell-dk/dom-util-for-webp/.php_cs.dist ADDED
@@ -0,0 +1,19 @@
1
+ <?php
2
+
3
+ $finder = PhpCsFixer\Finder::create()
4
+ ->exclude('tests')
5
+ ->in(__DIR__)
6
+ ;
7
+
8
+ $config = PhpCsFixer\Config::create();
9
+ $config
10
+ ->setRules([
11
+ '@PSR2' => true,
12
+ 'array_syntax' => [
13
+ 'syntax' => 'short',
14
+ ],
15
+ ])
16
+ ->setFinder($finder)
17
+ ;
18
+
19
+ return $config;
vendor/rosell-dk/dom-util-for-webp/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # dom-util-for-webp
2
+
3
+ [![Build Status](https://travis-ci.org/rosell-dk/dom-util-for-webp.png?branch=master)](https://travis-ci.org/rosell-dk/dom-util-for-webp)
4
+
5
+ *Replace image URLs found in HTML*
6
+
7
+ This library can do two things:
8
+
9
+ 1) Replace image URLs in HTML
10
+ 2) Replace *&lt;img&gt;* tags with *&lt;picture&gt;* tags, adding webp versions to sources
11
+
12
+ To setup with composer, run ```composer require rosell-dk/dom-util-for-webp```.
13
+
14
+ ## 1. Replacing image URLs in HTML
15
+
16
+ The *ImageUrlReplacer::replace($html)* method accepts a piece of HTML and returns HTML where where all image URLs have been replaced - even those in inline styles.
17
+
18
+ *Usage:*
19
+
20
+ ```php
21
+ $modifiedHtml = ImageUrlReplacer::replace($html);
22
+ ```
23
+
24
+ ### Example replacements:
25
+
26
+ *input:*
27
+
28
+ ```html
29
+ <img src="image.jpg">
30
+ <img src="1.jpg" srcset="2.jpg 1000w">
31
+ <picture>
32
+ <source srcset="1.jpg" type="image/webp">
33
+ <source srcset="2.png" type="image/webp">
34
+ <source src="3.gif"> <!-- gifs are skipped in default behaviour -->
35
+ <source src="4.jpg?width=200"> <!-- urls with query string are skipped in default behaviour -->
36
+ </picture>
37
+ <div style="background-image: url('image.jpeg')"></div>
38
+ <style>
39
+ #hero {
40
+ background: lightblue url("image.png") no-repeat fixed center;;
41
+ }
42
+ </style>
43
+ <input type="button" src="1.jpg">
44
+ <img data-src="image.jpg"> <!-- any attribute starting with "data-" are replaced (if it ends with "jpg", "jpeg" or "png"). For lazy-loading -->
45
+ ```
46
+
47
+ *output:*
48
+
49
+ ```html
50
+ <img src="image.jpg.webp">
51
+ <img src="1.jpg.webp" srcset="2.jpg.webp 1000w">
52
+ <picture>
53
+ <source srcset="1.jpg.webp" type="image/webp">
54
+ <source srcset="2.jpg.webp" type="image/webp">
55
+ <source srcset="3.gif"> <!-- gifs are skipped in default behaviour -->
56
+ <source srcset="4.jpg?width=200"> <!-- urls with query string are skipped in default behaviour -->
57
+ </picture>
58
+ <div style="background-image: url('image.jpeg.webp')"></div>
59
+ <style>
60
+ #hero {
61
+ background: lightblue url("image.png.webp") no-repeat fixed center;;
62
+ }
63
+ </style>
64
+ <input type="button" src="1.jpg.webp">
65
+ <img data-src="image.jpg.webp"> <!-- any attribute starting with "data-" are replaced (if it ends with "jpg", "jpeg" or "png"). For lazy-loading -->
66
+ ```
67
+
68
+ Default behaviour of *ImageUrlReplacer::replace*:
69
+ - The modified URL is the same as the original, with ".webp" appended (to change, override the `replaceUrl` function)
70
+ - Only replaces URLs that ends with "png", "jpg" or "jpeg" (no query strings either) (to change, override the `replaceUrl` function)
71
+ - Attribute search/replace limits to these tags: *&lt;img&gt;*, *&lt;source&gt;*, *&lt;input&gt;* and *&lt;iframe&gt;* (to change, override the `$searchInTags` property)
72
+ - Attribute search/replace limits to these attributes: "src", "src-set" and any attribute starting with "data-" (to change, override the `attributeFilter` function)
73
+ - Urls inside styles are replaced too (*background-image* and *background* properties)
74
+
75
+ The behaviour can be modified by extending *ImageUrlReplacer* and overriding public methods such as *replaceUrl*
76
+
77
+ ImageUrlReplacer uses the `Sunra\PhpSimple\HtmlDomParser`[library](https://github.com/sunra/php-simple-html-dom-parser) for parsing and modifying HTML. It wraps [simplehtmldom](http://simplehtmldom.sourceforge.net/). Simplehtmldom supports invalid HTML (it does not touch the invalid parts)
78
+
79
+
80
+ ### Example: Customized behaviour
81
+
82
+ ```php
83
+ class ImageUrlReplacerCustomReplacer extends ImageUrlReplacer
84
+ {
85
+ public function replaceUrl($url) {
86
+ // Only accept urls ending with "png", "jpg", "jpeg" and "gif"
87
+ if (!preg_match('#(png|jpe?g|gif)$#', $url)) {
88
+ return;
89
+ }
90
+
91
+ // Only accept full urls (beginning with http:// or https://)
92
+ if (!preg_match('#^https?://#', $url)) {
93
+ return;
94
+ }
95
+
96
+ // PS: You probably want to filter out external images too...
97
+
98
+ // Simply append ".webp" after current extension.
99
+ // This strategy ensures that "logo.jpg" and "logo.gif" gets counterparts with unique names
100
+ return $url . '.webp';
101
+ }
102
+
103
+ public function attributeFilter($attrName) {
104
+ // Don't allow any "data-" attribute, but limit to attributes that smells like they are used for images
105
+ // The following rule matches all attributes used for lazy loading images that we know of
106
+ return preg_match('#^(src|srcset|(data-[^=]*(lazy|small|slide|img|large|src|thumb|source|set|bg-url)[^=]*))$#i', $attrName);
107
+
108
+ // If you want to limit it further, only allowing attributes known to be used for lazy load,
109
+ // use the following regex instead:
110
+ //return preg_match('#^(src|srcset|data-(src|srcset|cvpsrc|cvpset|thumb|bg-url|large_image|lazyload|source-url|srcsmall|srclarge|srcfull|slide-img|lazy-original))$#i', $attrName);
111
+ }
112
+ }
113
+
114
+ $modifiedHtml = ImageUrlReplacerCustomReplacer::replace($html);
115
+ ```
116
+
117
+
118
+ ## 2. Replacing *&lt;img&gt;* tags with *&lt;picture&gt;* tags
119
+
120
+ The *PictureTags::replace($html)* method accepts a piece of HTML and returns HTML where where all &lt;img&gt; tags have been replaced with &lt;picture&gt; tags, adding webp versions to sources
121
+
122
+ Usage:
123
+
124
+ ```php
125
+ $modifiedHtml = PictureTags::replace($html);
126
+ ```
127
+
128
+ #### Example replacements:
129
+
130
+ *Input:*
131
+ ```html
132
+ <img src="1.png">
133
+ <img srcset="3.jpg 1000w" src="3.jpg">
134
+ <img data-lazy-src="9.jpg" style="border:2px solid red" class="something">
135
+ <figure class="wp-block-image">
136
+ <img src="12.jpg" alt="" class="wp-image-6" srcset="12.jpg 492w, 12-300x265.jpg 300w" sizes="(max-width: 492px) 100vw, 492px">
137
+ </figure>
138
+ ```
139
+
140
+ *Output*:
141
+ ```html
142
+ <picture><source srcset="1.png.webp" type="image/webp"><img src="1.png" class="webpexpress-processed"></picture>
143
+ <picture><source srcset="3.jpg.webp 1000w" type="image/webp"><img srcset="3.jpg 1000w" src="3.jpg" class="webpexpress-processed"></picture>
144
+ <picture><source data-lazy-src="9.jpg.webp" type="image/webp"><img data-lazy-src="9.jpg" style="border:2px solid red" class="something webpexpress-processed"></picture>
145
+ <figure class="wp-block-image">
146
+ <picture><source srcset="12.jpg.webp 492w, 12-300x265.jpg.webp 300w" sizes="(max-width: 492px) 100vw, 492px" type="image/webp"><img src="12.jpg" alt="" class="wp-image-6 webpexpress-processed" srcset="12.jpg 492w, 12-300x265.jpg 300w" sizes="(max-width: 492px) 100vw, 492px"></picture>
147
+ </figure>'
148
+ ```
149
+
150
+ Note that with the picture tags, it is still the img tag that shows the selected image. The picture tag is just a wrapper.
151
+ So it is correct behaviour not to copy the *style*, *width*, *class* or any other attributes to the picture tag. See [issue #9](https://github.com/rosell-dk/dom-util-for-webp/issues/9).
152
+
153
+
154
+ As with `ImageUrlReplacer`, you can override the *replaceUrl* function. There is however currently no other methods to override.
155
+
156
+ `PictureTags` currently uses regular expressions to do the replacing. There are plans to change implementation to use `Sunra\PhpSimple\HtmlDomParser`, like our `ImageUrlReplacer` class does.
vendor/rosell-dk/dom-util-for-webp/composer.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "rosell-dk/dom-util-for-webp",
3
+ "description": "Replace image URLs found in HTML",
4
+ "type": "library",
5
+ "license": "MIT",
6
+ "minimum-stability": "stable",
7
+ "keywords": ["webp", "replace", "images", "html"],
8
+ "scripts": {
9
+ "ci": [
10
+ "@build",
11
+ "@test",
12
+ "@phpcs-all",
13
+ "@composer validate --no-check-all --strict"
14
+ ],
15
+ "cs-fix-all": [
16
+ "php-cs-fixer fix src"
17
+ ],
18
+ "cs-fix": "php-cs-fixer fix",
19
+ "cs-dry": "php-cs-fixer fix --dry-run --diff",
20
+ "test": "phpunit",
21
+ "phpcs": "phpcs --standard=PSR2",
22
+ "phpcs-all": "phpcs --standard=PSR2 --ignore=src/simple_html_dom/simple_html_dom.inc src",
23
+ "phpcbf": "phpcbf --standard=PSR2"
24
+ },
25
+ "extra": {
26
+ "scripts-descriptions": {
27
+ "ci": "Run tests before CI",
28
+ "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'",
29
+ "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'",
30
+ "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard",
31
+ "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.",
32
+ "test": "Launches the preconfigured PHPUnit"
33
+ }
34
+ },
35
+ "autoload": {
36
+ "psr-4": { "DOMUtilForWebP\\": "src/" }
37
+ },
38
+ "autoload-dev": {
39
+ "psr-4": { "DOMUtilForWebPTests\\": "tests/" }
40
+ },
41
+ "authors": [
42
+ {
43
+ "name": "Bjørn Rosell",
44
+ "homepage": "https://www.bitwise-it.dk/contact",
45
+ "role": "Project Author"
46
+ }
47
+ ],
48
+ "require-dev": {
49
+ "friendsofphp/php-cs-fixer": "^2.11",
50
+ "phpunit/phpunit": "5.7.27",
51
+ "squizlabs/php_codesniffer": "3.*"
52
+ },
53
+ "config": {
54
+ "sort-packages": true
55
+ },
56
+ "require": {
57
+ }
58
+ }
vendor/rosell-dk/dom-util-for-webp/phpunit.xml.dist ADDED
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
5
+ backupGlobals="false"
6
+ backupStaticAttributes="false"
7
+ colors="true"
8
+ convertErrorsToExceptions="true"
9
+ convertNoticesToExceptions="true"
10
+ convertWarningsToExceptions="false"
11
+ processIsolation="false"
12
+ stopOnFailure="false"
13
+ bootstrap="vendor/autoload.php"
14
+ >
15
+ <testsuites>
16
+ <testsuite name="Dom util for WebP Test Suite">
17
+ <directory>./tests/</directory>
18
+ </testsuite>
19
+ </testsuites>
20
+
21
+ <filter>
22
+ <whitelist>
23
+ <directory>./</directory>
24
+ <exclude>
25
+ <directory>./vendor</directory>
26
+ <directory>./tests</directory>
27
+ </exclude>
28
+ </whitelist>
29
+ </filter>
30
+ </phpunit>
vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php ADDED
@@ -0,0 +1,212 @@
1
+ <?php
2
+
3
+ namespace DOMUtilForWebP;
4
+
5
+ //use Sunra\PhpSimple\HtmlDomParser;
6
+
7
+ /**
8
+ * Highly configurable class for replacing image URLs in HTML (both src and srcset syntax)
9
+ *
10
+ * Based on http://simplehtmldom.sourceforge.net/ - a library for easily manipulating HTML by means of a DOM.
11
+ * The great thing about this library is that it supports working on invalid HTML and it only applies the changes you
12
+ * make - very gently.
13
+ *
14
+ * TODO: Check out how ewww does it
15
+ *
16
+ * Behaviour can be customized by overriding the public methods (replaceUrl, $searchInTags, etc)
17
+ *
18
+ * Default behaviour:
19
+ * - The modified URL is the same as the original, with ".webp" appended (replaceUrl)
20
+ * - Limits to these tags: <img>, <source>, <input> and <iframe> ($searchInTags)
21
+ * - Limits to these attributes: "src", "src-set" and any attribute starting with "data-" (attributeFilter)
22
+ * - Only replaces URLs that ends with "png", "jpg" or "jpeg" (no query strings either) (replaceUrl)
23
+ *
24
+ *
25
+ */
26
+ class ImageUrlReplacer
27
+ {
28
+
29
+ // define tags to be searched. The div and li are on the list because these are often used with lazy loading
30
+ public static $searchInTags = ['img', 'source', 'input', 'iframe', 'div', 'li'];
31
+
32
+ /**
33
+ *
34
+ * @return webp url or, if URL should not be changed, return nothing
35
+ **/
36
+ public function replaceUrl($url)
37
+ {
38
+ if (!preg_match('#(png|jpe?g)$#', $url)) {
39
+ return;
40
+ }
41
+ return $url . '.webp';
42
+ }
43
+
44
+ public function replaceUrlOr($url, $returnValueIfDenied)
45
+ {
46
+ $url = $this->replaceUrl($url);
47
+ return (isset($url) ? $url : $returnValueIfDenied);
48
+ }
49
+
50
+ /*
51
+ public function isValidUrl($url)
52
+ {
53
+ return preg_match('#(png|jpe?g)$#', $url);
54
+ }*/
55
+
56
+ public function handleSrc($attrValue)
57
+ {
58
+ return $this->replaceUrlOr($attrValue, $attrValue);
59
+ }
60
+
61
+ public function handleSrcSet($attrValue)
62
+ {
63
+ // $attrValue is ie: <img data-x="1.jpg 1000w, 2.jpg">
64
+ $srcsetArr = explode(',', $attrValue);
65
+ foreach ($srcsetArr as $i => $srcSetEntry) {
66
+ // $srcSetEntry is ie "image.jpg 520w", but can also lack width, ie just "image.jpg"
67
+ // it can also be ie "image.jpg 2x"
68
+ $srcSetEntry = trim($srcSetEntry);
69
+ $entryParts = preg_split('/\s+/', $srcSetEntry, 2);
70
+ if (count($entryParts) == 2) {
71
+ list($src, $descriptors) = $entryParts;
72
+ } else {
73
+ $src = $srcSetEntry;
74
+ $descriptors = null;
75
+ }
76
+
77
+ $webpUrl = $this->replaceUrlOr($src, false);
78
+ if ($webpUrl !== false) {
79
+ $srcsetArr[$i] = $webpUrl . (isset($descriptors) ? ' ' . $descriptors : '');
80
+ }
81
+ }
82
+ return implode(', ', $srcsetArr);
83
+ }
84
+
85
+ /**
86
+ * Test if attribute value looks like it has srcset syntax.
87
+ * "image.jpg 100w" does for example. And "image.jpg 1x". Also "image1.jpg, image2.jpg 1x"
88