Lazy Load by WP Rocket - Version 2.3.3

Version Description

Enhancement: Add data-skip-lazy and skip-lazy class to exclusions list as part of the interoperability initiative between lazyload plugins Enhancement: Use native lazyload only if filter rocket_use_native_lazyload is true Enhancement: Apply lazyload on background images set on figure elements Bugfix: Correctly add the rocket-lazyload class when class attribute is empty on an element with a background image Bugfix: Correctly replace YouTube iframe with preview image when using relative protocol Bugfix: Preserve youtube-nocookie.com during LazyLoad

Download this release

Release Info

Developer wp_media
Plugin Icon 128x128 Lazy Load by WP Rocket
Version 2.3.3
Comparing to
See all releases

Code changes from version 2.3.2 to 2.3.3

Files changed (81) hide show
  1. composer.json +74 -74
  2. composer.lock +0 -2695
  3. main.php +4 -6
  4. phpcs.xml +0 -30
  5. readme.txt +322 -307
  6. rocket-lazy-load.php +78 -78
  7. src/Admin/AdminPage.php +176 -176
  8. src/Admin/ImagifyNotice.php +72 -72
  9. src/Dependencies/Interop/Container/ContainerInterface.php +15 -15
  10. src/Dependencies/Interop/Container/Exception/ContainerException.php +15 -15
  11. src/Dependencies/Interop/Container/Exception/NotFoundException.php +15 -15
  12. src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php +26 -26
  13. src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php +82 -82
  14. src/Dependencies/League/Container/Argument/RawArgument.php +27 -27
  15. src/Dependencies/League/Container/Argument/RawArgumentInterface.php +13 -13
  16. src/Dependencies/League/Container/Container.php +305 -305
  17. src/Dependencies/League/Container/ContainerAwareInterface.php +20 -20
  18. src/Dependencies/League/Container/ContainerAwareTrait.php +34 -34
  19. src/Dependencies/League/Container/ContainerInterface.php +59 -59
  20. src/Dependencies/League/Container/Definition/AbstractDefinition.php +62 -62
  21. src/Dependencies/League/Container/Definition/CallableDefinition.php +23 -23
  22. src/Dependencies/League/Container/Definition/ClassDefinition.php +67 -67
  23. src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php +23 -23
  24. src/Dependencies/League/Container/Definition/DefinitionFactory.php +28 -28
  25. src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php +17 -17
  26. src/Dependencies/League/Container/Definition/DefinitionInterface.php +30 -30
  27. src/Dependencies/League/Container/Exception/NotFoundException.php +10 -10
  28. src/Dependencies/League/Container/ImmutableContainerAwareInterface.php +22 -22
  29. src/Dependencies/League/Container/ImmutableContainerAwareTrait.php +36 -36
  30. src/Dependencies/League/Container/ImmutableContainerInterface.php +10 -10
  31. src/Dependencies/League/Container/Inflector/Inflector.php +103 -103
  32. src/Dependencies/League/Container/Inflector/InflectorAggregate.php +53 -53
  33. src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php +25 -25
  34. src/Dependencies/League/Container/ReflectionContainer.php +87 -87
  35. src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php +27 -27
  36. src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php +31 -31
  37. src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php +14 -14
  38. src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php +88 -88
  39. src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php +32 -32
  40. src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php +26 -26
  41. src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php +24 -24
  42. src/Dependencies/Psr/Container/ContainerExceptionInterface.php +13 -13
  43. src/Dependencies/Psr/Container/ContainerInterface.php +37 -37
  44. src/Dependencies/Psr/Container/NotFoundExceptionInterface.php +13 -13
  45. src/Dependencies/RocketLazyload/Assets.php +290 -299
  46. src/Dependencies/RocketLazyload/Iframe.php +232 -202
  47. src/Dependencies/RocketLazyload/Image.php +465 -474
  48. src/EventManagement/EventManager.php +145 -145
  49. src/EventManagement/EventManagerAwareSubscriberInterface.php +21 -21
  50. src/EventManagement/SubscriberInterface.php +39 -39
  51. src/Options/AbstractOptions.php +69 -69
  52. src/Options/OptionArray.php +111 -111
  53. src/Options/Options.php +106 -106
  54. src/Plugin.php +96 -97
  55. src/ServiceProvider/AdminServiceProvider.php +47 -47
  56. src/ServiceProvider/ImagifyNoticeServiceProvider.php +45 -45
  57. src/ServiceProvider/LazyloadServiceProvider.php +48 -48
  58. src/ServiceProvider/OptionServiceProvider.php +45 -45
  59. src/ServiceProvider/SubscribersServiceProvider.php +60 -60
  60. src/Subscriber/AdminPageSubscriber.php +131 -142
  61. src/Subscriber/ImagifyNoticeSubscriber.php +152 -152
  62. src/Subscriber/LazyloadSubscriber.php +432 -429
  63. src/Subscriber/ThirdParty/AMPSubscriber.php +74 -73
  64. src/rocket-lazyload-requirements-check.php +143 -143
  65. vendor/autoload.php +1 -1
  66. vendor/composer/autoload_classmap.php +192 -0
  67. vendor/composer/autoload_real.php +4 -4
  68. vendor/composer/autoload_static.php +199 -3
  69. vendor/composer/installed.json +22 -16
  70. vendor/composer/installers/composer.json +9 -4
  71. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +1 -0
  72. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +9 -19
  73. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +3 -1
  74. vendor/composer/installers/src/Composer/Installers/Installer.php +2 -0
  75. vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php +23 -0
  76. vendor/composer/installers/src/Composer/Installers/Plugin.php +12 -2
  77. vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php +9 -0
  78. vendor/wp-media/rocket-lazyload-common/composer.lock +74 -70
  79. vendor/wp-media/rocket-lazyload-common/src/Assets.php +210 -219
  80. vendor/wp-media/rocket-lazyload-common/src/Iframe.php +219 -189
  81. vendor/wp-media/rocket-lazyload-common/src/Image.php +452 -461
composer.json CHANGED
@@ -1,74 +1,74 @@
1
- {
2
- "name": "wp-media/rocket-lazy-load",
3
- "description": "Lazy Load images and iframes without jQuery",
4
- "keywords": [
5
- "wordpress",
6
- "lazyload"
7
- ],
8
- "homepage": "https://github.com/wp-media/rocket-lazy-load",
9
- "license": "GPL-2.0+",
10
- "authors": [
11
- {
12
- "name": "WP Media",
13
- "email": "contact@wp-media.me",
14
- "homepage": "https://wp-media.me"
15
- }
16
- ],
17
- "type": "wordpress-plugin",
18
- "config": {
19
- "sort-packages": true
20
- },
21
- "support": {
22
- "issues": "https://github.com/wp-media/rocket-lazy-load/issues",
23
- "source": "https://github.com/wp-media/rocket-lazy-load"
24
- },
25
- "autoload": {
26
- "psr-4": {
27
- "RocketLazyLoadPlugin\\": "src/"
28
- }
29
- },
30
- "autoload-dev": {
31
- "psr-4": {
32
- "RocketLazyLoadPlugin\\Tests\\Unit\\": "tests/Unit",
33
- "RocketLazyLoadPlugin\\Tests\\Integration\\": "tests/Integration"
34
- }
35
- },
36
- "require": {
37
- "php": ">=5.6",
38
- "composer/installers": "~1.0",
39
- "league/container": "^2.4",
40
- "wp-media/rocket-lazyload-common": "^2.0"
41
- },
42
- "require-dev": {
43
- "brain/monkey": "^2.0",
44
- "coenjacobs/mozart": "^0.4.0",
45
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
46
- "phpcompatibility/phpcompatibility-wp": "^2.0",
47
- "phpunit/phpunit": "^5.7",
48
- "wp-coding-standards/wpcs": "^2.0.0"
49
- },
50
- "extra": {
51
- "mozart": {
52
- "dep_namespace": "RocketLazyLoadPlugin\\Dependencies\\",
53
- "dep_directory": "/src/Dependencies/",
54
- "classmap_directory": "/classes/dependencies/",
55
- "classmap_prefix": "RLLP_",
56
- "packages": [
57
- "wp-media/rocket-lazyload-common",
58
- "league/container"
59
- ]
60
- }
61
- },
62
- "scripts": {
63
- "test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always",
64
- "test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist",
65
- "post-install-cmd": [
66
- "\"vendor/bin/mozart\" compose",
67
- "composer dump-autoload"
68
- ],
69
- "post-update-cmd": [
70
- "\"vendor/bin/mozart\" compose",
71
- "composer dump-autoload"
72
- ]
73
- }
74
- }
1
+ {
2
+ "name": "wp-media/rocket-lazy-load",
3
+ "description": "Lazy Load images and iframes without jQuery",
4
+ "keywords": [
5
+ "wordpress",
6
+ "lazyload"
7
+ ],
8
+ "homepage": "https://github.com/wp-media/rocket-lazy-load",
9
+ "license": "GPL-2.0+",
10
+ "authors": [
11
+ {
12
+ "name": "WP Media",
13
+ "email": "contact@wp-media.me",
14
+ "homepage": "https://wp-media.me"
15
+ }
16
+ ],
17
+ "type": "wordpress-plugin",
18
+ "config": {
19
+ "sort-packages": true
20
+ },
21
+ "support": {
22
+ "issues": "https://github.com/wp-media/rocket-lazy-load/issues",
23
+ "source": "https://github.com/wp-media/rocket-lazy-load"
24
+ },
25
+ "autoload": {
26
+ "psr-4": {
27
+ "RocketLazyLoadPlugin\\": "src/"
28
+ }
29
+ },
30
+ "autoload-dev": {
31
+ "psr-4": {
32
+ "RocketLazyLoadPlugin\\Tests\\Unit\\": "tests/Unit",
33
+ "RocketLazyLoadPlugin\\Tests\\Integration\\": "tests/Integration"
34
+ }
35
+ },
36
+ "require": {
37
+ "php": ">=5.6",
38
+ "composer/installers": "~1.0",
39
+ "league/container": "^2.4",
40
+ "wp-media/rocket-lazyload-common": "^2.0"
41
+ },
42
+ "require-dev": {
43
+ "brain/monkey": "^2.0",
44
+ "coenjacobs/mozart": "^0.4.0",
45
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
46
+ "phpcompatibility/phpcompatibility-wp": "^2.0",
47
+ "phpunit/phpunit": "^5.7",
48
+ "wp-coding-standards/wpcs": "^2.0.0"
49
+ },
50
+ "extra": {
51
+ "mozart": {
52
+ "dep_namespace": "RocketLazyLoadPlugin\\Dependencies\\",
53
+ "dep_directory": "/src/Dependencies/",
54
+ "classmap_directory": "/classes/dependencies/",
55
+ "classmap_prefix": "RLLP_",
56
+ "packages": [
57
+ "wp-media/rocket-lazyload-common",
58
+ "league/container"
59
+ ]
60
+ }
61
+ },
62
+ "scripts": {
63
+ "test-unit":"\"vendor/bin/phpunit\" --testsuite unit --colors=always",
64
+ "test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist",
65
+ "post-install-cmd": [
66
+ "\"vendor/bin/mozart\" compose",
67
+ "composer dump-autoload"
68
+ ],
69
+ "post-update-cmd": [
70
+ "\"vendor/bin/mozart\" compose",
71
+ "composer dump-autoload"
72
+ ]
73
+ }
74
+ }
composer.lock DELETED
@@ -1,2695 +0,0 @@
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": "ad8bf18ef0f69ab2d4fbfa356dcb019f",
8
- "packages": [
9
- {
10
- "name": "composer/installers",
11
- "version": "v1.7.0",
12
- "source": {
13
- "type": "git",
14
- "url": "https://github.com/composer/installers.git",
15
- "reference": "141b272484481432cda342727a427dc1e206bfa0"
16
- },
17
- "dist": {
18
- "type": "zip",
19
- "url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
20
- "reference": "141b272484481432cda342727a427dc1e206bfa0",
21
- "shasum": ""
22
- },
23
- "require": {
24
- "composer-plugin-api": "^1.0"
25
- },
26
- "replace": {
27
- "roundcube/plugin-installer": "*",
28
- "shama/baton": "*"
29
- },
30
- "require-dev": {
31
- "composer/composer": "1.0.*@dev",
32
- "phpunit/phpunit": "^4.8.36"
33
- },
34
- "type": "composer-plugin",
35
- "extra": {
36
- "class": "Composer\\Installers\\Plugin",
37
- "branch-alias": {
38
- "dev-master": "1.0-dev"
39
- }
40
- },
41
- "autoload": {
42
- "psr-4": {
43
- "Composer\\Installers\\": "src/Composer/Installers"
44
- }
45
- },
46
- "notification-url": "https://packagist.org/downloads/",
47
- "license": [
48
- "MIT"
49
- ],
50
- "authors": [
51
- {
52
- "name": "Kyle Robinson Young",
53
- "email": "kyle@dontkry.com",
54
- "homepage": "https://github.com/shama"
55
- }
56
- ],
57
- "description": "A multi-framework Composer library installer",
58
- "homepage": "https://composer.github.io/installers/",
59
- "keywords": [
60
- "Craft",
61
- "Dolibarr",
62
- "Eliasis",
63
- "Hurad",
64
- "ImageCMS",
65
- "Kanboard",
66
- "Lan Management System",
67
- "MODX Evo",
68
- "Mautic",
69
- "Maya",
70
- "OXID",
71
- "Plentymarkets",
72
- "Porto",
73
- "RadPHP",
74
- "SMF",
75
- "Thelia",
76
- "Whmcs",
77
- "WolfCMS",
78
- "agl",
79
- "aimeos",
80
- "annotatecms",
81
- "attogram",
82
- "bitrix",
83
- "cakephp",
84
- "chef",
85
- "cockpit",
86
- "codeigniter",
87
- "concrete5",
88
- "croogo",
89
- "dokuwiki",
90
- "drupal",
91
- "eZ Platform",
92
- "elgg",
93
- "expressionengine",
94
- "fuelphp",
95
- "grav",
96
- "installer",
97
- "itop",
98
- "joomla",
99
- "known",
100
- "kohana",
101
- "laravel",
102
- "lavalite",
103
- "lithium",
104
- "magento",
105
- "majima",
106
- "mako",
107
- "mediawiki",
108
- "modulework",
109
- "modx",
110
- "moodle",
111
- "osclass",
112
- "phpbb",
113
- "piwik",
114
- "ppi",
115
- "puppet",
116
- "pxcms",
117
- "reindex",
118
- "roundcube",
119
- "shopware",
120
- "silverstripe",
121
- "sydes",
122
- "symfony",
123
- "typo3",
124
- "wordpress",
125
- "yawik",
126
- "zend",
127
- "zikula"
128
- ],
129
- "time": "2019-08-12T15:00:31+00:00"
130
- },
131
- {
132
- "name": "container-interop/container-interop",
133
- "version": "1.2.0",
134
- "source": {
135
- "type": "git",
136
- "url": "https://github.com/container-interop/container-interop.git",
137
- "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
138
- },
139
- "dist": {
140
- "type": "zip",
141
- "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
142
- "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
143
- "shasum": ""
144
- },
145
- "require": {
146
- "psr/container": "^1.0"
147
- },
148
- "type": "library",
149
- "autoload": {
150
- "psr-4": {
151
- "Interop\\Container\\": "src/Interop/Container/"
152
- }
153
- },
154
- "notification-url": "https://packagist.org/downloads/",
155
- "license": [
156
- "MIT"
157
- ],
158
- "description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
159
- "homepage": "https://github.com/container-interop/container-interop",
160
- "time": "2017-02-14T19:40:03+00:00"
161
- },
162
- {
163
- "name": "league/container",
164
- "version": "2.4.1",
165
- "source": {
166
- "type": "git",
167
- "url": "https://github.com/thephpleague/container.git",
168
- "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0"
169
- },
170
- "dist": {
171
- "type": "zip",
172
- "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0",
173
- "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0",
174
- "shasum": ""
175
- },
176
- "require": {
177
- "container-interop/container-interop": "^1.2",
178
- "php": "^5.4.0 || ^7.0"
179
- },
180
- "provide": {
181
- "container-interop/container-interop-implementation": "^1.2",
182
- "psr/container-implementation": "^1.0"
183
- },
184
- "replace": {
185
- "orno/di": "~2.0"
186
- },
187
- "require-dev": {
188
- "phpunit/phpunit": "4.*"
189
- },
190
- "type": "library",
191
- "extra": {
192
- "branch-alias": {
193
- "dev-2.x": "2.x-dev",
194
- "dev-1.x": "1.x-dev"
195
- }
196
- },
197
- "autoload": {
198
- "psr-4": {
199
- "League\\Container\\": "src"
200
- }
201
- },
202
- "notification-url": "https://packagist.org/downloads/",
203
- "license": [
204
- "MIT"
205
- ],
206
- "authors": [
207
- {
208
- "name": "Phil Bennett",
209
- "email": "philipobenito@gmail.com",
210
- "homepage": "http://www.philipobenito.com",
211
- "role": "Developer"
212
- }
213
- ],
214
- "description": "A fast and intuitive dependency injection container.",
215
- "homepage": "https://github.com/thephpleague/container",
216
- "keywords": [
217
- "container",
218
- "dependency",
219
- "di",
220
- "injection",
221
- "league",
222
- "provider",
223
- "service"
224
- ],
225
- "time": "2017-05-10T09:20:27+00:00"
226
- },
227
- {
228
- "name": "psr/container",
229
- "version": "1.0.0",
230
- "source": {
231
- "type": "git",
232
- "url": "https://github.com/php-fig/container.git",
233
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
234
- },
235
- "dist": {
236
- "type": "zip",
237
- "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
238
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
239
- "shasum": ""
240
- },
241
- "require": {
242
- "php": ">=5.3.0"
243
- },
244
- "type": "library",
245
- "extra": {
246
- "branch-alias": {
247
- "dev-master": "1.0.x-dev"
248
- }
249
- },
250
- "autoload": {
251
- "psr-4": {
252
- "Psr\\Container\\": "src/"
253
- }
254
- },
255
- "notification-url": "https://packagist.org/downloads/",
256
- "license": [
257
- "MIT"
258
- ],
259
- "authors": [
260
- {
261
- "name": "PHP-FIG",
262
- "homepage": "http://www.php-fig.org/"
263
- }
264
- ],
265
- "description": "Common Container Interface (PHP FIG PSR-11)",
266
- "homepage": "https://github.com/php-fig/container",
267
- "keywords": [
268
- "PSR-11",
269
- "container",
270
- "container-interface",
271
- "container-interop",
272
- "psr"
273
- ],
274
- "time": "2017-02-14T16:28:37+00:00"
275
- },
276
- {
277
- "name": "wp-media/rocket-lazyload-common",
278
- "version": "v2.5.2",
279
- "source": {
280
- "type": "git",
281
- "url": "https://github.com/wp-media/rocket-lazyload-common.git",
282
- "reference": "37ca967029f6f86a207a9ae128c9e96bc95219d7"
283
- },
284
- "dist": {
285
- "type": "zip",
286
- "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/37ca967029f6f86a207a9ae128c9e96bc95219d7",
287
- "reference": "37ca967029f6f86a207a9ae128c9e96bc95219d7",
288
- "shasum": ""
289
- },
290
- "require": {
291
- "php": ">=5.6"
292
- },
293
- "require-dev": {
294
- "brain/monkey": "^2.0",
295
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
296
- "doctrine/instantiator": "1.0.*",
297
- "myclabs/deep-copy": "1.6.*",
298
- "phpcompatibility/phpcompatibility-wp": "^2.0",
299
- "phpdocumentor/reflection-docblock": "^3.3",
300
- "phpunit/php-token-stream": "^1.4",
301
- "phpunit/phpunit": "^5.7",
302
- "symfony/yaml": "2.8.*",
303
- "wp-coding-standards/wpcs": "^2.0.0"
304
- },
305
- "type": "library",
306
- "autoload": {
307
- "psr-4": {
308
- "RocketLazyload\\": "src"
309
- }
310
- },
311
- "notification-url": "https://packagist.org/downloads/",
312
- "license": [
313
- "GPL-3.0-or-later"
314
- ],
315
- "authors": [
316
- {
317
- "name": "WP Media",
318
- "email": "contact@wp-media.me"
319
- }
320
- ],
321
- "description": "Common Code between WP Rocket and Lazyload by WP Rocket",
322
- "time": "2019-09-07T12:37:44+00:00"
323
- }
324
- ],
325
- "packages-dev": [
326
- {
327
- "name": "antecedent/patchwork",
328
- "version": "2.1.9",
329
- "source": {
330
- "type": "git",
331
- "url": "https://github.com/antecedent/patchwork.git",
332
- "reference": "1229bb22283177e196b572120de0772d9ee9baac"
333
- },
334
- "dist": {
335
- "type": "zip",
336
- "url": "https://api.github.com/repos/antecedent/patchwork/zipball/1229bb22283177e196b572120de0772d9ee9baac",
337
- "reference": "1229bb22283177e196b572120de0772d9ee9baac",
338
- "shasum": ""
339
- },
340
- "require": {
341
- "php": ">=5.4.0"
342
- },
343
- "type": "library",
344
- "notification-url": "https://packagist.org/downloads/",
345
- "license": [
346
- "MIT"
347
- ],
348
- "authors": [
349
- {
350
- "name": "Ignas Rudaitis",
351
- "email": "ignas.rudaitis@gmail.com"
352
- }
353
- ],
354
- "description": "Method redefinition (monkey-patching) functionality for PHP.",
355
- "homepage": "http://patchwork2.org/",
356
- "keywords": [
357
- "aop",
358
- "aspect",
359
- "interception",
360
- "monkeypatching",
361
- "redefinition",
362
- "runkit",
363
- "testing"
364
- ],
365
- "time": "2019-08-18T15:18:18+00:00"
366
- },
367
- {
368
- "name": "brain/monkey",
369
- "version": "2.3.1",
370
- "source": {
371
- "type": "git",
372
- "url": "https://github.com/Brain-WP/BrainMonkey.git",
373
- "reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776"
374
- },
375
- "dist": {
376
- "type": "zip",
377
- "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
378
- "reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
379
- "shasum": ""
380
- },
381
- "require": {
382
- "antecedent/patchwork": "^2.0",
383
- "mockery/mockery": ">=0.9 <2",
384
- "php": ">=5.6.0"
385
- },
386
- "require-dev": {
387
- "phpunit/phpunit": "~5.7.9"
388
- },
389
- "type": "library",
390
- "extra": {
391
- "branch-alias": {
392
- "dev-version/1": "1.x-dev",
393
- "dev-master": "2.0.x-dev"
394
- }
395
- },
396
- "autoload": {
397
- "psr-4": {
398
- "Brain\\Monkey\\": "src/"
399
- },
400
- "files": [
401
- "inc/api.php"
402
- ]
403
- },
404
- "notification-url": "https://packagist.org/downloads/",
405
- "license": [
406
- "MIT"
407
- ],
408
- "authors": [
409
- {
410
- "name": "Giuseppe Mazzapica",
411
- "role": "Developer",
412
- "email": "giuseppe.mazzapica@gmail.com",
413
- "homepage": "https://gmazzap.me"
414
- }
415
- ],
416
- "description": "Mocking utility for PHP functions and WordPress plugin API",
417
- "keywords": [
418
- "Monkey Patching",
419
- "interception",
420
- "mock",
421
- "mock functions",
422
- "mockery",
423
- "patchwork",
424
- "redefinition",
425
- "runkit",
426
- "test",
427
- "testing"
428
- ],
429
- "time": "2019-07-26T19:00:28+00:00"
430
- },
431
- {
432
- "name": "coenjacobs/mozart",
433
- "version": "0.4.0",
434
- "source": {
435
- "type": "git",
436
- "url": "https://github.com/coenjacobs/mozart.git",
437
- "reference": "2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5"
438
- },
439
- "dist": {
440
- "type": "zip",
441
- "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5",
442
- "reference": "2b31a5edf3a4d822e5b23cffd1e2e44875b1f0a5",
443
- "shasum": ""
444
- },
445
- "require": {
446
- "league/flysystem": "^1.0",
447
- "php": "^7.1",
448
- "symfony/console": "^4",
449
- "symfony/finder": "^4"
450
- },
451
- "require-dev": {
452
- "coenjacobs/php-composter-phpcs": "^0.1.0",
453
- "phpunit/phpunit": "^7.5"
454
- },
455
- "bin": [
456
- "bin/mozart"
457
- ],
458
- "type": "library",
459
- "autoload": {
460
- "psr-4": {
461
- "CoenJacobs\\Mozart\\": "src/"
462
- }
463
- },
464
- "notification-url": "https://packagist.org/downloads/",
465
- "license": [
466
- "MIT"
467
- ],
468
- "authors": [
469
- {
470
- "name": "Coen Jacobs",
471
- "email": "coenjacobs@gmail.com"
472
- }
473
- ],
474
- "description": "Composes all dependencies as a package inside a WordPress plugin",
475
- "time": "2019-06-27T09:52:52+00:00"
476
- },
477
- {
478
- "name": "dealerdirect/phpcodesniffer-composer-installer",
479
- "version": "v0.5.0",
480
- "source": {
481
- "type": "git",
482
- "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
483
- "reference": "e749410375ff6fb7a040a68878c656c2e610b132"
484
- },
485
- "dist": {
486
- "type": "zip",
487
- "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132",
488
- "reference": "e749410375ff6fb7a040a68878c656c2e610b132",
489
- "shasum": ""
490
- },
491
- "require": {
492
- "composer-plugin-api": "^1.0",
493
- "php": "^5.3|^7",
494
- "squizlabs/php_codesniffer": "^2|^3"
495
- },
496
- "require-dev": {
497
- "composer/composer": "*",
498
- "phpcompatibility/php-compatibility": "^9.0",
499
- "sensiolabs/security-checker": "^4.1.0"
500
- },
501
- "type": "composer-plugin",
502
- "extra": {
503
- "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
504
- },
505
- "autoload": {
506
- "psr-4": {
507
- "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
508
- }
509
- },
510
- "notification-url": "https://packagist.org/downloads/",
511
- "license": [
512
- "MIT"
513
- ],
514
- "authors": [
515
- {
516
- "name": "Franck Nijhof",
517
- "email": "franck.nijhof@dealerdirect.com",
518
- "homepage": "http://www.frenck.nl",
519
- "role": "Developer / IT Manager"
520
- }
521
- ],
522
- "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
523
- "homepage": "http://www.dealerdirect.com",
524
- "keywords": [
525
- "PHPCodeSniffer",
526
- "PHP_CodeSniffer",
527
- "code quality",
528
- "codesniffer",
529
- "composer",
530
- "installer",
531
- "phpcs",
532
- "plugin",
533
- "qa",
534
- "quality",
535
- "standard",
536
- "standards",
537
- "style guide",
538
- "stylecheck",
539
- "tests"
540
- ],
541
- "time": "2018-10-26T13:21:45+00:00"
542
- },
543
- {
544
- "name": "doctrine/instantiator",
545
- "version": "1.2.0",
546
- "source": {
547
- "type": "git",
548
- "url": "https://github.com/doctrine/instantiator.git",
549
- "reference": "a2c590166b2133a4633738648b6b064edae0814a"
550
- },
551
- "dist": {
552
- "type": "zip",
553
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
554
- "reference": "a2c590166b2133a4633738648b6b064edae0814a",
555
- "shasum": ""
556
- },
557
- "require": {
558
- "php": "^7.1"
559
- },
560
- "require-dev": {
561
- "doctrine/coding-standard": "^6.0",
562
- "ext-pdo": "*",
563
- "ext-phar": "*",
564
- "phpbench/phpbench": "^0.13",
565
- "phpstan/phpstan-phpunit": "^0.11",
566
- "phpstan/phpstan-shim": "^0.11",
567
- "phpunit/phpunit": "^7.0"
568
- },
569
- "type": "library",
570
- "extra": {
571
- "branch-alias": {
572
- "dev-master": "1.2.x-dev"
573
- }
574
- },
575
- "autoload": {
576
- "psr-4": {
577
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
578
- }
579
- },
580
- "notification-url": "https://packagist.org/downloads/",
581
- "license": [
582
- "MIT"
583
- ],
584
- "authors": [
585
- {
586
- "name": "Marco Pivetta",
587
- "email": "ocramius@gmail.com",
588
- "homepage": "http://ocramius.github.com/"
589
- }
590
- ],
591
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
592
- "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
593
- "keywords": [
594
- "constructor",
595
- "instantiate"
596
- ],
597
- "time": "2019-03-17T17:37:11+00:00"
598
- },
599
- {
600
- "name": "hamcrest/hamcrest-php",
601
- "version": "v2.0.0",
602
- "source": {
603
- "type": "git",
604
- "url": "https://github.com/hamcrest/hamcrest-php.git",
605
- "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad"
606
- },
607
- "dist": {
608
- "type": "zip",
609
- "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad",
610
- "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad",
611
- "shasum": ""
612
- },
613
- "require": {
614
- "php": "^5.3|^7.0"
615
- },
616
- "replace": {
617
- "cordoval/hamcrest-php": "*",
618
- "davedevelopment/hamcrest-php": "*",
619
- "kodova/hamcrest-php": "*"
620
- },
621
- "require-dev": {
622
- "phpunit/php-file-iterator": "1.3.3",
623
- "phpunit/phpunit": "~4.0",
624
- "satooshi/php-coveralls": "^1.0"
625
- },
626
- "type": "library",
627
- "extra": {
628
- "branch-alias": {
629
- "dev-master": "2.0-dev"
630
- }
631
- },
632
- "autoload": {
633
- "classmap": [
634
- "hamcrest"
635
- ]
636
- },
637
- "notification-url": "https://packagist.org/downloads/",
638
- "license": [
639
- "BSD"
640
- ],
641
- "description": "This is the PHP port of Hamcrest Matchers",
642
- "keywords": [
643
- "test"
644
- ],
645
- "time": "2016-01-20T08:20:44+00:00"
646
- },
647
- {
648
- "name": "league/flysystem",
649
- "version": "1.0.46",
650
- "source": {
651
- "type": "git",
652
- "url": "https://github.com/thephpleague/flysystem.git",
653
- "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2"
654
- },
655
- "dist": {
656
- "type": "zip",
657
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
658
- "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
659
- "shasum": ""
660
- },
661
- "require": {
662
- "php": ">=5.5.9"
663
- },
664
- "conflict": {
665
- "league/flysystem-sftp": "<1.0.6"
666
- },
667
- "require-dev": {
668
- "ext-fileinfo": "*",
669
- "phpspec/phpspec": "^3.4",
670
- "phpunit/phpunit": "^5.7.10"
671
- },
672
- "suggest": {
673
- "ext-fileinfo": "Required for MimeType",
674
- "ext-ftp": "Allows you to use FTP server storage",
675
- "ext-openssl": "Allows you to use FTPS server storage",
676
- "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
677
- "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
678
- "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
679
- "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
680
- "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
681
- "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
682
- "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
683
- "league/flysystem-webdav": "Allows you to use WebDAV storage",
684
- "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
685
- "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
686
- "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
687
- },
688
- "type": "library",
689
- "extra": {
690
- "branch-alias": {
691
- "dev-master": "1.1-dev"
692
- }
693
- },
694
- "autoload": {
695
- "psr-4": {
696
- "League\\Flysystem\\": "src/"
697
- }
698
- },
699
- "notification-url": "https://packagist.org/downloads/",
700
- "license": [
701
- "MIT"
702
- ],
703
- "authors": [
704
- {
705
- "name": "Frank de Jonge",
706
- "email": "info@frenky.net"
707
- }
708
- ],
709
- "description": "Filesystem abstraction: Many filesystems, one API.",
710
- "keywords": [
711
- "Cloud Files",
712
- "WebDAV",
713
- "abstraction",
714
- "aws",
715
- "cloud",
716
- "copy.com",
717
- "dropbox",
718
- "file systems",
719
- "files",
720
- "filesystem",
721
- "filesystems",
722
- "ftp",
723
- "rackspace",
724
- "remote",
725
- "s3",
726
- "sftp",
727
- "storage"
728
- ],
729
- "time": "2018-08-22T07:45:22+00:00"
730
- },
731
- {
732
- "name": "mockery/mockery",
733
- "version": "1.2.3",
734
- "source": {
735
- "type": "git",
736
- "url": "https://github.com/mockery/mockery.git",
737
- "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031"
738
- },
739
- "dist": {
740
- "type": "zip",
741
- "url": "https://api.github.com/repos/mockery/mockery/zipball/4eff936d83eb809bde2c57a3cea0ee9643769031",
742
- "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031",
743
- "shasum": ""
744
- },
745
- "require": {
746
- "hamcrest/hamcrest-php": "~2.0",
747
- "lib-pcre": ">=7.0",
748
- "php": ">=5.6.0"
749
- },
750
- "require-dev": {
751
- "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0"
752
- },
753
- "type": "library",
754
- "extra": {
755
- "branch-alias": {
756
- "dev-master": "1.0.x-dev"
757
- }
758
- },
759
- "autoload": {
760
- "psr-0": {
761
- "Mockery": "library/"
762
- }
763
- },
764
- "notification-url": "https://packagist.org/downloads/",
765
- "license": [
766
- "BSD-3-Clause"
767
- ],
768
- "authors": [
769
- {
770
- "name": "Pádraic Brady",
771
- "email": "padraic.brady@gmail.com",
772
- "homepage": "http://blog.astrumfutura.com"
773
- },
774
- {
775
- "name": "Dave Marshall",
776
- "email": "dave.marshall@atstsolutions.co.uk",
777
- "homepage": "http://davedevelopment.co.uk"
778
- }
779
- ],
780
- "description": "Mockery is a simple yet flexible PHP mock object framework",
781
- "homepage": "https://github.com/mockery/mockery",
782
- "keywords": [
783
- "BDD",
784
- "TDD",
785
- "library",
786
- "mock",
787
- "mock objects",
788
- "mockery",
789
- "stub",
790
- "test",
791
- "test double",
792
- "testing"
793
- ],
794
- "time": "2019-08-07T15:01:07+00:00"
795
- },
796
- {
797
- "name": "myclabs/deep-copy",
798
- "version": "1.9.3",
799
- "source": {
800
- "type": "git",
801
- "url": "https://github.com/myclabs/DeepCopy.git",
802
- "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea"
803
- },
804
- "dist": {
805
- "type": "zip",
806
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea",
807
- "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea",
808
- "shasum": ""
809
- },
810
- "require": {
811
- "php": "^7.1"
812
- },
813
- "replace": {
814
- "myclabs/deep-copy": "self.version"
815
- },
816
- "require-dev": {
817
- "doctrine/collections": "^1.0",
818
- "doctrine/common": "^2.6",
819
- "phpunit/phpunit": "^7.1"
820
- },
821
- "type": "library",
822
- "autoload": {
823
- "psr-4": {
824
- "DeepCopy\\": "src/DeepCopy/"
825
- },
826
- "files": [
827
- "src/DeepCopy/deep_copy.php"
828
- ]
829
- },
830
- "notification-url": "https://packagist.org/downloads/",
831
- "license": [
832
- "MIT"
833
- ],
834
- "description": "Create deep copies (clones) of your objects",
835
- "keywords": [
836
- "clone",
837
- "copy",
838
- "duplicate",
839
- "object",
840
- "object graph"
841
- ],
842
- "time": "2019-08-09T12:45:53+00:00"
843
- },
844
- {
845
- "name": "phpcompatibility/php-compatibility",
846
- "version": "9.3.1",
847
- "source": {
848
- "type": "git",
849
- "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
850
- "reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196"
851
- },
852
- "dist": {
853
- "type": "zip",
854
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9999344e47e7af6b00e1a898eacc4e4368fb7196",
855
- "reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196",
856
- "shasum": ""
857
- },
858
- "require": {
859
- "php": ">=5.3",
860
- "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
861
- },
862
- "conflict": {
863
- "squizlabs/php_codesniffer": "2.6.2"
864
- },
865
- "require-dev": {
866
- "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
867
- },
868
- "suggest": {
869
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
870
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
871
- },
872
- "type": "phpcodesniffer-standard",
873
- "notification-url": "https://packagist.org/downloads/",
874
- "license": [
875
- "LGPL-3.0-or-later"
876
- ],
877
- "authors": [
878
- {
879
- "name": "Wim Godden",
880
- "homepage": "https://github.com/wimg",
881
- "role": "lead"
882
- },
883
- {
884
- "name": "Juliette Reinders Folmer",
885
- "homepage": "https://github.com/jrfnl",
886
- "role": "lead"
887
- },
888
- {
889
- "name": "Contributors",
890
- "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
891
- }
892
- ],
893
- "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
894
- "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
895
- "keywords": [
896
- "compatibility",
897
- "phpcs",
898
- "standards"
899
- ],
900
- "time": "2019-09-05T18:36:49+00:00"
901
- },
902
- {
903
- "name": "phpcompatibility/phpcompatibility-paragonie",
904
- "version": "1.1.0",
905
- "source": {
906
- "type": "git",
907
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
908
- "reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936"
909
- },
910
- "dist": {
911
- "type": "zip",
912
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
913
- "reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
914
- "shasum": ""
915
- },
916
- "require": {
917
- "phpcompatibility/php-compatibility": "^9.0"
918
- },
919
- "require-dev": {
920
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5",
921
- "paragonie/random_compat": "dev-master",
922
- "paragonie/sodium_compat": "dev-master"
923
- },
924
- "suggest": {
925
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
926
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
927
- },
928
- "type": "phpcodesniffer-standard",
929
- "notification-url": "https://packagist.org/downloads/",
930
- "license": [
931
- "LGPL-3.0-or-later"
932
- ],
933
- "authors": [
934
- {
935
- "name": "Wim Godden",
936
- "role": "lead"
937
- },
938
- {
939
- "name": "Juliette Reinders Folmer",
940
- "role": "lead"
941
- }
942
- ],
943
- "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
944
- "homepage": "http://phpcompatibility.com/",
945
- "keywords": [
946
- "compatibility",
947
- "paragonie",
948
- "phpcs",
949
- "polyfill",
950
- "standards"
951
- ],
952
- "time": "2019-08-28T15:58:19+00:00"
953
- },
954
- {
955
- "name": "phpcompatibility/phpcompatibility-wp",
956
- "version": "2.1.0",
957
- "source": {
958
- "type": "git",
959
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
960
- "reference": "41bef18ba688af638b7310666db28e1ea9158b2f"
961
- },
962
- "dist": {
963
- "type": "zip",
964
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f",
965
- "reference": "41bef18ba688af638b7310666db28e1ea9158b2f",
966
- "shasum": ""
967
- },
968
- "require": {
969
- "phpcompatibility/php-compatibility": "^9.0",
970
- "phpcompatibility/phpcompatibility-paragonie": "^1.0"
971
- },
972
- "require-dev": {
973
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5"
974
- },
975
- "suggest": {
976
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
977
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
978
- },
979
- "type": "phpcodesniffer-standard",
980
- "notification-url": "https://packagist.org/downloads/",
981
- "license": [
982
- "LGPL-3.0-or-later"
983
- ],
984
- "authors": [
985
- {
986
- "name": "Wim Godden",
987
- "role": "lead"
988
- },
989
- {
990
- "name": "Juliette Reinders Folmer",
991
- "role": "lead"
992
- }
993
- ],
994
- "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
995
- "homepage": "http://phpcompatibility.com/",
996
- "keywords": [
997
- "compatibility",
998
- "phpcs",
999
- "standards",
1000
- "wordpress"
1001
- ],
1002
- "time": "2019-08-28T14:22:28+00:00"
1003
- },
1004
- {
1005
- "name": "phpdocumentor/reflection-common",
1006
- "version": "1.0.1",
1007
- "source": {
1008
- "type": "git",
1009
- "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
1010
- "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
1011
- },
1012
- "dist": {
1013
- "type": "zip",
1014
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
1015
- "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
1016
- "shasum": ""
1017
- },
1018
- "require": {
1019
- "php": ">=5.5"
1020
- },
1021
- "require-dev": {
1022
- "phpunit/phpunit": "^4.6"
1023
- },
1024
- "type": "library",
1025
- "extra": {
1026
- "branch-alias": {
1027
- "dev-master": "1.0.x-dev"
1028
- }
1029
- },
1030
- "autoload": {
1031
- "psr-4": {
1032
- "phpDocumentor\\Reflection\\": [
1033
- "src"
1034
- ]
1035
- }
1036
- },
1037
- "notification-url": "https://packagist.org/downloads/",
1038
- "license": [
1039
- "MIT"
1040
- ],
1041
- "authors": [
1042
- {
1043
- "name": "Jaap van Otterdijk",
1044
- "email": "opensource@ijaap.nl"
1045
- }
1046
- ],
1047
- "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
1048
- "homepage": "http://www.phpdoc.org",
1049
- "keywords": [
1050
- "FQSEN",
1051
- "phpDocumentor",
1052
- "phpdoc",
1053
- "reflection",
1054
- "static analysis"
1055
- ],
1056
- "time": "2017-09-11T18:02:19+00:00"
1057
- },
1058
- {
1059
- "name": "phpdocumentor/reflection-docblock",
1060
- "version": "4.3.1",
1061
- "source": {
1062
- "type": "git",
1063
- "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
1064
- "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c"
1065
- },
1066
- "dist": {
1067
- "type": "zip",
1068
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
1069
- "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
1070
- "shasum": ""
1071
- },
1072
- "require": {
1073
- "php": "^7.0",
1074
- "phpdocumentor/reflection-common": "^1.0.0",
1075
- "phpdocumentor/type-resolver": "^0.4.0",
1076
- "webmozart/assert": "^1.0"
1077
- },
1078
- "require-dev": {
1079
- "doctrine/instantiator": "~1.0.5",
1080
- "mockery/mockery": "^1.0",
1081
- "phpunit/phpunit": "^6.4"
1082
- },
1083
- "type": "library",
1084
- "extra": {
1085
- "branch-alias": {
1086
- "dev-master": "4.x-dev"
1087
- }
1088
- },
1089
- "autoload": {
1090
- "psr-4": {
1091
- "phpDocumentor\\Reflection\\": [
1092
- "src/"
1093
- ]
1094
- }
1095
- },
1096
- "notification-url": "https://packagist.org/downloads/",
1097
- "license": [
1098
- "MIT"
1099
- ],
1100
- "authors": [
1101
- {
1102
- "name": "Mike van Riel",
1103
- "email": "me@mikevanriel.com"
1104
- }
1105
- ],
1106
- "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
1107
- "time": "2019-04-30T17:48:53+00:00"
1108
- },
1109
- {
1110
- "name": "phpdocumentor/type-resolver",
1111
- "version": "0.4.0",
1112
- "source": {
1113
- "type": "git",
1114
- "url": "https://github.com/phpDocumentor/TypeResolver.git",
1115
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
1116
- },
1117
- "dist": {
1118
- "type": "zip",
1119
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
1120
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
1121
- "shasum": ""
1122
- },
1123
- "require": {
1124
- "php": "^5.5 || ^7.0",
1125
- "phpdocumentor/reflection-common": "^1.0"
1126
- },
1127
- "require-dev": {
1128
- "mockery/mockery": "^0.9.4",
1129
- "phpunit/phpunit": "^5.2||^4.8.24"
1130
- },
1131
- "type": "library",
1132
- "extra": {
1133
- "branch-alias": {
1134
- "dev-master": "1.0.x-dev"
1135
- }
1136
- },
1137
- "autoload": {
1138
- "psr-4": {
1139
- "phpDocumentor\\Reflection\\": [
1140
- "src/"
1141
- ]
1142
- }
1143
- },
1144
- "notification-url": "https://packagist.org/downloads/",
1145
- "license": [
1146
- "MIT"
1147
- ],
1148
- "authors": [
1149
- {
1150
- "name": "Mike van Riel",
1151
- "email": "me@mikevanriel.com"
1152
- }
1153
- ],
1154
- "time": "2017-07-14T14:27:02+00:00"
1155
- },
1156
- {
1157
- "name": "phpspec/prophecy",
1158
- "version": "1.8.1",
1159
- "source": {
1160
- "type": "git",
1161
- "url": "https://github.com/phpspec/prophecy.git",
1162
- "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
1163
- },
1164
- "dist": {
1165
- "type": "zip",
1166
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
1167
- "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
1168
- "shasum": ""
1169
- },
1170
- "require": {
1171
- "doctrine/instantiator": "^1.0.2",
1172
- "php": "^5.3|^7.0",
1173
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
1174
- "sebastian/comparator": "^1.1|^2.0|^3.0",
1175
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
1176
- },
1177
- "require-dev": {
1178
- "phpspec/phpspec": "^2.5|^3.2",
1179
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
1180
- },
1181
- "type": "library",
1182
- "extra": {
1183
- "branch-alias": {
1184
- "dev-master": "1.8.x-dev"
1185
- }
1186
- },
1187
- "autoload": {
1188
- "psr-4": {
1189
- "Prophecy\\": "src/Prophecy"
1190
- }
1191
- },
1192
- "notification-url": "https://packagist.org/downloads/",
1193
- "license": [
1194
- "MIT"
1195
- ],
1196
- "authors": [
1197
- {
1198
- "name": "Konstantin Kudryashov",
1199
- "email": "ever.zet@gmail.com",
1200
- "homepage": "http://everzet.com"
1201
- },
1202
- {
1203
- "name": "Marcello Duarte",
1204
- "email": "marcello.duarte@gmail.com"
1205
- }
1206
- ],
1207
- "description": "Highly opinionated mocking framework for PHP 5.3+",
1208
- "homepage": "https://github.com/phpspec/prophecy",
1209
- "keywords": [
1210
- "Double",
1211
- "Dummy",
1212
- "fake",
1213
- "mock",
1214
- "spy",
1215
- "stub"
1216
- ],
1217
- "time": "2019-06-13T12:50:23+00:00"
1218
- },
1219
- {
1220
- "name": "phpunit/php-code-coverage",
1221
- "version": "4.0.8",
1222
- "source": {
1223
- "type": "git",
1224
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
1225
- "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
1226
- },
1227
- "dist": {
1228
- "type": "zip",
1229
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
1230
- "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
1231
- "shasum": ""
1232
- },
1233
- "require": {
1234
- "ext-dom": "*",
1235
- "ext-xmlwriter": "*",
1236
- "php": "^5.6 || ^7.0",
1237
- "phpunit/php-file-iterator": "^1.3",
1238
- "phpunit/php-text-template": "^1.2",
1239
- "phpunit/php-token-stream": "^1.4.2 || ^2.0",
1240
- "sebastian/code-unit-reverse-lookup": "^1.0",
1241
- "sebastian/environment": "^1.3.2 || ^2.0",
1242
- "sebastian/version": "^1.0 || ^2.0"
1243
- },
1244
- "require-dev": {
1245
- "ext-xdebug": "^2.1.4",
1246
- "phpunit/phpunit": "^5.7"
1247
- },
1248
- "suggest": {
1249
- "ext-xdebug": "^2.5.1"
1250
- },
1251
- "type": "library",
1252
- "extra": {
1253
- "branch-alias": {
1254
- "dev-master": "4.0.x-dev"
1255
- }
1256
- },
1257
- "autoload": {
1258
- "classmap": [
1259
- "src/"
1260
- ]
1261
- },
1262
- "notification-url": "https://packagist.org/downloads/",
1263
- "license": [
1264
- "BSD-3-Clause"
1265
- ],
1266
- "authors": [
1267
- {
1268
- "name": "Sebastian Bergmann",
1269
- "email": "sb@sebastian-bergmann.de",
1270
- "role": "lead"
1271
- }
1272
- ],
1273
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
1274
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
1275
- "keywords": [
1276
- "coverage",
1277
- "testing",
1278
- "xunit"
1279
- ],
1280
- "time": "2017-04-02T07:44:40+00:00"
1281
- },
1282
- {
1283
- "name": "phpunit/php-file-iterator",
1284
- "version": "1.4.5",
1285
- "source": {
1286
- "type": "git",
1287
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
1288
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
1289
- },
1290
- "dist": {
1291
- "type": "zip",
1292
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
1293
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
1294
- "shasum": ""
1295
- },
1296
- "require": {
1297
- "php": ">=5.3.3"
1298
- },
1299
- "type": "library",
1300
- "extra": {
1301
- "branch-alias": {
1302
- "dev-master": "1.4.x-dev"
1303
- }
1304
- },
1305
- "autoload": {
1306
- "classmap": [
1307
- "src/"
1308
- ]
1309
- },
1310
- "notification-url": "https://packagist.org/downloads/",
1311
- "license": [
1312
- "BSD-3-Clause"
1313
- ],
1314
- "authors": [
1315
- {
1316
- "name": "Sebastian Bergmann",
1317
- "email": "sb@sebastian-bergmann.de",
1318
- "role": "lead"
1319
- }
1320
- ],
1321
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
1322
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
1323
- "keywords": [
1324
- "filesystem",
1325
- "iterator"
1326
- ],
1327
- "time": "2017-11-27T13:52:08+00:00"
1328
- },
1329
- {
1330
- "name": "phpunit/php-text-template",
1331
- "version": "1.2.1",
1332
- "source": {
1333
- "type": "git",
1334
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
1335
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
1336
- },
1337
- "dist": {
1338
- "type": "zip",
1339
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
1340
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
1341
- "shasum": ""
1342
- },
1343
- "require": {
1344
- "php": ">=5.3.3"
1345
- },
1346
- "type": "library",
1347
- "autoload": {
1348
- "classmap": [
1349
- "src/"
1350
- ]
1351
- },
1352
- "notification-url": "https://packagist.org/downloads/",
1353
- "license": [
1354
- "BSD-3-Clause"
1355
- ],
1356
- "authors": [
1357
- {
1358
- "name": "Sebastian Bergmann",
1359
- "email": "sebastian@phpunit.de",
1360
- "role": "lead"
1361
- }
1362
- ],
1363
- "description": "Simple template engine.",
1364
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
1365
- "keywords": [
1366
- "template"
1367
- ],
1368
- "time": "2015-06-21T13:50:34+00:00"
1369
- },
1370
- {
1371
- "name": "phpunit/php-timer",
1372
- "version": "1.0.9",
1373
- "source": {
1374
- "type": "git",
1375
- "url": "https://github.com/sebastianbergmann/php-timer.git",
1376
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
1377
- },
1378
- "dist": {
1379
- "type": "zip",
1380
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
1381
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
1382
- "shasum": ""
1383
- },
1384
- "require": {
1385
- "php": "^5.3.3 || ^7.0"
1386
- },
1387
- "require-dev": {
1388
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
1389
- },
1390
- "type": "library",
1391
- "extra": {
1392
- "branch-alias": {
1393
- "dev-master": "1.0-dev"
1394
- }
1395
- },
1396
- "autoload": {
1397
- "classmap": [
1398
- "src/"
1399
- ]
1400
- },
1401
- "notification-url": "https://packagist.org/downloads/",
1402
- "license": [
1403
- "BSD-3-Clause"
1404
- ],
1405
- "authors": [
1406
- {
1407
- "name": "Sebastian Bergmann",
1408
- "email": "sb@sebastian-bergmann.de",
1409
- "role": "lead"
1410
- }
1411
- ],
1412
- "description": "Utility class for timing",
1413
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
1414
- "keywords": [
1415
- "timer"
1416
- ],
1417
- "time": "2017-02-26T11:10:40+00:00"
1418
- },
1419
- {
1420
- "name": "phpunit/php-token-stream",
1421
- "version": "2.0.2",
1422
- "source": {
1423
- "type": "git",
1424
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
1425
- "reference": "791198a2c6254db10131eecfe8c06670700904db"
1426
- },
1427
- "dist": {
1428
- "type": "zip",
1429
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
1430
- "reference": "791198a2c6254db10131eecfe8c06670700904db",
1431
- "shasum": ""
1432
- },
1433
- "require": {
1434
- "ext-tokenizer": "*",
1435
- "php": "^7.0"
1436
- },
1437
- "require-dev": {
1438
- "phpunit/phpunit": "^6.2.4"
1439
- },
1440
- "type": "library",
1441
- "extra": {
1442
- "branch-alias": {
1443
- "dev-master": "2.0-dev"
1444
- }
1445
- },
1446
- "autoload": {
1447
- "classmap": [
1448
- "src/"
1449
- ]
1450
- },
1451
- "notification-url": "https://packagist.org/downloads/",
1452
- "license": [
1453
- "BSD-3-Clause"
1454
- ],
1455
- "authors": [
1456
- {
1457
- "name": "Sebastian Bergmann",
1458
- "email": "sebastian@phpunit.de"
1459
- }
1460
- ],
1461
- "description": "Wrapper around PHP's tokenizer extension.",
1462
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
1463
- "keywords": [
1464
- "tokenizer"
1465
- ],
1466
- "time": "2017-11-27T05:48:46+00:00"
1467
- },
1468
- {
1469
- "name": "phpunit/phpunit",
1470
- "version": "5.7.27",
1471
- "source": {
1472
- "type": "git",
1473
- "url": "https://github.com/sebastianbergmann/phpunit.git",
1474
- "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
1475
- },
1476
- "dist": {
1477
- "type": "zip",
1478
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
1479
- "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
1480
- "shasum": ""
1481
- },
1482
- "require": {
1483
- "ext-dom": "*",
1484
- "ext-json": "*",
1485
- "ext-libxml": "*",
1486
- "ext-mbstring": "*",
1487
- "ext-xml": "*",
1488
- "myclabs/deep-copy": "~1.3",
1489
- "php": "^5.6 || ^7.0",
1490
- "phpspec/prophecy": "^1.6.2",
1491
- "phpunit/php-code-coverage": "^4.0.4",
1492
- "phpunit/php-file-iterator": "~1.4",
1493
- "phpunit/php-text-template": "~1.2",
1494
- "phpunit/php-timer": "^1.0.6",
1495
- "phpunit/phpunit-mock-objects": "^3.2",
1496
- "sebastian/comparator": "^1.2.4",
1497
- "sebastian/diff": "^1.4.3",
1498
- "sebastian/environment": "^1.3.4 || ^2.0",
1499
- "sebastian/exporter": "~2.0",
1500
- "sebastian/global-state": "^1.1",
1501
- "sebastian/object-enumerator": "~2.0",
1502
- "sebastian/resource-operations": "~1.0",
1503
- "sebastian/version": "^1.0.6|^2.0.1",
1504
- "symfony/yaml": "~2.1|~3.0|~4.0"
1505
- },
1506
- "conflict": {
1507
- "phpdocumentor/reflection-docblock": "3.0.2"
1508
- },
1509
- "require-dev": {
1510
- "ext-pdo": "*"
1511
- },
1512
- "suggest": {
1513
- "ext-xdebug": "*",
1514
- "phpunit/php-invoker": "~1.1"
1515
- },
1516
- "bin": [
1517
- "phpunit"
1518
- ],
1519
- "type": "library",
1520
- "extra": {
1521
- "branch-alias": {
1522
- "dev-master": "5.7.x-dev"
1523
- }
1524
- },
1525
- "autoload": {
1526
- "classmap": [
1527
- "src/"
1528
- ]
1529
- },
1530
- "notification-url": "https://packagist.org/downloads/",
1531
- "license": [
1532
- "BSD-3-Clause"
1533
- ],
1534
- "authors": [
1535
- {
1536
- "name": "Sebastian Bergmann",
1537
- "email": "sebastian@phpunit.de",
1538
- "role": "lead"
1539
- }
1540
- ],
1541
- "description": "The PHP Unit Testing framework.",
1542
- "homepage": "https://phpunit.de/",
1543
- "keywords": [
1544
- "phpunit",
1545
- "testing",
1546
- "xunit"
1547
- ],
1548
- "time": "2018-02-01T05:50:59+00:00"
1549
- },
1550
- {
1551
- "name": "phpunit/phpunit-mock-objects",
1552
- "version": "3.4.4",
1553
- "source": {
1554
- "type": "git",
1555
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
1556
- "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
1557
- },
1558
- "dist": {
1559
- "type": "zip",
1560
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
1561
- "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
1562
- "shasum": ""
1563
- },
1564
- "require": {
1565
- "doctrine/instantiator": "^1.0.2",
1566
- "php": "^5.6 || ^7.0",
1567
- "phpunit/php-text-template": "^1.2",
1568
- "sebastian/exporter": "^1.2 || ^2.0"
1569
- },
1570
- "conflict": {
1571
- "phpunit/phpunit": "<5.4.0"
1572
- },
1573
- "require-dev": {
1574
- "phpunit/phpunit": "^5.4"
1575
- },
1576
- "suggest": {
1577
- "ext-soap": "*"
1578
- },
1579
- "type": "library",
1580
- "extra": {
1581
- "branch-alias": {
1582
- "dev-master": "3.2.x-dev"
1583
- }
1584
- },
1585
- "autoload": {
1586
- "classmap": [
1587
- "src/"
1588
- ]
1589
- },
1590
- "notification-url": "https://packagist.org/downloads/",
1591
- "license": [
1592
- "BSD-3-Clause"
1593
- ],
1594
- "authors": [
1595
- {
1596
- "name": "Sebastian Bergmann",
1597
- "email": "sb@sebastian-bergmann.de",
1598
- "role": "lead"
1599
- }
1600
- ],
1601
- "description": "Mock Object library for PHPUnit",
1602
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
1603
- "keywords": [
1604
- "mock",
1605
- "xunit"
1606
- ],
1607
- "abandoned": true,
1608
- "time": "2017-06-30T09:13:00+00:00"
1609
- },
1610
- {
1611
- "name": "sebastian/code-unit-reverse-lookup",
1612
- "version": "1.0.1",
1613
- "source": {
1614
- "type": "git",
1615
- "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
1616
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
1617
- },
1618
- "dist": {
1619
- "type": "zip",
1620
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
1621
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
1622
- "shasum": ""
1623
- },
1624
- "require": {
1625
- "php": "^5.6 || ^7.0"
1626
- },
1627
- "require-dev": {
1628
- "phpunit/phpunit": "^5.7 || ^6.0"
1629
- },
1630
- "type": "library",
1631
- "extra": {
1632
- "branch-alias": {
1633
- "dev-master": "1.0.x-dev"
1634
- }
1635
- },
1636
- "autoload": {
1637
- "classmap": [
1638
- "src/"
1639
- ]
1640
- },
1641
- "notification-url": "https://packagist.org/downloads/",
1642
- "license": [
1643
- "BSD-3-Clause"
1644
- ],
1645
- "authors": [
1646
- {
1647
- "name": "Sebastian Bergmann",
1648
- "email": "sebastian@phpunit.de"
1649
- }
1650
- ],
1651
- "description": "Looks up which function or method a line of code belongs to",
1652
- "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
1653
- "time": "2017-03-04T06:30:41+00:00"
1654
- },
1655
- {
1656
- "name": "sebastian/comparator",
1657
- "version": "1.2.4",
1658
- "source": {
1659
- "type": "git",
1660
- "url": "https://github.com/sebastianbergmann/comparator.git",
1661
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
1662
- },
1663
- "dist": {
1664
- "type": "zip",
1665
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
1666
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
1667
- "shasum": ""
1668
- },
1669
- "require": {
1670
- "php": ">=5.3.3",
1671
- "sebastian/diff": "~1.2",
1672
- "sebastian/exporter": "~1.2 || ~2.0"
1673
- },
1674
- "require-dev": {
1675
- "phpunit/phpunit": "~4.4"
1676
- },
1677
- "type": "library",
1678
- "extra": {
1679
- "branch-alias": {
1680
- "dev-master": "1.2.x-dev"
1681
- }
1682
- },
1683
- "autoload": {
1684
- "classmap": [
1685
- "src/"
1686
- ]
1687
- },
1688
- "notification-url": "https://packagist.org/downloads/",
1689
- "license": [
1690
- "BSD-3-Clause"
1691
- ],
1692
- "authors": [
1693
- {
1694
- "name": "Jeff Welch",
1695
- "email": "whatthejeff@gmail.com"
1696
- },
1697
- {
1698
- "name": "Volker Dusch",
1699
- "email": "github@wallbash.com"
1700
- },
1701
- {
1702
- "name": "Bernhard Schussek",
1703
- "email": "bschussek@2bepublished.at"
1704
- },
1705
- {
1706
- "name": "Sebastian Bergmann",
1707
- "email": "sebastian@phpunit.de"
1708
- }
1709
- ],
1710
- "description": "Provides the functionality to compare PHP values for equality",
1711
- "homepage": "http://www.github.com/sebastianbergmann/comparator",
1712
- "keywords": [
1713
- "comparator",
1714
- "compare",
1715
- "equality"
1716
- ],
1717
- "time": "2017-01-29T09:50:25+00:00"
1718
- },
1719
- {
1720
- "name": "sebastian/diff",
1721
- "version": "1.4.3",
1722
- "source": {
1723
- "type": "git",
1724
- "url": "https://github.com/sebastianbergmann/diff.git",
1725
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
1726
- },
1727
- "dist": {
1728
- "type": "zip",
1729
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
1730
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
1731
- "shasum": ""
1732
- },
1733
- "require": {
1734
- "php": "^5.3.3 || ^7.0"
1735
- },
1736
- "require-dev": {
1737
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
1738
- },
1739
- "type": "library",
1740
- "extra": {
1741
- "branch-alias": {
1742
- "dev-master": "1.4-dev"
1743
- }
1744
- },
1745
- "autoload": {
1746
- "classmap": [
1747
- "src/"
1748
- ]
1749
- },
1750
- "notification-url": "https://packagist.org/downloads/",
1751
- "license": [
1752
- "BSD-3-Clause"
1753
- ],
1754
- "authors": [
1755
- {
1756
- "name": "Kore Nordmann",
1757
- "email": "mail@kore-nordmann.de"
1758
- },
1759
- {
1760
- "name": "Sebastian Bergmann",
1761
- "email": "sebastian@phpunit.de"
1762
- }
1763
- ],
1764
- "description": "Diff implementation",
1765
- "homepage": "https://github.com/sebastianbergmann/diff",
1766
- "keywords": [
1767
- "diff"
1768
- ],
1769
- "time": "2017-05-22T07:24:03+00:00"
1770
- },
1771
- {
1772
- "name": "sebastian/environment",
1773
- "version": "2.0.0",
1774
- "source": {
1775
- "type": "git",
1776
- "url": "https://github.com/sebastianbergmann/environment.git",
1777
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
1778
- },
1779
- "dist": {
1780
- "type": "zip",
1781
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1782
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1783
- "shasum": ""
1784
- },
1785
- "require": {
1786
- "php": "^5.6 || ^7.0"
1787
- },
1788
- "require-dev": {
1789
- "phpunit/phpunit": "^5.0"
1790
- },
1791
- "type": "library",
1792
- "extra": {
1793
- "branch-alias": {
1794
- "dev-master": "2.0.x-dev"
1795
- }
1796
- },
1797
- "autoload": {
1798
- "classmap": [
1799
- "src/"
1800
- ]
1801
- },
1802
- "notification-url": "https://packagist.org/downloads/",
1803
- "license": [
1804
- "BSD-3-Clause"
1805
- ],
1806
- "authors": [
1807
- {
1808
- "name": "Sebastian Bergmann",
1809
- "email": "sebastian@phpunit.de"
1810
- }
1811
- ],
1812
- "description": "Provides functionality to handle HHVM/PHP environments",
1813
- "homepage": "http://www.github.com/sebastianbergmann/environment",
1814
- "keywords": [
1815
- "Xdebug",
1816
- "environment",
1817
- "hhvm"
1818
- ],
1819
- "time": "2016-11-26T07:53:53+00:00"
1820
- },
1821
- {
1822
- "name": "sebastian/exporter",
1823
- "version": "2.0.0",
1824
- "source": {
1825
- "type": "git",
1826
- "url": "https://github.com/sebastianbergmann/exporter.git",
1827
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
1828
- },
1829
- "dist": {
1830
- "type": "zip",
1831
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1832
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1833
- "shasum": ""
1834
- },
1835
- "require": {
1836
- "php": ">=5.3.3",
1837
- "sebastian/recursion-context": "~2.0"
1838
- },
1839
- "require-dev": {
1840
- "ext-mbstring": "*",
1841
- "phpunit/phpunit": "~4.4"
1842
- },
1843
- "type": "library",
1844
- "extra": {
1845
- "branch-alias": {
1846
- "dev-master": "2.0.x-dev"
1847
- }
1848
- },
1849
- "autoload": {
1850
- "classmap": [
1851
- "src/"
1852
- ]
1853
- },
1854
- "notification-url": "https://packagist.org/downloads/",
1855
- "license": [
1856
- "BSD-3-Clause"
1857
- ],
1858
- "authors": [
1859
- {
1860
- "name": "Jeff Welch",
1861
- "email": "whatthejeff@gmail.com"
1862
- },
1863
- {
1864
- "name": "Volker Dusch",
1865
- "email": "github@wallbash.com"
1866
- },
1867
- {
1868
- "name": "Bernhard Schussek",
1869
- "email": "bschussek@2bepublished.at"
1870
- },
1871
- {
1872
- "name": "Sebastian Bergmann",
1873
- "email": "sebastian@phpunit.de"
1874
- },
1875
- {
1876
- "name": "Adam Harvey",
1877
- "email": "aharvey@php.net"
1878
- }
1879
- ],
1880
- "description": "Provides the functionality to export PHP variables for visualization",
1881
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
1882
- "keywords": [
1883
- "export",
1884
- "exporter"
1885
- ],
1886
- "time": "2016-11-19T08:54:04+00:00"
1887
- },
1888
- {
1889
- "name": "sebastian/global-state",
1890
- "version": "1.1.1",
1891
- "source": {
1892
- "type": "git",
1893
- "url": "https://github.com/sebastianbergmann/global-state.git",
1894
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1895
- },
1896
- "dist": {
1897
- "type": "zip",
1898
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1899
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1900
- "shasum": ""
1901
- },
1902
- "require": {
1903
- "php": ">=5.3.3"
1904
- },
1905
- "require-dev": {
1906
- "phpunit/phpunit": "~4.2"
1907
- },
1908
- "suggest": {
1909
- "ext-uopz": "*"
1910
- },
1911
- "type": "library",
1912
- "extra": {
1913
- "branch-alias": {
1914
- "dev-master": "1.0-dev"
1915
- }
1916
- },
1917
- "autoload": {
1918
- "classmap": [
1919
- "src/"
1920
- ]
1921
- },
1922
- "notification-url": "https://packagist.org/downloads/",
1923
- "license": [
1924
- "BSD-3-Clause"
1925
- ],
1926
- "authors": [
1927
- {
1928
- "name": "Sebastian Bergmann",
1929
- "email": "sebastian@phpunit.de"
1930
- }
1931
- ],
1932
- "description": "Snapshotting of global state",
1933
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
1934
- "keywords": [
1935
- "global state"
1936
- ],
1937
- "time": "2015-10-12T03:26:01+00:00"
1938
- },
1939
- {
1940
- "name": "sebastian/object-enumerator",
1941
- "version": "2.0.1",
1942
- "source": {
1943
- "type": "git",
1944
- "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1945
- "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
1946
- },
1947
- "dist": {
1948
- "type": "zip",
1949
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
1950
- "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
1951
- "shasum": ""
1952
- },
1953
- "require": {
1954
- "php": ">=5.6",
1955
- "sebastian/recursion-context": "~2.0"
1956
- },
1957
- "require-dev": {
1958
- "phpunit/phpunit": "~5"
1959
- },
1960
- "type": "library",
1961
- "extra": {
1962
- "branch-alias": {
1963
- "dev-master": "2.0.x-dev"
1964
- }
1965
- },
1966
- "autoload": {
1967
- "classmap": [
1968
- "src/"
1969
- ]
1970
- },
1971
- "notification-url": "https://packagist.org/downloads/",
1972
- "license": [
1973
- "BSD-3-Clause"
1974
- ],
1975
- "authors": [
1976
- {
1977
- "name": "Sebastian Bergmann",
1978
- "email": "sebastian@phpunit.de"
1979
- }
1980
- ],
1981
- "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1982
- "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1983
- "time": "2017-02-18T15:18:39+00:00"
1984
- },
1985
- {
1986
- "name": "sebastian/recursion-context",
1987
- "version": "2.0.0",
1988
- "source": {
1989
- "type": "git",
1990
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
1991
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1992
- },
1993
- "dist": {
1994
- "type": "zip",
1995
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1996
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1997
- "shasum": ""
1998
- },
1999
- "require": {
2000
- "php": ">=5.3.3"
2001
- },
2002
- "require-dev": {
2003
- "phpunit/phpunit": "~4.4"
2004
- },
2005
- "type": "library",
2006
- "extra": {
2007
- "branch-alias": {
2008
- "dev-master": "2.0.x-dev"
2009
- }
2010
- },
2011
- "autoload": {
2012
- "classmap": [
2013
- "src/"
2014
- ]
2015
- },
2016
- "notification-url": "https://packagist.org/downloads/",
2017
- "license": [
2018
- "BSD-3-Clause"
2019
- ],
2020
- "authors": [
2021
- {
2022
- "name": "Jeff Welch",
2023
- "email": "whatthejeff@gmail.com"
2024
- },
2025
- {
2026
- "name": "Sebastian Bergmann",
2027
- "email": "sebastian@phpunit.de"
2028
- },
2029
- {
2030
- "name": "Adam Harvey",
2031
- "email": "aharvey@php.net"
2032
- }
2033
- ],
2034
- "description": "Provides functionality to recursively process PHP variables",
2035
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
2036
- "time": "2016-11-19T07:33:16+00:00"
2037
- },
2038
- {
2039
- "name": "sebastian/resource-operations",
2040
- "version": "1.0.0",
2041
- "source": {
2042
- "type": "git",
2043
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
2044
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
2045
- },
2046
- "dist": {
2047
- "type": "zip",
2048
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
2049
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
2050
- "shasum": ""
2051
- },
2052
- "require": {
2053
- "php": ">=5.6.0"
2054
- },
2055
- "type": "library",
2056
- "extra": {
2057
- "branch-alias": {
2058
- "dev-master": "1.0.x-dev"
2059
- }
2060
- },
2061
- "autoload": {
2062
- "classmap": [
2063
- "src/"
2064
- ]
2065
- },
2066
- "notification-url": "https://packagist.org/downloads/",
2067
- "license": [
2068
- "BSD-3-Clause"
2069
- ],
2070
- "authors": [
2071
- {
2072
- "name": "Sebastian Bergmann",
2073
- "email": "sebastian@phpunit.de"
2074
- }
2075
- ],
2076
- "description": "Provides a list of PHP built-in functions that operate on resources",
2077
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
2078
- "time": "2015-07-28T20:34:47+00:00"
2079
- },
2080
- {
2081
- "name": "sebastian/version",
2082
- "version": "2.0.1",
2083
- "source": {
2084
- "type": "git",
2085
- "url": "https://github.com/sebastianbergmann/version.git",
2086
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
2087
- },
2088
- "dist": {
2089
- "type": "zip",
2090
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
2091
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
2092
- "shasum": ""
2093
- },
2094
- "require": {
2095
- "php": ">=5.6"
2096
- },
2097
- "type": "library",
2098
- "extra": {
2099
- "branch-alias": {
2100
- "dev-master": "2.0.x-dev"
2101
- }
2102
- },
2103
- "autoload": {
2104
- "classmap": [
2105
- "src/"
2106
- ]
2107
- },
2108
- "notification-url": "https://packagist.org/downloads/",
2109
- "license": [
2110
- "BSD-3-Clause"
2111
- ],
2112
- "authors": [
2113
- {
2114
- "name": "Sebastian Bergmann",
2115
- "email": "sebastian@phpunit.de",
2116
- "role": "lead"
2117
- }
2118
- ],
2119
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
2120
- "homepage": "https://github.com/sebastianbergmann/version",
2121
- "time": "2016-10-03T07:35:21+00:00"
2122
- },
2123
- {
2124
- "name": "squizlabs/php_codesniffer",
2125
- "version": "3.4.2",
2126
- "source": {
2127
- "type": "git",
2128
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
2129
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
2130
- },
2131
- "dist": {
2132
- "type": "zip",
2133
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
2134
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
2135
- "shasum": ""
2136
- },
2137
- "require": {
2138
- "ext-simplexml": "*",
2139
- "ext-tokenizer": "*",
2140
- "ext-xmlwriter": "*",
2141
- "php": ">=5.4.0"
2142
- },
2143
- "require-dev": {
2144
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
2145
- },
2146
- "bin": [
2147
- "bin/phpcs",
2148
- "bin/phpcbf"
2149
- ],
2150
- "type": "library",
2151
- "extra": {
2152
- "branch-alias": {
2153
- "dev-master": "3.x-dev"
2154
- }
2155
- },
2156
- "notification-url": "https://packagist.org/downloads/",
2157
- "license": [
2158
- "BSD-3-Clause"
2159
- ],
2160
- "authors": [
2161
- {
2162
- "name": "Greg Sherwood",
2163
- "role": "lead"
2164
- }
2165
- ],
2166
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
2167
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
2168
- "keywords": [
2169
- "phpcs",
2170
- "standards"
2171
- ],
2172
- "time": "2019-04-10T23:49:02+00:00"
2173
- },
2174
- {
2175
- "name": "symfony/console",
2176
- "version": "v4.3.4",
2177
- "source": {
2178
- "type": "git",
2179
- "url": "https://github.com/symfony/console.git",
2180
- "reference": "de63799239b3881b8a08f8481b22348f77ed7b36"
2181
- },
2182
- "dist": {
2183
- "type": "zip",
2184
- "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36",
2185
- "reference": "de63799239b3881b8a08f8481b22348f77ed7b36",
2186
- "shasum": ""
2187
- },
2188
- "require": {
2189
- "php": "^7.1.3",
2190
- "symfony/polyfill-mbstring": "~1.0",
2191
- "symfony/polyfill-php73": "^1.8",
2192
- "symfony/service-contracts": "^1.1"
2193
- },
2194
- "conflict": {
2195
- "symfony/dependency-injection": "<3.4",
2196
- "symfony/event-dispatcher": "<4.3",
2197
- "symfony/process": "<3.3"
2198
- },
2199
- "provide": {
2200
- "psr/log-implementation": "1.0"
2201
- },
2202
- "require-dev": {
2203
- "psr/log": "~1.0",
2204
- "symfony/config": "~3.4|~4.0",
2205
- "symfony/dependency-injection": "~3.4|~4.0",
2206
- "symfony/event-dispatcher": "^4.3",
2207
- "symfony/lock": "~3.4|~4.0",
2208
- "symfony/process": "~3.4|~4.0",
2209
- "symfony/var-dumper": "^4.3"
2210
- },
2211
- "suggest": {
2212
- "psr/log": "For using the console logger",
2213
- "symfony/event-dispatcher": "",
2214
- "symfony/lock": "",
2215
- "symfony/process": ""
2216
- },
2217
- "type": "library",
2218
- "extra": {
2219
- "branch-alias": {
2220
- "dev-master": "4.3-dev"
2221
- }
2222
- },
2223
- "autoload": {
2224
- "psr-4": {
2225
- "Symfony\\Component\\Console\\": ""
2226
- },
2227
- "exclude-from-classmap": [
2228
- "/Tests/"
2229
- ]
2230
- },
2231
- "notification-url": "https://packagist.org/downloads/",
2232
- "license": [
2233
- "MIT"
2234
- ],
2235
- "authors": [
2236
- {
2237
- "name": "Fabien Potencier",
2238
- "email": "fabien@symfony.com"
2239
- },
2240
- {
2241
- "name": "Symfony Community",
2242
- "homepage": "https://symfony.com/contributors"
2243
- }
2244
- ],
2245
- "description": "Symfony Console Component",
2246
- "homepage": "https://symfony.com",
2247
- "time": "2019-08-26T08:26:39+00:00"
2248
- },
2249
- {
2250
- "name": "symfony/finder",
2251
- "version": "v4.3.4",
2252
- "source": {
2253
- "type": "git",
2254
- "url": "https://github.com/symfony/finder.git",
2255
- "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2"
2256
- },
2257
- "dist": {
2258
- "type": "zip",
2259
- "url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2",
2260
- "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2",
2261
- "shasum": ""
2262
- },
2263
- "require": {
2264
- "php": "^7.1.3"
2265
- },
2266
- "type": "library",
2267
- "extra": {
2268
- "branch-alias": {
2269
- "dev-master": "4.3-dev"
2270
- }
2271
- },
2272
- "autoload": {
2273
- "psr-4": {
2274
- "Symfony\\Component\\Finder\\": ""
2275
- },
2276
- "exclude-from-classmap": [
2277
- "/Tests/"
2278
- ]
2279
- },
2280
- "notification-url": "https://packagist.org/downloads/",
2281
- "license": [
2282
- "MIT"
2283
- ],
2284
- "authors": [
2285
- {
2286
- "name": "Fabien Potencier",
2287
- "email": "fabien@symfony.com"
2288
- },
2289
- {
2290
- "name": "Symfony Community",
2291
- "homepage": "https://symfony.com/contributors"
2292
- }
2293
- ],
2294
- "description": "Symfony Finder Component",
2295
- "homepage": "https://symfony.com",
2296
- "time": "2019-08-14T12:26:46+00:00"
2297
- },
2298
- {
2299
- "name": "symfony/polyfill-ctype",
2300
- "version": "v1.12.0",
2301
- "source": {
2302
- "type": "git",
2303
- "url": "https://github.com/symfony/polyfill-ctype.git",
2304
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4"
2305
- },
2306
- "dist": {
2307
- "type": "zip",
2308
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
2309
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4",
2310
- "shasum": ""
2311
- },
2312
- "require": {
2313
- "php": ">=5.3.3"
2314
- },
2315
- "suggest": {
2316
- "ext-ctype": "For best performance"
2317
- },
2318
- "type": "library",
2319
- "extra": {
2320
- "branch-alias": {
2321
- "dev-master": "1.12-dev"
2322
- }
2323
- },
2324
- "autoload": {
2325
- "psr-4": {
2326
- "Symfony\\Polyfill\\Ctype\\": ""
2327
- },
2328
- "files": [
2329
- "bootstrap.php"
2330
- ]
2331
- },
2332
- "notification-url": "https://packagist.org/downloads/",
2333
- "license": [
2334
- "MIT"
2335
- ],
2336
- "authors": [
2337
- {
2338
- "name": "Gert de Pagter",
2339
- "email": "BackEndTea@gmail.com"
2340
- },
2341
- {
2342
- "name": "Symfony Community",
2343
- "homepage": "https://symfony.com/contributors"
2344
- }
2345
- ],
2346
- "description": "Symfony polyfill for ctype functions",
2347
- "homepage": "https://symfony.com",
2348
- "keywords": [
2349
- "compatibility",
2350
- "ctype",
2351
- "polyfill",
2352
- "portable"
2353
- ],
2354
- "time": "2019-08-06T08:03:45+00:00"
2355
- },
2356
- {
2357
- "name": "symfony/polyfill-mbstring",
2358
- "version": "v1.12.0",
2359
- "source": {
2360
- "type": "git",
2361
- "url": "https://github.com/symfony/polyfill-mbstring.git",
2362
- "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
2363
- },
2364
- "dist": {
2365
- "type": "zip",
2366
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
2367
- "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
2368
- "shasum": ""
2369
- },
2370
- "require": {
2371
- "php": ">=5.3.3"
2372
- },
2373
- "suggest": {
2374
- "ext-mbstring": "For best performance"
2375
- },
2376
- "type": "library",
2377
- "extra": {
2378
- "branch-alias": {
2379
- "dev-master": "1.12-dev"
2380
- }
2381
- },
2382
- "autoload": {
2383
- "psr-4": {
2384
- "Symfony\\Polyfill\\Mbstring\\": ""
2385
- },
2386
- "files": [
2387
- "bootstrap.php"
2388
- ]
2389
- },
2390
- "notification-url": "https://packagist.org/downloads/",
2391
- "license": [
2392
- "MIT"
2393
- ],
2394
- "authors": [
2395
- {
2396
- "name": "Nicolas Grekas",
2397
- "email": "p@tchwork.com"
2398
- },
2399
- {
2400
- "name": "Symfony Community",
2401
- "homepage": "https://symfony.com/contributors"
2402
- }
2403
- ],
2404
- "description": "Symfony polyfill for the Mbstring extension",
2405
- "homepage": "https://symfony.com",
2406
- "keywords": [
2407
- "compatibility",
2408
- "mbstring",
2409
- "polyfill",
2410
- "portable",
2411
- "shim"
2412
- ],
2413
- "time": "2019-08-06T08:03:45+00:00"
2414
- },
2415
- {
2416
- "name": "symfony/polyfill-php73",
2417
- "version": "v1.12.0",
2418
- "source": {
2419
- "type": "git",
2420
- "url": "https://github.com/symfony/polyfill-php73.git",
2421
- "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188"
2422
- },
2423
- "dist": {
2424
- "type": "zip",
2425
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188",
2426
- "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188",
2427
- "shasum": ""
2428
- },
2429
- "require": {
2430
- "php": ">=5.3.3"
2431
- },
2432
- "type": "library",
2433
- "extra": {
2434
- "branch-alias": {
2435
- "dev-master": "1.12-dev"
2436
- }
2437
- },
2438
- "autoload": {
2439
- "psr-4": {
2440
- "Symfony\\Polyfill\\Php73\\": ""
2441
- },
2442
- "files": [
2443
- "bootstrap.php"
2444
- ],
2445
- "classmap": [
2446
- "Resources/stubs"
2447
- ]
2448
- },
2449
- "notification-url": "https://packagist.org/downloads/",
2450
- "license": [
2451
- "MIT"
2452
- ],
2453
- "authors": [
2454
- {
2455
- "name": "Nicolas Grekas",
2456
- "email": "p@tchwork.com"
2457
- },
2458
- {
2459
- "name": "Symfony Community",
2460
- "homepage": "https://symfony.com/contributors"
2461
- }
2462
- ],
2463
- "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
2464
- "homepage": "https://symfony.com",
2465
- "keywords": [
2466
- "compatibility",
2467
- "polyfill",
2468
- "portable",
2469
- "shim"
2470
- ],
2471
- "time": "2019-08-06T08:03:45+00:00"
2472
- },
2473
- {
2474
- "name": "symfony/service-contracts",
2475
- "version": "v1.1.6",
2476
- "source": {
2477
- "type": "git",
2478
- "url": "https://github.com/symfony/service-contracts.git",
2479
- "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3"
2480
- },
2481
- "dist": {
2482
- "type": "zip",
2483
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3",
2484
- "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3",
2485
- "shasum": ""
2486
- },
2487
- "require": {
2488
- "php": "^7.1.3",
2489
- "psr/container": "^1.0"
2490
- },
2491
- "suggest": {
2492
- "symfony/service-implementation": ""
2493
- },
2494
- "type": "library",
2495
- "extra": {
2496
- "branch-alias": {
2497
- "dev-master": "1.1-dev"
2498
- }
2499
- },
2500
- "autoload": {
2501
- "psr-4": {
2502
- "Symfony\\Contracts\\Service\\": ""
2503
- }
2504
- },
2505
- "notification-url": "https://packagist.org/downloads/",
2506
- "license": [
2507
- "MIT"
2508
- ],
2509
- "authors": [
2510
- {
2511
- "name": "Nicolas Grekas",
2512
- "email": "p@tchwork.com"
2513
- },
2514
- {
2515
- "name": "Symfony Community",
2516
- "homepage": "https://symfony.com/contributors"
2517
- }
2518
- ],
2519
- "description": "Generic abstractions related to writing services",
2520
- "homepage": "https://symfony.com",
2521
- "keywords": [
2522
- "abstractions",
2523
- "contracts",
2524
- "decoupling",
2525
- "interfaces",
2526
- "interoperability",
2527
- "standards"
2528
- ],
2529
- "time": "2019-08-20T14:44:19+00:00"
2530
- },
2531
- {
2532
- "name": "symfony/yaml",
2533
- "version": "v4.3.4",
2534
- "source": {
2535
- "type": "git",
2536
- "url": "https://github.com/symfony/yaml.git",
2537
- "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686"
2538
- },
2539
- "dist": {
2540
- "type": "zip",
2541
- "url": "https://api.github.com/repos/symfony/yaml/zipball/5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
2542
- "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
2543
- "shasum": ""
2544
- },
2545
- "require": {
2546
- "php": "^7.1.3",
2547
- "symfony/polyfill-ctype": "~1.8"
2548
- },
2549
- "conflict": {
2550
- "symfony/console": "<3.4"
2551
- },
2552
- "require-dev": {
2553
- "symfony/console": "~3.4|~4.0"
2554
- },
2555
- "suggest": {
2556
- "symfony/console": "For validating YAML files using the lint command"
2557
- },
2558
- "type": "library",
2559
- "extra": {
2560
- "branch-alias": {
2561
- "dev-master": "4.3-dev"
2562
- }
2563
- },
2564
- "autoload": {
2565
- "psr-4": {
2566
- "Symfony\\Component\\Yaml\\": ""
2567
- },
2568
- "exclude-from-classmap": [
2569
- "/Tests/"
2570
- ]
2571
- },
2572
- "notification-url": "https://packagist.org/downloads/",
2573
- "license": [
2574
- "MIT"
2575
- ],
2576
- "authors": [
2577
- {
2578
- "name": "Fabien Potencier",
2579
- "email": "fabien@symfony.com"
2580
- },
2581
- {
2582
- "name": "Symfony Community",
2583
- "homepage": "https://symfony.com/contributors"
2584
- }
2585
- ],
2586
- "description": "Symfony Yaml Component",
2587
- "homepage": "https://symfony.com",
2588
- "time": "2019-08-20T14:27:59+00:00"
2589
- },
2590
- {
2591
- "name": "webmozart/assert",
2592
- "version": "1.5.0",
2593
- "source": {
2594
- "type": "git",
2595
- "url": "https://github.com/webmozart/assert.git",
2596
- "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
2597
- },
2598
- "dist": {
2599
- "type": "zip",
2600
- "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
2601
- "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
2602
- "shasum": ""
2603
- },
2604
- "require": {
2605
- "php": "^5.3.3 || ^7.0",
2606
- "symfony/polyfill-ctype": "^1.8"
2607
- },
2608
- "require-dev": {
2609
- "phpunit/phpunit": "^4.8.36 || ^7.5.13"
2610
- },
2611
- "type": "library",
2612
- "extra": {
2613
- "branch-alias": {
2614
- "dev-master": "1.3-dev"
2615
- }
2616
- },
2617
- "autoload": {
2618
- "psr-4": {
2619
- "Webmozart\\Assert\\": "src/"
2620
- }
2621
- },
2622
- "notification-url": "https://packagist.org/downloads/",
2623
- "license": [
2624
- "MIT"
2625
- ],
2626
- "authors": [
2627
- {
2628
- "name": "Bernhard Schussek",
2629
- "email": "bschussek@gmail.com"
2630
- }
2631
- ],
2632
- "description": "Assertions to validate method input/output with nice error messages.",
2633
- "keywords": [
2634
- "assert",
2635
- "check",
2636
- "validate"
2637
- ],
2638
- "time": "2019-08-24T08:43:50+00:00"
2639
- },
2640
- {
2641
- "name": "wp-coding-standards/wpcs",
2642
- "version": "2.1.1",
2643
- "source": {
2644
- "type": "git",
2645
- "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
2646
- "reference": "bd9c33152115e6741e3510ff7189605b35167908"
2647
- },
2648
- "dist": {
2649
- "type": "zip",
2650
- "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908",
2651
- "reference": "bd9c33152115e6741e3510ff7189605b35167908",
2652
- "shasum": ""
2653
- },
2654
- "require": {
2655
- "php": ">=5.4",
2656
- "squizlabs/php_codesniffer": "^3.3.1"
2657
- },
2658
- "require-dev": {
2659
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
2660
- "phpcompatibility/php-compatibility": "^9.0",
2661
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
2662
- },
2663
- "suggest": {
2664
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
2665
- },
2666
- "type": "phpcodesniffer-standard",
2667
- "notification-url": "https://packagist.org/downloads/",
2668
- "license": [
2669
- "MIT"
2670
- ],
2671
- "authors": [
2672
- {
2673
- "name": "Contributors",
2674
- "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
2675
- }
2676
- ],
2677
- "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
2678
- "keywords": [
2679
- "phpcs",
2680
- "standards",
2681
- "wordpress"
2682
- ],
2683
- "time": "2019-05-21T02:50:00+00:00"
2684
- }
2685
- ],
2686
- "aliases": [],
2687
- "minimum-stability": "stable",
2688
- "stability-flags": [],
2689
- "prefer-stable": false,
2690
- "prefer-lowest": false,
2691
- "platform": {
2692
- "php": ">=5.6"
2693
- },
2694
- "platform-dev": []
2695
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
main.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
- defined('ABSPATH') || die('Cheatin&#8217; uh?');
3
 
4
  // Composer autoload.
5
- if (file_exists(ROCKET_LL_PATH . 'vendor/autoload.php')) {
6
- require ROCKET_LL_PATH . 'vendor/autoload.php';
7
  }
8
 
9
- $rocket_lazyload = new RocketLazyLoadPlugin\Plugin();
10
-
11
- add_action('plugins_loaded', [ $rocket_lazyload, 'load' ]);
1
  <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin&#8217; uh?' );
3
 
4
  // Composer autoload.
5
+ if ( file_exists( ROCKET_LL_PATH . 'vendor/autoload.php' ) ) {
6
+ require ROCKET_LL_PATH . 'vendor/autoload.php';
7
  }
8
 
9
+ add_action( 'plugins_loaded', [ new RocketLazyLoadPlugin\Plugin(), 'load' ] );
 
 
phpcs.xml DELETED
@@ -1,30 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="Rocket Lazyload">
3
- <description>Rocket LazyLoad</description>
4
-
5
- <arg name="extensions" value="php"/>
6
-
7
- <file>.</file>
8
-
9
- <!-- Run against the PHPCompatibility ruleset -->
10
- <rule ref="PHPCompatibility"/>
11
- <rule ref="PSR2" />
12
- <!-- Check for cross-version support for PHP 5.4 and higher. -->
13
- <config name="testVersion" value="5.4-"/>
14
- <config name="minimum_supported_wp_version" value="4.7"/>
15
-
16
- <exclude-pattern>*.js</exclude-pattern>
17
- <exclude-pattern>/vendor/*</exclude-pattern>
18
- <exclude-pattern>/assets/*</exclude-pattern>
19
-
20
- <rule ref="WordPress.WP.I18n">
21
- <properties>
22
- <property name="text_domain" type="array" value="rocket-lazy-load" />
23
- </properties>
24
- </rule>
25
- <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
26
- <properties>
27
- <property name="prefixes" type="array" value="rocket_lazyload,ROCKET_LL,RocketLazyLoadPlugin" />
28
- </properties>
29
- </rule>
30
- </ruleset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,307 +1,322 @@
1
- === Lazy Load by WP Rocket ===
2
- Contributors: wp_rocket, wp_media
3
- Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube
4
- Requires at least: 4.7
5
- Tested up to: 5.2
6
- Requires PHP: 5.6
7
- Stable tag: 2.3.2
8
-
9
- Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
10
-
11
- == Description ==
12
-
13
- Lazy Load by WP Rocket displays images and/or iframes on a page only when they are visible to the user. This reduces the number of HTTP requests mechanism and improves the loading time.
14
-
15
- This plugin works on thumbnails, all images in a post content or in a widget text, avatars, smilies and iframes. No JavaScript library such as jQuery is used and the script weight is less than 10KB.
16
-
17
- You can also replace Youtube iframes by a preview thumbnail to further speed up the loading time of your website.
18
-
19
- = Dependencies =
20
-
21
- Lazyload script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)
22
-
23
- = Related Plugins =
24
- * [Imagify](https://imagify.io/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best Image Optimizer to speed up your website with lighter images.
25
- * [WP Rocket](https://wp-rocket.me/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best caching plugin to speed-up your WordPress website.
26
- * [Heartbeat Control by WP Rocket](https://wordpress.org/plugins/heartbeat-control/): Heartbeat Control by WP Rocket: Best plugin to control the WordPress Heartbeat API and reduce CPU usage.
27
-
28
- == Installation ==
29
-
30
- 1. Upload the complete `rocket-lazy-load` folder to the `/wp-content/plugins/` directory
31
- 2. Activate the plugin through the 'Plugins' menu in WordPress
32
-
33
- == Frequently Asked Questions ==
34
-
35
- = How can I deactivate Lazy Load on some pages? =
36
-
37
- You can use the `do_rocket_lazyload` filter.
38
-
39
- Here is an example to put in functions.php files that disable lazyload on posts:
40
-
41
- `
42
- add_action( 'wp', 'deactivate_rocket_lazyload_on_single' );
43
- function deactivate_rocket_lazyload_on_single() {
44
- if ( is_single() ) {
45
- add_filter( 'do_rocket_lazyload', '__return_false' );
46
- }
47
- }
48
- `
49
-
50
- = How can I deactivate Lazy Load on some images? =
51
-
52
- Simply add a `data-no-lazy="1"` property in you `img` or `iframe` tag.
53
-
54
- You can also use the filters `rocket_lazyload_excluded_attributes` or `rocket_lazyload_excluded_src` to exclude specific patterns.
55
-
56
- For iframes, the filter is `rocket_lazyload_iframe_excluded_patterns`.
57
-
58
- = How can I change the threshold to trigger the load? =
59
-
60
- You can use the `rocket_lazyload_threshold` filter.
61
-
62
- Code sample:
63
-
64
- `
65
- function rocket_lazyload_custom_threshold( $threshold ) {
66
- return 100;
67
- }
68
- add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );
69
- `
70
-
71
- = I use plugin X and my images don't show anymore =
72
-
73
- Some plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.
74
-
75
- = How can I lazyload a background-image? =
76
-
77
- The plugin will automatically lazyload background-images set with a `style` attribute to a `div` element:
78
-
79
- `<div style="background-image: url(image.jpg);">`
80
-
81
- You can also apply it manually. The element you want to apply lazyload on must have this specific markup:
82
-
83
- `<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
84
-
85
- The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
86
-
87
- == Changelog ==
88
- = 2.3.2 =
89
- Bugfix: Incorrect characters used in Youtube thumbnail HTML code
90
-
91
- = 2.3.1 =
92
- Bugfix: Prevent a conflict with WP Rocket
93
- Bugfix: apply loading="lazy" on Youtube thumbnail
94
- Bugfix: Add autoplay attribute on iframe loaded with Youtube thumbnail
95
-
96
- = 2.3 =
97
- Enhancement: Add support for browser native lazyload
98
- Bugfix: Prevent broken image in some cases for picture element
99
- Bugfix: Prevent wrong lazy attributes for srcset and sizes on an image inside a picture element
100
-
101
- = 2.2.3 =
102
- * Enhancement: Improve compatibility for the picture element
103
- * Enhancement: Apply lazyload on background images set on section, span and li elements
104
- * Enhancement: also pass $width and $height values to the rocket_lazyload_placeholder filter
105
- * Bugfix: Use 0 instead of 1 for the default placeholder dimensions to improve compatibility
106
- * Bugfix: Improve infinite scroll support
107
- * Bugfix: Exclude Enfold avia-background-fixed background images and data-large_image from lazyload
108
-
109
- = 2.2.2 =
110
- * Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues
111
- * Bugfix: Correctly handle responsive videos using fitVids again
112
-
113
- = 2.2.1 =
114
- * Enhancement: add a way to customize the lazyload script options
115
- * Bugfix: Prevent error on Internet Explorer 11
116
- * Bugfix: Prevent conflict with WooCommerce variation swatches
117
- * Bugfix: Prevent empty `src` when the image is an inline base64
118
- * Bugfix: Prevent issue when the original `src` attribute uses single quotes
119
-
120
- = 2.2 =
121
- * Enhancement: Update lazyload script to the latest version
122
- * Enhancement: Use the dimensions of the original image for the placeholder size when possible, to reduce content reflow
123
- * Enhancement: Ignore images using the new loading attribute introduce by Chrome for browser-native lazyload
124
-
125
- = 2.1.5 =
126
- * Bugfix: Prevent matching with the wrong data when a data-style attribute is on a div for background images
127
- * Remove data-cfasync="false" by default
128
- * Enhancement: Add filter rocket_lazyload_script_tag to modify the lazyload script HTML if needed
129
- * Enhancement: Add data-no-minify attribute to the lazyload script tag to prevent it from being combined by JS combiners
130
- * Enhancement: Improve MutationObserver code to only call the lazyload update method if an image/iframe or element with .rocket-lazyload is contained in the new node(s) added to the DOM
131
-
132
- = 2.1.4 =
133
- * Regression fix: Correctly exclude scripts from lazyload again
134
-
135
- = 2.1.3 =
136
- * Bugfix: Ignore content inside noscript tags to prevent modifying them and causing some display issues
137
-
138
- = 2.1.2 =
139
- * Enhancement: Update lazyload script to the latest version
140
- * Enhancement: Add a way to lazyload the Youtube thumbnail image
141
- * Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution
142
- * Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead
143
- * Enhancement: Add data-cfasync="false" to the lazyload script tag
144
- * Enhancement: Prevent lazyload on the Oxygen Builder page editor
145
- * Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier
146
-
147
-
148
- = 2.1.1 =
149
- * Bugfix: Correctly apply lazyload on `picture` elements
150
- * Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute
151
-
152
- = 2.1 =
153
- * Enhancement: Update lazyload script to the latest version
154
- * Enhancement: Apply lazyload on picture elements found on the page
155
- * Enhancement: Apply lazyload on div elements with a background image found on the page. See FAQ for more info.
156
-
157
- = 2.0.4 =
158
- * Enhancement: Add filter for iframe lazyload pattern exclusion
159
- * Enhancement: Auto-exclude soliloquy-image pattern from lazyload
160
- * Bugfix: Prevent issue when an image/iframe is duplicated on the same page
161
- * Bugfix: Prevent W3C validation error for the SVG placeholder
162
-
163
- = 2.0.3.2 =
164
- * Bugfix: Correctly ignore inline scripts with line breaks inside
165
-
166
- = 2.0.3.1 =
167
- * Bugfix: Correct an issue preventing lazyload from working
168
-
169
- = 2.0.3 =
170
- * Bugfix: Prevent incorrect display if JavaScript is disabled
171
- * Bugfix: Don't apply lazyload on Divi/Extra/Beaver Builder Editor pages
172
- * Bugfix: Use the correct URL for each iframe when multiple iframes are on the same page
173
- * Bugfix: Ignore content inside inline script tags to prevent applying lazyload in it
174
-
175
- = 2.0.2 =
176
- * Bugfix: Fix an error in the compatibility for the AMP plugin
177
-
178
- = 2.0.1 =
179
- * Bugfix: Prevent a fatal error on case sensitive operating systems
180
-
181
- = 2.0 =
182
- * Enhancement: Lazyload is now applied on the template_redirect hook, which should allow the plugin to apply the optimization on more images and encountering less conflicts at the same time
183
- * Enhancement: Specifically target with the lazyload script images/iframes elements with a data-lazy-src attribute
184
- * Enhancement: Update lazyload script to the latest version
185
- * Enhancement: Possibility to apply lazyload on background-images with a specific markup, see FAQ
186
- * Enhancement: Use a svg image as placeholder instead of a base64 gif
187
- * Bugfix: Only use MutationObserver if available in the browser
188
- * Bugfix: When using the Youtube thumbnail option, correctly format the Youtube query if the video URL is encoded
189
- * Bugfix: Improve iframe matching to prevent unexpected results
190
- * Bugfix: Update CSS for the Youtube thumbnail option to prevent issue with the Gutenberg embeds block
191
-
192
- = 1.4.9 =
193
- * Enhancement: Update lazyload script to the latest available version
194
- * Enhancement: Use lazy-sizes to prevent W3C validation error when sizes is defined but srcset is not
195
- * Enhancement: Parse images or iframes only if the element is selected to be lazyloaded in the options
196
- * Fix: Prevent warning for lazyload+v in Google Search Console
197
- * Fix: Prevent PHP Notice with WooCommerce for product images
198
-
199
- = 1.4.8 =
200
- * Notice: Minimum WordPress version required is now 4.7
201
- * Enhancement: Update lazyload script version
202
- * Enhancement: Remove placeholder image to improve perceived loading time
203
- * Enhancement: Compatibility with Youtube privacy URL
204
- * Enhancement: Update play image to match Youtube logo
205
- * Enhancement: Support Youtube URL parameters
206
- * Enhancement: Lazyload images displayed with wp_get_attachment_image(). /!\ no fallback if JavaScript is disabled
207
- * Fix: Use the correct size set in srcset for the lazyloaded image
208
- * Fix: Prevent Youtube thumbnail replacement on playlists
209
- * Fix: Prevent iframe lazyload on AMP pages
210
- * Fix: Correct text domain for translations (thanks @ Chantal Coolsma)
211
-
212
- = 1.4.7 =
213
- * Fix compatibility with infinite scroll
214
- * Prevent lazyload on masterSlider images
215
-
216
- = 1.4.6 =
217
- * Correctly include version 8.5.2 of lazyload script
218
- * Prevent 404 error on lazyload script if URL contains "-v"
219
-
220
- = 1.4.5 =
221
- * Rename Setting Page Name in WP Menu
222
- * New Product Banner in Settings Page
223
- * Conditionally load a different version of the script depending on browser support of IntersectionObserver
224
- * Fix a bug where images initially hidden are not correctly displayed when coming into view (slider, tabs, accordion)
225
-
226
- = 1.4.4 =
227
- * Admin Redesign
228
-
229
- = 1.4.3 =
230
- * Plugin is compatible again with PHP < 5.4
231
-
232
- = 1.4.2 =
233
- * Update lazyload script to bring back compatibility with IE9/10
234
-
235
- = 1.4.1 =
236
- * Fix bug caused by a too aggressive cleanup
237
-
238
- = 1.4 =
239
- * New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page
240
-
241
- = 1.3.3 =
242
- * 2017-09-16
243
- * Prevent scripts and styles being removed during html parsing
244
-
245
- = 1.3.2 =
246
- * 2017-09-12
247
- * Fix images not displaying in certain conditions because image attributes exclusion was not working correctly
248
-
249
- = 1.3.1 =
250
- * 2017-09-07
251
- * Don't apply lazyload on Divi slider
252
-
253
- = 1.3 =
254
- * 2017-09-01
255
- * Improve HTML parsing of images and iframes to be faster and more efficient
256
- * Make the lazyload compatible with fitVids for iframes
257
- * Don't apply lazyload on AMP pages (compatible with AMP plugin from Automattic)
258
- * Use about:blank as default iframe placeholder to prevent warning in browser console
259
- * Don't apply lazyload on upPrev thumbnail
260
-
261
- = 1.2.1 =
262
- * 2017-08-22
263
- * Fix missing lazyload script
264
- * Don't lazyload for images in REST API requests
265
-
266
- = 1.2 =
267
- * 2017-08-22
268
- * Update lazyload script to latest version
269
- * Change the way the script is loaded
270
-
271
- = 1.1.1 =
272
- * 2017-02-13
273
- * Bug fix: Remove use of short tag to prevent 500 error on some installations
274
-
275
- = 1.1 =
276
- * 2017-02-12
277
- * *New*
278
- * JS library updated
279
- * Support for iFrame
280
- * Support for srcset and sizes
281
- * New options page
282
-
283
- = 1.0.4 =
284
- * 2015-04-28
285
- * Bug Fix: Resolved a conflict between LazyLoad & Emoji since WordPress 4.2
286
-
287
- = 1.0.3 =
288
- * 2015-01-08
289
- * Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.
290
-
291
- = 1.0.2 =
292
- * 2014-12-28
293
- * Improvement: Add « rocket_lazyload_html » filter to manage the output that will be printed.
294
-
295
- = 1.0.1.1 =
296
- * 2014-07-25
297
- * Fix stupid error with new regex in 1.0.1
298
-
299
- = 1.0.1 =
300
- * 2014-07-16
301
- * Bug Fix: when a IMG tag or content (widget or post) contains the string "data-no-lazy", all IMG tags were ignored instead of one.
302
- * Security fix: The preg_replace() could lead to a XSS vuln, thanks to Alexander Concha
303
- * Code compliance
304
-
305
- = 1.0 =
306
- * 2014-01-01
307
- * Initial release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Lazy Load - Optimize Images ===
2
+ Contributors: wp_rocket, wp_media
3
+ Tags: lazyload, lazy load, images, iframes, thumbnail, thumbnails, smiley, smilies, avatar, gravatar, youtube
4
+ Requires at least: 4.7
5
+ Tested up to: 5.4
6
+ Requires PHP: 5.6
7
+ Stable tag: 2.3.3
8
+
9
+ Lazy Load your images and iframes, replace Youtube videos by a preview thumbnail.
10
+
11
+ == Description ==
12
+
13
+ Lazy Load by WP Rocket displays images and/or iframes on a page only when they are visible to the user. This reduces the number of HTTP requests mechanism and improves the loading time.
14
+
15
+ This plugin works on thumbnails, all images in a post content or in a widget text, avatars, smilies and iframes. No JavaScript library such as jQuery is used and the script weight is less than 10KB.
16
+
17
+ You can also replace Youtube iframes by a preview thumbnail to further speed up the loading time of your website.
18
+
19
+ = Dependencies =
20
+
21
+ Lazyload script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)
22
+
23
+ = Related Plugins =
24
+ * [Imagify](https://imagify.io/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best Image Optimizer to speed up your website with lighter images.
25
+ * [WP Rocket](https://wp-rocket.me/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=LazyLoadPlugin): Best caching plugin to speed-up your WordPress website.
26
+ * [Heartbeat Control by WP Rocket](https://wordpress.org/plugins/heartbeat-control/): Heartbeat Control by WP Rocket: Best plugin to control the WordPress Heartbeat API and reduce CPU usage.
27
+
28
+ == Installation ==
29
+
30
+ 1. Upload the complete `rocket-lazy-load` folder to the `/wp-content/plugins/` directory
31
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ = How can I use native lazyload? =
36
+ To use native lazyload on browsers supporting this feature, you need to use the following line:
37
+
38
+ `add_filter( 'rocket_use_native_lazyload', '__return_true' );`
39
+
40
+ Browsers that do not support native lazyload will use the JS-based solution as before.
41
+
42
+ = How can I deactivate Lazy Load on some pages? =
43
+
44
+ You can use the `do_rocket_lazyload` filter.
45
+
46
+ Here is an example to put in functions.php files that disable lazyload on posts:
47
+
48
+ `
49
+ add_action( 'wp', 'deactivate_rocket_lazyload_on_single' );
50
+ function deactivate_rocket_lazyload_on_single() {
51
+ if ( is_single() ) {
52
+ add_filter( 'do_rocket_lazyload', '__return_false' );
53
+ }
54
+ }
55
+ `
56
+
57
+ = How can I deactivate Lazy Load on some images? =
58
+
59
+ Simply add a `data-no-lazy="1"` property in you `img` or `iframe` tag.
60
+
61
+ You can also use the filters `rocket_lazyload_excluded_attributes` or `rocket_lazyload_excluded_src` to exclude specific patterns.
62
+
63
+ For iframes, the filter is `rocket_lazyload_iframe_excluded_patterns`.
64
+
65
+ = How can I change the threshold to trigger the load? =
66
+
67
+ You can use the `rocket_lazyload_threshold` filter.
68
+
69
+ Code sample:
70
+
71
+ `
72
+ function rocket_lazyload_custom_threshold( $threshold ) {
73
+ return 100;
74
+ }
75
+ add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );
76
+ `
77
+
78
+ = I use plugin X and my images don't show anymore =
79
+
80
+ Some plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.
81
+
82
+ = How can I lazyload a background-image? =
83
+
84
+ The plugin will automatically lazyload background-images set with a `style` attribute to a `div` element:
85
+
86
+ `<div style="background-image: url(image.jpg);">`
87
+
88
+ You can also apply it manually. The element you want to apply lazyload on must have this specific markup:
89
+
90
+ `<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>`
91
+
92
+ The element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.
93
+
94
+ == Changelog ==
95
+ = 2.3.3 =
96
+ Enhancement: Add data-skip-lazy and skip-lazy class to exclusions list as part of the interoperability initiative between lazyload plugins
97
+ Enhancement: Use native lazyload only if filter `rocket_use_native_lazyload` is true
98
+ Enhancement: Apply lazyload on background images set on `figure` elements
99
+ Bugfix: Correctly add the rocket-lazyload class when class attribute is empty on an element with a background image
100
+ Bugfix: Correctly replace YouTube iframe with preview image when using relative protocol
101
+ Bugfix: Preserve youtube-nocookie.com during LazyLoad
102
+
103
+ = 2.3.2 =
104
+ Bugfix: Incorrect characters used in Youtube thumbnail HTML code
105
+
106
+ = 2.3.1 =
107
+ Bugfix: Prevent a conflict with WP Rocket
108
+ Bugfix: apply loading="lazy" on Youtube thumbnail
109
+ Bugfix: Add autoplay attribute on iframe loaded with Youtube thumbnail
110
+
111
+ = 2.3 =
112
+ Enhancement: Add support for browser native lazyload
113
+ Bugfix: Prevent broken image in some cases for picture element
114
+ Bugfix: Prevent wrong lazy attributes for srcset and sizes on an image inside a picture element
115
+
116
+ = 2.2.3 =
117
+ * Enhancement: Improve compatibility for the picture element
118
+ * Enhancement: Apply lazyload on background images set on section, span and li elements
119
+ * Enhancement: also pass $width and $height values to the rocket_lazyload_placeholder filter
120
+ * Bugfix: Use 0 instead of 1 for the default placeholder dimensions to improve compatibility
121
+ * Bugfix: Improve infinite scroll support
122
+ * Bugfix: Exclude Enfold avia-background-fixed background images and data-large_image from lazyload
123
+
124
+ = 2.2.2 =
125
+ * Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues
126
+ * Bugfix: Correctly handle responsive videos using fitVids again
127
+
128
+ = 2.2.1 =
129
+ * Enhancement: add a way to customize the lazyload script options
130
+ * Bugfix: Prevent error on Internet Explorer 11
131
+ * Bugfix: Prevent conflict with WooCommerce variation swatches
132
+ * Bugfix: Prevent empty `src` when the image is an inline base64
133
+ * Bugfix: Prevent issue when the original `src` attribute uses single quotes
134
+
135
+ = 2.2 =
136
+ * Enhancement: Update lazyload script to the latest version
137
+ * Enhancement: Use the dimensions of the original image for the placeholder size when possible, to reduce content reflow
138
+ * Enhancement: Ignore images using the new loading attribute introduce by Chrome for browser-native lazyload
139
+
140
+ = 2.1.5 =
141
+ * Bugfix: Prevent matching with the wrong data when a data-style attribute is on a div for background images
142
+ * Remove data-cfasync="false" by default
143
+ * Enhancement: Add filter rocket_lazyload_script_tag to modify the lazyload script HTML if needed
144
+ * Enhancement: Add data-no-minify attribute to the lazyload script tag to prevent it from being combined by JS combiners
145
+ * Enhancement: Improve MutationObserver code to only call the lazyload update method if an image/iframe or element with .rocket-lazyload is contained in the new node(s) added to the DOM
146
+
147
+ = 2.1.4 =
148
+ * Regression fix: Correctly exclude scripts from lazyload again
149
+
150
+ = 2.1.3 =
151
+ * Bugfix: Ignore content inside noscript tags to prevent modifying them and causing some display issues
152
+
153
+ = 2.1.2 =
154
+ * Enhancement: Update lazyload script to the latest version
155
+ * Enhancement: Add a way to lazyload the Youtube thumbnail image
156
+ * Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution
157
+ * Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead
158
+ * Enhancement: Add data-cfasync="false" to the lazyload script tag
159
+ * Enhancement: Prevent lazyload on the Oxygen Builder page editor
160
+ * Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier
161
+
162
+
163
+ = 2.1.1 =
164
+ * Bugfix: Correctly apply lazyload on `picture` elements
165
+ * Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute
166
+
167
+ = 2.1 =
168
+ * Enhancement: Update lazyload script to the latest version
169
+ * Enhancement: Apply lazyload on picture elements found on the page
170
+ * Enhancement: Apply lazyload on div elements with a background image found on the page. See FAQ for more info.
171
+
172
+ = 2.0.4 =
173
+ * Enhancement: Add filter for iframe lazyload pattern exclusion
174
+ * Enhancement: Auto-exclude soliloquy-image pattern from lazyload
175
+ * Bugfix: Prevent issue when an image/iframe is duplicated on the same page
176
+ * Bugfix: Prevent W3C validation error for the SVG placeholder
177
+
178
+ = 2.0.3.2 =
179
+ * Bugfix: Correctly ignore inline scripts with line breaks inside
180
+
181
+ = 2.0.3.1 =
182
+ * Bugfix: Correct an issue preventing lazyload from working
183
+
184
+ = 2.0.3 =
185
+ * Bugfix: Prevent incorrect display if JavaScript is disabled
186
+ * Bugfix: Don't apply lazyload on Divi/Extra/Beaver Builder Editor pages
187
+ * Bugfix: Use the correct URL for each iframe when multiple iframes are on the same page
188
+ * Bugfix: Ignore content inside inline script tags to prevent applying lazyload in it
189
+
190
+ = 2.0.2 =
191
+ * Bugfix: Fix an error in the compatibility for the AMP plugin
192
+
193
+ = 2.0.1 =
194
+ * Bugfix: Prevent a fatal error on case sensitive operating systems
195
+
196
+ = 2.0 =
197
+ * Enhancement: Lazyload is now applied on the template_redirect hook, which should allow the plugin to apply the optimization on more images and encountering less conflicts at the same time
198
+ * Enhancement: Specifically target with the lazyload script images/iframes elements with a data-lazy-src attribute
199
+ * Enhancement: Update lazyload script to the latest version
200
+ * Enhancement: Possibility to apply lazyload on background-images with a specific markup, see FAQ
201
+ * Enhancement: Use a svg image as placeholder instead of a base64 gif
202
+ * Bugfix: Only use MutationObserver if available in the browser
203
+ * Bugfix: When using the Youtube thumbnail option, correctly format the Youtube query if the video URL is encoded
204
+ * Bugfix: Improve iframe matching to prevent unexpected results
205
+ * Bugfix: Update CSS for the Youtube thumbnail option to prevent issue with the Gutenberg embeds block
206
+
207
+ = 1.4.9 =
208
+ * Enhancement: Update lazyload script to the latest available version
209
+ * Enhancement: Use lazy-sizes to prevent W3C validation error when sizes is defined but srcset is not
210
+ * Enhancement: Parse images or iframes only if the element is selected to be lazyloaded in the options
211
+ * Fix: Prevent warning for lazyload+v in Google Search Console
212
+ * Fix: Prevent PHP Notice with WooCommerce for product images
213
+
214
+ = 1.4.8 =
215
+ * Notice: Minimum WordPress version required is now 4.7
216
+ * Enhancement: Update lazyload script version
217
+ * Enhancement: Remove placeholder image to improve perceived loading time
218
+ * Enhancement: Compatibility with Youtube privacy URL
219
+ * Enhancement: Update play image to match Youtube logo
220
+ * Enhancement: Support Youtube URL parameters
221
+ * Enhancement: Lazyload images displayed with wp_get_attachment_image(). /!\ no fallback if JavaScript is disabled
222
+ * Fix: Use the correct size set in srcset for the lazyloaded image
223
+ * Fix: Prevent Youtube thumbnail replacement on playlists
224
+ * Fix: Prevent iframe lazyload on AMP pages
225
+ * Fix: Correct text domain for translations (thanks @ Chantal Coolsma)
226
+
227
+ = 1.4.7 =
228
+ * Fix compatibility with infinite scroll
229
+ * Prevent lazyload on masterSlider images
230
+
231
+ = 1.4.6 =
232
+ * Correctly include version 8.5.2 of lazyload script
233
+ * Prevent 404 error on lazyload script if URL contains "-v"
234
+
235
+ = 1.4.5 =
236
+ * Rename Setting Page Name in WP Menu
237
+ * New Product Banner in Settings Page
238
+ * Conditionally load a different version of the script depending on browser support of IntersectionObserver
239
+ * Fix a bug where images initially hidden are not correctly displayed when coming into view (slider, tabs, accordion)
240
+
241
+ = 1.4.4 =
242
+ * Admin Redesign
243
+
244
+ = 1.4.3 =
245
+ * Plugin is compatible again with PHP < 5.4
246
+
247
+ = 1.4.2 =
248
+ * Update lazyload script to bring back compatibility with IE9/10
249
+
250
+ = 1.4.1 =
251
+ * Fix bug caused by a too aggressive cleanup
252
+
253
+ = 1.4 =
254
+ * New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page
255
+
256
+ = 1.3.3 =
257
+ * 2017-09-16
258
+ * Prevent scripts and styles being removed during html parsing
259
+
260
+ = 1.3.2 =
261
+ * 2017-09-12
262
+ * Fix images not displaying in certain conditions because image attributes exclusion was not working correctly
263
+
264
+ = 1.3.1 =
265
+ * 2017-09-07
266
+ * Don't apply lazyload on Divi slider
267
+
268
+ = 1.3 =
269
+ * 2017-09-01
270
+ * Improve HTML parsing of images and iframes to be faster and more efficient
271
+ * Make the lazyload compatible with fitVids for iframes
272
+ * Don't apply lazyload on AMP pages (compatible with AMP plugin from Automattic)
273
+ * Use about:blank as default iframe placeholder to prevent warning in browser console
274
+ * Don't apply lazyload on upPrev thumbnail
275
+
276
+ = 1.2.1 =
277
+ * 2017-08-22
278
+ * Fix missing lazyload script
279
+ * Don't lazyload for images in REST API requests
280
+
281
+ = 1.2 =
282
+ * 2017-08-22
283
+ * Update lazyload script to latest version
284
+ * Change the way the script is loaded
285
+
286
+ = 1.1.1 =
287
+ * 2017-02-13
288
+ * Bug fix: Remove use of short tag to prevent 500 error on some installations
289
+
290
+ = 1.1 =
291
+ * 2017-02-12
292
+ * *New*
293
+ * JS library updated
294
+ * Support for iFrame
295
+ * Support for srcset and sizes
296
+ * New options page
297
+
298
+ = 1.0.4 =
299
+ * 2015-04-28
300
+ * Bug Fix: Resolved a conflict between LazyLoad & Emoji since WordPress 4.2
301
+
302
+ = 1.0.3 =
303
+ * 2015-01-08
304
+ * Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.
305
+
306
+ = 1.0.2 =
307
+ * 2014-12-28
308
+ * Improvement: Add « rocket_lazyload_html » filter to manage the output that will be printed.
309
+
310
+ = 1.0.1.1 =
311
+ * 2014-07-25
312
+ * Fix stupid error with new regex in 1.0.1
313
+
314
+ = 1.0.1 =
315
+ * 2014-07-16
316
+ * Bug Fix: when a IMG tag or content (widget or post) contains the string "data-no-lazy", all IMG tags were ignored instead of one.
317
+ * Security fix: The preg_replace() could lead to a XSS vuln, thanks to Alexander Concha
318
+ * Code compliance
319
+
320
+ = 1.0 =
321
+ * 2014-01-01
322
+ * Initial release.
rocket-lazy-load.php CHANGED
@@ -1,78 +1,78 @@
1
- <?php
2
- /**
3
- * Plugin Name: Lazy Load by WP Rocket
4
- * Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
5
- * Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
6
- * Version: 2.3.2
7
- * Author: WP Rocket
8
- * Author URI: https://wp-rocket.me
9
- * Text Domain: rocket-lazy-load
10
- * Domain Path: /languages
11
- *
12
- * @package RocketLazyloadPlugin
13
- *
14
- * Copyright 2015-2019 WP Media
15
- *
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation; either version 2 of the License, or
19
- * (at your option) any later version.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- * GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
- */
29
-
30
- defined('ABSPATH') || die('Cheatin\' uh?');
31
-
32
- define('ROCKET_LL_VERSION', '2.3.2');
33
- define('ROCKET_LL_WP_VERSION', '4.7');
34
- define('ROCKET_LL_PHP_VERSION', '5.6');
35
- define('ROCKET_LL_BASENAME', plugin_basename(__FILE__));
36
- define('ROCKET_LL_PATH', realpath(plugin_dir_path(__FILE__)) . '/');
37
- define('ROCKET_LL_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets/');
38
- define('ROCKET_LL_FRONT_JS_URL', ROCKET_LL_ASSETS_URL . 'js/');
39
- define('ROCKET_LL_INT_MAX', PHP_INT_MAX - 15);
40
-
41
- require ROCKET_LL_PATH . 'src/rocket-lazyload-requirements-check.php';
42
-
43
- /**
44
- * Loads plugin translations
45
- *
46
- * @since 2.0
47
- * @author Remy Perona
48
- *
49
- * @return void
50
- */
51
- function rocket_lazyload_textdomain()
52
- {
53
- // Load translations from the languages directory.
54
- $locale = get_locale();
55
-
56
- // This filter is documented in /wp-includes/l10n.php.
57
- $locale = apply_filters('plugin_locale', $locale, 'rocket-lazy-load'); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
58
- load_textdomain('rocket-lazy-load', WP_LANG_DIR . '/plugins/rocket-lazy-load-' . $locale . '.mo');
59
-
60
- load_plugin_textdomain('rocket-lazy-load', false, dirname(plugin_basename(__FILE__)) . '/languages/');
61
- }
62
-
63
- add_action('plugins_loaded', 'rocket_lazyload_textdomain');
64
-
65
- $rocket_lazyload_requirement_checks = new Rocket_Lazyload_Requirements_Check(
66
- array(
67
- 'plugin_name' => 'Lazy Load by WP Rocket',
68
- 'plugin_version' => ROCKET_LL_VERSION,
69
- 'wp_version' => ROCKET_LL_WP_VERSION,
70
- 'php_version' => ROCKET_LL_PHP_VERSION,
71
- )
72
- );
73
-
74
- if ($rocket_lazyload_requirement_checks->check()) {
75
- require ROCKET_LL_PATH . 'main.php';
76
- }
77
-
78
- unset($rocket_lazyload_requirement_checks);
1
+ <?php
2
+ /**
3
+ * Plugin Name: Lazy Load - Optimize Images
4
+ * Plugin URI: http://wordpress.org/plugins/rocket-lazy-load/
5
+ * Description: The tiny Lazy Load script for WordPress without jQuery or others libraries.
6
+ * Version: 2.3.3
7
+ * Requires PHP: 5.6
8
+ * Author: WP Rocket
9
+ * Author URI: https://wp-rocket.me
10
+ * Text Domain: rocket-lazy-load
11
+ * Domain Path: /languages
12
+ *
13
+ * @package RocketLazyloadPlugin
14
+ *
15
+ * Copyright 2015-2019 WP Media
16
+ *
17
+ * This program is free software; you can redistribute it and/or modify
18
+ * it under the terms of the GNU General Public License as published by
19
+ * the Free Software Foundation; either version 2 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * This program is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
29
+ */
30
+
31
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
32
+
33
+ define( 'ROCKET_LL_VERSION', '2.3.3' );
34
+ define( 'ROCKET_LL_WP_VERSION', '4.9' );
35
+ define( 'ROCKET_LL_PHP_VERSION', '5.6' );
36
+ define( 'ROCKET_LL_BASENAME', plugin_basename( __FILE__ ) );
37
+ define( 'ROCKET_LL_PATH', realpath( plugin_dir_path( __FILE__ ) ) . '/' );
38
+ define( 'ROCKET_LL_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' );
39
+ define( 'ROCKET_LL_FRONT_JS_URL', ROCKET_LL_ASSETS_URL . 'js/' );
40
+ define( 'ROCKET_LL_INT_MAX', PHP_INT_MAX - 15 );
41
+
42
+ require ROCKET_LL_PATH . 'src/rocket-lazyload-requirements-check.php';
43
+
44
+ /**
45
+ * Loads plugin translations
46
+ *
47
+ * @since 2.0
48
+ * @author Remy Perona
49
+ *
50
+ * @return void
51
+ */
52
+ function rocket_lazyload_textdomain() {
53
+ // Load translations from the languages directory.
54
+ $locale = get_locale();
55
+
56
+ // This filter is documented in /wp-includes/l10n.php.
57
+ $locale = apply_filters( 'plugin_locale', $locale, 'rocket-lazy-load' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
58
+ load_textdomain( 'rocket-lazy-load', WP_LANG_DIR . '/plugins/rocket-lazy-load-' . $locale . '.mo' );
59
+
60
+ load_plugin_textdomain( 'rocket-lazy-load', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
61
+ }
62
+
63
+ add_action( 'plugins_loaded', 'rocket_lazyload_textdomain' );
64
+
65
+ $rocket_lazyload_requirement_checks = new Rocket_Lazyload_Requirements_Check(
66
+ [
67
+ 'plugin_name' => 'Lazy Load by WP Rocket',
68
+ 'plugin_version' => ROCKET_LL_VERSION,
69
+ 'wp_version' => ROCKET_LL_WP_VERSION,
70
+ 'php_version' => ROCKET_LL_PHP_VERSION,
71
+ ]
72
+ );
73
+
74
+ if ( $rocket_lazyload_requirement_checks->check() ) {
75
+ require ROCKET_LL_PATH . 'main.php';
76
+ }
77
+
78
+ unset( $rocket_lazyload_requirement_checks );
src/Admin/AdminPage.php CHANGED
@@ -1,176 +1,176 @@
1
- <?php
2
- /**
3
- * Admin Page Class
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Admin;
9
-
10
- defined('ABSPATH') || die('Cheatin\' uh?');
11
-
12
- use RocketLazyLoadPlugin\Options\Options;
13
- use RocketLazyLoadPlugin\Options\OptionArray;
14
-
15
- /**
16
- * Admin page configuration
17
- *
18
- * @since 2.0
19
- * @author Remy Perona
20
- */
21
- class AdminPage
22
- {
23
- /**
24
- * Plugin slug
25
- *
26
- * @since 2.0
27
- * @author Remy Perona
28
- *
29
- * @var string
30
- */
31
- private $slug = 'rocket_lazyload';
32
-
33
- /**
34
- * Options instance
35
- *
36
- * @since 2.0
37
- * @author Remy Perona
38
- *
39
- * @var Options
40
- */
41
- private $options;
42
-
43
- /**
44
- * OptionArray instance
45
- *
46
- * @since 2.0
47
- * @author Remy Perona
48
- *
49
- * @var OptionArray
50
- */
51
- private $option_array;
52
-
53
- /**
54
- * Template path
55
- *
56
- * @since 2.0
57
- * @author Remy Perona
58
- *
59
- * @var string
60
- */
61
- private $template_path;
62
-
63
- /**
64
- * Constructor
65
- *
66
- * @since 2.0
67
- * @author Remy Perona
68
- *
69
- * @param Options $options Options instance.
70
- * @param OptionArray $option_array OptionArray instance.
71
- * @param string $template_path Template path.
72
- */
73
- public function __construct(Options $options, OptionArray $option_array, $template_path)
74
- {
75
- $this->options = $options;
76
- $this->option_array = $option_array;
77
- $this->template_path = $template_path;
78
- }
79
-
80
- /**
81
- * Registers plugin settings with WordPress
82
- *
83
- * @since 2.0
84
- * @author Remy Perona
85
- *
86
- * @return void
87
- */
88
- public function configure()
89
- {
90
- register_setting($this->getSlug(), $this->options->getOptionName('_options'));
91
- }
92
-
93
- /**
94
- * Gets the settings page title
95
- *
96
- * @since 2.0
97
- * @author Remy Perona
98
- *
99
- * @return string
100
- */
101
- public function getPageTitle()
102
- {
103
- return __('LazyLoad by WP Rocket', 'rocket-lazy-load');
104
- }
105
-
106
- /**
107
- * Gets the settings submenu title
108
- *
109
- * @since 2.0
110
- * @author Remy Perona
111
- *
112
- * @return string
113
- */
114
- public function getMenuTitle()
115
- {
116
- return __('LazyLoad', 'rocket-lazy-load');
117
- }
118
-
119
- /**
120
- * Gets the plugin slug
121
- *
122
- * @since 2.0
123
- * @author Remy Perona
124
- *
125
- * @return string
126
- */
127
- public function getSlug()
128
- {
129
- return $this->slug;
130
- }
131
-
132
- /**
133
- * Gets the plugin required capability
134
- *
135
- * @since 2.0
136
- * @author Remy Perona
137
- *
138
- * @return string
139
- */
140
- public function getCapability()
141
- {
142
- return 'manage_options';
143
- }
144
-
145
- /**
146
- * Renders the admin page template
147
- *
148
- * @since 2.0
149
- * @author Remy Perona
150
- *
151
- * @return void
152
- */
153
- public function renderPage()
154
- {
155
- $this->renderTemplate('admin-page');
156
- }
157
-
158
- /**
159
- * Renders the given template if it's readable.
160
- *
161
- * @since 2.0
162
- * @author Remy Perona
163
- *
164
- * @param string $template Template name.
165
- */
166
- protected function renderTemplate($template)
167
- {
168
- $template_path = $this->template_path . $template . '.php';
169
-
170
- if (! is_readable($template_path)) {
171
- return;
172
- }
173
-
174
- include $template_path;
175
- }
176
- }
1
+ <?php
2
+ /**
3
+ * Admin Page Class
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Admin;
9
+
10
+ defined('ABSPATH') || die('Cheatin\' uh?');
11
+
12
+ use RocketLazyLoadPlugin\Options\Options;
13
+ use RocketLazyLoadPlugin\Options\OptionArray;
14
+
15
+ /**
16
+ * Admin page configuration
17
+ *
18
+ * @since 2.0
19
+ * @author Remy Perona
20
+ */
21
+ class AdminPage
22
+ {
23
+ /**
24
+ * Plugin slug
25
+ *
26
+ * @since 2.0
27
+ * @author Remy Perona
28
+ *
29
+ * @var string
30
+ */
31
+ private $slug = 'rocket_lazyload';
32
+
33
+ /**
34
+ * Options instance
35
+ *
36
+ * @since 2.0
37
+ * @author Remy Perona
38
+ *
39
+ * @var Options
40
+ */
41
+ private $options;
42
+
43
+ /**
44
+ * OptionArray instance
45
+ *
46
+ * @since 2.0
47
+ * @author Remy Perona
48
+ *
49
+ * @var OptionArray
50
+ */
51
+ private $option_array;
52
+
53
+ /**
54
+ * Template path
55
+ *
56
+ * @since 2.0
57
+ * @author Remy Perona
58
+ *
59
+ * @var string
60
+ */
61
+ private $template_path;
62
+
63
+ /**
64
+ * Constructor
65
+ *
66
+ * @since 2.0
67
+ * @author Remy Perona
68
+ *
69
+ * @param Options $options Options instance.
70
+ * @param OptionArray $option_array OptionArray instance.
71
+ * @param string $template_path Template path.
72
+ */
73
+ public function __construct(Options $options, OptionArray $option_array, $template_path)
74
+ {
75
+ $this->options = $options;
76
+ $this->option_array = $option_array;
77
+ $this->template_path = $template_path;
78
+ }
79
+
80
+ /**
81
+ * Registers plugin settings with WordPress
82
+ *
83
+ * @since 2.0
84
+ * @author Remy Perona
85
+ *
86
+ * @return void
87
+ */
88
+ public function configure()
89
+ {
90
+ register_setting($this->getSlug(), $this->options->getOptionName('_options'));
91
+ }
92
+
93
+ /**
94
+ * Gets the settings page title
95
+ *
96
+ * @since 2.0
97
+ * @author Remy Perona
98
+ *
99
+ * @return string
100
+ */
101
+ public function getPageTitle()
102
+ {
103
+ return __('LazyLoad by WP Rocket', 'rocket-lazy-load');
104
+ }
105
+
106
+ /**
107
+ * Gets the settings submenu title
108
+ *
109
+ * @since 2.0
110
+ * @author Remy Perona
111
+ *
112
+ * @return string
113
+ */
114
+ public function getMenuTitle()
115
+ {
116
+ return __('LazyLoad', 'rocket-lazy-load');
117
+ }
118
+
119
+ /**
120
+ * Gets the plugin slug
121
+ *
122
+ * @since 2.0
123
+ * @author Remy Perona
124
+ *
125
+ * @return string
126
+ */
127
+ public function getSlug()
128
+ {
129
+ return $this->slug;
130
+ }
131
+
132
+ /**
133
+ * Gets the plugin required capability
134
+ *
135
+ * @since 2.0
136
+ * @author Remy Perona
137
+ *
138
+ * @return string
139
+ */
140
+ public function getCapability()
141
+ {
142
+ return 'manage_options';
143
+ }
144
+
145
+ /**
146
+ * Renders the admin page template
147
+ *
148
+ * @since 2.0
149
+ * @author Remy Perona
150
+ *
151
+ * @return void
152
+ */
153
+ public function renderPage()
154
+ {
155
+ $this->renderTemplate('admin-page');
156
+ }
157
+
158
+ /**
159
+ * Renders the given template if it's readable.
160
+ *
161
+ * @since 2.0
162
+ * @author Remy Perona
163
+ *
164
+ * @param string $template Template name.
165
+ */
166
+ protected function renderTemplate($template)
167
+ {
168
+ $template_path = $this->template_path . $template . '.php';
169
+
170
+ if (! is_readable($template_path)) {
171
+ return;
172
+ }
173
+
174
+ include $template_path;
175
+ }
176
+ }
src/Admin/ImagifyNotice.php CHANGED
@@ -1,72 +1,72 @@
1
- <?php
2
- /**
3
- * Imagify Notice Class
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Admin;
9
-
10
- /**
11
- * Imagify Notice display
12
- *
13
- * @since 2.0
14
- * @author Remy Perona
15
- */
16
- class ImagifyNotice
17
- {
18
- /**
19
- * Template path
20
- *
21
- * @since 2.0
22
- * @author Remy Perona
23
- *
24
- * @var string
25
- */
26
- private $template_path;
27
-
28
- /**
29
- * Constructor
30
- *
31
- * @since 2.0
32
- * @author Remy Perona
33
- *
34
- * @param string $template_path Template path.
35
- */
36
- public function __construct($template_path)
37
- {
38
- $this->template_path = $template_path;
39
- }
40
-
41
- /**
42
- * Renders the Imagify notice
43
- *
44
- * @since 2.0
45
- * @author Remy Perona
46
- *
47
- * @return void
48
- */
49
- public function displayNotice()
50
- {
51
- $this->renderTemplate('imagify-notice');
52
- }
53
-
54
- /**
55
- * Renders the given template if it's readable.
56
- *
57
- * @since 2.0
58
- * @author Remy Perona
59
- *
60
- * @param string $template Template name.
61
- */
62
- protected function renderTemplate($template)
63
- {
64
- $template_path = $this->template_path . $template . '.php';
65
-
66
- if (! is_readable($template_path)) {
67
- return;
68
- }
69
-
70
- include $template_path;
71
- }
72
- }
1
+ <?php
2
+ /**
3
+ * Imagify Notice Class
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Admin;
9
+
10
+ /**
11
+ * Imagify Notice display
12
+ *
13
+ * @since 2.0
14
+ * @author Remy Perona
15
+ */
16
+ class ImagifyNotice
17
+ {
18
+ /**
19
+ * Template path
20
+ *
21
+ * @since 2.0
22
+ * @author Remy Perona
23
+ *
24
+ * @var string
25
+ */
26
+ private $template_path;
27
+
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @since 2.0
32
+ * @author Remy Perona
33
+ *
34
+ * @param string $template_path Template path.
35
+ */
36
+ public function __construct($template_path)
37
+ {
38
+ $this->template_path = $template_path;
39
+ }
40
+
41
+ /**
42
+ * Renders the Imagify notice
43
+ *
44
+ * @since 2.0
45
+ * @author Remy Perona
46
+ *
47
+ * @return void
48
+ */
49
+ public function displayNotice()
50
+ {
51
+ $this->renderTemplate('imagify-notice');
52
+ }
53
+
54
+ /**
55
+ * Renders the given template if it's readable.
56
+ *
57
+ * @since 2.0
58
+ * @author Remy Perona
59
+ *
60
+ * @param string $template Template name.
61
+ */
62
+ protected function renderTemplate($template)
63
+ {
64
+ $template_path = $this->template_path . $template . '.php';
65
+
66
+ if (! is_readable($template_path)) {
67
+ return;
68
+ }
69
+
70
+ include $template_path;
71
+ }
72
+ }
src/Dependencies/Interop/Container/ContainerInterface.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Interop\Container;
7
-
8
- use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerInterface as PsrContainerInterface;
9
-
10
- /**
11
- * Describes the interface of a container that exposes methods to read its entries.
12
- */
13
- interface ContainerInterface extends PsrContainerInterface
14
- {
15
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Interop\Container;
7
+
8
+ use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerInterface as PsrContainerInterface;
9
+
10
+ /**
11
+ * Describes the interface of a container that exposes methods to read its entries.
12
+ */
13
+ interface ContainerInterface extends PsrContainerInterface
14
+ {
15
+ }
src/Dependencies/Interop/Container/Exception/ContainerException.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
7
-
8
- use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerExceptionInterface as PsrContainerException;
9
-
10
- /**
11
- * Base interface representing a generic exception in a container.
12
- */
13
- interface ContainerException extends PsrContainerException
14
- {
15
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
7
+
8
+ use RocketLazyLoadPlugin\Dependencies\Psr\Container\ContainerExceptionInterface as PsrContainerException;
9
+
10
+ /**
11
+ * Base interface representing a generic exception in a container.
12
+ */
13
+ interface ContainerException extends PsrContainerException
14
+ {
15
+ }
src/Dependencies/Interop/Container/Exception/NotFoundException.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
7
-
8
- use RocketLazyLoadPlugin\Dependencies\Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
9
-
10
- /**
11
- * No entry was found in the container.
12
- */
13
- interface NotFoundException extends ContainerException, PsrNotFoundException
14
- {
15
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception;
7
+
8
+ use RocketLazyLoadPlugin\Dependencies\Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
9
+
10
+ /**
11
+ * No entry was found in the container.
12
+ */
13
+ interface NotFoundException extends ContainerException, PsrNotFoundException
14
+ {
15
+ }
src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
- use ReflectionFunctionAbstract;
7
-
8
- interface ArgumentResolverInterface extends ImmutableContainerAwareInterface
9
- {
10
- /**
11
- * Resolve an array of arguments to their concrete implementations.
12
- *
13
- * @param array $arguments
14
- * @return array
15
- */
16
- public function resolveArguments(array $arguments);
17
-
18
- /**
19
- * Resolves the correct arguments to be passed to a method.
20
- *
21
- * @param \ReflectionFunctionAbstract $method
22
- * @param array $args
23
- * @return array
24
- */
25
- public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []);
26
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
+ use ReflectionFunctionAbstract;
7
+
8
+ interface ArgumentResolverInterface extends ImmutableContainerAwareInterface
9
+ {
10
+ /**
11
+ * Resolve an array of arguments to their concrete implementations.
12
+ *
13
+ * @param array $arguments
14
+ * @return array
15
+ */
16
+ public function resolveArguments(array $arguments);
17
+
18
+ /**
19
+ * Resolves the correct arguments to be passed to a method.
20
+ *
21
+ * @param \ReflectionFunctionAbstract $method
22
+ * @param array $args
23
+ * @return array
24
+ */
25
+ public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []);
26
+ }
src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php CHANGED
@@ -1,82 +1,82 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\ReflectionContainer;
7
- use ReflectionFunctionAbstract;
8
- use ReflectionParameter;
9
-
10
- trait ArgumentResolverTrait
11
- {
12
- /**
13
- * {@inheritdoc}
14
- */
15
- public function resolveArguments(array $arguments)
16
- {
17
- foreach ($arguments as &$arg) {
18
- if ($arg instanceof RawArgumentInterface) {
19
- $arg = $arg->getValue();
20
- continue;
21
- }
22
-
23
- if (! is_string($arg)) {
24
- continue;
25
- }
26
-
27
- $container = $this->getContainer();
28
-
29
- if (is_null($container) && $this instanceof ReflectionContainer) {
30
- $container = $this;
31
- }
32
-
33
- if (! is_null($container) && $container->has($arg)) {
34
- $arg = $container->get($arg);
35
-
36
- if ($arg instanceof RawArgumentInterface) {
37
- $arg = $arg->getValue();
38
- }
39
-
40
- continue;
41
- }
42
- }
43
-
44
- return $arguments;
45
- }
46
-
47
- /**
48
- * {@inheritdoc}
49
- */
50
- public function reflectArguments(ReflectionFunctionAbstract $method, array $args = [])
51
- {
52
- $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) {
53
- $name = $param->getName();
54
- $class = $param->getClass();
55
-
56
- if (array_key_exists($name, $args)) {
57
- return $args[$name];
58
- }
59
-
60
- if (! is_null($class)) {
61
- return $class->getName();
62
- }
63
-
64
- if ($param->isDefaultValueAvailable()) {
65
- return $param->getDefaultValue();
66
- }
67
-
68
- throw new NotFoundException(sprintf(
69
- 'Unable to resolve a value for parameter (%s) in the function/method (%s)',
70
- $name,
71
- $method->getName()
72
- ));
73
- }, $method->getParameters());
74
-
75
- return $this->resolveArguments($arguments);
76
- }
77
-
78
- /**
79
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
80
- */
81
- abstract public function getContainer();
82
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ReflectionContainer;
7
+ use ReflectionFunctionAbstract;
8
+ use ReflectionParameter;
9
+
10
+ trait ArgumentResolverTrait
11
+ {
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function resolveArguments(array $arguments)
16
+ {
17
+ foreach ($arguments as &$arg) {
18
+ if ($arg instanceof RawArgumentInterface) {
19
+ $arg = $arg->getValue();
20
+ continue;
21
+ }
22
+
23
+ if (! is_string($arg)) {
24
+ continue;
25
+ }
26
+
27
+ $container = $this->getContainer();
28
+
29
+ if (is_null($container) && $this instanceof ReflectionContainer) {
30
+ $container = $this;
31
+ }
32
+
33
+ if (! is_null($container) && $container->has($arg)) {
34
+ $arg = $container->get($arg);
35
+
36
+ if ($arg instanceof RawArgumentInterface) {
37
+ $arg = $arg->getValue();
38
+ }
39
+
40
+ continue;
41
+ }
42
+ }
43
+
44
+ return $arguments;
45
+ }
46
+
47
+ /**
48
+ * {@inheritdoc}
49
+ */
50
+ public function reflectArguments(ReflectionFunctionAbstract $method, array $args = [])
51
+ {
52
+ $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) {
53
+ $name = $param->getName();
54
+ $class = $param->getClass();
55
+
56
+ if (array_key_exists($name, $args)) {
57
+ return $args[$name];
58
+ }
59
+
60
+ if (! is_null($class)) {
61
+ return $class->getName();
62
+ }
63
+
64
+ if ($param->isDefaultValueAvailable()) {
65
+ return $param->getDefaultValue();
66
+ }
67
+
68
+ throw new NotFoundException(sprintf(
69
+ 'Unable to resolve a value for parameter (%s) in the function/method (%s)',
70
+ $name,
71
+ $method->getName()
72
+ ));
73
+ }, $method->getParameters());
74
+
75
+ return $this->resolveArguments($arguments);
76
+ }
77
+
78
+ /**
79
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
80
+ */
81
+ abstract public function getContainer();
82
+ }
src/Dependencies/League/Container/Argument/RawArgument.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
-
5
- class RawArgument implements RawArgumentInterface
6
- {
7
- /**
8
- * @var mixed
9
- */
10
- protected $value;
11
-
12
- /**
13
- * {@inheritdoc}
14
- */
15
- public function __construct($value)
16
- {
17
- $this->value = $value;
18
- }
19
-
20
- /**
21
- * {@inheritdoc}
22
- */
23
- public function getValue()
24
- {
25
- return $this->value;
26
- }
27
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
+
5
+ class RawArgument implements RawArgumentInterface
6
+ {
7
+ /**
8
+ * @var mixed
9
+ */
10
+ protected $value;
11
+
12
+ /**
13
+ * {@inheritdoc}
14
+ */
15
+ public function __construct($value)
16
+ {
17
+ $this->value = $value;
18
+ }
19
+
20
+ /**
21
+ * {@inheritdoc}
22
+ */
23
+ public function getValue()
24
+ {
25
+ return $this->value;
26
+ }
27
+ }
src/Dependencies/League/Container/Argument/RawArgumentInterface.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
-
5
- interface RawArgumentInterface
6
- {
7
- /**
8
- * Return the value of the raw argument.
9
- *
10
- * @return mixed
11
- */
12
- public function getValue();
13
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Argument;
4
+
5
+ interface RawArgumentInterface
6
+ {
7
+ /**
8
+ * Return the value of the raw argument.
9
+ *
10
+ * @return mixed
11
+ */
12
+ public function getValue();
13
+ }
src/Dependencies/League/Container/Container.php CHANGED
@@ -1,305 +1,305 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\RawArgumentInterface;
7
- use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactory;
8
- use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface;
9
- use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface;
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
11
- use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregate;
12
- use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface;
13
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregate;
14
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface;
15
-
16
- class Container implements ContainerInterface
17
- {
18
- /**
19
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface
20
- */
21
- protected $definitionFactory;
22
-
23
- /**
24
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
25
- */
26
- protected $definitions = [];
27
-
28
- /**
29
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
30
- */
31
- protected $sharedDefinitions = [];
32
-
33
- /**
34
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface
35
- */
36
- protected $inflectors;
37
-
38
- /**
39
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface
40
- */
41
- protected $providers;
42
-
43
- /**
44
- * @var array
45
- */
46
- protected $shared = [];
47
-
48
- /**
49
- * @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface[]
50
- */
51
- protected $delegates = [];
52
-
53
- /**
54
- * Constructor.
55
- *
56
- * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers
57
- * @param \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface|null $inflectors
58
- * @param \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface|null $definitionFactory
59
- */
60
- public function __construct(
61
- ServiceProviderAggregateInterface $providers = null,
62
- InflectorAggregateInterface $inflectors = null,
63
- DefinitionFactoryInterface $definitionFactory = null
64
- ) {
65
- // set required dependencies
66
- $this->providers = (is_null($providers))
67
- ? (new ServiceProviderAggregate)->setContainer($this)
68
- : $providers->setContainer($this);
69
-
70
- $this->inflectors = (is_null($inflectors))
71
- ? (new InflectorAggregate)->setContainer($this)
72
- : $inflectors->setContainer($this);
73
-
74
- $this->definitionFactory = (is_null($definitionFactory))
75
- ? (new DefinitionFactory)->setContainer($this)
76
- : $definitionFactory->setContainer($this);
77
- }
78
-
79
- /**
80
- * {@inheritdoc}
81
- */
82
- public function get($alias, array $args = [])
83
- {
84
- try {
85
- return $this->getFromThisContainer($alias, $args);
86
- } catch (NotFoundException $exception) {
87
- if ($this->providers->provides($alias)) {
88
- $this->providers->register($alias);
89
-
90
- return $this->getFromThisContainer($alias, $args);
91
- }
92
-
93
- $resolved = $this->getFromDelegate($alias, $args);
94
-
95
- return $this->inflectors->inflect($resolved);
96
- }
97
- }
98
-
99
- /**
100
- * {@inheritdoc}
101
- */
102
- public function has($alias)
103
- {
104
- if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) {
105
- return true;
106
- }
107
-
108
- if ($this->providers->provides($alias)) {
109
- return true;
110
- }
111
-
112
- return $this->hasInDelegate($alias);
113
- }
114
-
115
- /**
116
- * Returns a boolean to determine if the container has a shared instance of an alias.
117
- *
118
- * @param string $alias
119
- * @param boolean $resolved
120
- * @return boolean
121
- */
122
- public function hasShared($alias, $resolved = false)
123
- {
124
- $shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared;
125
-
126
- return (array_key_exists($alias, $shared));
127
- }
128
-
129
- /**
130
- * {@inheritdoc}
131
- */
132
- public function add($alias, $concrete = null, $share = false)
133
- {
134
- unset($this->shared[$alias]);
135
- unset($this->definitions[$alias]);
136
- unset($this->sharedDefinitions[$alias]);
137
-
138
- if (is_null($concrete)) {
139
- $concrete = $alias;
140
- }
141
-
142
- $definition = $this->definitionFactory->getDefinition($alias, $concrete);
143
-
144
- if ($definition instanceof DefinitionInterface) {
145
- if ($share === false) {
146
- $this->definitions[$alias] = $definition;
147
- } else {
148
- $this->sharedDefinitions[$alias] = $definition;
149
- }
150
-
151
- return $definition;
152
- }
153
-
154
- // dealing with a value that cannot build a definition
155
- $this->shared[$alias] = $concrete;
156
- }
157
-
158
- /**
159
- * {@inheritdoc}
160
- */
161
- public function share($alias, $concrete = null)
162
- {
163
- return $this->add($alias, $concrete, true);
164
- }
165
-
166
- /**
167
- * {@inheritdoc}
168
- */
169
- public function addServiceProvider($provider)
170
- {
171
- $this->providers->add($provider);
172
-
173
- return $this;
174
- }
175
-
176
- /**
177
- * {@inheritdoc}
178
- */
179
- public function extend($alias)
180
- {
181
- if ($this->providers->provides($alias)) {
182
- $this->providers->register($alias);
183
- }
184
-
185
- if (array_key_exists($alias, $this->definitions)) {
186
- return $this->definitions[$alias];
187
- }
188
-
189
- if (array_key_exists($alias, $this->sharedDefinitions)) {
190
- return $this->sharedDefinitions[$alias];
191
- }
192
-
193
- throw new NotFoundException(
194
- sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias)
195
- );
196
- }
197
-
198
- /**
199
- * {@inheritdoc}
200
- */
201
- public function inflector($type, callable $callback = null)
202
- {
203
- return $this->inflectors->add($type, $callback);
204
- }
205
-
206
- /**
207
- * {@inheritdoc}
208
- */
209
- public function call(callable $callable, array $args = [])
210
- {
211
- return (new ReflectionContainer)->setContainer($this)->call($callable, $args);
212
- }
213
-
214
- /**
215
- * Delegate a backup container to be checked for services if it
216
- * cannot be resolved via this container.
217
- *
218
- * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
219
- * @return $this
220
- */
221
- public function delegate(InteropContainerInterface $container)
222
- {
223
- $this->delegates[] = $container;
224
-
225
- if ($container instanceof ImmutableContainerAwareInterface) {
226
- $container->setContainer($this);
227
- }
228
-
229
- return $this;
230
- }
231
-
232
- /**
233
- * Returns true if service is registered in one of the delegated backup containers.
234
- *
235
- * @param string $alias
236
- * @return boolean
237
- */
238
- public function hasInDelegate($alias)
239
- {
240
- foreach ($this->delegates as $container) {
241
- if ($container->has($alias)) {
242
- return true;
243
- }
244
- }
245
-
246
- return false;
247
- }
248
-
249
- /**
250
- * Attempt to get a service from the stack of delegated backup containers.
251
- *
252
- * @param string $alias
253
- * @param array $args
254
- * @return mixed
255
- */
256
- protected function getFromDelegate($alias, array $args = [])
257
- {
258
- foreach ($this->delegates as $container) {
259
- if ($container->has($alias)) {
260
- return $container->get($alias, $args);
261
- }
262
-
263
- continue;
264
- }
265
-
266
- throw new NotFoundException(
267
- sprintf('Alias (%s) is not being managed by the container', $alias)
268
- );
269
-
270
- }
271
-
272
- /**
273
- * Get a service that has been registered in this container.
274
- *
275
- * @param string $alias
276
- * @param array $args
277
- * @return mixed
278
- */
279
- protected function getFromThisContainer($alias, array $args = [])
280
- {
281
- if ($this->hasShared($alias, true)) {
282
- $shared = $this->inflectors->inflect($this->shared[$alias]);
283
- if ($shared instanceof RawArgumentInterface) {
284
- return $shared->getValue();
285
- }
286
- return $shared;
287
- }
288
-
289
- if (array_key_exists($alias, $this->sharedDefinitions)) {
290
- $shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build());
291
- $this->shared[$alias] = $shared;
292
- return $shared;
293
- }
294
-
295
- if (array_key_exists($alias, $this->definitions)) {
296
- return $this->inflectors->inflect(
297
- $this->definitions[$alias]->build($args)
298
- );
299
- }
300
-
301
- throw new NotFoundException(
302
- sprintf('Alias (%s) is not being managed by the container', $alias)
303
- );
304
- }
305
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\RawArgumentInterface;
7
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactory;
8
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface;
9
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface;
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
11
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregate;
12
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface;
13
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregate;
14
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface;
15
+
16
+ class Container implements ContainerInterface
17
+ {
18
+ /**
19
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface
20
+ */
21
+ protected $definitionFactory;
22
+
23
+ /**
24
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
25
+ */
26
+ protected $definitions = [];
27
+
28
+ /**
29
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface[]
30
+ */
31
+ protected $sharedDefinitions = [];
32
+
33
+ /**
34
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface
35
+ */
36
+ protected $inflectors;
37
+
38
+ /**
39
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface
40
+ */
41
+ protected $providers;
42
+
43
+ /**
44
+ * @var array
45
+ */
46
+ protected $shared = [];
47
+
48
+ /**
49
+ * @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface[]
50
+ */
51
+ protected $delegates = [];
52
+
53
+ /**
54
+ * Constructor.
55
+ *
56
+ * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers
57
+ * @param \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\InflectorAggregateInterface|null $inflectors
58
+ * @param \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionFactoryInterface|null $definitionFactory
59
+ */
60
+ public function __construct(
61
+ ServiceProviderAggregateInterface $providers = null,
62
+ InflectorAggregateInterface $inflectors = null,
63
+ DefinitionFactoryInterface $definitionFactory = null
64
+ ) {
65
+ // set required dependencies
66
+ $this->providers = (is_null($providers))
67
+ ? (new ServiceProviderAggregate)->setContainer($this)
68
+ : $providers->setContainer($this);
69
+
70
+ $this->inflectors = (is_null($inflectors))
71
+ ? (new InflectorAggregate)->setContainer($this)
72
+ : $inflectors->setContainer($this);
73
+
74
+ $this->definitionFactory = (is_null($definitionFactory))
75
+ ? (new DefinitionFactory)->setContainer($this)
76
+ : $definitionFactory->setContainer($this);
77
+ }
78
+
79
+ /**
80
+ * {@inheritdoc}
81
+ */
82
+ public function get($alias, array $args = [])
83
+ {
84
+ try {
85
+ return $this->getFromThisContainer($alias, $args);
86
+ } catch (NotFoundException $exception) {
87
+ if ($this->providers->provides($alias)) {
88
+ $this->providers->register($alias);
89
+
90
+ return $this->getFromThisContainer($alias, $args);
91
+ }
92
+
93
+ $resolved = $this->getFromDelegate($alias, $args);
94
+
95
+ return $this->inflectors->inflect($resolved);
96
+ }
97
+ }
98
+
99
+ /**
100
+ * {@inheritdoc}
101
+ */
102
+ public function has($alias)
103
+ {
104
+ if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) {
105
+ return true;
106
+ }
107
+
108
+ if ($this->providers->provides($alias)) {
109
+ return true;
110
+ }
111
+
112
+ return $this->hasInDelegate($alias);
113
+ }
114
+
115
+ /**
116
+ * Returns a boolean to determine if the container has a shared instance of an alias.
117
+ *
118
+ * @param string $alias
119
+ * @param boolean $resolved
120
+ * @return boolean
121
+ */
122
+ public function hasShared($alias, $resolved = false)
123
+ {
124
+ $shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared;
125
+
126
+ return (array_key_exists($alias, $shared));
127
+ }
128
+
129
+ /**
130
+ * {@inheritdoc}
131
+ */
132
+ public function add($alias, $concrete = null, $share = false)
133
+ {
134
+ unset($this->shared[$alias]);
135
+ unset($this->definitions[$alias]);
136
+ unset($this->sharedDefinitions[$alias]);
137
+
138
+ if (is_null($concrete)) {
139
+ $concrete = $alias;
140
+ }
141
+
142
+ $definition = $this->definitionFactory->getDefinition($alias, $concrete);
143
+
144
+ if ($definition instanceof DefinitionInterface) {
145
+ if ($share === false) {
146
+ $this->definitions[$alias] = $definition;
147
+ } else {
148
+ $this->sharedDefinitions[$alias] = $definition;
149
+ }
150
+
151
+ return $definition;
152
+ }
153
+
154
+ // dealing with a value that cannot build a definition
155
+ $this->shared[$alias] = $concrete;
156
+ }
157
+
158
+ /**
159
+ * {@inheritdoc}
160
+ */
161
+ public function share($alias, $concrete = null)
162
+ {
163
+ return $this->add($alias, $concrete, true);
164
+ }
165
+
166
+ /**
167
+ * {@inheritdoc}
168
+ */
169
+ public function addServiceProvider($provider)
170
+ {
171
+ $this->providers->add($provider);
172
+
173
+ return $this;
174
+ }
175
+
176
+ /**
177
+ * {@inheritdoc}
178
+ */
179
+ public function extend($alias)
180
+ {
181
+ if ($this->providers->provides($alias)) {
182
+ $this->providers->register($alias);
183
+ }
184
+
185
+ if (array_key_exists($alias, $this->definitions)) {
186
+ return $this->definitions[$alias];
187
+ }
188
+
189
+ if (array_key_exists($alias, $this->sharedDefinitions)) {
190
+ return $this->sharedDefinitions[$alias];
191
+ }
192
+
193
+ throw new NotFoundException(
194
+ sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias)
195
+ );
196
+ }
197
+
198
+ /**
199
+ * {@inheritdoc}
200
+ */
201
+ public function inflector($type, callable $callback = null)
202
+ {
203
+ return $this->inflectors->add($type, $callback);
204
+ }
205
+
206
+ /**
207
+ * {@inheritdoc}
208
+ */
209
+ public function call(callable $callable, array $args = [])
210
+ {
211
+ return (new ReflectionContainer)->setContainer($this)->call($callable, $args);
212
+ }
213
+
214
+ /**
215
+ * Delegate a backup container to be checked for services if it
216
+ * cannot be resolved via this container.
217
+ *
218
+ * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
219
+ * @return $this
220
+ */
221
+ public function delegate(InteropContainerInterface $container)
222
+ {
223
+ $this->delegates[] = $container;
224
+
225
+ if ($container instanceof ImmutableContainerAwareInterface) {
226
+ $container->setContainer($this);
227
+ }
228
+
229
+ return $this;
230
+ }
231
+
232
+ /**
233
+ * Returns true if service is registered in one of the delegated backup containers.
234
+ *
235
+ * @param string $alias
236
+ * @return boolean
237
+ */
238
+ public function hasInDelegate($alias)
239
+ {
240
+ foreach ($this->delegates as $container) {
241
+ if ($container->has($alias)) {
242
+ return true;
243
+ }
244
+ }
245
+
246
+ return false;
247
+ }
248
+
249
+ /**
250
+ * Attempt to get a service from the stack of delegated backup containers.
251
+ *
252
+ * @param string $alias
253
+ * @param array $args
254
+ * @return mixed
255
+ */
256
+ protected function getFromDelegate($alias, array $args = [])
257
+ {
258
+ foreach ($this->delegates as $container) {
259
+ if ($container->has($alias)) {
260
+ return $container->get($alias, $args);
261
+ }
262
+
263
+ continue;
264
+ }
265
+
266
+ throw new NotFoundException(
267
+ sprintf('Alias (%s) is not being managed by the container', $alias)
268
+ );
269
+
270
+ }
271
+
272
+ /**
273
+ * Get a service that has been registered in this container.
274
+ *
275
+ * @param string $alias
276
+ * @param array $args
277
+ * @return mixed
278
+ */
279
+ protected function getFromThisContainer($alias, array $args = [])
280
+ {
281
+ if ($this->hasShared($alias, true)) {
282
+ $shared = $this->inflectors->inflect($this->shared[$alias]);
283
+ if ($shared instanceof RawArgumentInterface) {
284
+ return $shared->getValue();
285
+ }
286
+ return $shared;
287
+ }
288
+
289
+ if (array_key_exists($alias, $this->sharedDefinitions)) {
290
+ $shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build());
291
+ $this->shared[$alias] = $shared;
292
+ return $shared;
293
+ }
294
+
295
+ if (array_key_exists($alias, $this->definitions)) {
296
+ return $this->inflectors->inflect(
297
+ $this->definitions[$alias]->build($args)
298
+ );
299
+ }
300
+
301
+ throw new NotFoundException(
302
+ sprintf('Alias (%s) is not being managed by the container', $alias)
303
+ );
304
+ }
305
+ }
src/Dependencies/League/Container/ContainerAwareInterface.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- interface ContainerAwareInterface
6
- {
7
- /**
8
- * Set a container
9
- *
10
- * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
11
- */
12
- public function setContainer(ContainerInterface $container);
13
-
14
- /**
15
- * Get the container
16
- *
17
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
18
- */
19
- public function getContainer();
20
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ interface ContainerAwareInterface
6
+ {
7
+ /**
8
+ * Set a container
9
+ *
10
+ * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
11
+ */
12
+ public function setContainer(ContainerInterface $container);
13
+
14
+ /**
15
+ * Get the container
16
+ *
17
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
18
+ */
19
+ public function getContainer();
20
+ }
src/Dependencies/League/Container/ContainerAwareTrait.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- trait ContainerAwareTrait
6
- {
7
- /**
8
- * @var \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
9
- */
10
- protected $container;
11
-
12
- /**
13
- * Set a container.
14
- *
15
- * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
16
- * @return $this
17
- */
18
- public function setContainer(ContainerInterface $container)
19
- {
20
- $this->container = $container;
21
-
22
- return $this;
23
- }
24
-
25
- /**
26
- * Get the container.
27
- *
28
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
29
- */
30
- public function getContainer()
31
- {
32
- return $this->container;
33
- }
34
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ trait ContainerAwareTrait
6
+ {
7
+ /**
8
+ * @var \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
9
+ */
10
+ protected $container;
11
+
12
+ /**
13
+ * Set a container.
14
+ *
15
+ * @param \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface $container
16
+ * @return $this
17
+ */
18
+ public function setContainer(ContainerInterface $container)
19
+ {
20
+ $this->container = $container;
21
+
22
+ return $this;
23
+ }
24
+
25
+ /**
26
+ * Get the container.
27
+ *
28
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ContainerInterface
29
+ */
30
+ public function getContainer()
31
+ {
32
+ return $this->container;
33
+ }
34
+ }
src/Dependencies/League/Container/ContainerInterface.php CHANGED
@@ -1,59 +1,59 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- interface ContainerInterface extends ImmutableContainerInterface
6
- {
7
- /**
8
- * Add an item to the container.
9
- *
10
- * @param string $alias
11
- * @param mixed|null $concrete
12
- * @param boolean $share
13
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
14
- */
15
- public function add($alias, $concrete = null, $share = false);
16
-
17
- /**
18
- * Convenience method to add an item to the container as a shared item.
19
- *
20
- * @param string $alias
21
- * @param mixed|null $concrete
22
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
23
- */
24
- public function share($alias, $concrete = null);
25
-
26
- /**
27
- * Add a service provider to the container.
28
- *
29
- * @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
30
- * @return void
31
- */
32
- public function addServiceProvider($provider);
33
-
34
- /**
35
- * Returns a definition of an item to be extended.
36
- *
37
- * @param string $alias
38
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
39
- */
40
- public function extend($alias);
41
-
42
- /**
43
- * Allows for manipulation of specific types on resolution.
44
- *
45
- * @param string $type
46
- * @param callable|null $callback
47
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector|void
48
- */
49
- public function inflector($type, callable $callback = null);
50
-
51
- /**
52
- * Invoke a callable via the container.
53
- *
54
- * @param callable $callable
55
- * @param array $args
56
- * @return mixed
57
- */
58
- public function call(callable $callable, array $args = []);
59
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ interface ContainerInterface extends ImmutableContainerInterface
6
+ {
7
+ /**
8
+ * Add an item to the container.
9
+ *
10
+ * @param string $alias
11
+ * @param mixed|null $concrete
12
+ * @param boolean $share
13
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
14
+ */
15
+ public function add($alias, $concrete = null, $share = false);
16
+
17
+ /**
18
+ * Convenience method to add an item to the container as a shared item.
19
+ *
20
+ * @param string $alias
21
+ * @param mixed|null $concrete
22
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
23
+ */
24
+ public function share($alias, $concrete = null);
25
+
26
+ /**
27
+ * Add a service provider to the container.
28
+ *
29
+ * @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
30
+ * @return void
31
+ */
32
+ public function addServiceProvider($provider);
33
+
34
+ /**
35
+ * Returns a definition of an item to be extended.
36
+ *
37
+ * @param string $alias
38
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Definition\DefinitionInterface
39
+ */
40
+ public function extend($alias);
41
+
42
+ /**
43
+ * Allows for manipulation of specific types on resolution.
44
+ *
45
+ * @param string $type
46
+ * @param callable|null $callback
47
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector|void
48
+ */
49
+ public function inflector($type, callable $callback = null);
50
+
51
+ /**
52
+ * Invoke a callable via the container.
53
+ *
54
+ * @param callable $callable
55
+ * @param array $args
56
+ * @return mixed
57
+ */
58
+ public function call(callable $callable, array $args = []);
59
+ }
src/Dependencies/League/Container/Definition/AbstractDefinition.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
7
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
8
-
9
- abstract class AbstractDefinition implements ArgumentResolverInterface, DefinitionInterface
10
- {
11
- use ArgumentResolverTrait;
12
- use ImmutableContainerAwareTrait;
13
-
14
- /**
15
- * @var string
16
- */
17
- protected $alias;
18
-
19
- /**
20
- * @var mixed
21
- */
22
- protected $concrete;
23
-
24
- /**
25
- * @var array
26
- */
27
- protected $arguments = [];
28
-
29
- /**
30
- * Constructor.
31
- *
32
- * @param string $alias
33
- * @param mixed $concrete
34
- */
35
- public function __construct($alias, $concrete)
36
- {
37
- $this->alias = $alias;
38
- $this->concrete = $concrete;
39
- }
40
-
41
- /**
42
- * {@inheritdoc}
43
- */
44
- public function withArgument($arg)
45
- {
46
- $this->arguments[] = $arg;
47
-
48
- return $this;
49
- }
50
-
51
- /**
52
- * {@inheritdoc}
53
- */
54
- public function withArguments(array $args)
55
- {
56
- foreach ($args as $arg) {
57
- $this->withArgument($arg);
58
- }
59
-
60
- return $this;
61
- }
62
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
7
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
8
+
9
+ abstract class AbstractDefinition implements ArgumentResolverInterface, DefinitionInterface
10
+ {
11
+ use ArgumentResolverTrait;
12
+ use ImmutableContainerAwareTrait;
13
+
14
+ /**
15
+ * @var string
16
+ */
17
+ protected $alias;
18
+
19
+ /**
20
+ * @var mixed
21
+ */
22
+ protected $concrete;
23
+
24
+ /**
25
+ * @var array
26
+ */
27
+ protected $arguments = [];
28
+
29
+ /**
30
+ * Constructor.
31
+ *
32
+ * @param string $alias
33
+ * @param mixed $concrete
34
+ */
35
+ public function __construct($alias, $concrete)
36
+ {
37
+ $this->alias = $alias;
38
+ $this->concrete = $concrete;
39
+ }
40
+
41
+ /**
42
+ * {@inheritdoc}
43
+ */
44
+ public function withArgument($arg)
45
+ {
46
+ $this->arguments[] = $arg;
47
+
48
+ return $this;
49
+ }
50
+
51
+ /**
52
+ * {@inheritdoc}
53
+ */
54
+ public function withArguments(array $args)
55
+ {
56
+ foreach ($args as $arg) {
57
+ $this->withArgument($arg);
58
+ }
59
+
60
+ return $this;
61
+ }
62
+ }
src/Dependencies/League/Container/Definition/CallableDefinition.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- class CallableDefinition extends AbstractDefinition
6
- {
7
- /**
8
- * {@inheritdoc}
9
- */
10
- public function build(array $args = [])
11
- {
12
- $args = (empty($args)) ? $this->arguments : $args;
13
- $resolved = $this->resolveArguments($args);
14
-
15
- if (is_array($this->concrete) && is_string($this->concrete[0])) {
16
- $this->concrete[0] = ($this->getContainer()->has($this->concrete[0]))
17
- ? $this->getContainer()->get($this->concrete[0])
18
- : $this->concrete[0];
19
- }
20
-
21
- return call_user_func_array($this->concrete, $resolved);
22
- }
23
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ class CallableDefinition extends AbstractDefinition
6
+ {
7
+ /**
8
+ * {@inheritdoc}
9
+ */
10
+ public function build(array $args = [])
11
+ {
12
+ $args = (empty($args)) ? $this->arguments : $args;
13
+ $resolved = $this->resolveArguments($args);
14
+
15
+ if (is_array($this->concrete) && is_string($this->concrete[0])) {
16
+ $this->concrete[0] = ($this->getContainer()->has($this->concrete[0]))
17
+ ? $this->getContainer()->get($this->concrete[0])
18
+ : $this->concrete[0];
19
+ }
20
+
21
+ return call_user_func_array($this->concrete, $resolved);
22
+ }
23
+ }
src/Dependencies/League/Container/Definition/ClassDefinition.php CHANGED
@@ -1,67 +1,67 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- use ReflectionClass;
6
-
7
- class ClassDefinition extends AbstractDefinition implements ClassDefinitionInterface
8
- {
9
- /**
10
- * @var array
11
- */
12
- protected $methods = [];
13
-
14
- /**
15
- * {@inheritdoc}
16
- */
17
- public function withMethodCall($method, array $args = [])
18
- {
19
- $this->methods[] = [
20
- 'method' => $method,
21
- 'arguments' => $args
22
- ];
23
-
24
- return $this;
25
- }
26
-
27
- /**
28
- * {@inheritdoc}
29
- */
30
- public function withMethodCalls(array $methods = [])
31
- {
32
- foreach ($methods as $method => $args) {
33
- $this->withMethodCall($method, $args);
34
- }
35
-
36
- return $this;
37
- }
38
-
39
- /**
40
- * {@inheritdoc}
41
- */
42
- public function build(array $args = [])
43
- {
44
- $args = (empty($args)) ? $this->arguments : $args;
45
- $resolved = $this->resolveArguments($args);
46
- $reflection = new ReflectionClass($this->concrete);
47
- $instance = $reflection->newInstanceArgs($resolved);
48
-
49
- return $this->invokeMethods($instance);
50
- }
51
-
52
- /**
53
- * Invoke methods on resolved instance.
54
- *
55
- * @param object $instance
56
- * @return object
57
- */
58
- protected function invokeMethods($instance)
59
- {
60
- foreach ($this->methods as $method) {
61
- $args = $this->resolveArguments($method['arguments']);
62
- call_user_func_array([$instance, $method['method']], $args);
63
- }
64
-
65
- return $instance;
66
- }
67
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ use ReflectionClass;
6
+
7
+ class ClassDefinition extends AbstractDefinition implements ClassDefinitionInterface
8
+ {
9
+ /**
10
+ * @var array
11
+ */
12
+ protected $methods = [];
13
+
14
+ /**
15
+ * {@inheritdoc}
16
+ */
17
+ public function withMethodCall($method, array $args = [])
18
+ {
19
+ $this->methods[] = [
20
+ 'method' => $method,
21
+ 'arguments' => $args
22
+ ];
23
+
24
+ return $this;
25
+ }
26
+
27
+ /**
28
+ * {@inheritdoc}
29
+ */
30
+ public function withMethodCalls(array $methods = [])
31
+ {
32
+ foreach ($methods as $method => $args) {
33
+ $this->withMethodCall($method, $args);
34
+ }
35
+
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * {@inheritdoc}
41
+ */
42
+ public function build(array $args = [])
43
+ {
44
+ $args = (empty($args)) ? $this->arguments : $args;
45
+ $resolved = $this->resolveArguments($args);
46
+ $reflection = new ReflectionClass($this->concrete);
47
+ $instance = $reflection->newInstanceArgs($resolved);
48
+
49
+ return $this->invokeMethods($instance);
50
+ }
51
+
52
+ /**
53
+ * Invoke methods on resolved instance.
54
+ *
55
+ * @param object $instance
56
+ * @return object
57
+ */
58
+ protected function invokeMethods($instance)
59
+ {
60
+ foreach ($this->methods as $method) {
61
+ $args = $this->resolveArguments($method['arguments']);
62
+ call_user_func_array([$instance, $method['method']], $args);
63
+ }
64
+
65
+ return $instance;
66
+ }
67
+ }
src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- interface ClassDefinitionInterface extends DefinitionInterface
6
- {
7
- /**
8
- * Add a method to be invoked
9
- *
10
- * @param string $method
11
- * @param array $args
12
- * @return $this
13
- */
14
- public function withMethodCall($method, array $args = []);
15
-
16
- /**
17
- * Add multiple methods to be invoked
18
- *
19
- * @param array $methods
20
- * @return $this
21
- */
22
- public function withMethodCalls(array $methods = []);
23
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ interface ClassDefinitionInterface extends DefinitionInterface
6
+ {
7
+ /**
8
+ * Add a method to be invoked
9
+ *
10
+ * @param string $method
11
+ * @param array $args
12
+ * @return $this
13
+ */
14
+ public function withMethodCall($method, array $args = []);
15
+
16
+ /**
17
+ * Add multiple methods to be invoked
18
+ *
19
+ * @param array $methods
20
+ * @return $this
21
+ */
22
+ public function withMethodCalls(array $methods = []);
23
+ }
src/Dependencies/League/Container/Definition/DefinitionFactory.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
-
7
- class DefinitionFactory implements DefinitionFactoryInterface
8
- {
9
- use ImmutableContainerAwareTrait;
10
-
11
- /**
12
- * {@inheritdoc}
13
- */
14
- public function getDefinition($alias, $concrete)
15
- {
16
- if (is_callable($concrete)) {
17
- return (new CallableDefinition($alias, $concrete))->setContainer($this->getContainer());
18
- }
19
-
20
- if (is_string($concrete) && class_exists($concrete)) {
21
- return (new ClassDefinition($alias, $concrete))->setContainer($this->getContainer());
22
- }
23
-
24
- // if the item is not definable we just return the value to be stored
25
- // in the container as an arbitrary value/instance
26
- return $concrete;
27
- }
28
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
+
7
+ class DefinitionFactory implements DefinitionFactoryInterface
8
+ {
9
+ use ImmutableContainerAwareTrait;
10
+
11
+ /**
12
+ * {@inheritdoc}
13
+ */
14
+ public function getDefinition($alias, $concrete)
15
+ {
16
+ if (is_callable($concrete)) {
17
+ return (new CallableDefinition($alias, $concrete))->setContainer($this->getContainer());
18
+ }
19
+
20
+ if (is_string($concrete) && class_exists($concrete)) {
21
+ return (new ClassDefinition($alias, $concrete))->setContainer($this->getContainer());
22
+ }
23
+
24
+ // if the item is not definable we just return the value to be stored
25
+ // in the container as an arbitrary value/instance
26
+ return $concrete;
27
+ }
28
+ }
src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
-
7
- interface DefinitionFactoryInterface extends ImmutableContainerAwareInterface
8
- {
9
- /**
10
- * Return a definition based on type of concrete.
11
- *
12
- * @param string $alias
13
- * @param mixed $concrete
14
- * @return mixed
15
- */
16
- public function getDefinition($alias, $concrete);
17
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
+
7
+ interface DefinitionFactoryInterface extends ImmutableContainerAwareInterface
8
+ {
9
+ /**
10
+ * Return a definition based on type of concrete.
11
+ *
12
+ * @param string $alias
13
+ * @param mixed $concrete
14
+ * @return mixed
15
+ */
16
+ public function getDefinition($alias, $concrete);
17
+ }
src/Dependencies/League/Container/Definition/DefinitionInterface.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
-
5
- interface DefinitionInterface
6
- {
7
- /**
8
- * Handle instantiation and manipulation of value and return.
9
- *
10
- * @param array $args
11
- * @return mixed
12
- */
13
- public function build(array $args = []);
14
-
15
- /**
16
- * Add an argument to be injected.
17
- *
18
- * @param mixed $arg
19
- * @return $this
20
- */
21
- public function withArgument($arg);
22
-
23
- /**
24
- * Add multiple arguments to be injected.
25
- *
26
- * @param array $args
27
- * @return $this
28
- */
29
- public function withArguments(array $args);
30
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Definition;
4
+
5
+ interface DefinitionInterface
6
+ {
7
+ /**
8
+ * Handle instantiation and manipulation of value and return.
9
+ *
10
+ * @param array $args
11
+ * @return mixed
12
+ */
13
+ public function build(array $args = []);
14
+
15
+ /**
16
+ * Add an argument to be injected.
17
+ *
18
+ * @param mixed $arg
19
+ * @return $this
20
+ */
21
+ public function withArgument($arg);
22
+
23
+ /**
24
+ * Add multiple arguments to be injected.
25
+ *
26
+ * @param array $args
27
+ * @return $this
28
+ */
29
+ public function withArguments(array $args);
30
+ }
src/Dependencies/League/Container/Exception/NotFoundException.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Exception;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface;
6
- use InvalidArgumentException;
7
-
8
- class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
9
- {
10
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Exception;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface;
6
+ use InvalidArgumentException;
7
+
8
+ class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
9
+ {
10
+ }
src/Dependencies/League/Container/ImmutableContainerAwareInterface.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
-
7
- interface ImmutableContainerAwareInterface
8
- {
9
- /**
10
- * Set a container
11
- *
12
- * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
13
- */
14
- public function setContainer(InteropContainerInterface $container);
15
-
16
- /**
17
- * Get the container
18
- *
19
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
20
- */
21
- public function getContainer();
22
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
+
7
+ interface ImmutableContainerAwareInterface
8
+ {
9
+ /**
10
+ * Set a container
11
+ *
12
+ * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
13
+ */
14
+ public function setContainer(InteropContainerInterface $container);
15
+
16
+ /**
17
+ * Get the container
18
+ *
19
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
20
+ */
21
+ public function getContainer();
22
+ }
src/Dependencies/League/Container/ImmutableContainerAwareTrait.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
-
7
- trait ImmutableContainerAwareTrait
8
- {
9
- /**
10
- * @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface
11
- */
12
- protected $container;
13
-
14
- /**
15
- * Set a container.
16
- *
17
- * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
18
- * @return $this
19
- */
20
- public function setContainer(InteropContainerInterface $container)
21
- {
22
- $this->container = $container;
23
-
24
- return $this;
25
- }
26
-
27
- /**
28
- * Get the container.
29
- *
30
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
31
- */
32
- public function getContainer()
33
- {
34
- return $this->container;
35
- }
36
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
+
7
+ trait ImmutableContainerAwareTrait
8
+ {
9
+ /**
10
+ * @var \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface
11
+ */
12
+ protected $container;
13
+
14
+ /**
15
+ * Set a container.
16
+ *
17
+ * @param \RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface $container
18
+ * @return $this
19
+ */
20
+ public function setContainer(InteropContainerInterface $container)
21
+ {
22
+ $this->container = $container;
23
+
24
+ return $this;
25
+ }
26
+
27
+ /**
28
+ * Get the container.
29
+ *
30
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerInterface
31
+ */
32
+ public function getContainer()
33
+ {
34
+ return $this->container;
35
+ }
36
+ }
src/Dependencies/League/Container/ImmutableContainerInterface.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
-
7
- interface ImmutableContainerInterface extends InteropContainerInterface
8
- {
9
-
10
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\Interop\Container\ContainerInterface as InteropContainerInterface;
6
+
7
+ interface ImmutableContainerInterface extends InteropContainerInterface
8
+ {
9
+
10
+ }
src/Dependencies/League/Container/Inflector/Inflector.php CHANGED
@@ -1,103 +1,103 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
7
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
8
-
9
- class Inflector implements ArgumentResolverInterface
10
- {
11
- use ArgumentResolverTrait;
12
- use ImmutableContainerAwareTrait;
13
-
14
- /**
15
- * @var array
16
- */
17
- protected $methods = [];
18
-
19
- /**
20
- * @var array
21
- */
22
- protected $properties = [];
23
-
24
- /**
25
- * Defines a method to be invoked on the subject object.
26
- *
27
- * @param string $name
28
- * @param array $args
29
- * @return $this
30
- */
31
- public function invokeMethod($name, array $args)
32
- {
33
- $this->methods[$name] = $args;
34
-
35
- return $this;
36
- }
37
-
38
- /**
39
- * Defines multiple methods to be invoked on the subject object.
40
- *
41
- * @param array $methods
42
- * @return $this
43
- */
44
- public function invokeMethods(array $methods)
45
- {
46
- foreach ($methods as $name => $args) {
47
- $this->invokeMethod($name, $args);
48
- }
49
-
50
- return $this;
51
- }
52
-
53
- /**
54
- * Defines a property to be set on the subject object.
55
- *
56
- * @param string $property
57
- * @param mixed $value
58
- * @return $this
59
- */
60
- public function setProperty($property, $value)
61
- {
62
- $this->properties[$property] = $value;
63
-
64
- return $this;
65
- }
66
-
67
- /**
68
- * Defines multiple properties to be set on the subject object.
69
- *
70
- * @param array $properties
71
- * @return $this
72
- */
73
- public function setProperties(array $properties)
74
- {
75
- foreach ($properties as $property => $value) {
76
- $this->setProperty($property, $value);
77
- }
78
-
79
- return $this;
80
- }
81
-
82
- /**
83
- * Apply inflections to an object.
84
- *
85
- * @param object $object
86
- * @return void
87
- */
88
- public function inflect($object)
89
- {
90
- $properties = $this->resolveArguments(array_values($this->properties));
91
- $properties = array_combine(array_keys($this->properties), $properties);
92
-
93
- foreach ($properties as $property => $value) {
94
- $object->{$property} = $value;
95
- }
96
-
97
- foreach ($this->methods as $method => $args) {
98
- $args = $this->resolveArguments($args);
99
-
100
- call_user_func_array([$object, $method], $args);
101
- }
102
- }
103
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
7
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
8
+
9
+ class Inflector implements ArgumentResolverInterface
10
+ {
11
+ use ArgumentResolverTrait;
12
+ use ImmutableContainerAwareTrait;
13
+
14
+ /**
15
+ * @var array
16
+ */
17
+ protected $methods = [];
18
+
19
+ /**
20
+ * @var array
21
+ */
22
+ protected $properties = [];
23
+
24
+ /**
25
+ * Defines a method to be invoked on the subject object.
26
+ *
27
+ * @param string $name
28
+ * @param array $args
29
+ * @return $this
30
+ */
31
+ public function invokeMethod($name, array $args)
32
+ {
33
+ $this->methods[$name] = $args;
34
+
35
+ return $this;
36
+ }
37
+
38
+ /**
39
+ * Defines multiple methods to be invoked on the subject object.
40
+ *
41
+ * @param array $methods
42
+ * @return $this
43
+ */
44
+ public function invokeMethods(array $methods)
45
+ {
46
+ foreach ($methods as $name => $args) {
47
+ $this->invokeMethod($name, $args);
48
+ }
49
+
50
+ return $this;
51
+ }
52
+
53
+ /**
54
+ * Defines a property to be set on the subject object.
55
+ *
56
+ * @param string $property
57
+ * @param mixed $value
58
+ * @return $this
59
+ */
60
+ public function setProperty($property, $value)
61
+ {
62
+ $this->properties[$property] = $value;
63
+
64
+ return $this;
65
+ }
66
+
67
+ /**
68
+ * Defines multiple properties to be set on the subject object.
69
+ *
70
+ * @param array $properties
71
+ * @return $this
72
+ */
73
+ public function setProperties(array $properties)
74
+ {
75
+ foreach ($properties as $property => $value) {
76
+ $this->setProperty($property, $value);
77
+ }
78
+
79
+ return $this;
80
+ }
81
+
82
+ /**
83
+ * Apply inflections to an object.
84
+ *
85
+ * @param object $object
86
+ * @return void
87
+ */
88
+ public function inflect($object)
89
+ {
90
+ $properties = $this->resolveArguments(array_values($this->properties));
91
+ $properties = array_combine(array_keys($this->properties), $properties);
92
+
93
+ foreach ($properties as $property => $value) {
94
+ $object->{$property} = $value;
95
+ }
96
+
97
+ foreach ($this->methods as $method => $args) {
98
+ $args = $this->resolveArguments($args);
99
+
100
+ call_user_func_array([$object, $method], $args);
101
+ }
102
+ }
103
+ }
src/Dependencies/League/Container/Inflector/InflectorAggregate.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
-
7
- class InflectorAggregate implements InflectorAggregateInterface
8
- {
9
- use ImmutableContainerAwareTrait;
10
-
11
- /**
12
- * @var array
13
- */
14
- protected $inflectors = [];
15
-
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function add($type, callable $callback = null)
20
- {
21
- if (is_null($callback)) {
22
- $inflector = new Inflector;
23
- $this->inflectors[$type] = $inflector;
24
-
25
- return $inflector;
26
- }
27
-
28
- $this->inflectors[$type] = $callback;
29
- }
30
-
31
- /**
32
- * {@inheritdoc}
33
- */
34
- public function inflect($object)
35
- {
36
- foreach ($this->inflectors as $type => $inflector) {
37
- if (! $object instanceof $type) {
38
- continue;
39
- }
40
-
41
- if ($inflector instanceof Inflector) {
42
- $inflector->setContainer($this->getContainer());
43
- $inflector->inflect($object);
44
- continue;
45
- }
46
-
47
- // must be dealing with a callable as the inflector
48
- call_user_func_array($inflector, [$object]);
49
- }
50
-
51
- return $object;
52
- }
53
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareTrait;
6
+
7
+ class InflectorAggregate implements InflectorAggregateInterface
8
+ {
9
+ use ImmutableContainerAwareTrait;
10
+
11
+ /**
12
+ * @var array
13
+ */
14
+ protected $inflectors = [];
15
+
16
+ /**
17
+ * {@inheritdoc}
18
+ */
19
+ public function add($type, callable $callback = null)
20
+ {
21
+ if (is_null($callback)) {
22
+ $inflector = new Inflector;
23
+ $this->inflectors[$type] = $inflector;
24
+
25
+ return $inflector;
26
+ }
27
+
28
+ $this->inflectors[$type] = $callback;
29
+ }
30
+
31
+ /**
32
+ * {@inheritdoc}
33
+ */
34
+ public function inflect($object)
35
+ {
36
+ foreach ($this->inflectors as $type => $inflector) {
37
+ if (! $object instanceof $type) {
38
+ continue;
39
+ }
40
+
41
+ if ($inflector instanceof Inflector) {
42
+ $inflector->setContainer($this->getContainer());
43
+ $inflector->inflect($object);
44
+ continue;
45
+ }
46
+
47
+ // must be dealing with a callable as the inflector
48
+ call_user_func_array($inflector, [$object]);
49
+ }
50
+
51
+ return $object;
52
+ }
53
+ }
src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
-
7
- interface InflectorAggregateInterface extends ImmutableContainerAwareInterface
8
- {
9
- /**
10
- * Add an inflector to the aggregate.
11
- *
12
- * @param string $type
13
- * @param callable $callback
14
- * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector
15
- */
16
- public function add($type, callable $callback = null);
17
-
18
- /**
19
- * Applies all inflectors to an object.
20
- *
21
- * @param object $object
22
- * @return object
23
- */
24
- public function inflect($object);
25
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\Inflector;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ImmutableContainerAwareInterface;
6
+
7
+ interface InflectorAggregateInterface extends ImmutableContainerAwareInterface
8
+ {
9
+ /**
10
+ * Add an inflector to the aggregate.
11
+ *
12
+ * @param string $type
13
+ * @param callable $callback
14
+ * @return \RocketLazyLoadPlugin\Dependencies\League\Container\Inflector\Inflector
15
+ */
16
+ public function add($type, callable $callback = null);
17
+
18
+ /**
19
+ * Applies all inflectors to an object.
20
+ *
21
+ * @param object $object
22
+ * @return object
23
+ */
24
+ public function inflect($object);
25
+ }
src/Dependencies/League/Container/ReflectionContainer.php CHANGED
@@ -1,87 +1,87 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
7
- use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
8
- use ReflectionClass;
9
- use ReflectionFunction;
10
- use ReflectionMethod;
11
-
12
- class ReflectionContainer implements
13
- ArgumentResolverInterface,
14
- ImmutableContainerInterface
15
- {
16
- use ArgumentResolverTrait;
17
- use ImmutableContainerAwareTrait;
18
-
19
- /**
20
- * {@inheritdoc}
21
- */
22
- public function get($alias, array $args = [])
23
- {
24
- if (! $this->has($alias)) {
25
- throw new NotFoundException(
26
- sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias)
27
- );
28
- }
29
-
30
- $reflector = new ReflectionClass($alias);
31
- $construct = $reflector->getConstructor();
32
-
33
- if ($construct === null) {
34
- return new $alias;
35
- }
36
-
37
- return $reflector->newInstanceArgs(
38
- $this->reflectArguments($construct, $args)
39
- );
40
- }
41
-
42
- /**
43
- * {@inheritdoc}
44
- */
45
- public function has($alias)
46
- {
47
- return class_exists($alias);
48
- }
49
-
50
- /**
51
- * Invoke a callable via the container.
52
- *
53
- * @param callable $callable
54
- * @param array $args
55
- * @return mixed
56
- */
57
- public function call(callable $callable, array $args = [])
58
- {
59
- if (is_string($callable) && strpos($callable, '::') !== false) {
60
- $callable = explode('::', $callable);
61
- }
62
-
63
- if (is_array($callable)) {
64
- if (is_string($callable[0])) {
65
- $callable[0] = $this->getContainer()->get($callable[0]);
66
- }
67
-
68
- $reflection = new ReflectionMethod($callable[0], $callable[1]);
69
-
70
- if ($reflection->isStatic()) {
71
- $callable[0] = null;
72
- }
73
-
74
- return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
75
- }
76
-
77
- if (is_object($callable)) {
78
- $reflection = new ReflectionMethod($callable, '__invoke');
79
-
80
- return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
81
- }
82
-
83
- $reflection = new ReflectionFunction($callable);
84
-
85
- return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
86
- }
87
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverInterface;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Argument\ArgumentResolverTrait;
7
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Exception\NotFoundException;
8
+ use ReflectionClass;
9
+ use ReflectionFunction;
10
+ use ReflectionMethod;
11
+
12
+ class ReflectionContainer implements
13
+ ArgumentResolverInterface,
14
+ ImmutableContainerInterface
15
+ {
16
+ use ArgumentResolverTrait;
17
+ use ImmutableContainerAwareTrait;
18
+
19
+ /**
20
+ * {@inheritdoc}
21
+ */
22
+ public function get($alias, array $args = [])
23
+ {
24
+ if (! $this->has($alias)) {
25
+ throw new NotFoundException(
26
+ sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $alias)
27
+ );
28
+ }
29
+
30
+ $reflector = new ReflectionClass($alias);
31
+ $construct = $reflector->getConstructor();
32
+
33
+ if ($construct === null) {
34
+ return new $alias;
35
+ }
36
+
37
+ return $reflector->newInstanceArgs(
38
+ $this->reflectArguments($construct, $args)
39
+ );
40
+ }
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function has($alias)
46
+ {
47
+ return class_exists($alias);
48
+ }
49
+
50
+ /**
51
+ * Invoke a callable via the container.
52
+ *
53
+ * @param callable $callable
54
+ * @param array $args
55
+ * @return mixed
56
+ */
57
+ public function call(callable $callable, array $args = [])
58
+ {
59
+ if (is_string($callable) && strpos($callable, '::') !== false) {
60
+ $callable = explode('::', $callable);
61
+ }
62
+
63
+ if (is_array($callable)) {
64
+ if (is_string($callable[0])) {
65
+ $callable[0] = $this->getContainer()->get($callable[0]);
66
+ }
67
+
68
+ $reflection = new ReflectionMethod($callable[0], $callable[1]);
69
+
70
+ if ($reflection->isStatic()) {
71
+ $callable[0] = null;
72
+ }
73
+
74
+ return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args));
75
+ }
76
+
77
+ if (is_object($callable)) {
78
+ $reflection = new ReflectionMethod($callable, '__invoke');
79
+
80
+ return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args));
81
+ }
82
+
83
+ $reflection = new ReflectionFunction($callable);
84
+
85
+ return $reflection->invokeArgs($this->reflectArguments($reflection, $args));
86
+ }
87
+ }
src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
6
-
7
- abstract class AbstractServiceProvider implements ServiceProviderInterface
8
- {
9
- use ContainerAwareTrait;
10
-
11
- /**
12
- * @var array
13
- */
14
- protected $provides = [];
15
-
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function provides($alias = null)
20
- {
21
- if (! is_null($alias)) {
22
- return (in_array($alias, $this->provides));
23
- }
24
-
25
- return $this->provides;
26
- }
27
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
6
+
7
+ abstract class AbstractServiceProvider implements ServiceProviderInterface
8
+ {
9
+ use ContainerAwareTrait;
10
+
11
+ /**
12
+ * @var array
13
+ */
14
+ protected $provides = [];
15
+
16
+ /**
17
+ * {@inheritdoc}
18
+ */
19
+ public function provides($alias = null)
20
+ {
21
+ if (! is_null($alias)) {
22
+ return (in_array($alias, $this->provides));
23
+ }
24
+
25
+ return $this->provides;
26
+ }
27
+ }
src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- abstract class AbstractSignatureServiceProvider
6
- extends AbstractServiceProvider
7
- implements SignatureServiceProviderInterface
8
- {
9
- /**
10
- * @var string
11
- */
12
- protected $signature;
13
-
14
- /**
15
- * {@inheritdoc}
16
- */
17
- public function withSignature($signature)
18
- {
19
- $this->signature = $signature;
20
-
21
- return $this;
22
- }
23
-
24
- /**
25
- * {@inheritdoc}
26
- */
27
- public function getSignature()
28
- {
29
- return (is_null($this->signature)) ? get_class($this) : $this->signature;
30
- }
31
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ abstract class AbstractSignatureServiceProvider
6
+ extends AbstractServiceProvider
7
+ implements SignatureServiceProviderInterface
8
+ {
9
+ /**
10
+ * @var string
11
+ */
12
+ protected $signature;
13
+
14
+ /**
15
+ * {@inheritdoc}
16
+ */
17
+ public function withSignature($signature)
18
+ {
19
+ $this->signature = $signature;
20
+
21
+ return $this;
22
+ }
23
+
24
+ /**
25
+ * {@inheritdoc}
26
+ */
27
+ public function getSignature()
28
+ {
29
+ return (is_null($this->signature)) ? get_class($this) : $this->signature;
30
+ }
31
+ }
src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- interface BootableServiceProviderInterface extends ServiceProviderInterface
6
- {
7
- /**
8
- * Method will be invoked on registration of a service provider implementing
9
- * this interface. Provides ability for eager loading of Service Providers.
10
- *
11
- * @return void
12
- */
13
- public function boot();
14
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ interface BootableServiceProviderInterface extends ServiceProviderInterface
6
+ {
7
+ /**
8
+ * Method will be invoked on registration of a service provider implementing
9
+ * this interface. Provides ability for eager loading of Service Providers.
10
+ *
11
+ * @return void
12
+ */
13
+ public function boot();
14
+ }
src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php CHANGED
@@ -1,88 +1,88 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
- use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
7
-
8
- class ServiceProviderAggregate implements ServiceProviderAggregateInterface
9
- {
10
- use ContainerAwareTrait;
11
-
12
- /**
13
- * @var array
14
- */
15
- protected $providers = [];
16
-
17
- /**
18
- * @var array
19
- */
20
- protected $registered = [];
21
-
22
- /**
23
- * {@inheritdoc}
24
- */
25
- public function add($provider)
26
- {
27
- if (is_string($provider) && class_exists($provider)) {
28
- $provider = new $provider;
29
- }
30
-
31
- if ($provider instanceof ContainerAwareInterface) {
32
- $provider->setContainer($this->getContainer());
33
- }
34
-
35
- if ($provider instanceof BootableServiceProviderInterface) {
36
- $provider->boot();
37
- }
38
-
39
- if ($provider instanceof ServiceProviderInterface) {
40
- foreach ($provider->provides() as $service) {
41
- $this->providers[$service] = $provider;
42
- }
43
-
44
- return $this;
45
- }
46
-
47
- throw new \InvalidArgumentException(
48
- 'A service provider must be a fully qualified class name or instance ' .
49
- 'of (\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface)'
50
- );
51
- }
52
-
53
- /**
54
- * {@inheritdoc}
55
- */
56
- public function provides($service)
57
- {
58
- return array_key_exists($service, $this->providers);
59
- }
60
-
61
- /**
62
- * {@inheritdoc}
63
- */
64
- public function register($service)
65
- {
66
- if (! array_key_exists($service, $this->providers)) {
67
- throw new \InvalidArgumentException(
68
- sprintf('(%s) is not provided by a service provider', $service)
69
- );
70
- }
71
-
72
- $provider = $this->providers[$service];
73
- $signature = get_class($provider);
74
-
75
- if ($provider instanceof SignatureServiceProviderInterface) {
76
- $signature = $provider->getSignature();
77
- }
78
-
79
- // ensure that the provider hasn't already been invoked by any other service request
80
- if (in_array($signature, $this->registered)) {
81
- return;
82
- }
83
-
84
- $provider->register();
85
-
86
- $this->registered[] = $signature;
87
- }
88
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareTrait;
7
+
8
+ class ServiceProviderAggregate implements ServiceProviderAggregateInterface
9
+ {
10
+ use ContainerAwareTrait;
11
+
12
+ /**
13
+ * @var array
14
+ */
15
+ protected $providers = [];
16
+
17
+ /**
18
+ * @var array
19
+ */
20
+ protected $registered = [];
21
+
22
+ /**
23
+ * {@inheritdoc}
24
+ */
25
+ public function add($provider)
26
+ {
27
+ if (is_string($provider) && class_exists($provider)) {
28
+ $provider = new $provider;
29
+ }
30
+
31
+ if ($provider instanceof ContainerAwareInterface) {
32
+ $provider->setContainer($this->getContainer());
33
+ }
34
+
35
+ if ($provider instanceof BootableServiceProviderInterface) {
36
+ $provider->boot();
37
+ }
38
+
39
+ if ($provider instanceof ServiceProviderInterface) {
40
+ foreach ($provider->provides() as $service) {
41
+ $this->providers[$service] = $provider;
42
+ }
43
+
44
+ return $this;
45
+ }
46
+
47
+ throw new \InvalidArgumentException(
48
+ 'A service provider must be a fully qualified class name or instance ' .
49
+ 'of (\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface)'
50
+ );
51
+ }
52
+
53
+ /**
54
+ * {@inheritdoc}
55
+ */
56
+ public function provides($service)
57
+ {
58
+ return array_key_exists($service, $this->providers);
59
+ }
60
+
61
+ /**
62
+ * {@inheritdoc}
63
+ */
64
+ public function register($service)
65
+ {
66
+ if (! array_key_exists($service, $this->providers)) {
67
+ throw new \InvalidArgumentException(
68
+ sprintf('(%s) is not provided by a service provider', $service)
69
+ );
70
+ }
71
+
72
+ $provider = $this->providers[$service];
73
+ $signature = get_class($provider);
74
+
75
+ if ($provider instanceof SignatureServiceProviderInterface) {
76
+ $signature = $provider->getSignature();
77
+ }
78
+
79
+ // ensure that the provider hasn't already been invoked by any other service request
80
+ if (in_array($signature, $this->registered)) {
81
+ return;
82
+ }
83
+
84
+ $provider->register();
85
+
86
+ $this->registered[] = $signature;
87
+ }
88
+ }
src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
-
7
- interface ServiceProviderAggregateInterface extends ContainerAwareInterface
8
- {
9
- /**
10
- * Add a service provider to the aggregate.
11
- *
12
- * @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
13
- * @return $this
14
- */
15
- public function add($provider);
16
-
17
- /**
18
- * Determines whether a service is provided by the aggregate.
19
- *
20
- * @param string $service
21
- * @return boolean
22
- */
23
- public function provides($service);
24
-
25
- /**
26
- * Invokes the register method of a provider that provides a specific service.
27
- *
28
- * @param string $service
29
- * @return void
30
- */
31
- public function register($service);
32
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
+
7
+ interface ServiceProviderAggregateInterface extends ContainerAwareInterface
8
+ {
9
+ /**
10
+ * Add a service provider to the aggregate.
11
+ *
12
+ * @param string|\RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface $provider
13
+ * @return $this
14
+ */
15
+ public function add($provider);
16
+
17
+ /**
18
+ * Determines whether a service is provided by the aggregate.
19
+ *
20
+ * @param string $service
21
+ * @return boolean
22
+ */
23
+ public function provides($service);
24
+
25
+ /**
26
+ * Invokes the register method of a provider that provides a specific service.
27
+ *
28
+ * @param string $service
29
+ * @return void
30
+ */
31
+ public function register($service);
32
+ }
src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
-
7
- interface ServiceProviderInterface extends ContainerAwareInterface
8
- {
9
- /**
10
- * Returns a boolean if checking whether this provider provides a specific
11
- * service or returns an array of provided services if no argument passed.
12
- *
13
- * @param string $service
14
- * @return boolean|array
15
- */
16
- public function provides($service = null);
17
-
18
- /**
19
- * Use the register method to register items with the container via the
20
- * protected $this->container property or the `getContainer` method
21
- * from the ContainerAwareTrait.
22
- *
23
- * @return void
24
- */
25
- public function register();
26
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ContainerAwareInterface;
6
+
7
+ interface ServiceProviderInterface extends ContainerAwareInterface
8
+ {
9
+ /**
10
+ * Returns a boolean if checking whether this provider provides a specific
11
+ * service or returns an array of provided services if no argument passed.
12
+ *
13
+ * @param string $service
14
+ * @return boolean|array
15
+ */
16
+ public function provides($service = null);
17
+
18
+ /**
19
+ * Use the register method to register items with the container via the
20
+ * protected $this->container property or the `getContainer` method
21
+ * from the ContainerAwareTrait.
22
+ *
23
+ * @return void
24
+ */
25
+ public function register();
26
+ }
src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
-
3
- namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
-
5
- interface SignatureServiceProviderInterface
6
- {
7
- /**
8
- * Set a custom signature for the service provider. This enables
9
- * registering the same service provider multiple times.
10
- *
11
- * @param string $signature
12
- * @return self
13
- */
14
- public function withSignature($signature);
15
-
16
- /**
17
- * The signature of the service provider uniquely identifies it, so
18
- * that we can quickly determine if it has already been registered.
19
- * Defaults to get_class($provider).
20
- *
21
- * @return string
22
- */
23
- public function getSignature();
24
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider;
4
+
5
+ interface SignatureServiceProviderInterface
6
+ {
7
+ /**
8
+ * Set a custom signature for the service provider. This enables
9
+ * registering the same service provider multiple times.
10
+ *
11
+ * @param string $signature
12
+ * @return self
13
+ */
14
+ public function withSignature($signature);
15
+
16
+ /**
17
+ * The signature of the service provider uniquely identifies it, so
18
+ * that we can quickly determine if it has already been registered.
19
+ * Defaults to get_class($provider).
20
+ *
21
+ * @return string
22
+ */
23
+ public function getSignature();
24
+ }
src/Dependencies/Psr/Container/ContainerExceptionInterface.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
-
8
- /**
9
- * Base interface representing a generic exception in a container.
10
- */
11
- interface ContainerExceptionInterface
12
- {
13
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
+
8
+ /**
9
+ * Base interface representing a generic exception in a container.
10
+ */
11
+ interface ContainerExceptionInterface
12
+ {
13
+ }
src/Dependencies/Psr/Container/ContainerInterface.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
-
8
- /**
9
- * Describes the interface of a container that exposes methods to read its entries.
10
- */
11
- interface ContainerInterface
12
- {
13
- /**
14
- * Finds an entry of the container by its identifier and returns it.
15
- *
16
- * @param string $id Identifier of the entry to look for.
17
- *
18
- * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
19
- * @throws ContainerExceptionInterface Error while retrieving the entry.
20
- *
21
- * @return mixed Entry.
22
- */
23
- public function get($id);
24
-
25
- /**
26
- * Returns true if the container can return an entry for the given identifier.
27
- * Returns false otherwise.
28
- *
29
- * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
30
- * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
31
- *
32
- * @param string $id Identifier of the entry to look for.
33
- *
34
- * @return bool
35
- */
36
- public function has($id);
37
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
+
8
+ /**
9
+ * Describes the interface of a container that exposes methods to read its entries.
10
+ */
11
+ interface ContainerInterface
12
+ {
13
+ /**
14
+ * Finds an entry of the container by its identifier and returns it.
15
+ *
16
+ * @param string $id Identifier of the entry to look for.
17
+ *
18
+ * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
19
+ * @throws ContainerExceptionInterface Error while retrieving the entry.
20
+ *
21
+ * @return mixed Entry.
22
+ */
23
+ public function get($id);
24
+
25
+ /**
26
+ * Returns true if the container can return an entry for the given identifier.
27
+ * Returns false otherwise.
28
+ *
29
+ * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
30
+ * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
31
+ *
32
+ * @param string $id Identifier of the entry to look for.
33
+ *
34
+ * @return bool
35
+ */
36
+ public function has($id);
37
+ }
src/Dependencies/Psr/Container/NotFoundExceptionInterface.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
-
8
- /**
9
- * No entry was found in the container.
10
- */
11
- interface NotFoundExceptionInterface extends ContainerExceptionInterface
12
- {
13
- }
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace RocketLazyLoadPlugin\Dependencies\Psr\Container;
7
+
8
+ /**
9
+ * No entry was found in the container.
10
+ */
11
+ interface NotFoundExceptionInterface extends ContainerExceptionInterface
12
+ {
13
+ }
src/Dependencies/RocketLazyload/Assets.php CHANGED
@@ -1,299 +1,290 @@
1
- <?php
2
- /**
3
- * Handle the lazyload required assets: inline CSS and JS
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
-
10
- /**
11
- * Class containing the methods to return or print the assets needed for lazyloading
12
- */
13
- class Assets
14
- {
15
- /**
16
- * Inserts the lazyload script in the HTML
17
- *
18
- * @param array $args Array of arguments to populate the lazyload script tag.
19
- * @return void
20
- */
21
- public function insertLazyloadScript($args = [])
22
- {
23
- echo $this->getLazyloadScript($args);
24
- }
25
-
26
- /**
27
- * Gets the inline lazyload script configuration
28
- *
29
- * @param array $args Array of arguments to populate the lazyload script options.
30
- * @return string
31
- */
32
- public function getInlineLazyloadScript($args = [])
33
- {
34
- $defaults = [
35
- 'elements' => [
36
- 'img',
37
- 'iframe',
38
- ],
39
- 'threshold' => 300,
40
- 'options' => [],
41
- ];
42
-
43
- $allowed_options = [
44
- 'container' => 1,
45
- 'thresholds' => 1,
46
- 'data_bg' => 1,
47
- 'class_error' => 1,
48
- 'load_delay' => 1,
49
- 'auto_unobserve' => 1,
50
- 'callback_enter' => 1,
51
- 'callback_exit' => 1,
52
- 'callback_reveal' => 1,
53
- 'callback_error' => 1,
54
- 'callback_finish' => 1,
55
- 'use_native' => 1,
56
- ];
57
-
58
- $args = wp_parse_args($args, $defaults);
59
- $script = '';
60
-
61
- $args['options'] = array_intersect_key($args['options'], $allowed_options);
62
-
63
- $script .= 'window.lazyLoadOptions = {
64
- elements_selector: "' . esc_attr(implode(',', $args['elements'])) . '",
65
- data_src: "lazy-src",
66
- data_srcset: "lazy-srcset",
67
- data_sizes: "lazy-sizes",
68
- class_loading: "lazyloading",
69
- class_loaded: "lazyloaded",
70
- threshold: ' . esc_attr($args['threshold']) . ',
71
- callback_loaded: function(element) {
72
- if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
73
- if (element.classList.contains("lazyloaded") ) {
74
- if (typeof window.jQuery != "undefined") {
75
- if (jQuery.fn.fitVids) {
76
- jQuery(element).parent().fitVids();
77
- }
78
- }
79
- }
80
- }
81
- }';
82
-
83
- if (! empty($args['options'])) {
84
- $script .= ',' . PHP_EOL;
85
-
86
- foreach ($args['options'] as $option => $value) {
87
- $script .= $option . ': ' . $value . ',';
88
- }
89
-
90
- $script = rtrim($script, ',');
91
- }
92
-
93
- $script .= '};';
94
-
95
- $script .= '
96
- window.addEventListener(\'LazyLoad::Initialized\', function (e) {
97
- var lazyLoadInstance = e.detail.instance;
98
-
99
- if (window.MutationObserver) {
100
- var observer = new MutationObserver(function(mutations) {
101
- var image_count = 0;
102
- var iframe_count = 0;
103
- var rocketlazy_count = 0;
104
-
105
- mutations.forEach(function(mutation) {
106
- for (i = 0; i < mutation.addedNodes.length; i++) {
107
- if (typeof mutation.addedNodes[i].getElementsByTagName !== \'function\') {
108
- return;
109
- }
110
-
111
- if (typeof mutation.addedNodes[i].getElementsByClassName !== \'function\') {
112
- return;
113
- }
114
-
115
- images = mutation.addedNodes[i].getElementsByTagName(\'img\');
116
- is_image = mutation.addedNodes[i].tagName == "IMG";
117
- iframes = mutation.addedNodes[i].getElementsByTagName(\'iframe\');
118
- is_iframe = mutation.addedNodes[i].tagName == "IFRAME";
119
- rocket_lazy = mutation.addedNodes[i].getElementsByClassName(\'rocket-lazyload\');
120
-
121
- image_count += images.length;
122
- iframe_count += iframes.length;
123
- rocketlazy_count += rocket_lazy.length;
124
-
125
- if(is_image){
126
- image_count += 1;
127
- }
128
-
129
- if(is_iframe){
130
- iframe_count += 1;
131
- }
132
- }
133
- } );
134
-
135
- if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){
136
- lazyLoadInstance.update();
137
- }
138
- } );
139
-
140
- var b = document.getElementsByTagName("body")[0];
141
- var config = { childList: true, subtree: true };
142
-
143
- observer.observe(b, config);
144
- }
145
- }, false);';
146
-
147
- return $script;
148
- }
149
-
150
- /**
151
- * Returns the lazyload inline script
152
- *
153
- * @param array $args Array of arguments to populate the lazyload script options.
154
- * @return string
155
- */
156
- public function getLazyloadScript($args = [])
157
- {
158
- $defaults = [
159
- 'base_url' => '',
160
- 'version' => '',
161
- 'polyfill' => false,
162
- ];
163
-
164
- $args = wp_parse_args($args, $defaults);
165
- $min = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
166
- $script = '';
167
-
168
- if (isset($args['polyfill']) && $args['polyfill']) {
169
- $script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
170
- }
171
-
172
- /**
173
- * Filters the script tag for the lazyload script
174
- *
175
- * @since 2.2.6
176
- *
177
- * @param $script_tag HTML tag for the lazyload script.
178
- */
179
- $script .= apply_filters('rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>');
180
-
181
- return $script;
182
- }
183
-
184
- /**
185
- * Inserts in the HTML the script to replace the Youtube thumbnail by the iframe.
186
- *
187
- * @param array $args Array of arguments to populate the script options.
188
- * @return void
189
- */
190
- public function insertYoutubeThumbnailScript($args = [])
191
- {
192
- echo $this->getYoutubeThumbnailScript($args);
193
- }
194
-
195
- /**
196
- * Returns the Youtube Thumbnail inline script
197
- *
198
- * @param array $args Array of arguments to populate the script options.
199
- * @return string
200
- */
201
- public function getYoutubeThumbnailScript($args = [])
202
- {
203
- $defaults = [
204
- 'resolution' => 'hqdefault',
205
- 'lazy_image' => false,
206
- ];
207
-
208
- $allowed_resolutions = [
209
- 'default' => [
210
- 'width' => 120,
211
- 'height' => 90,
212
- ],
213
- 'mqdefault' => [
214
- 'width' => 320,
215
- 'height' => 180,
216
- ],
217
- 'hqdefault' => [
218
- 'width' => 480,
219
- 'height' => 360,
220
- ],
221
- 'sddefault' => [
222
- 'width' => 640,
223
- 'height' => 480,
224
- ],
225
-
226
- 'maxresdefault' => [
227
- 'width' => 1280,
228
- 'height' => 720,
229
- ],
230
- ];
231
-
232
- $args['resolution'] = ( isset($args['resolution']) && isset($allowed_resolutions[ $args['resolution'] ]) ) ? $args['resolution'] : 'hqdefault';
233
-
234
- $args = wp_parse_args($args, $defaults);
235
-
236
- $image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
237
-
238
- if (isset($args['lazy_image']) && $args['lazy_image']) {
239
- $image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
240
- }
241
-
242
- return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\"allow\", \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
243
- }
244
-
245
- /**
246
- * Inserts the CSS to style the Youtube thumbnail container
247
- *
248
- * @param array $args Array of arguments to populate the CSS.
249
- * @return void
250
- */
251
- public function insertYoutubeThumbnailCSS($args = [])
252
- {
253
- wp_register_style('rocket-lazyload', false);
254
- wp_enqueue_style('rocket-lazyload');
255
- wp_add_inline_style('rocket-lazyload', $this->getYoutubeThumbnailCSS($args));
256
- }
257
-
258
- /**
259
- * Returns the CSS for the Youtube Thumbnail
260
- *
261
- * @param array $args Array of arguments to populate the CSS.
262
- * @return string
263
- */
264
- public function getYoutubeThumbnailCSS($args = [])
265
- {
266
- $defaults = [
267
- 'base_url' => '',
268
- 'responsive_embeds' => true,
269
- ];
270
-
271
- $args = wp_parse_args($args, $defaults);
272
-
273
- $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}';
274
-
275
- if ($args['responsive_embeds']) {
276
- $css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}';
277
- }
278
-
279
- return $css;
280
- }
281
-
282
- /**
283
- * Inserts the CSS needed when Javascript is not enabled to keep the display correct
284
- */
285
- public function insertNoJSCSS()
286
- {
287
- echo $this->getNoJSCSS();
288
- }
289
-
290
- /**
291
- * Returns the CSS to correctly display images when JavaScript is disabled
292
- *
293
- * @return string
294
- */
295
- public function getNoJSCSS()
296
- {
297
- return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
298
- }
299
- }
1
+ <?php
2
+ /**
3
+ * Handle the lazyload required assets: inline CSS and JS
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
+
10
+ /**
11
+ * Class containing the methods to return or print the assets needed for lazyloading
12
+ */
13
+ class Assets {
14
+
15
+ /**
16
+ * Inserts the lazyload script in the HTML
17
+ *
18
+ * @param array $args Array of arguments to populate the lazyload script tag.
19
+ * @return void
20
+ */
21
+ public function insertLazyloadScript( $args = [] ) {
22
+ echo $this->getLazyloadScript( $args );
23
+ }
24
+
25
+ /**
26
+ * Gets the inline lazyload script configuration
27
+ *
28
+ * @param array $args Array of arguments to populate the lazyload script options.
29
+ * @return string
30
+ */
31
+ public function getInlineLazyloadScript( $args = [] ) {
32
+ $defaults = [
33
+ 'elements' => [
34
+ 'img',
35
+ 'iframe',
36
+ ],
37
+ 'threshold' => 300,
38
+ 'options' => [],
39
+ ];
40
+
41
+ $allowed_options = [
42
+ 'container' => 1,
43
+ 'thresholds' => 1,
44
+ 'data_bg' => 1,
45
+ 'class_error' => 1,
46
+ 'load_delay' => 1,
47
+ 'auto_unobserve' => 1,
48
+ 'callback_enter' => 1,
49
+ 'callback_exit' => 1,
50
+ 'callback_reveal' => 1,
51
+ 'callback_error' => 1,
52
+ 'callback_finish' => 1,
53
+ 'use_native' => 1,
54
+ ];
55
+
56
+ $args = wp_parse_args( $args, $defaults );
57
+ $script = '';
58
+
59
+ $args['options'] = array_intersect_key( $args['options'], $allowed_options );
60
+
61
+ $script .= 'window.lazyLoadOptions = {
62
+ elements_selector: "' . esc_attr( implode( ',', $args['elements'] ) ) . '",
63
+ data_src: "lazy-src",
64
+ data_srcset: "lazy-srcset",
65
+ data_sizes: "lazy-sizes",
66
+ class_loading: "lazyloading",
67
+ class_loaded: "lazyloaded",
68
+ threshold: ' . esc_attr( $args['threshold'] ) . ',
69
+ callback_loaded: function(element) {
70
+ if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
71
+ if (element.classList.contains("lazyloaded") ) {
72
+ if (typeof window.jQuery != "undefined") {
73
+ if (jQuery.fn.fitVids) {
74
+ jQuery(element).parent().fitVids();
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }';
80
+
81
+ if ( ! empty( $args['options'] ) ) {
82
+ $script .= ',' . PHP_EOL;
83
+
84
+ foreach ( $args['options'] as $option => $value ) {
85
+ $script .= $option . ': ' . $value . ',';
86
+ }
87
+
88
+ $script = rtrim( $script, ',' );
89
+ }
90
+
91
+ $script .= '};';
92
+
93
+ $script .= '
94
+ window.addEventListener(\'LazyLoad::Initialized\', function (e) {
95
+ var lazyLoadInstance = e.detail.instance;
96
+
97
+ if (window.MutationObserver) {
98
+ var observer = new MutationObserver(function(mutations) {
99
+ var image_count = 0;
100
+ var iframe_count = 0;
101
+ var rocketlazy_count = 0;
102
+
103
+ mutations.forEach(function(mutation) {
104
+ for (i = 0; i < mutation.addedNodes.length; i++) {
105
+ if (typeof mutation.addedNodes[i].getElementsByTagName !== \'function\') {
106
+ return;
107
+ }
108
+
109
+ if (typeof mutation.addedNodes[i].getElementsByClassName !== \'function\') {
110
+ return;
111
+ }
112
+
113
+ images = mutation.addedNodes[i].getElementsByTagName(\'img\');
114
+ is_image = mutation.addedNodes[i].tagName == "IMG";
115
+ iframes = mutation.addedNodes[i].getElementsByTagName(\'iframe\');
116
+ is_iframe = mutation.addedNodes[i].tagName == "IFRAME";
117
+ rocket_lazy = mutation.addedNodes[i].getElementsByClassName(\'rocket-lazyload\');
118
+
119
+ image_count += images.length;
120
+ iframe_count += iframes.length;
121
+ rocketlazy_count += rocket_lazy.length;
122
+
123
+ if(is_image){
124
+ image_count += 1;
125
+ }
126
+
127
+ if(is_iframe){
128
+ iframe_count += 1;
129
+ }
130
+ }
131
+ } );
132
+
133
+ if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){
134
+ lazyLoadInstance.update();
135
+ }
136
+ } );
137
+
138
+ var b = document.getElementsByTagName("body")[0];
139
+ var config = { childList: true, subtree: true };
140
+
141
+ observer.observe(b, config);
142
+ }
143
+ }, false);';
144
+
145
+ return $script;
146
+ }
147
+
148
+ /**
149
+ * Returns the lazyload inline script
150
+ *
151
+ * @param array $args Array of arguments to populate the lazyload script options.
152
+ * @return string
153
+ */
154
+ public function getLazyloadScript( $args = [] ) {
155
+ $defaults = [
156
+ 'base_url' => '',
157
+ 'version' => '',
158
+ 'polyfill' => false,
159
+ ];
160
+
161
+ $args = wp_parse_args( $args, $defaults );
162
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
163
+ $script = '';
164
+
165
+ if ( isset( $args['polyfill'] ) && $args['polyfill'] ) {
166
+ $script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
167
+ }
168
+
169
+ /**
170
+ * Filters the script tag for the lazyload script
171
+ *
172
+ * @since 2.2.6
173
+ *
174
+ * @param $script_tag HTML tag for the lazyload script.
175
+ */
176
+ $script .= apply_filters( 'rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>' );
177
+
178
+ return $script;
179
+ }
180
+
181
+ /**
182
+ * Inserts in the HTML the script to replace the Youtube thumbnail by the iframe.
183
+ *
184
+ * @param array $args Array of arguments to populate the script options.
185
+ * @return void
186
+ */
187
+ public function insertYoutubeThumbnailScript( $args = [] ) {
188
+ echo $this->getYoutubeThumbnailScript( $args );
189
+ }
190
+
191
+ /**
192
+ * Returns the Youtube Thumbnail inline script
193
+ *
194
+ * @param array $args Array of arguments to populate the script options.
195
+ * @return string
196
+ */
197
+ public function getYoutubeThumbnailScript( $args = [] ) {
198
+ $defaults = [
199
+ 'resolution' => 'hqdefault',
200
+ 'lazy_image' => false,
201
+ ];
202
+
203
+ $allowed_resolutions = [
204
+ 'default' => [
205
+ 'width' => 120,
206
+ 'height' => 90,
207
+ ],
208
+ 'mqdefault' => [
209
+ 'width' => 320,
210
+ 'height' => 180,
211
+ ],
212
+ 'hqdefault' => [
213
+ 'width' => 480,
214
+ 'height' => 360,
215
+ ],
216
+ 'sddefault' => [
217
+ 'width' => 640,
218
+ 'height' => 480,
219
+ ],
220
+
221
+ 'maxresdefault' => [
222
+ 'width' => 1280,
223
+ 'height' => 720,
224
+ ],
225
+ ];
226
+
227
+ $args['resolution'] = ( isset( $args['resolution'] ) && isset( $allowed_resolutions[ $args['resolution'] ] ) ) ? $args['resolution'] : 'hqdefault';
228
+
229
+ $args = wp_parse_args( $args, $defaults );
230
+
231
+ $image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
232
+
233
+ if ( isset( $args['lazy_image'] ) && $args['lazy_image'] ) {
234
+ $image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
235
+ }
236
+
237
+ return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.src)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\"allow\", \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.setAttribute(\"data-src\", a[t].dataset.src),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
238
+ }
239
+
240
+ /**
241
+ * Inserts the CSS to style the Youtube thumbnail container
242
+ *
243
+ * @param array $args Array of arguments to populate the CSS.
244
+ * @return void
245
+ */
246
+ public function insertYoutubeThumbnailCSS( $args = [] ) {
247
+ wp_register_style( 'rocket-lazyload', false );
248
+ wp_enqueue_style( 'rocket-lazyload' );
249
+ wp_add_inline_style( 'rocket-lazyload', $this->getYoutubeThumbnailCSS( $args ) );
250
+ }
251
+
252
+ /**
253
+ * Returns the CSS for the Youtube Thumbnail
254
+ *
255
+ * @param array $args Array of arguments to populate the CSS.
256
+ * @return string
257
+ */
258
+ public function getYoutubeThumbnailCSS( $args = [] ) {
259
+ $defaults = [
260
+ 'base_url' => '',
261
+ 'responsive_embeds' => true,
262
+ ];
263
+
264
+ $args = wp_parse_args( $args, $defaults );
265
+
266
+ $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}';
267
+
268
+ if ( $args['responsive_embeds'] ) {
269
+ $css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}';
270
+ }
271
+
272
+ return $css;
273
+ }
274
+
275
+ /**
276
+ * Inserts the CSS needed when Javascript is not enabled to keep the display correct
277
+ */
278
+ public function insertNoJSCSS() {
279
+ echo $this->getNoJSCSS();
280
+ }
281
+
282
+ /**
283
+ * Returns the CSS to correctly display images when JavaScript is disabled
284
+ *
285
+ * @return string
286
+ */
287
+ public function getNoJSCSS() {
288
+ return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
289
+ }
290
+ }
 
 
 
 
 
 
 
 
 
src/Dependencies/RocketLazyload/Iframe.php CHANGED
@@ -1,202 +1,232 @@
1
- <?php
2
- /**
3
- * Handles lazyloading of iframes
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
-
10
- /**
11
- * A class to provide the methods needed to lazyload iframes in WP Rocket and Lazyload by WP Rocket
12
- */
13
- class Iframe
14
- {
15
- /**
16
- * Finds iframes in the HTML provided and call the methods to lazyload them
17
- *
18
- * @param string $html Original HTML.
19
- * @param string $buffer Content to parse.
20
- * @param array $args Array of arguments to use.
21
- * @return string
22
- */
23
- public function lazyloadIframes($html, $buffer, $args = [])
24
- {
25
- $defaults = [
26
- 'youtube' => false,
27
- ];
28
-
29
- $args = wp_parse_args($args, $defaults);
30
-
31
- if (! preg_match_all('@<iframe(?<atts>\s.+)>.*</iframe>@iUs', $buffer, $iframes, PREG_SET_ORDER) ) {
32
- return $html;
33
- }
34
-
35
- $iframes = array_unique($iframes, SORT_REGULAR);
36
-
37
- foreach ($iframes as $iframe) {
38
- if ($this->isIframeExcluded($iframe)) {
39
- continue;
40
- }
41
-
42
- // Given the previous regex pattern, $iframe['atts'] starts with a whitespace character.
43
- if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $iframe['atts'], $atts)) {
44
- continue;
45
- }
46
-
47
- $iframe['src'] = trim($atts['src']);
48
-
49
- if ('' === $iframe['src']) {
50
- continue;
51
- }
52
-
53
- if ($args['youtube']) {
54
- $iframe_lazyload = $this->replaceYoutubeThumbnail($iframe);
55
- }
56
-
57
- if (empty($iframe_lazyload)) {
58
- $iframe_lazyload = $this->replaceIframe($iframe);
59
- }
60
-
61
- $html = str_replace($iframe[0], $iframe_lazyload, $html);
62
-
63
- unset($iframe_lazyload);
64
- }
65
-
66
- return $html;
67
- }
68
-
69
- /**
70
- * Checks if the provided iframe is excluded from lazyload
71
- *
72
- * @param array $iframe Array of matched patterns.
73
- * @return boolean
74
- */
75
- public function isIframeExcluded($iframe)
76
- {
77
-
78
- foreach ($this->getExcludedPatterns() as $excluded_pattern) {
79
- if (strpos($iframe[0], $excluded_pattern) !== false) {
80
- return true;
81
- }
82
- }
83
-
84
- return false;
85
- }
86
-
87
- /**
88
- * Gets patterns excluded from lazyload for iframes
89
- *
90
- * @since 2.1.1
91
- *
92
- * @return array
93
- */
94
- private function getExcludedPatterns()
95
- {
96
- /**
97
- * Filters the patterns excluded from lazyload for iframes
98
- *
99
- * @since 2.1.1
100
- *
101
- * @param array $excluded_patterns Array of excluded patterns.
102
- */
103
- return apply_filters(
104
- 'rocket_lazyload_iframe_excluded_patterns',
105
- [
106
- 'gform_ajax_frame',
107
- 'data-no-lazy=',
108
- 'recaptcha/api/fallback',
109
- 'loading="eager"',
110
- ]
111
- );
112
- }
113
-
114
- /**
115
- * Applies lazyload on the iframe provided
116
- *
117
- * @param array $iframe Array of matched elements.
118
- * @return string
119
- */
120
- private function replaceIframe($iframe)
121
- {
122
- /**
123
- * Filter the LazyLoad placeholder on src attribute
124
- *
125
- * @since 1.0
126
- *
127
- * @param string $placeholder placeholder that will be printed.
128
- */
129
- $placeholder = apply_filters('rocket_lazyload_placeholder', 'about:blank');
130
-
131
- $placeholder_atts = str_replace($iframe['src'], $placeholder, $iframe['atts']);
132
- $iframe_lazyload = str_replace($iframe['atts'], $placeholder_atts . ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url($iframe['src']) . '"', $iframe[0]);
133
-
134
- if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $iframe_lazyload)) {
135
- $iframe_lazyload = str_replace('<iframe', '<iframe loading="lazy"', $iframe_lazyload);
136
- }
137
-
138
- /**
139
- * Filter the LazyLoad HTML output on iframes
140
- *
141
- * @since 1.0
142
- *
143
- * @param array $html Output that will be printed.
144
- */
145
- $iframe_lazyload = apply_filters('rocket_lazyload_iframe_html', $iframe_lazyload);
146
- $iframe_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
147
-
148
- return $iframe_lazyload;
149
- }
150
-
151
- /**
152
- * Replaces the iframe provided by the Youtube thumbnail
153
- *
154
- * @param array $iframe Array of matched elements.
155
- * @return bool|string
156
- */
157
- private function replaceYoutubeThumbnail($iframe)
158
- {
159
- $youtube_id = $this->getYoutubeIDFromURL($iframe['src']);
160
-
161
- if (! $youtube_id) {
162
- return false;
163
- }
164
-
165
- $query = wp_parse_url(htmlspecialchars_decode($iframe['src']), PHP_URL_QUERY);
166
-
167
- /**
168
- * Filter the LazyLoad HTML output on Youtube iframes
169
- *
170
- * @since 2.11
171
- *
172
- * @param array $html Output that will be printed.
173
- */
174
- $youtube_lazyload = apply_filters('rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-id="' . esc_attr($youtube_id) . '" data-query="' . esc_attr($query) . '"></div>');
175
- $youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
176
-
177
- return $youtube_lazyload;
178
- }
179
-
180
- /**
181
- * Gets the Youtube ID from the URL provided
182
- *
183
- * @param string $url URL to search.
184
- * @return bool|string
185
- */
186
- public function getYoutubeIDFromURL($url)
187
- {
188
- $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be|youtube\.com|youtube-nocookie\.com)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
189
- $result = preg_match($pattern, $url, $matches);
190
-
191
- if (! $result) {
192
- return false;
193
- }
194
-
195
- // exclude playlist.
196
- if ('videoseries' === $matches[1]) {
197
- return false;
198
- }
199
-
200
- return $matches[1];
201
- }
202
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles lazyloading of iframes
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
+
10
+ /**
11
+ * A class to provide the methods needed to lazyload iframes in WP Rocket and Lazyload by WP Rocket
12
+ */
13
+ class Iframe {
14
+
15
+ /**
16
+ * Finds iframes in the HTML provided and call the methods to lazyload them
17
+ *
18
+ * @param string $html Original HTML.
19
+ * @param string $buffer Content to parse.
20
+ * @param array $args Array of arguments to use.
21
+ * @return string
22
+ */
23
+ public function lazyloadIframes( $html, $buffer, $args = [] ) {
24
+ $defaults = [
25
+ 'youtube' => false,
26
+ ];
27
+
28
+ $args = wp_parse_args( $args, $defaults );
29
+
30
+ if ( ! preg_match_all( '@<iframe(?<atts>\s.+)>.*</iframe>@iUs', $buffer, $iframes, PREG_SET_ORDER ) ) {
31
+ return $html;
32
+ }
33
+
34
+ $iframes = array_unique( $iframes, SORT_REGULAR );
35
+
36
+ foreach ( $iframes as $iframe ) {
37
+ if ( $this->isIframeExcluded( $iframe ) ) {
38
+ continue;
39
+ }
40
+
41
+ // Given the previous regex pattern, $iframe['atts'] starts with a whitespace character.
42
+ if ( ! preg_match( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $iframe['atts'], $atts ) ) {
43
+ continue;
44
+ }
45
+
46
+ $iframe['src'] = trim( $atts['src'] );
47
+
48
+ if ( '' === $iframe['src'] ) {
49
+ continue;
50
+ }
51
+
52
+ if ( $args['youtube'] ) {
53
+ $iframe_lazyload = $this->replaceYoutubeThumbnail( $iframe );
54
+ }
55
+
56
+ if ( empty( $iframe_lazyload ) ) {
57
+ $iframe_lazyload = $this->replaceIframe( $iframe );
58
+ }
59
+
60
+ $html = str_replace( $iframe[0], $iframe_lazyload, $html );
61
+
62
+ unset( $iframe_lazyload );
63
+ }
64
+
65
+ return $html;
66
+ }
67
+
68
+ /**
69
+ * Checks if the provided iframe is excluded from lazyload
70
+ *
71
+ * @param array $iframe Array of matched patterns.
72
+ * @return boolean
73
+ */
74
+ public function isIframeExcluded( $iframe ) {
75
+
76
+ foreach ( $this->getExcludedPatterns() as $excluded_pattern ) {
77
+ if ( strpos( $iframe[0], $excluded_pattern ) !== false ) {
78
+ return true;
79
+ }
80
+ }
81
+
82
+ return false;
83
+ }
84
+
85
+ /**
86
+ * Gets patterns excluded from lazyload for iframes
87
+ *
88
+ * @since 2.1.1
89
+ *
90
+ * @return array
91
+ */
92
+ private function getExcludedPatterns() {
93
+ /**
94
+ * Filters the patterns excluded from lazyload for iframes
95
+ *
96
+ * @since 2.1.1
97
+ *
98
+ * @param array $excluded_patterns Array of excluded patterns.
99
+ */
100
+ return apply_filters(
101
+ 'rocket_lazyload_iframe_excluded_patterns',
102
+ [
103
+ 'gform_ajax_frame',
104
+ 'data-no-lazy=',
105
+ 'recaptcha/api/fallback',
106
+ 'loading="eager"',
107
+ 'data-skip-lazy',
108
+ 'skip-lazy',
109
+ ]
110
+ );
111
+ }
112
+
113
+ /**
114
+ * Applies lazyload on the iframe provided
115
+ *
116
+ * @param array $iframe Array of matched elements.
117
+ * @return string
118
+ */
119
+ private function replaceIframe( $iframe ) {
120
+ /**
121
+ * Filter the LazyLoad placeholder on src attribute
122
+ *
123
+ * @since 1.0
124
+ *
125
+ * @param string $placeholder placeholder that will be printed.
126
+ */
127
+ $placeholder = apply_filters( 'rocket_lazyload_placeholder', 'about:blank' );
128
+
129
+ $placeholder_atts = str_replace( $iframe['src'], $placeholder, $iframe['atts'] );
130
+ $iframe_lazyload = str_replace( $iframe['atts'], $placeholder_atts . ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url( $iframe['src'] ) . '"', $iframe[0] );
131
+
132
+ if ( ! preg_match( '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $iframe_lazyload ) ) {
133
+ $iframe_lazyload = str_replace( '<iframe', '<iframe loading="lazy"', $iframe_lazyload );
134
+ }
135
+
136
+ /**
137
+ * Filter the LazyLoad HTML output on iframes
138
+ *
139
+ * @since 1.0
140
+ *
141
+ * @param array $html Output that will be printed.
142
+ */
143
+ $iframe_lazyload = apply_filters( 'rocket_lazyload_iframe_html', $iframe_lazyload );
144
+ $iframe_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
145
+
146
+ return $iframe_lazyload;
147
+ }
148
+
149
+ /**
150
+ * Replaces the iframe provided by the Youtube thumbnail
151
+ *
152
+ * @param array $iframe Array of matched elements.
153
+ * @return bool|string
154
+ */
155
+ private function replaceYoutubeThumbnail( $iframe ) {
156
+ $youtube_id = $this->getYoutubeIDFromURL( $iframe['src'] );
157
+
158
+ if ( ! $youtube_id ) {
159
+ return false;
160
+ }
161
+
162
+ $query = wp_parse_url( htmlspecialchars_decode( $iframe['src'] ), PHP_URL_QUERY );
163
+
164
+ $youtube_url = $this->changeYoutubeUrlForYoutuDotBe( $iframe['src'] );
165
+ $youtube_url = $this->cleanYoutubeUrl( $iframe['src'] );
166
+ /**
167
+ * Filter the LazyLoad HTML output on Youtube iframes
168
+ *
169
+ * @since 2.11
170
+ *
171
+ * @param array $html Output that will be printed.
172
+ */
173
+ $youtube_lazyload = apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '"></div>' );
174
+ $youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
175
+
176
+ return $youtube_lazyload;
177
+ }
178
+
179
+ /**
180
+ * Gets the Youtube ID from the URL provided
181
+ *
182
+ * @param string $url URL to search.
183
+ * @return bool|string
184
+ */
185
+ public function getYoutubeIDFromURL( $url ) {
186
+ $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be|youtube\.com|youtube-nocookie\.com)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
187
+ $result = preg_match( $pattern, $url, $matches );
188
+
189
+ if ( ! $result ) {
190
+ return false;
191
+ }
192
+
193
+ // exclude playlist.
194
+ if ( 'videoseries' === $matches[1] ) {
195
+ return false;
196
+ }
197
+
198
+ return $matches[1];
199
+ }
200
+
201
+ /**
202
+ * Changes URL youtu.be/ID to youtube.com/embed/ID
203
+ *
204
+ * @param string $url URL to replace.
205
+ * @return string Unchanged URL or modified URL.
206
+ */
207
+ public function changeYoutubeUrlForYoutuDotBe( $url ) {
208
+ $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
209
+ $result = preg_match( $pattern, $url, $matches );
210
+
211
+ if ( ! $result ) {
212
+ return $url;
213
+ }
214
+
215
+ return 'https://www.youtube.com/embed/' . $matches[1];
216
+ }
217
+
218
+ /**
219
+ * Cleans Youtube URL. Keeps only scheme, host and path.
220
+ *
221
+ * @param string $url URL to be cleaned.
222
+ * @return string Cleaned URL
223
+ */
224
+ public function cleanYoutubeUrl( $url ) {
225
+ $parsed_url = wp_parse_url( $url, -1 );
226
+ $scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] . '://' : '//';
227
+ $host = isset( $parsed_url['host'] ) ? $parsed_url['host'] : '';
228
+ $path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '';
229
+
230
+ return $scheme . $host . $path;
231
+ }
232
+ }
src/Dependencies/RocketLazyload/Image.php CHANGED
@@ -1,474 +1,465 @@
1
- <?php
2
- /**
3
- * Handles lazyloading of images
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
-
10
- /**
11
- * A class to provide the methods needed to lazyload images in WP Rocket and Lazyload by WP Rocket
12
- */
13
- class Image
14
- {
15
- /**
16
- * Finds the images to be lazyloaded and call the callback method to replace them.
17
- *
18
- * @param string $html Original HTML.
19
- * @param string $buffer Content to parse.
20
- * @return string
21
- */
22
- public function lazyloadImages($html, $buffer)
23
- {
24
- if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER)) {
25
- return $html;
26
- }
27
-
28
- $images = array_unique($images, SORT_REGULAR);
29
-
30
- foreach ($images as $image) {
31
- $image = $this->canLazyload($image);
32
-
33
- if (! $image) {
34
- continue;
35
- }
36
-
37
- $image_lazyload = $this->replaceImage($image);
38
- $image_lazyload .= $this->noscript($image[0]);
39
- $html = str_replace($image[0], $image_lazyload, $html);
40
-
41
- unset($image_lazyload);
42
- }
43
-
44
- return $html;
45
- }
46
-
47
- /**
48
- * Applies lazyload on background images defined in style attributes
49
- *
50
- * @param string $html Original HTML.
51
- * @param string $buffer Content to parse.
52
- * @return string
53
- */
54
- public function lazyloadBackgroundImages($html, $buffer)
55
- {
56
- if (! preg_match_all('#<(?<tag>div|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER)) {
57
- return $html;
58
- }
59
-
60
- foreach ($elements as $element) {
61
- if ($this->isExcluded($element['before'] . $element['after'], $this->getExcludedAttributes())) {
62
- continue;
63
- }
64
-
65
- if (! preg_match('#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url)) {
66
- continue;
67
- }
68
-
69
- $url['url'] = trim($url['url'], '\'" ');
70
-
71
- if ($this->isExcluded($url['url'], $this->getExcludedSrc())) {
72
- continue;
73
- }
74
-
75
- $lazy_bg = $this->addLazyCLass($element[0]);
76
- $lazy_bg = str_replace($url[0], '', $lazy_bg);
77
- $lazy_bg = str_replace('<' . $element['tag'], '<' . $element['tag'] . ' data-bg="url(' . esc_attr($url['url']) . ')"', $lazy_bg);
78
-
79
- $html = str_replace($element[0], $lazy_bg, $html);
80
- unset($lazy_bg);
81
- }
82
-
83
- return $html;
84
- }
85
-
86
- /**
87
- * Add the identifier class to the element
88
- *
89
- * @param string $element Element to add the class to.
90
- * @return string
91
- */
92
- private function addLazyClass($element)
93
- {
94
- if (preg_match('#class=["\']?(?<classes>[^"\'>]*)["\']?#is', $element, $class)) {
95
- $classes = str_replace($class['classes'], $class['classes'] . ' rocket-lazyload', $class[0]);
96
- $element = str_replace($class[0], $classes, $element);
97
-
98
- return $element;
99
- }
100
-
101
- return preg_replace('#<(img|div|section|li|span)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element);
102
- }
103
-
104
- /**
105
- * Applies lazyload on picture elements found in the HTML.
106
- *
107
- * @param string $html Original HTML.
108
- * @param string $buffer Content to parse.
109
- * @return string
110
- */
111
- public function lazyloadPictures($html, $buffer)
112
- {
113
- if (! preg_match_all('#<picture(?:.*)?>(?<sources>.*)</picture>#iUs', $buffer, $pictures, PREG_SET_ORDER)) {
114
- return $html;
115
- }
116
-
117
- $pictures = array_unique($pictures, SORT_REGULAR);
118
- $excluded = array_merge($this->getExcludedAttributes(), $this->getExcludedSrc());
119
-
120
- foreach ($pictures as $picture) {
121
- if ($this->isExcluded($picture[0], $excluded)) {
122
- continue;
123
- }
124
-
125
- if (preg_match_all('#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER)) {
126
- $sources = array_unique($sources, SORT_REGULAR);
127
-
128
- $lazy_sources = 0;
129
-
130
- foreach ($sources as $source) {
131
- $lazyload_srcset = preg_replace('/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0]);
132
- $html = str_replace($source[0], $lazyload_srcset, $html);
133
-
134
- unset($lazyload_srcset);
135
- $lazy_sources++;
136
- }
137
- }
138
-
139
- if (0 === $lazy_sources) {
140
- continue;
141
- }
142
-
143
- if (! preg_match('#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img)) {
144
- continue;
145
- }
146
-
147
- $img = $this->canLazyload($img);
148
-
149
- if (! $img) {
150
- continue;
151
- }
152
-
153
- $img_lazy = $this->replaceImage($img);
154
- $html = str_replace($img[0], $img_lazy, $html);
155
-
156
- unset($img_lazy);
157
- }
158
-
159
- return $html;
160
- }
161
-
162
- /**
163
- * Checks if the image can be lazyloaded
164
- *
165
- * @param Array $image Array of image data coming from Regex.
166
- * @return bool|Array
167
- */
168
- private function canLazyload($image)
169
- {
170
- if ($this->isExcluded($image['atts'], $this->getExcludedAttributes())) {
171
- return false;
172
- }
173
-
174
- // Given the previous regex pattern, $image['atts'] starts with a whitespace character.
175
- if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $image['atts'], $atts)) {
176
- return false;
177
- }
178
-
179
- $image['src'] = trim($atts['src']);
180
-
181
- if ('' === $image['src']) {
182
- return false;
183
- }
184
-
185
- if ($this->isExcluded($image['src'], $this->getExcludedSrc())) {
186
- return false;
187
- }
188
-
189
- // Don't apply LazyLoad on images from WP Retina x2.
190
- if (function_exists('wr2x_picture_rewrite')) {
191
- if (wr2x_get_retina(trailingslashit(ABSPATH) . wr2x_get_pathinfo_from_image_src(trim($image['src'], '"')))) {
192
- return false;
193
- }
194
- }
195
-
196
- return $image;
197
- }
198
-
199
- /**
200
- * Checks if the provided string matches with the provided excluded patterns
201
- *
202
- * @param string $string String to check.
203
- * @param array $excluded_values Patterns to match against.
204
- * @return boolean
205
- */
206
- public function isExcluded($string, $excluded_values)
207
- {
208
- if (! is_array($excluded_values)) {
209
- (array) $excluded_values;
210
- }
211
-
212
- if (empty($excluded_values)) {
213
- return false;
214
- }
215
-
216
- foreach ($excluded_values as $excluded_value) {
217
- if (strpos($string, $excluded_value) !== false) {
218
- return true;
219
- }
220
- }
221
-
222
- return false;
223
- }
224
-
225
- /**
226
- * Returns the list of excluded attributes
227
- *
228
- * @return array
229
- */
230
- public function getExcludedAttributes()
231
- {
232
- /**
233
- * Filters the attributes used to prevent lazylad from being applied
234
- *
235
- * @since 1.0
236
- * @author Remy Perona
237
- *
238
- * @param array $excluded_attributes An array of excluded attributes.
239
- */
240
- return apply_filters(
241
- 'rocket_lazyload_excluded_attributes',
242
- [
243
- 'data-src=',
244
- 'data-no-lazy=',
245
- 'data-lazy-original=',
246
- 'data-lazy-src=',
247
- 'data-lazysrc=',
248
- 'data-lazyload=',
249
- 'data-bgposition=',
250
- 'data-envira-src=',
251
- 'fullurl=',
252
- 'lazy-slider-img=',
253
- 'data-srcset=',
254
- 'class="ls-l',
255
- 'class="ls-bg',
256
- 'soliloquy-image',
257
- 'loading="eager"',
258
- 'swatch-img',
259
- 'data-height-percentage',
260
- 'data-large_image',
261
- 'avia-bg-style-fixed',
262
- ]
263
- );
264
- }
265
-
266
- /**
267
- * Returns the list of excluded src
268
- *
269
- * @return array
270
- */
271
- public function getExcludedSrc()
272
- {
273
- /**
274
- * Filters the src used to prevent lazylad from being applied
275
- *
276
- * @since 1.0
277
- * @author Remy Perona
278
- *
279
- * @param array $excluded_src An array of excluded src.
280
- */
281
- return apply_filters(
282
- 'rocket_lazyload_excluded_src',
283
- [
284
- '/wpcf7_captcha/',
285
- 'timthumb.php?src',
286
- 'woocommerce/assets/images/placeholder.png',
287
- ]
288
- );
289
- }
290
-
291
- /**
292
- * Replaces the original image by the lazyload one
293
- *
294
- * @param array $image Array of matches elements.
295
- * @return string
296
- */
297
- private function replaceImage($image)
298
- {
299
- $width = 0;
300
- $height = 0;
301
-
302
- if (preg_match('@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts)) {
303
- $width = absint($atts['width']);
304
- }
305
-
306
- if (preg_match('@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts)) {
307
- $height = absint($atts['height']);
308
- }
309
-
310
- $placeholder_atts = preg_replace('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder($width, $height) . '"', $image['atts']);
311
-
312
- $image_lazyload = str_replace($image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0]);
313
-
314
- if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload)) {
315
- $image_lazyload = str_replace('<img', '<img loading="lazy"', $image_lazyload);
316
- }
317
-
318
- /**
319
- * Filter the LazyLoad HTML output
320
- *
321
- * @since 1.0
322
- *
323
- * @param string $html Output that will be printed
324
- */
325
- $image_lazyload = apply_filters('rocket_lazyload_html', $image_lazyload);
326
-
327
- return $image_lazyload;
328
- }
329
-
330
- /**
331
- * Returns the HTML tag wrapped inside noscript tags
332
- *
333
- * @param string $element Element to wrap.
334
- * @return string
335
- */
336
- private function noscript($element)
337
- {
338
- return '<noscript>' . $element . '</noscript>';
339
- }
340
-
341
- /**
342
- * Applies lazyload on srcset and sizes attributes
343
- *
344
- * @param string $html HTML image tag.
345
- * @return string
346
- */
347
- public function lazyloadResponsiveAttributes($html)
348
- {
349
- $html = preg_replace('/[\s|"|\'](srcset)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
350
- $html = preg_replace('/[\s|"|\'](sizes)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
351
-
352
- return $html;
353
- }
354
-
355
- /**
356
- * Finds patterns matching smiley and call the callback method to replace them with the image
357
- *
358
- * @param string $text Content to search in.
359
- * @return string
360
- */
361
- public function convertSmilies($text)
362
- {
363
- global $wp_smiliessearch;
364
-
365
- if (! get_option('use_smilies') || empty($wp_smiliessearch)) {
366
- return $text;
367
- }
368
-
369
- $output = '';
370
- // HTML loop taken from texturize function, could possible be consolidated.
371
- $textarr = preg_split('/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between.
372
- $stop = count($textarr);// loop stuff.
373
-
374
- // Ignore proessing of specific tags.
375
- $tags_to_ignore = 'code|pre|style|script|textarea';
376
- $ignore_block_element = '';
377
-
378
- for ($i = 0; $i < $stop; $i++) {
379
- $content = $textarr[ $i ];
380
-
381
- // If we're in an ignore block, wait until we find its closing tag.
382
- if ('' === $ignore_block_element && preg_match('/^<(' . $tags_to_ignore . ')>/', $content, $matches)) {
383
- $ignore_block_element = $matches[1];
384
- }
385
-
386
- // If it's not a tag and not in ignore block.
387
- if ('' === $ignore_block_element && strlen($content) > 0 && '<' !== $content[0]) {
388
- $content = preg_replace_callback($wp_smiliessearch, [$this, 'translateSmiley'], $content);
389
- }
390
-
391
- // did we exit ignore block.
392
- if ('' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content) {
393
- $ignore_block_element = '';
394
- }
395
-
396
- $output .= $content;
397
- }
398
-
399
- return $output;
400
- }
401
-
402
- /**
403
- * Replace matches by smiley image, lazyloaded
404
- *
405
- * @param array $matches Array of matches.
406
- * @return string
407
- */
408
- private function translateSmiley($matches)
409
- {
410
- global $wpsmiliestrans;
411
-
412
- if (count($matches) === 0) {
413
- return '';
414
- }
415
-
416
- $smiley = trim(reset($matches));
417
- $img = $wpsmiliestrans[ $smiley ];
418
-
419
- $matches = [];
420
- $ext = preg_match('/\.([^.]+)$/', $img, $matches) ? strtolower($matches[1]) : false;
421
- $image_exts = ['jpg', 'jpeg', 'jpe', 'gif', 'png'];
422
-
423
- // Don't convert smilies that aren't images - they're probably emoji.
424
- if (! in_array($ext, $image_exts, true)) {
425
- return $img;
426
- }
427
-
428
- /**
429
- * Filter the Smiley image URL before it's used in the image element.
430
- *
431
- * @since 2.9.0
432
- *
433
- * @param string $smiley_url URL for the smiley image.
434
- * @param string $img Filename for the smiley image.
435
- * @param string $site_url Site URL, as returned by site_url().
436
- */
437
- $src_url = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url());
438
-
439
- // Don't LazyLoad if process is stopped for these reasons.
440
- if (is_feed() || is_preview()) {
441
- return sprintf(' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url($src_url), esc_attr($smiley));
442
- }
443
-
444
- return sprintf(' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $this->getPlaceholder(), esc_url($src_url), esc_attr($smiley));
445
- }
446
-
447
- /**
448
- * Returns the placeholder for the src attribute
449
- *
450
- * @since 1.2
451
- * @author Remy Perona
452
- *
453
- * @param int $width Width of the placeholder image. Default 0.
454
- * @param int $height Height of the placeholder image. Default 0.
455
- * @return string
456
- */
457
- public function getPlaceholder($width = 0, $height = 0)
458
- {
459
- $width = 0 === $width ? 0 : absint($width);
460
- $height = 0 === $height ? 0 : absint($height);
461
-
462
- $placeholder = str_replace(' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E");
463
- /**
464
- * Filter the image lazyLoad placeholder on src attribute
465
- *
466
- * @since 1.1
467
- *
468
- * @param string $placeholder Placeholder that will be printed.
469
- * @param int $width Placeholder width.
470
- * @param int $height Placeholder height.
471
- */
472
- return apply_filters('rocket_lazyload_placeholder', $placeholder, $width, $height);
473
- }
474
- }
1
+ <?php
2
+ /**
3
+ * Handles lazyloading of images
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Dependencies\RocketLazyload;
9
+
10
+ /**
11
+ * A class to provide the methods needed to lazyload images in WP Rocket and Lazyload by WP Rocket
12
+ */
13
+ class Image {
14
+
15
+ /**
16
+ * Finds the images to be lazyloaded and call the callback method to replace them.
17
+ *
18
+ * @param string $html Original HTML.
19
+ * @param string $buffer Content to parse.
20
+ * @return string
21
+ */
22
+ public function lazyloadImages( $html, $buffer ) {
23
+ if ( ! preg_match_all( '#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER ) ) {
24
+ return $html;
25
+ }
26
+
27
+ $images = array_unique( $images, SORT_REGULAR );
28
+
29
+ foreach ( $images as $image ) {
30
+ $image = $this->canLazyload( $image );
31
+
32
+ if ( ! $image ) {
33
+ continue;
34
+ }
35
+
36
+ $image_lazyload = $this->replaceImage( $image );
37
+ $image_lazyload .= $this->noscript( $image[0] );
38
+ $html = str_replace( $image[0], $image_lazyload, $html );
39
+
40
+ unset( $image_lazyload );
41
+ }
42
+
43
+ return $html;
44
+ }
45
+
46
+ /**
47
+ * Applies lazyload on background images defined in style attributes
48
+ *
49
+ * @param string $html Original HTML.
50
+ * @param string $buffer Content to parse.
51
+ * @return string
52
+ */
53
+ public function lazyloadBackgroundImages( $html, $buffer ) {
54
+ if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
55
+ return $html;
56
+ }
57
+
58
+ foreach ( $elements as $element ) {
59
+ if ( $this->isExcluded( $element['before'] . $element['after'], $this->getExcludedAttributes() ) ) {
60
+ continue;
61
+ }
62
+
63
+ if ( ! preg_match( '#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url ) ) {
64
+ continue;
65
+ }
66
+
67
+ $url['url'] = trim( $url['url'], '\'" ' );
68
+
69
+ if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
70
+ continue;
71
+ }
72
+
73
+ $lazy_bg = $this->addLazyCLass( $element[0] );
74
+ $lazy_bg = str_replace( $url[0], '', $lazy_bg );
75
+ $lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="url(' . esc_attr( $url['url'] ) . ')"', $lazy_bg );
76
+
77
+ $html = str_replace( $element[0], $lazy_bg, $html );
78
+ unset( $lazy_bg );
79
+ }
80
+
81
+ return $html;
82
+ }
83
+
84
+ /**
85
+ * Add the identifier class to the element
86
+ *
87
+ * @param string $element Element to add the class to.
88
+ * @return string
89
+ */
90
+ private function addLazyClass( $element ) {
91
+ if ( preg_match( '#class=["\']?(?<classes>[^"\'>]*)["\']?#is', $element, $class ) ) {
92
+ if ( empty( $class['classes'] ) ) {
93
+ return str_replace( $class[0], 'class="rocket-lazyload"', $element );
94
+ }
95
+
96
+ $classes = str_replace( $class['classes'], $class['classes'] . ' rocket-lazyload', $class[0] );
97
+
98
+ return str_replace( $class[0], $classes, $element );
99
+ }
100
+
101
+ return preg_replace( '#<(img|div|figure|section|li|span)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element );
102
+ }
103
+
104
+ /**
105
+ * Applies lazyload on picture elements found in the HTML.
106
+ *
107
+ * @param string $html Original HTML.
108
+ * @param string $buffer Content to parse.
109
+ * @return string
110
+ */
111
+ public function lazyloadPictures( $html, $buffer ) {
112
+ if ( ! preg_match_all( '#<picture(?:.*)?>(?<sources>.*)</picture>#iUs', $buffer, $pictures, PREG_SET_ORDER ) ) {
113
+ return $html;
114
+ }
115
+
116
+ $pictures = array_unique( $pictures, SORT_REGULAR );
117
+ $excluded = array_merge( $this->getExcludedAttributes(), $this->getExcludedSrc() );
118
+
119
+ foreach ( $pictures as $picture ) {
120
+ if ( $this->isExcluded( $picture[0], $excluded ) ) {
121
+ continue;
122
+ }
123
+
124
+ if ( preg_match_all( '#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER ) ) {
125
+ $sources = array_unique( $sources, SORT_REGULAR );
126
+
127
+ $lazy_sources = 0;
128
+
129
+ foreach ( $sources as $source ) {
130
+ $lazyload_srcset = preg_replace( '/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0] );
131
+ $html = str_replace( $source[0], $lazyload_srcset, $html );
132
+
133
+ unset( $lazyload_srcset );
134
+ $lazy_sources++;
135
+ }
136
+ }
137
+
138
+ if ( 0 === $lazy_sources ) {
139
+ continue;
140
+ }
141
+
142
+ if ( ! preg_match( '#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img ) ) {
143
+ continue;
144
+ }
145
+
146
+ $img = $this->canLazyload( $img );
147
+
148
+ if ( ! $img ) {
149
+ continue;
150
+ }
151
+
152
+ $img_lazy = $this->replaceImage( $img );
153
+ $html = str_replace( $img[0], $img_lazy, $html );
154
+
155
+ unset( $img_lazy );
156
+ }
157
+
158
+ return $html;
159
+ }
160
+
161
+ /**
162
+ * Checks if the image can be lazyloaded
163
+ *
164
+ * @param Array $image Array of image data coming from Regex.
165
+ * @return bool|Array
166
+ */
167
+ private function canLazyload( $image ) {
168
+ if ( $this->isExcluded( $image['atts'], $this->getExcludedAttributes() ) ) {
169
+ return false;
170
+ }
171
+
172
+ // Given the previous regex pattern, $image['atts'] starts with a whitespace character.
173
+ if ( ! preg_match( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $image['atts'], $atts ) ) {
174
+ return false;
175
+ }
176
+
177
+ $image['src'] = trim( $atts['src'] );
178
+
179
+ if ( '' === $image['src'] ) {
180
+ return false;
181
+ }
182
+
183
+ if ( $this->isExcluded( $image['src'], $this->getExcludedSrc() ) ) {
184
+ return false;
185
+ }
186
+
187
+ // Don't apply LazyLoad on images from WP Retina x2.
188
+ if ( function_exists( 'wr2x_picture_rewrite' ) ) {
189
+ if ( wr2x_get_retina( trailingslashit( ABSPATH ) . wr2x_get_pathinfo_from_image_src( trim( $image['src'], '"' ) ) ) ) {
190
+ return false;
191
+ }
192
+ }
193
+
194
+ return $image;
195
+ }
196
+
197
+ /**
198
+ * Checks if the provided string matches with the provided excluded patterns
199
+ *
200
+ * @param string $string String to check.
201
+ * @param array $excluded_values Patterns to match against.
202
+ * @return boolean
203
+ */
204
+ public function isExcluded( $string, $excluded_values ) {
205
+ if ( ! is_array( $excluded_values ) ) {
206
+ (array) $excluded_values;
207
+ }
208
+
209
+ if ( empty( $excluded_values ) ) {
210
+ return false;
211
+ }
212
+
213
+ foreach ( $excluded_values as $excluded_value ) {
214
+ if ( strpos( $string, $excluded_value ) !== false ) {
215
+ return true;
216
+ }
217
+ }
218
+
219
+ return false;
220
+ }
221
+
222
+ /**
223
+ * Returns the list of excluded attributes
224
+ *
225
+ * @return array
226
+ */
227
+ public function getExcludedAttributes() {
228
+ /**
229
+ * Filters the attributes used to prevent lazylad from being applied
230
+ *
231
+ * @since 1.0
232
+ * @author Remy Perona
233
+ *
234
+ * @param array $excluded_attributes An array of excluded attributes.
235
+ */
236
+ return apply_filters(
237
+ 'rocket_lazyload_excluded_attributes',
238
+ [
239
+ 'data-src=',
240
+ 'data-no-lazy=',
241
+ 'data-lazy-original=',
242
+ 'data-lazy-src=',
243
+ 'data-lazysrc=',
244
+ 'data-lazyload=',
245
+ 'data-bgposition=',
246
+ 'data-envira-src=',
247
+ 'fullurl=',
248
+ 'lazy-slider-img=',
249
+ 'data-srcset=',
250
+ 'class="ls-l',
251
+ 'class="ls-bg',
252
+ 'soliloquy-image',
253
+ 'loading="eager"',
254
+ 'swatch-img',
255
+ 'data-height-percentage',
256
+ 'data-large_image',
257
+ 'avia-bg-style-fixed',
258
+ 'data-skip-lazy',
259
+ 'skip-lazy',
260
+ ]
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Returns the list of excluded src
266
+ *
267
+ * @return array
268
+ */
269
+ public function getExcludedSrc() {
270
+ /**
271
+ * Filters the src used to prevent lazylad from being applied
272
+ *
273
+ * @since 1.0
274
+ * @author Remy Perona
275
+ *
276
+ * @param array $excluded_src An array of excluded src.
277
+ */
278
+ return apply_filters(
279
+ 'rocket_lazyload_excluded_src',
280
+ [
281
+ '/wpcf7_captcha/',
282
+ 'timthumb.php?src',
283
+ 'woocommerce/assets/images/placeholder.png',
284
+ ]
285
+ );
286
+ }
287
+
288
+ /**
289
+ * Replaces the original image by the lazyload one
290
+ *
291
+ * @param array $image Array of matches elements.
292
+ * @return string
293
+ */
294
+ private function replaceImage( $image ) {
295
+ $width = 0;
296
+ $height = 0;
297
+
298
+ if ( preg_match( '@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts ) ) {
299
+ $width = absint( $atts['width'] );
300
+ }
301
+
302
+ if ( preg_match( '@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts ) ) {
303
+ $height = absint( $atts['height'] );
304
+ }
305
+
306
+ $placeholder_atts = preg_replace( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder( $width, $height ) . '"', $image['atts'] );
307
+
308
+ $image_lazyload = str_replace( $image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0] );
309
+
310
+ if ( ! preg_match( '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload ) && apply_filters( 'rocket_use_native_lazyload', false ) ) {
311
+ $image_lazyload = str_replace( '<img', '<img loading="lazy"', $image_lazyload );
312
+ }
313
+
314
+ /**
315
+ * Filter the LazyLoad HTML output
316
+ *
317
+ * @since 1.0
318
+ *
319
+ * @param string $html Output that will be printed
320
+ */
321
+ $image_lazyload = apply_filters( 'rocket_lazyload_html', $image_lazyload );
322
+
323
+ return $image_lazyload;
324
+ }
325
+
326
+ /**
327
+ * Returns the HTML tag wrapped inside noscript tags
328
+ *
329
+ * @param string $element Element to wrap.
330
+ * @return string
331
+ */
332
+ private function noscript( $element ) {
333
+ return '<noscript>' . $element . '</noscript>';
334
+ }
335
+
336
+ /**
337
+ * Applies lazyload on srcset and sizes attributes
338
+ *
339
+ * @param string $html HTML image tag.
340
+ * @return string
341
+ */
342
+ public function lazyloadResponsiveAttributes( $html ) {
343
+ $html = preg_replace( '/[\s|"|\'](srcset)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html );
344
+ $html = preg_replace( '/[\s|"|\'](sizes)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html );
345
+
346
+ return $html;
347
+ }
348
+
349
+ /**
350
+ * Finds patterns matching smiley and call the callback method to replace them with the image
351
+ *
352
+ * @param string $text Content to search in.
353
+ * @return string
354
+ */
355
+ public function convertSmilies( $text ) {
356
+ global $wp_smiliessearch;
357
+
358
+ if ( ! get_option( 'use_smilies' ) || empty( $wp_smiliessearch ) ) {
359
+ return $text;
360
+ }
361
+
362
+ $output = '';
363
+ // HTML loop taken from texturize function, could possible be consolidated.
364
+ $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between.
365
+ $stop = count( $textarr );// loop stuff.
366
+
367
+ // Ignore proessing of specific tags.
368
+ $tags_to_ignore = 'code|pre|style|script|textarea';
369
+ $ignore_block_element = '';
370
+
371
+ for ( $i = 0; $i < $stop; $i++ ) {
372
+ $content = $textarr[ $i ];
373
+
374
+ // If we're in an ignore block, wait until we find its closing tag.
375
+ if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
376
+ $ignore_block_element = $matches[1];
377
+ }
378
+
379
+ // If it's not a tag and not in ignore block.
380
+ if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' !== $content[0] ) {
381
+ $content = preg_replace_callback( $wp_smiliessearch, [ $this, 'translateSmiley' ], $content );
382
+ }
383
+
384
+ // did we exit ignore block.
385
+ if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content ) {
386
+ $ignore_block_element = '';
387
+ }
388
+
389
+ $output .= $content;
390
+ }
391
+
392
+ return $output;
393
+ }
394
+
395
+ /**
396
+ * Replace matches by smiley image, lazyloaded
397
+ *
398
+ * @param array $matches Array of matches.
399
+ * @return string
400
+ */
401
+ private function translateSmiley( $matches ) {
402
+ global $wpsmiliestrans;
403
+
404
+ if ( count( $matches ) === 0 ) {
405
+ return '';
406
+ }
407
+
408
+ $smiley = trim( reset( $matches ) );
409
+ $img = $wpsmiliestrans[ $smiley ];
410
+
411
+ $matches = [];
412
+ $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
413
+ $image_exts = [ 'jpg', 'jpeg', 'jpe', 'gif', 'png' ];
414
+
415
+ // Don't convert smilies that aren't images - they're probably emoji.
416
+ if ( ! in_array( $ext, $image_exts, true ) ) {
417
+ return $img;
418
+ }
419
+
420
+ /**
421
+ * Filter the Smiley image URL before it's used in the image element.
422
+ *
423
+ * @since 2.9.0
424
+ *
425
+ * @param string $smiley_url URL for the smiley image.
426
+ * @param string $img Filename for the smiley image.
427
+ * @param string $site_url Site URL, as returned by site_url().
428
+ */
429
+ $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
430
+
431
+ // Don't LazyLoad if process is stopped for these reasons.
432
+ if ( is_feed() || is_preview() ) {
433
+ return sprintf( ' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url( $src_url ), esc_attr( $smiley ) );
434
+ }
435
+
436
+ return sprintf( ' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $this->getPlaceholder(), esc_url( $src_url ), esc_attr( $smiley ) );
437
+ }
438
+
439
+ /**
440
+ * Returns the placeholder for the src attribute
441
+ *
442
+ * @since 1.2
443
+ * @author Remy Perona
444
+ *
445
+ * @param int $width Width of the placeholder image. Default 0.
446
+ * @param int $height Height of the placeholder image. Default 0.
447
+ * @return string
448
+ */
449
+ public function getPlaceholder( $width = 0, $height = 0 ) {
450
+ $width = 0 === $width ? 0 : absint( $width );
451
+ $height = 0 === $height ? 0 : absint( $height );
452
+
453
+ $placeholder = str_replace( ' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E" );
454
+ /**
455
+ * Filter the image lazyLoad placeholder on src attribute
456
+ *
457
+ * @since 1.1
458
+ *
459
+ * @param string $placeholder Placeholder that will be printed.
460
+ * @param int $width Placeholder width.
461
+ * @param int $height Placeholder height.
462
+ */
463
+ return apply_filters( 'rocket_lazyload_placeholder', $placeholder, $width, $height );
464
+ }
465
+ }
 
 
 
 
 
 
 
 
 
src/EventManagement/EventManager.php CHANGED
@@ -1,145 +1,145 @@
1
- <?php
2
- /**
3
- * Event Manager to interact with the WP plugin API
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\EventManagement;
9
-
10
- defined('ABSPATH') || die('Cheatin\' uh?');
11
-
12
- /**
13
- * The event manager manages events using the WordPress plugin API.
14
- *
15
- * @since 3.1
16
- * @author Carl Alexander <contact@carlalexander.ca>
17
- */
18
- class EventManager
19
- {
20
- /**
21
- * Adds a callback to a specific hook of the WordPress plugin API.
22
- *
23
- * @uses add_filter()
24
- *
25
- * @param string $hook_name Name of the hook.
26
- * @param callable $callback Callback function.
27
- * @param int $priority Priority.
28
- * @param int $accepted_args Number of arguments.
29
- */
30
- public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1)
31
- {
32
- add_filter($hook_name, $callback, $priority, $accepted_args);
33
- }
34
-
35
- /**
36
- * Add an event subscriber.
37
- *
38
- * The event manager registers all the hooks that the given subscriber
39
- * wants to register with the WordPress Plugin API.
40
- *
41
- * @param SubscriberInterface $subscriber SubscriberInterface implementation.
42
- */
43
- public function addSubscriber(SubscriberInterface $subscriber)
44
- {
45
- if ($subscriber instanceof EventManagerAwareSubscriberInterface) {
46
- $subscriber->setEventManager($this);
47
- }
48
-
49
- foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
50
- $this->addSubscriberCallback($subscriber, $hook_name, $parameters);
51
- }
52
- }
53
-
54
- /**
55
- * Checks the WordPress plugin API to see if the given hook has
56
- * the given callback. The priority of the callback will be returned
57
- * or false. If no callback is given will return true or false if
58
- * there's any callbacks registered to the hook.
59
- *
60
- * @uses has_filter()
61
- *
62
- * @param string $hook_name Hook name.
63
- * @param mixed $callback Callback.
64
- *
65
- * @return bool|int
66
- */
67
- public function hasCallback($hook_name, $callback = false)
68
- {
69
- return has_filter($hook_name, $callback);
70
- }
71
-
72
- /**
73
- * Removes the given callback from the given hook. The WordPress plugin API only
74
- * removes the hook if the callback and priority match a registered hook.
75
- *
76
- * @uses remove_filter()
77
- *
78
- * @param string $hook_name Hook name.
79
- * @param callable $callback Callback.
80
- * @param int $priority Priority.
81
- *
82
- * @return bool
83
- */
84
- public function removeCallback($hook_name, $callback, $priority = 10)
85
- {
86
- return remove_filter($hook_name, $callback, $priority);
87
- }
88
-
89
- /**
90
- * Remove an event subscriber.
91
- *
92
- * The event manager removes all the hooks that the given subscriber
93
- * wants to register with the WordPress Plugin API.
94
- *
95
- * @param SubscriberInterface $subscriber SubscriberInterface implementation.
96
- */
97
- public function removeSubscriber(SubscriberInterface $subscriber)
98
- {
99
- foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
100
- $this->removeSubscriberCallback($subscriber, $hook_name, $parameters);
101
- }
102
- }
103
-
104
- /**
105
- * Adds the given subscriber's callback to a specific hook
106
- * of the WordPress plugin API.
107
- *
108
- * @param SubscriberInterface $subscriber SubscriberInterface implementation.
109
- * @param string $hook_name Hook name.
110
- * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
111
- */
112
- private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
113
- {
114
- if (is_string($parameters)) {
115
- $this->addCallback($hook_name, [ $subscriber, $parameters ]);
116
- } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
117
- foreach ($parameters as $parameter) {
118
- $this->addSubscriberCallback($subscriber, $hook_name, $parameter);
119
- }
120
- } elseif (is_array($parameters) && isset($parameters[0])) {
121
- $this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1);
122
- }
123
- }
124
-
125
- /**
126
- * Removes the given subscriber's callback to a specific hook
127
- * of the WordPress plugin API.
128
- *
129
- * @param SubscriberInterface $subscriber SubscriberInterface implementation.
130
- * @param string $hook_name Hook name.
131
- * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
132
- */
133
- private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
134
- {
135
- if (is_string($parameters)) {
136
- $this->removeCallback($hook_name, [ $subscriber, $parameters ]);
137
- } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
138
- foreach ($parameters as $parameter) {
139
- $this->removeSubscriberCallback($subscriber, $hook_name, $parameter);
140
- }
141
- } elseif (is_array($parameters) && isset($parameters[0])) {
142
- $this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10);
143
- }
144
- }
145
- }
1
+ <?php
2
+ /**
3
+ * Event Manager to interact with the WP plugin API
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\EventManagement;
9
+
10
+ defined('ABSPATH') || die('Cheatin\' uh?');
11
+
12
+ /**
13
+ * The event manager manages events using the WordPress plugin API.
14
+ *
15
+ * @since 3.1
16
+ * @author Carl Alexander <contact@carlalexander.ca>
17
+ */
18
+ class EventManager
19
+ {
20
+ /**
21
+ * Adds a callback to a specific hook of the WordPress plugin API.
22
+ *
23
+ * @uses add_filter()
24
+ *
25
+ * @param string $hook_name Name of the hook.
26
+ * @param callable $callback Callback function.
27
+ * @param int $priority Priority.
28
+ * @param int $accepted_args Number of arguments.
29
+ */
30
+ public function addCallback($hook_name, $callback, $priority = 10, $accepted_args = 1)
31
+ {
32
+ add_filter($hook_name, $callback, $priority, $accepted_args);
33
+ }
34
+
35
+ /**
36
+ * Add an event subscriber.
37
+ *
38
+ * The event manager registers all the hooks that the given subscriber
39
+ * wants to register with the WordPress Plugin API.
40
+ *
41
+ * @param SubscriberInterface $subscriber SubscriberInterface implementation.
42
+ */
43
+ public function addSubscriber(SubscriberInterface $subscriber)
44
+ {
45
+ if ($subscriber instanceof EventManagerAwareSubscriberInterface) {
46
+ $subscriber->setEventManager($this);
47
+ }
48
+
49
+ foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
50
+ $this->addSubscriberCallback($subscriber, $hook_name, $parameters);
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Checks the WordPress plugin API to see if the given hook has
56
+ * the given callback. The priority of the callback will be returned
57
+ * or false. If no callback is given will return true or false if
58
+ * there's any callbacks registered to the hook.
59
+ *
60
+ * @uses has_filter()
61
+ *
62
+ * @param string $hook_name Hook name.
63
+ * @param mixed $callback Callback.
64
+ *
65
+ * @return bool|int
66
+ */
67
+ public function hasCallback($hook_name, $callback = false)
68
+ {
69
+ return has_filter($hook_name, $callback);
70
+ }
71
+
72
+ /**
73
+ * Removes the given callback from the given hook. The WordPress plugin API only
74
+ * removes the hook if the callback and priority match a registered hook.
75
+ *
76
+ * @uses remove_filter()
77
+ *
78
+ * @param string $hook_name Hook name.
79
+ * @param callable $callback Callback.
80
+ * @param int $priority Priority.
81
+ *
82
+ * @return bool
83
+ */
84
+ public function removeCallback($hook_name, $callback, $priority = 10)
85
+ {
86
+ return remove_filter($hook_name, $callback, $priority);
87
+ }
88
+
89
+ /**
90
+ * Remove an event subscriber.
91
+ *
92
+ * The event manager removes all the hooks that the given subscriber
93
+ * wants to register with the WordPress Plugin API.
94
+ *
95
+ * @param SubscriberInterface $subscriber SubscriberInterface implementation.
96
+ */
97
+ public function removeSubscriber(SubscriberInterface $subscriber)
98
+ {
99
+ foreach ($subscriber->getSubscribedEvents() as $hook_name => $parameters) {
100
+ $this->removeSubscriberCallback($subscriber, $hook_name, $parameters);
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Adds the given subscriber's callback to a specific hook
106
+ * of the WordPress plugin API.
107
+ *
108
+ * @param SubscriberInterface $subscriber SubscriberInterface implementation.
109
+ * @param string $hook_name Hook name.
110
+ * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
111
+ */
112
+ private function addSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
113
+ {
114
+ if (is_string($parameters)) {
115
+ $this->addCallback($hook_name, [ $subscriber, $parameters ]);
116
+ } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
117
+ foreach ($parameters as $parameter) {
118
+ $this->addSubscriberCallback($subscriber, $hook_name, $parameter);
119
+ }
120
+ } elseif (is_array($parameters) && isset($parameters[0])) {
121
+ $this->addCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10, isset($parameters[2]) ? $parameters[2] : 1);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Removes the given subscriber's callback to a specific hook
127
+ * of the WordPress plugin API.
128
+ *
129
+ * @param SubscriberInterface $subscriber SubscriberInterface implementation.
130
+ * @param string $hook_name Hook name.
131
+ * @param mixed $parameters Parameters, can be a string, an array or a multidimensional array.
132
+ */
133
+ private function removeSubscriberCallback(SubscriberInterface $subscriber, $hook_name, $parameters)
134
+ {
135
+ if (is_string($parameters)) {
136
+ $this->removeCallback($hook_name, [ $subscriber, $parameters ]);
137
+ } elseif (is_array($parameters) && count($parameters) !== count($parameters, COUNT_RECURSIVE)) {
138
+ foreach ($parameters as $parameter) {
139
+ $this->removeSubscriberCallback($subscriber, $hook_name, $parameter);
140
+ }
141
+ } elseif (is_array($parameters) && isset($parameters[0])) {
142
+ $this->removeCallback($hook_name, [ $subscriber, $parameters[0] ], isset($parameters[1]) ? $parameters[1] : 10);
143
+ }
144
+ }
145
+ }
src/EventManagement/EventManagerAwareSubscriberInterface.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * Interface for subscribers who need access to the event manager object
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\EventManagement;
9
-
10
- interface EventManagerAwareSubscriberInterface extends SubscriberInterface
11
- {
12
- /**
13
- * Set the WordPress event manager for the subscriber.
14
- *
15
- * @since 3.1
16
- * @author Remy Perona
17
- *
18
- * @param EventManager $event_manager EventManager instance.
19
- */
20
- public function setEventManager(EventManager $event_manager);
21
- }
1
+ <?php
2
+ /**
3
+ * Interface for subscribers who need access to the event manager object
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\EventManagement;
9
+
10
+ interface EventManagerAwareSubscriberInterface extends SubscriberInterface
11
+ {
12
+ /**
13
+ * Set the WordPress event manager for the subscriber.
14
+ *
15
+ * @since 3.1
16
+ * @author Remy Perona
17
+ *
18
+ * @param EventManager $event_manager EventManager instance.
19
+ */
20
+ public function setEventManager(EventManager $event_manager);
21
+ }
src/EventManagement/SubscriberInterface.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /**
3
- * Interface for subscribers
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\EventManagement;
9
-
10
- /**
11
- * A Subscriber knows what specific WordPress events it wants to listen to.
12
- *
13
- * When an EventManager adds a Subscriber, it gets all the WordPress events that
14
- * it wants to listen to. It then adds the subscriber as a listener for each of them.
15
- *
16
- * @author Carl Alexander <contact@carlalexander.ca>
17
- */
18
- interface SubscriberInterface
19
- {
20
- /**
21
- * Returns an array of events that this subscriber wants to listen to.
22
- *
23
- * The array key is the event name. The value can be:
24
- *
25
- * * The method name
26
- * * An array with the method name and priority
27
- * * An array with the method name, priority and number of accepted arguments
28
- *
29
- * For instance:
30
- *
31
- * * array('hook_name' => 'method_name')
32
- * * array('hook_name' => array('method_name', $priority))
33
- * * array('hook_name' => array('method_name', $priority, $accepted_args))
34
- * * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2)))
35
- *
36
- * @return array
37
- */
38
- public function getSubscribedEvents();
39
- }
1
+ <?php
2
+ /**
3
+ * Interface for subscribers
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\EventManagement;
9
+
10
+ /**
11
+ * A Subscriber knows what specific WordPress events it wants to listen to.
12
+ *
13
+ * When an EventManager adds a Subscriber, it gets all the WordPress events that
14
+ * it wants to listen to. It then adds the subscriber as a listener for each of them.
15
+ *
16
+ * @author Carl Alexander <contact@carlalexander.ca>
17
+ */
18
+ interface SubscriberInterface
19
+ {
20
+ /**
21
+ * Returns an array of events that this subscriber wants to listen to.
22
+ *
23
+ * The array key is the event name. The value can be:
24
+ *
25
+ * * The method name
26
+ * * An array with the method name and priority
27
+ * * An array with the method name, priority and number of accepted arguments
28
+ *
29
+ * For instance:
30
+ *
31
+ * * array('hook_name' => 'method_name')
32
+ * * array('hook_name' => array('method_name', $priority))
33
+ * * array('hook_name' => array('method_name', $priority, $accepted_args))
34
+ * * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2)))
35
+ *
36
+ * @return array
37
+ */
38
+ public function getSubscribedEvents();
39
+ }
src/Options/AbstractOptions.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
- /**
3
- * Abstract class to interact with the WP options API
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Options;
9
-
10
- /**
11
- * Manages options using the WordPress options API.
12
- *
13
- * @since 2.0
14
- * @author Remy Perona
15
- */
16
- abstract class AbstractOptions
17
- {
18
- /**
19
- * Gets the option for the given name. Returns the default value if the value does not exist.
20
- *
21
- * @since 2.0
22
- * @author Remy Perona
23
- *
24
- * @param string $name Name of the option to get.
25
- * @param mixed $default Default value to return if the value does not exist.
26
- *
27
- * @return mixed
28
- */
29
- abstract public function get($name, $default = null);
30
-
31
- /**
32
- * Sets the value of an option. Update the value if the option for the given name already exists.
33
- *
34
- * @since 2.0
35
- * @author Remy Perona
36
- * @param string $name Name of the option to set.
37
- * @param mixed $value Value to set for the option.
38
- *
39
- * @return void
40
- */
41
- abstract public function set($name, $value);
42
-
43
- /**
44
- * Deletes the option with the given name.
45
- *
46
- * @since 2.0
47
- * @author Remy Perona
48
- *
49
- * @param string $name Name of the option to delete.
50
- *
51
- * @return void
52
- */
53
- abstract public function delete($name);
54
-
55
- /**
56
- * Checks if the option with the given name exists.
57
- *
58
- * @since 2.0
59
- * @author Remy Perona
60
- *
61
- * @param string $name Name of the option to check.
62
- *
63
- * @return boolean True if the option exists, false otherwise
64
- */
65
- public function has($name)
66
- {
67
- return null !== $this->get($name);
68
- }
69
- }
1
+ <?php
2
+ /**
3
+ * Abstract class to interact with the WP options API
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Options;
9
+
10
+ /**
11
+ * Manages options using the WordPress options API.
12
+ *
13
+ * @since 2.0
14
+ * @author Remy Perona
15
+ */
16
+ abstract class AbstractOptions
17
+ {
18
+ /**
19
+ * Gets the option for the given name. Returns the default value if the value does not exist.
20
+ *
21
+ * @since 2.0
22
+ * @author Remy Perona
23
+ *
24
+ * @param string $name Name of the option to get.
25
+ * @param mixed $default Default value to return if the value does not exist.
26
+ *
27
+ * @return mixed
28
+ */
29
+ abstract public function get($name, $default = null);
30
+
31
+ /**
32
+ * Sets the value of an option. Update the value if the option for the given name already exists.
33
+ *
34
+ * @since 2.0
35
+ * @author Remy Perona
36
+ * @param string $name Name of the option to set.
37
+ * @param mixed $value Value to set for the option.
38
+ *
39
+ * @return void
40
+ */
41
+ abstract public function set($name, $value);
42
+
43
+ /**
44
+ * Deletes the option with the given name.
45
+ *
46
+ * @since 2.0
47
+ * @author Remy Perona
48
+ *
49
+ * @param string $name Name of the option to delete.
50
+ *
51
+ * @return void
52
+ */
53
+ abstract public function delete($name);
54
+
55
+ /**
56
+ * Checks if the option with the given name exists.
57
+ *
58
+ * @since 2.0
59
+ * @author Remy Perona
60
+ *
61
+ * @param string $name Name of the option to check.
62
+ *
63
+ * @return boolean True if the option exists, false otherwise
64
+ */
65
+ public function has($name)
66
+ {
67
+ return null !== $this->get($name);
68
+ }
69
+ }
src/Options/OptionArray.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
- /**
3
- * Manages the plugin options data
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Options;
9
-
10
- /**
11
- * Manages the data inside an option.
12
- *
13
- * @since 2.0
14
- * @author Remy Perona
15
- */
16
- class OptionArray
17
- {
18
- /**
19
- * Option data
20
- *
21
- * @var Array Array of data inside the option
22
- */
23
- private $options;
24
-
25
- /**
26
- * Constructor
27
- *
28
- * @param Array $options Array of data coming from an option.
29
- */
30
- public function __construct($options)
31
- {
32
- $this->options = $options;
33
- }
34
-
35
- /**
36
- * Checks if the provided key exists in the option data array.
37
- *
38
- * @since 2.0
39
- * @author Remy Perona
40
- *
41
- * @param string $key key name.
42
- * @return boolean
43
- */
44
- public function has($key)
45
- {
46
- return isset($this->options[ $key ]);
47
- }
48
-
49
- /**
50
- * Gets the value associated with a specific key.
51
- *
52
- * @since 2.0
53
- * @author Remy Perona
54
- *
55
- * @param string $key key name.
56
- * @param mixed $default default value to return if key doesn't exist.
57
- * @return mixed
58
- */
59
- public function get($key, $default = '')
60
- {
61
- if (! $this->has($key)) {
62
- return $default;
63
- }
64
-
65
- return $this->options[ $key ];
66
- }
67
-
68
- /**
69
- * Sets the value associated with a specific key.
70
- *
71
- * @since 2.0
72
- * @author Remy Perona
73
- *
74
- * @param string $key key name.
75
- * @param mixed $value Value to set.
76
- * @return void
77
- */
78
- public function set($key, $value)
79
- {
80
- $this->options[ $key ] = $value;
81
- }
82
-
83
- /**
84
- * Sets multiple values.
85
- *
86
- * @since 2.0
87
- * @author Remy Perona
88
- *
89
- * @param array $options An array of key/value pairs to set.
90
- * @return void
91
- */
92
- public function setValues($options)
93
- {
94
- foreach ($options as $key => $value) {
95
- $this->set($key, $value);
96
- }
97
- }
98
-
99
- /**
100
- * Gets the option array.
101
- *
102
- * @since 2.0
103
- * @author Remy Perona
104
- *
105
- * @return array
106
- */
107
- public function getOptions()
108
- {
109
- return $this->options;
110
- }
111
- }
1
+ <?php
2
+ /**
3
+ * Manages the plugin options data
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Options;
9
+
10
+ /**
11
+ * Manages the data inside an option.
12
+ *
13
+ * @since 2.0
14
+ * @author Remy Perona
15
+ */
16
+ class OptionArray
17
+ {
18
+ /**
19
+ * Option data
20
+ *
21
+ * @var Array Array of data inside the option
22
+ */
23
+ private $options;
24
+
25
+ /**
26
+ * Constructor
27
+ *
28
+ * @param Array $options Array of data coming from an option.
29
+ */
30
+ public function __construct($options)
31
+ {
32
+ $this->options = $options;
33
+ }
34
+
35
+ /**
36
+ * Checks if the provided key exists in the option data array.
37
+ *
38
+ * @since 2.0
39
+ * @author Remy Perona
40
+ *
41
+ * @param string $key key name.
42
+ * @return boolean
43
+ */
44
+ public function has($key)
45
+ {
46
+ return isset($this->options[ $key ]);
47
+ }
48
+
49
+ /**
50
+ * Gets the value associated with a specific key.
51
+ *
52
+ * @since 2.0
53
+ * @author Remy Perona
54
+ *
55
+ * @param string $key key name.
56
+ * @param mixed $default default value to return if key doesn't exist.
57
+ * @return mixed
58
+ */
59
+ public function get($key, $default = '')
60
+ {
61
+ if (! $this->has($key)) {
62
+ return $default;
63
+ }
64
+
65
+ return $this->options[ $key ];
66
+ }
67
+
68
+ /**
69
+ * Sets the value associated with a specific key.
70
+ *
71
+ * @since 2.0
72
+ * @author Remy Perona
73
+ *
74
+ * @param string $key key name.
75
+ * @param mixed $value Value to set.
76
+ * @return void
77
+ */
78
+ public function set($key, $value)
79
+ {
80
+ $this->options[ $key ] = $value;
81
+ }
82
+
83
+ /**
84
+ * Sets multiple values.
85
+ *
86
+ * @since 2.0
87
+ * @author Remy Perona
88
+ *
89
+ * @param array $options An array of key/value pairs to set.
90
+ * @return void
91
+ */
92
+ public function setValues($options)
93
+ {
94
+ foreach ($options as $key => $value) {
95
+ $this->set($key, $value);
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Gets the option array.
101
+ *
102
+ * @since 2.0
103
+ * @author Remy Perona
104
+ *
105
+ * @return array
106
+ */
107
+ public function getOptions()
108
+ {
109
+ return $this->options;
110
+ }
111
+ }
src/Options/Options.php CHANGED
@@ -1,106 +1,106 @@
1
- <?php
2
- /**
3
- * Options Class
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Options;
9
-
10
- defined('ABSPATH') || die('Cheatin\' uh?');
11
-
12
- /**
13
- * Interact with the WordPress Options API
14
- */
15
- class Options extends AbstractOptions
16
- {
17
- /**
18
- * The prefix used by Rocket Lazyload options.
19
- *
20
- * @since 2.0
21
- * @author Remy Perona
22
- *
23
- * @var string
24
- */
25
- private $prefix;
26
-
27
- /**
28
- * Constructor
29
- *
30
- * @since 2.0
31
- * @author Remy Perona
32
- *
33
- * @param string $prefix options prefix.
34
- */
35
- public function __construct($prefix = '')
36
- {
37
- $this->prefix = $prefix;
38
- }
39
-
40
- /**
41
- * Gets the option name used to store the option in the WordPress database.
42
- *
43
- * @since 2.0
44
- * @author Remy Perona
45
- *
46
- * @param string $name Unprefixed name of the option.
47
- *
48
- * @return string
49
- */
50
- public function getOptionName($name)
51
- {
52
- return $this->prefix . $name;
53
- }
54
-
55
- /**
56
- * Gets the option for the given name. Returns the default value if the value does not exist.
57
- *
58
- * @since 2.0
59
- * @author Remy Perona
60
- *
61
- * @param string $name Name of the option to get.
62
- * @param mixed $default Default value to return if the value does not exist.
63
- *
64
- * @return mixed
65
- */
66
- public function get($name, $default = null)
67
- {
68
- $option = get_option($this->getOptionName($name), $default);
69
-
70
- if (is_array($default) && ! is_array($option)) {
71
- $option = (array) $option;
72
- }
73
-
74
- return $option;
75
- }
76
-
77
- /**
78
- * Sets the value of an option. Update the value if the option for the given name already exists.
79
- *
80
- * @since 2.0
81
- * @author Remy Perona
82
- * @param string $name Name of the option to set.
83
- * @param mixed $value Value to set for the option.
84
- *
85
- * @return void
86
- */
87
- public function set($name, $value)
88
- {
89
- update_option($this->getOptionName($name), $value);
90
- }
91
-
92
- /**
93
- * Deletes the option with the given name.
94
- *
95
- * @since 2.0
96
- * @author Remy Perona
97
- *
98
- * @param string $name Name of the option to delete.
99
- *
100
- * @return void
101
- */
102
- public function delete($name)
103
- {
104
- delete_option($this->getOptionName($name));
105
- }
106
- }
1
+ <?php
2
+ /**
3
+ * Options Class
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Options;
9
+
10
+ defined('ABSPATH') || die('Cheatin\' uh?');
11
+
12
+ /**
13
+ * Interact with the WordPress Options API
14
+ */
15
+ class Options extends AbstractOptions
16
+ {
17
+ /**
18
+ * The prefix used by Rocket Lazyload options.
19
+ *
20
+ * @since 2.0
21
+ * @author Remy Perona
22
+ *
23
+ * @var string
24
+ */
25
+ private $prefix;
26
+
27
+ /**
28
+ * Constructor
29
+ *
30
+ * @since 2.0
31
+ * @author Remy Perona
32
+ *
33
+ * @param string $prefix options prefix.
34
+ */
35
+ public function __construct($prefix = '')
36
+ {
37
+ $this->prefix = $prefix;
38
+ }
39
+
40
+ /**
41
+ * Gets the option name used to store the option in the WordPress database.
42
+ *
43
+ * @since 2.0
44
+ * @author Remy Perona
45
+ *
46
+ * @param string $name Unprefixed name of the option.
47
+ *
48
+ * @return string
49
+ */
50
+ public function getOptionName($name)
51
+ {
52
+ return $this->prefix . $name;
53
+ }
54
+
55
+ /**
56
+ * Gets the option for the given name. Returns the default value if the value does not exist.
57
+ *
58
+ * @since 2.0
59
+ * @author Remy Perona
60
+ *
61
+ * @param string $name Name of the option to get.
62
+ * @param mixed $default Default value to return if the value does not exist.
63
+ *
64
+ * @return mixed
65
+ */
66
+ public function get($name, $default = null)
67
+ {
68
+ $option = get_option($this->getOptionName($name), $default);
69
+
70
+ if (is_array($default) && ! is_array($option)) {
71
+ $option = (array) $option;
72
+ }
73
+
74
+ return $option;
75
+ }
76
+
77
+ /**
78
+ * Sets the value of an option. Update the value if the option for the given name already exists.
79
+ *
80
+ * @since 2.0
81
+ * @author Remy Perona
82
+ * @param string $name Name of the option to set.
83
+ * @param mixed $value Value to set for the option.
84
+ *
85
+ * @return void
86
+ */
87
+ public function set($name, $value)
88
+ {
89
+ update_option($this->getOptionName($name), $value);
90
+ }
91
+
92
+ /**
93
+ * Deletes the option with the given name.
94
+ *
95
+ * @since 2.0
96
+ * @author Remy Perona
97
+ *
98
+ * @param string $name Name of the option to delete.
99
+ *
100
+ * @return void
101
+ */
102
+ public function delete($name)
103
+ {
104
+ delete_option($this->getOptionName($name));
105
+ }
106
+ }
src/Plugin.php CHANGED
@@ -1,97 +1,96 @@
1
- <?php
2
- /**
3
- * Initialize and load the plugin
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\Container;
11
- use RocketLazyLoadPlugin\EventManagement\EventManager;
12
- use RocketLazyLoadPlugin\Options\Options;
13
-
14
- /**
15
- * Plugin initialize
16
- *
17
- * @since 2.0
18
- * @author Remy Perona
19
- */
20
- class Plugin
21
- {
22
- /**
23
- * Is the plugin loaded
24
- *
25
- * @since 2.0
26
- * @author Remy Perona
27
- *
28
- * @var boolean
29
- */
30
- private $loaded = false;
31
-
32
- /**
33
- * Checks if the plugin is loaded
34
- *
35
- * @since 2.0
36
- * @author Remy Perona
37
- *
38
- * @return boolean
39
- */
40
- private function isLoaded()
41
- {
42
- return $this->loaded;
43
- }
44
-
45
- /**
46
- * Loads the plugin in WordPress
47
- *
48
- * @since 2.0
49
- * @author Remy Perona
50
- *
51
- * @return void
52
- */
53
- public function load()
54
- {
55
- if ($this->isLoaded()) {
56
- return;
57
- }
58
-
59
- $container = new Container();
60
-
61
- $container->add('template_path', ROCKET_LL_PATH . 'views/');
62
- $container->add('plugin_basename', ROCKET_LL_BASENAME);
63
-
64
- $container->add('options', function () {
65
- return new Options('rocket_lazyload');
66
- });
67
-
68
- $container->add('event_manager', function () {
69
- return new EventManager();
70
- });
71
-
72
- $service_providers = [
73
- 'RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider',
74
- 'RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider',
75
- 'RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider',
76
- 'RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider',
77
- 'RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider',
78
- ];
79
-
80
- foreach ($service_providers as $service) {
81
- $container->addServiceProvider($service);
82
- }
83
-
84
- $subscribers = [
85
- 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
86
- 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
87
- 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
88
- 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
89
- ];
90
-
91
- foreach ($subscribers as $subscriber) {
92
- $container->get('event_manager')->addSubscriber($container->get($subscriber));
93
- }
94
-
95
- $this->loaded = true;
96
- }
97
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin;
4
+
5
+ use RocketLazyLoadPlugin\Dependencies\League\Container\Container;
6
+ use RocketLazyLoadPlugin\EventManagement\EventManager;
7
+ use RocketLazyLoadPlugin\Options\Options;
8
+
9
+ /**
10
+ * Plugin initialize
11
+ *
12
+ * @since 2.0
13
+ * @author Remy Perona
14
+ */
15
+ class Plugin {
16
+
17
+ /**
18
+ * Is the plugin loaded
19
+ *
20
+ * @since 2.0
21
+ * @author Remy Perona
22
+ *
23
+ * @var boolean
24
+ */
25
+ private $loaded = false;
26
+
27
+ /**
28
+ * Checks if the plugin is loaded
29
+ *
30
+ * @since 2.0
31
+ * @author Remy Perona
32
+ *
33
+ * @return boolean
34
+ */
35
+ private function isLoaded() {
36
+ return $this->loaded;
37
+ }
38
+
39
+ /**
40
+ * Loads the plugin in WordPress
41
+ *
42
+ * @since 2.0
43
+ * @author Remy Perona
44
+ *
45
+ * @return void
46
+ */
47
+ public function load() {
48
+ if ( $this->isLoaded() ) {
49
+ return;
50
+ }
51
+
52
+ $container = new Container();
53
+
54
+ $container->add( 'template_path', \ROCKET_LL_PATH . 'views/' );
55
+ $container->add( 'plugin_basename', \ROCKET_LL_BASENAME );
56
+
57
+ $container->add(
58
+ 'options',
59
+ function () {
60
+ return new Options( 'rocket_lazyload' );
61
+ }
62
+ );
63
+
64
+ $container->add(
65
+ 'event_manager',
66
+ function () {
67
+ return new EventManager();
68
+ }
69
+ );
70
+
71
+ $service_providers = [
72
+ 'RocketLazyLoadPlugin\ServiceProvider\OptionServiceProvider',
73
+ 'RocketLazyLoadPlugin\ServiceProvider\AdminServiceProvider',
74
+ 'RocketLazyLoadPlugin\ServiceProvider\ImagifyNoticeServiceProvider',
75
+ 'RocketLazyLoadPlugin\ServiceProvider\LazyloadServiceProvider',
76
+ 'RocketLazyLoadPlugin\ServiceProvider\SubscribersServiceProvider',
77
+ ];
78
+
79
+ foreach ( $service_providers as $service ) {
80
+ $container->addServiceProvider( $service );
81
+ }
82
+
83
+ $subscribers = [
84
+ 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
85
+ 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
86
+ 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
87
+ 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
88
+ ];
89
+
90
+ foreach ( $subscribers as $subscriber ) {
91
+ $container->get( 'event_manager' )->addSubscriber( $container->get( $subscriber ) );
92
+ }
93
+
94
+ $this->loaded = true;
95
+ }
96
+ }
 
src/ServiceProvider/AdminServiceProvider.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /**
3
- * Service Provider for the admin page classes
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\ServiceProvider;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
-
12
- /**
13
- * Adds the admin page to the container
14
- *
15
- * @since 2.0
16
- * @author Remy Perona
17
- */
18
- class AdminServiceProvider extends AbstractServiceProvider
19
- {
20
- /**
21
- * Data provided by the service provider
22
- *
23
- * @since 2.0
24
- * @author Remy Perona
25
- *
26
- * @var array
27
- */
28
- protected $provides = [
29
- 'RocketLazyLoadPlugin\Admin\AdminPage',
30
- ];
31
-
32
- /**
33
- * Registers the admin page in the container
34
- *
35
- * @since 2.0
36
- * @author Remy Perona
37
- *
38
- * @return void
39
- */
40
- public function register()
41
- {
42
- $this->getContainer()->add('RocketLazyLoadPlugin\Admin\AdminPage')
43
- ->withArgument($this->getContainer()->get('options'))
44
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
45
- ->withArgument($this->getContainer()->get('template_path'));
46
- }
47
- }
1
+ <?php
2
+ /**
3
+ * Service Provider for the admin page classes
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\ServiceProvider;
9
+
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
+
12
+ /**
13
+ * Adds the admin page to the container
14
+ *
15
+ * @since 2.0
16
+ * @author Remy Perona
17
+ */
18
+ class AdminServiceProvider extends AbstractServiceProvider
19
+ {
20
+ /**
21
+ * Data provided by the service provider
22
+ *
23
+ * @since 2.0
24
+ * @author Remy Perona
25
+ *
26
+ * @var array
27
+ */
28
+ protected $provides = [
29
+ 'RocketLazyLoadPlugin\Admin\AdminPage',
30
+ ];
31
+
32
+ /**
33
+ * Registers the admin page in the container
34
+ *
35
+ * @since 2.0
36
+ * @author Remy Perona
37
+ *
38
+ * @return void
39
+ */
40
+ public function register()
41
+ {
42
+ $this->getContainer()->add('RocketLazyLoadPlugin\Admin\AdminPage')
43
+ ->withArgument($this->getContainer()->get('options'))
44
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
45
+ ->withArgument($this->getContainer()->get('template_path'));
46
+ }
47
+ }
src/ServiceProvider/ImagifyNoticeServiceProvider.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- /**
3
- * Service Provider for the imagify notice class
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\ServiceProvider;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
-
12
- /**
13
- * Adds the Imagify notice to the container
14
- *
15
- * @since 2.0
16
- * @author Remy Perona
17
- */
18
- class ImagifyNoticeServiceProvider extends AbstractServiceProvider
19
- {
20
- /**
21
- * Data provided by the service provider
22
- *
23
- * @since 2.0
24
- * @author Remy Perona
25
- *
26
- * @var array
27
- */
28
- protected $provides = [
29
- 'RocketLazyLoadPlugin\Admin\ImagifyNotice',
30
- ];
31
-
32
- /**
33
- * Registers the Imagify notice in the container
34
- *
35
- * @since 2.0
36
- * @author Remy Perona
37
- *
38
- * @return void
39
- */
40
- public function register()
41
- {
42
- $this->getContainer()->add('RocketLazyLoadPlugin\Admin\ImagifyNotice')
43
- ->withArgument($this->getContainer()->get('template_path'));
44
- }
45
- }
1
+ <?php
2
+ /**
3
+ * Service Provider for the imagify notice class
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\ServiceProvider;
9
+
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
+
12
+ /**
13
+ * Adds the Imagify notice to the container
14
+ *
15
+ * @since 2.0
16
+ * @author Remy Perona
17
+ */
18
+ class ImagifyNoticeServiceProvider extends AbstractServiceProvider
19
+ {
20
+ /**
21
+ * Data provided by the service provider
22
+ *
23
+ * @since 2.0
24
+ * @author Remy Perona
25
+ *
26
+ * @var array
27
+ */
28
+ protected $provides = [
29
+ 'RocketLazyLoadPlugin\Admin\ImagifyNotice',
30
+ ];
31
+
32
+ /**
33
+ * Registers the Imagify notice in the container
34
+ *
35
+ * @since 2.0
36
+ * @author Remy Perona
37
+ *
38
+ * @return void
39
+ */
40
+ public function register()
41
+ {
42
+ $this->getContainer()->add('RocketLazyLoadPlugin\Admin\ImagifyNotice')
43
+ ->withArgument($this->getContainer()->get('template_path'));
44
+ }
45
+ }
src/ServiceProvider/LazyloadServiceProvider.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- /**
3
- * Service Provider for the lazyload library
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\ServiceProvider;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
-
12
- /**
13
- * Adds the lazyload library to the container
14
- *
15
- * @since 2.0
16
- * @author Remy Perona
17
- */
18
- class LazyloadServiceProvider extends AbstractServiceProvider
19
- {
20
- /**
21
- * Data provided by the service provider
22
- *
23
- * @since 2.0
24
- * @author Remy Perona
25
- *
26
- * @var array
27
- */
28
- protected $provides = [
29
- 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets',
30
- 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image',
31
- 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe',
32
- ];
33
-
34
- /**
35
- * Registers the lazyload library in the container
36
- *
37
- * @since 2.0
38
- * @author Remy Perona
39
- *
40
- * @return void
41
- */
42
- public function register()
43
- {
44
- $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets');
45
- $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image');
46
- $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe');
47
- }
48
- }
1
+ <?php
2
+ /**
3
+ * Service Provider for the lazyload library
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\ServiceProvider;
9
+
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
+
12
+ /**
13
+ * Adds the lazyload library to the container
14
+ *
15
+ * @since 2.0
16
+ * @author Remy Perona
17
+ */
18
+ class LazyloadServiceProvider extends AbstractServiceProvider
19
+ {
20
+ /**
21
+ * Data provided by the service provider
22
+ *
23
+ * @since 2.0
24
+ * @author Remy Perona
25
+ *
26
+ * @var array
27
+ */
28
+ protected $provides = [
29
+ 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets',
30
+ 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image',
31
+ 'RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe',
32
+ ];
33
+
34
+ /**
35
+ * Registers the lazyload library in the container
36
+ *
37
+ * @since 2.0
38
+ * @author Remy Perona
39
+ *
40
+ * @return void
41
+ */
42
+ public function register()
43
+ {
44
+ $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets');
45
+ $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image');
46
+ $this->getContainer()->add('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe');
47
+ }
48
+ }
src/ServiceProvider/OptionServiceProvider.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- /**
3
- * Service Provider for the plugin options
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\ServiceProvider;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
-
12
- /**
13
- * Adds the option array to the container
14
- *
15
- * @since 2.0
16
- * @author Remy Perona
17
- */
18
- class OptionServiceProvider extends AbstractServiceProvider
19
- {
20
- /**
21
- * Data provided by the service provider
22
- *
23
- * @since 2.0
24
- * @author Remy Perona
25
- *
26
- * @var array
27
- */
28
- protected $provides = [
29
- 'RocketLazyLoadPlugin\Options\OptionArray',
30
- ];
31
-
32
- /**
33
- * Registers the option array in the container
34
- *
35
- * @since 2.0
36
- * @author Remy Perona
37
- *
38
- * @return void
39
- */
40
- public function register()
41
- {
42
- $this->getContainer()->add('RocketLazyLoadPlugin\Options\OptionArray')
43
- ->withArgument($this->getContainer()->get('options')->get('_options'));
44
- }
45
- }
1
+ <?php
2
+ /**
3
+ * Service Provider for the plugin options
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\ServiceProvider;
9
+
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
+
12
+ /**
13
+ * Adds the option array to the container
14
+ *
15
+ * @since 2.0
16
+ * @author Remy Perona
17
+ */
18
+ class OptionServiceProvider extends AbstractServiceProvider
19
+ {
20
+ /**
21
+ * Data provided by the service provider
22
+ *
23
+ * @since 2.0
24
+ * @author Remy Perona
25
+ *
26
+ * @var array
27
+ */
28
+ protected $provides = [
29
+ 'RocketLazyLoadPlugin\Options\OptionArray',
30
+ ];
31
+
32
+ /**
33
+ * Registers the option array in the container
34
+ *
35
+ * @since 2.0
36
+ * @author Remy Perona
37
+ *
38
+ * @return void
39
+ */
40
+ public function register()
41
+ {
42
+ $this->getContainer()->add('RocketLazyLoadPlugin\Options\OptionArray')
43
+ ->withArgument($this->getContainer()->get('options')->get('_options'));
44
+ }
45
+ }
src/ServiceProvider/SubscribersServiceProvider.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
- /**
3
- * Service Provider for the plugin subscribers
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\ServiceProvider;
9
-
10
- use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
-
12
- /**
13
- * Adds the subscribers to the container
14
- *
15
- * @since 2.0
16
- * @author Remy Perona
17
- */
18
- class SubscribersServiceProvider extends AbstractServiceProvider
19
- {
20
- /**
21
- * Data provided by the service provider
22
- *
23
- * @since 2.0
24
- * @author Remy Perona
25
- *
26
- * @var array
27
- */
28
- protected $provides = [
29
- 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
30
- 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
31
- 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
32
- 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
33
- ];
34
-
35
- /**
36
- * Registers the subscribers in the container
37
- *
38
- * @since 2.0
39
- * @author Remy Perona
40
- *
41
- * @return void
42
- */
43
- public function register()
44
- {
45
- $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber');
46
-
47
- $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber')
48
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\AdminPage'))
49
- ->withArgument($this->getContainer()->get('plugin_basename'));
50
-
51
- $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber')
52
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\ImagifyNotice'));
53
-
54
- $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber')
55
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
56
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets'))
57
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image'))
58
- ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe'));
59
- }
60
- }
1
+ <?php
2
+ /**
3
+ * Service Provider for the plugin subscribers
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\ServiceProvider;
9
+
10
+ use RocketLazyLoadPlugin\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11
+
12
+ /**
13
+ * Adds the subscribers to the container
14
+ *
15
+ * @since 2.0
16
+ * @author Remy Perona
17
+ */
18
+ class SubscribersServiceProvider extends AbstractServiceProvider
19
+ {
20
+ /**
21
+ * Data provided by the service provider
22
+ *
23
+ * @since 2.0
24
+ * @author Remy Perona
25
+ *
26
+ * @var array
27
+ */
28
+ protected $provides = [
29
+ 'RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber',
30
+ 'RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber',
31
+ 'RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber',
32
+ 'RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber',
33
+ ];
34
+
35
+ /**
36
+ * Registers the subscribers in the container
37
+ *
38
+ * @since 2.0
39
+ * @author Remy Perona
40
+ *
41
+ * @return void
42
+ */
43
+ public function register()
44
+ {
45
+ $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ThirdParty\AMPSubscriber');
46
+
47
+ $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\AdminPageSubscriber')
48
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\AdminPage'))
49
+ ->withArgument($this->getContainer()->get('plugin_basename'));
50
+
51
+ $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\ImagifyNoticeSubscriber')
52
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Admin\ImagifyNotice'));
53
+
54
+ $this->getContainer()->share('RocketLazyLoadPlugin\Subscriber\LazyloadSubscriber')
55
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Options\OptionArray'))
56
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets'))
57
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image'))
58
+ ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe'));
59
+ }
60
+ }
src/Subscriber/AdminPageSubscriber.php CHANGED
@@ -1,142 +1,131 @@
1
- <?php
2
- /**
3
- * Admin Page subscriber
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Subscriber;
9
-
10
- defined('ABSPATH') || die('Cheatin\' uh?');
11
-
12
- use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
13
- use RocketLazyLoadPlugin\Admin\AdminPage;
14
-
15
- /**
16
- * Admin Page Subscriber
17
- *
18
- * @since 2.0
19
- * @author Remy Perona
20
- */
21
- class AdminPageSubscriber implements SubscriberInterface
22
- {
23
- /**
24
- * AdminPage instance
25
- *
26
- * @since 2.0
27
- * @author Remy Perona
28
- *
29
- * @var AdminPage
30
- */
31
- private $page;
32
-
33
- /**
34
- * Plugin basename
35
- *
36
- * @since 2.0
37
- * @author Remy Perona
38
- *
39
- * @var string
40
- */
41
- private $plugin_basename;
42
-
43
- /**
44
- * Constructor
45
- *
46
- * @since 2.0
47
- * @author Remy Perona
48
- *
49
- * @param AdminPage $page AdminPage instance.
50
- * @param string $plugin_basename Plugin basename.
51
- */
52
- public function __construct(AdminPage $page, $plugin_basename)
53
- {
54
- $this->page = $page;
55
- $this->plugin_basename = $plugin_basename;
56
- }
57
-
58
- /**
59
- * @inheritDoc
60
- */
61
- public function getSubscribedEvents()
62
- {
63
- return [
64
- 'admin_init' => 'configure',
65
- 'admin_menu' => 'addAdminPage',
66
- 'plugin_action_links_' . $this->plugin_basename => 'addPluginPageLink',
67
- 'admin_enqueue_scripts' => 'enqueueAdminStyle',
68
- ];
69
- }
70
-
71
- /**
72
- * Registers the plugin settings in WordPress
73
- *
74
- * @since 2.0
75
- * @author Remy Perona
76
- *
77
- * @return void
78
- */
79
- public function configure()
80
- {
81
- $this->page->configure();
82
- }
83
-
84
- /**
85
- * Adds the admin page to the settings menu
86
- *
87
- * @since 2.0
88
- * @author Remy Perona
89
- *
90
- * @return void
91
- */
92
- public function addAdminPage()
93
- {
94
- add_options_page(
95
- $this->page->getPageTitle(),
96
- $this->page->getMenuTitle(),
97
- $this->page->getCapability(),
98
- $this->page->getSlug(),
99
- [ $this->page, 'renderPage' ]
100
- );
101
- }
102
-
103
- /**
104
- * Adds a link to the plugin settings on the plugins page
105
- *
106
- * @since 2.0
107
- * @author Remy Perona
108
- *
109
- * @param array $actions Actions for the plugin.
110
- * @return array
111
- */
112
- public function addPluginPageLink($actions)
113
- {
114
- array_unshift(
115
- $actions,
116
- sprintf(
117
- '<a href="%s">%s</a>',
118
- admin_url('options-general.php?page=' . $this->page->getSlug()),
119
- __('Settings', 'rocket-lazy-load')
120
- )
121
- );
122
-
123
- return $actions;
124
- }
125
-
126
- /**
127
- * Enqueue the css for the option page
128
- *
129
- * @since 2.0
130
- * @author Remy Perona
131
- *
132
- * @param string $hook_suffix Current page hook.
133
- */
134
- public function enqueueAdminStyle($hook_suffix)
135
- {
136
- if ('settings_page_rocket_lazyload' !== $hook_suffix) {
137
- return;
138
- }
139
-
140
- wp_enqueue_style('rocket-lazyload', ROCKET_LL_ASSETS_URL . 'css/admin.css', null, ROCKET_LL_VERSION);
141
- }
142
- }
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Subscriber;
4
+
5
+ use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
6
+ use RocketLazyLoadPlugin\Admin\AdminPage;
7
+
8
+ /**
9
+ * Admin Page Subscriber
10
+ *
11
+ * @since 2.0
12
+ * @author Remy Perona
13
+ */
14
+ class AdminPageSubscriber implements SubscriberInterface {
15
+
16
+ /**
17
+ * AdminPage instance
18
+ *
19
+ * @since 2.0
20
+ * @author Remy Perona
21
+ *
22
+ * @var AdminPage
23
+ */
24
+ private $page;
25
+
26
+ /**
27
+ * Plugin basename
28
+ *
29
+ * @since 2.0
30
+ * @author Remy Perona
31
+ *
32
+ * @var string
33
+ */
34
+ private $plugin_basename;
35
+
36
+ /**
37
+ * Constructor
38
+ *
39
+ * @since 2.0
40
+ * @author Remy Perona
41
+ *
42
+ * @param AdminPage $page AdminPage instance.
43
+ * @param string $plugin_basename Plugin basename.
44
+ */
45
+ public function __construct( AdminPage $page, $plugin_basename ) {
46
+ $this->page = $page;
47
+ $this->plugin_basename = $plugin_basename;
48
+ }
49
+
50
+ /**
51
+ * Returns an array of events that this subscriber wants to listen to.
52
+ *
53
+ * @return array
54
+ */
55
+ public function getSubscribedEvents() {
56
+ return [
57
+ 'admin_init' => 'configure',
58
+ 'admin_menu' => 'addAdminPage',
59
+ "plugin_action_links_{$this->plugin_basename}" => 'addPluginPageLink',
60
+ 'admin_enqueue_scripts' => 'enqueueAdminStyle',
61
+ ];
62
+ }
63
+
64
+ /**
65
+ * Registers the plugin settings in WordPress
66
+ *
67
+ * @since 2.0
68
+ * @author Remy Perona
69
+ *
70
+ * @return void
71
+ */
72
+ public function configure() {
73
+ $this->page->configure();
74
+ }
75
+
76
+ /**
77
+ * Adds the admin page to the settings menu
78
+ *
79
+ * @since 2.0
80
+ * @author Remy Perona
81
+ *
82
+ * @return void
83
+ */
84
+ public function addAdminPage() {
85
+ add_options_page(
86
+ $this->page->getPageTitle(),
87
+ $this->page->getMenuTitle(),
88
+ $this->page->getCapability(),
89
+ $this->page->getSlug(),
90
+ [ $this->page, 'renderPage' ]
91
+ );
92
+ }
93
+
94
+ /**
95
+ * Adds a link to the plugin settings on the plugins page
96
+ *
97
+ * @since 2.0
98
+ * @author Remy Perona
99
+ *
100
+ * @param array $actions Actions for the plugin.
101
+ * @return array
102
+ */
103
+ public function addPluginPageLink( $actions ) {
104
+ array_unshift(
105
+ $actions,
106
+ sprintf(
107
+ '<a href="%s">%s</a>',
108
+ admin_url( 'options-general.php?page=' . $this->page->getSlug() ),
109
+ __( 'Settings', 'rocket-lazy-load' )
110
+ )
111
+ );
112
+
113
+ return $actions;
114
+ }
115
+
116
+ /**
117
+ * Enqueue the css for the option page
118
+ *
119
+ * @since 2.0
120
+ * @author Remy Perona
121
+ *
122
+ * @param string $hook_suffix Current page hook.
123
+ */
124
+ public function enqueueAdminStyle( $hook_suffix ) {
125
+ if ( 'settings_page_rocket_lazyload' !== $hook_suffix ) {
126
+ return;
127
+ }
128
+
129
+ wp_enqueue_style( 'rocket-lazyload', \ROCKET_LL_ASSETS_URL . 'css/admin.css', null, \ROCKET_LL_VERSION );
130
+ }
131
+ }
 
 
 
 
 
 
 
 
 
 
 
src/Subscriber/ImagifyNoticeSubscriber.php CHANGED
@@ -1,152 +1,152 @@
1
- <?php
2
- /**
3
- * Imagify Notice subscriber
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Subscriber;
9
-
10
- defined('ABSPATH') || die('Cheatin\' uh?');
11
-
12
- use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
13
- use RocketLazyLoadPlugin\Admin\ImagifyNotice;
14
-
15
- /**
16
- * Imagify Notice Subscriber
17
- *
18
- * @since 2.0
19
- * @author Remy Perona
20
- */
21
- class ImagifyNoticeSubscriber implements SubscriberInterface
22
- {
23
- /**
24
- * ImagifyNotice instance
25
- *
26
- * @since 2.0
27
- * @author Remy Perona
28
- *
29
- * @var ImagifyNotice
30
- */
31
- private $imagify_notice;
32
-
33
- /**
34
- * Constructor
35
- *
36
- * @since 2.0
37
- * @author Remy Perona
38
- *
39
- * @param ImagifyNotice $imagify_notice ImagifyNotice instance.
40
- */
41
- public function __construct(ImagifyNotice $imagify_notice)
42
- {
43
- $this->imagify_notice = $imagify_notice;
44
- }
45
-
46
- /**
47
- * @inheritDoc
48
- */
49
- public function getSubscribedEvents()
50
- {
51
- return [
52
- 'admin_notices' => 'imagifyNotice',
53
- 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS',
54
- 'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes',
55
- 'admin_post_rocket_lazyload_ignore' => 'dismissBoxes',
56
- ];
57
- }
58
-
59
- /**
60
- * Displays the Imagify notice
61
- *
62
- * @since 2.0
63
- * @author Remy Perona
64
- *
65
- * @return void
66
- */
67
- public function imagifyNotice()
68
- {
69
- $current_screen = get_current_screen();
70
-
71
- if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) {
72
- return;
73
- }
74
-
75
- $boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
76
-
77
- if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) {
78
- return;
79
- }
80
-
81
- $this->imagify_notice->displayNotice();
82
- }
83
-
84
- /**
85
- * Inserts the javascript to dismiss the notice
86
- *
87
- * @since 2.0
88
- * @author Remy Perona
89
- *
90
- * @return void
91
- */
92
- public function dismissNoticeJS()
93
- {
94
- echo "<script>
95
- jQuery( document ).ready( function( $ ){
96
- $( '.rktll-cross' ).on( 'click', function( e ) {
97
- e.preventDefault();
98
- var url = $( this ).attr( 'href' ).replace( 'admin-post', 'admin-ajax' );
99
- $.get( url ).done( $( this ).parent().hide( 'slow' ) );
100
- });
101
- } );
102
- </script>";
103
- }
104
-
105
- /**
106
- * Saves the dismiss for the user
107
- *
108
- * @since 2.0
109
- * @author Remy Perona
110
- *
111
- * @return void
112
- */
113
- public function dismissBoxes()
114
- {
115
- if (! isset($_GET['box'], $_GET['action'], $_GET['_wpnonce'])) {
116
- return;
117
- }
118
-
119
- if (! wp_verify_nonce(sanitize_key($_GET['_wpnonce']), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice')) {
120
- if (defined('DOING_AJAX')) {
121
- wp_send_json(['error' => 1]);
122
- } else {
123
- wp_nonce_ays('');
124
- }
125
- }
126
-
127
- $box = sanitize_key(wp_unslash($_GET['box']));
128
-
129
- if ('rocket_lazyload_imagify_notice' === $box) {
130
- update_option('rocket_lazyload_dismiss_imagify_notice', 0);
131
- }
132
-
133
- $actual = (array) get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
134
- $actual = array_merge($actual, [ $box ]);
135
- $actual = array_filter($actual);
136
- $actual = array_unique($actual);
137
-
138
- update_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', $actual);
139
- delete_transient($box);
140
-
141
- if (empty($GLOBALS['pagenow']) || 'admin-post.php' !== $GLOBALS['pagenow']) {
142
- return;
143
- }
144
-
145
- if (defined('DOING_AJAX')) {
146
- wp_send_json(['error' => 0]);
147
- } else {
148
- wp_safe_redirect(esc_url_raw(wp_get_referer()));
149
- die();
150
- }
151
- }
152
- }
1
+ <?php
2
+ /**
3
+ * Imagify Notice subscriber
4
+ *
5
+ * @package RocketLazyload
6
+ */
7
+
8
+ namespace RocketLazyLoadPlugin\Subscriber;
9
+
10
+ defined('ABSPATH') || die('Cheatin\' uh?');
11
+
12
+ use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
13
+ use RocketLazyLoadPlugin\Admin\ImagifyNotice;
14
+
15
+ /**
16
+ * Imagify Notice Subscriber
17
+ *
18
+ * @since 2.0
19
+ * @author Remy Perona
20
+ */
21
+ class ImagifyNoticeSubscriber implements SubscriberInterface
22
+ {
23
+ /**
24
+ * ImagifyNotice instance
25
+ *
26
+ * @since 2.0
27
+ * @author Remy Perona
28
+ *
29
+ * @var ImagifyNotice
30
+ */
31
+ private $imagify_notice;
32
+
33
+ /**
34
+ * Constructor
35
+ *
36
+ * @since 2.0
37
+ * @author Remy Perona
38
+ *
39
+ * @param ImagifyNotice $imagify_notice ImagifyNotice instance.
40
+ */
41
+ public function __construct(ImagifyNotice $imagify_notice)
42
+ {
43
+ $this->imagify_notice = $imagify_notice;
44
+ }
45
+
46
+ /**
47
+ * @inheritDoc
48
+ */
49
+ public function getSubscribedEvents()
50
+ {
51
+ return [
52
+ 'admin_notices' => 'imagifyNotice',
53
+ 'admin_footer-settings_page_rocket_lazyload' => 'dismissNoticeJS',
54
+ 'wp_ajax_rocket_lazyload_ignore' => 'dismissBoxes',
55
+ 'admin_post_rocket_lazyload_ignore' => 'dismissBoxes',
56
+ ];
57
+ }
58
+
59
+ /**
60
+ * Displays the Imagify notice
61
+ *
62
+ * @since 2.0
63
+ * @author Remy Perona
64
+ *
65
+ * @return void
66
+ */
67
+ public function imagifyNotice()
68
+ {
69
+ $current_screen = get_current_screen();
70
+
71
+ if ('admin_notices' === current_filter() && ( isset($current_screen) && 'settings_page_rocket_lazyload' !== $current_screen->base )) {
72
+ return;
73
+ }
74
+
75
+ $boxes = get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
76
+
77
+ if (defined('IMAGIFY_VERSION') || in_array('rocket_lazyload_imagify_notice', (array) $boxes, true) || 1 === get_option('rocket_lazyload_dismiss_imagify_notice') || ! current_user_can('manage_options')) {
78
+ return;
79
+ }
80
+
81
+ $this->imagify_notice->displayNotice();
82
+ }
83
+
84
+ /**
85
+ * Inserts the javascript to dismiss the notice
86
+ *
87
+ * @since 2.0
88
+ * @author Remy Perona
89
+ *
90
+ * @return void
91
+ */
92
+ public function dismissNoticeJS()
93
+ {
94
+ echo "<script>
95
+ jQuery( document ).ready( function( $ ){
96
+ $( '.rktll-cross' ).on( 'click', function( e ) {
97
+ e.preventDefault();
98
+ var url = $( this ).attr( 'href' ).replace( 'admin-post', 'admin-ajax' );
99
+ $.get( url ).done( $( this ).parent().hide( 'slow' ) );
100
+ });
101
+ } );
102
+ </script>";
103
+ }
104
+
105
+ /**
106
+ * Saves the dismiss for the user
107
+ *
108
+ * @since 2.0
109
+ * @author Remy Perona
110
+ *
111
+ * @return void
112
+ */
113
+ public function dismissBoxes()
114
+ {
115
+ if (! isset($_GET['box'], $_GET['action'], $_GET['_wpnonce'])) {
116
+ return;
117
+ }
118
+
119
+ if (! wp_verify_nonce(sanitize_key($_GET['_wpnonce']), 'rocket_lazyload_ignore_rocket_lazyload_imagify_notice')) {
120
+ if (defined('DOING_AJAX')) {
121
+ wp_send_json(['error' => 1]);
122
+ } else {
123
+ wp_nonce_ays('');
124
+ }
125
+ }
126
+
127
+ $box = sanitize_key(wp_unslash($_GET['box']));
128
+
129
+ if ('rocket_lazyload_imagify_notice' === $box) {
130
+ update_option('rocket_lazyload_dismiss_imagify_notice', 0);
131
+ }
132
+
133
+ $actual = (array) get_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', true);
134
+ $actual = array_merge($actual, [ $box ]);
135
+ $actual = array_filter($actual);
136
+ $actual = array_unique($actual);
137
+
138
+ update_user_meta(get_current_user_id(), 'rocket_lazyload_boxes', $actual);
139
+ delete_transient($box);
140
+
141
+ if (empty($GLOBALS['pagenow']) || 'admin-post.php' !== $GLOBALS['pagenow']) {
142
+ return;
143
+ }
144
+
145
+ if (defined('DOING_AJAX')) {
146
+ wp_send_json(['error' => 0]);
147
+ } else {
148
+ wp_safe_redirect(esc_url_raw(wp_get_referer()));
149
+ die();
150
+ }
151
+ }
152
+ }
src/Subscriber/LazyloadSubscriber.php CHANGED
@@ -1,429 +1,432 @@
1
- <?php
2
- /**
3
- * Lazyload subscriber
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Subscriber;
9
-
10
- use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
11
- use RocketLazyLoadPlugin\Options\OptionArray;
12
- use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets;
13
- use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image;
14
- use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe;
15
-
16
- /**
17
- * Lazyload Subscriber
18
- *
19
- * @since 2.0
20
- * @author Remy Perona
21
- */
22
- class LazyloadSubscriber implements SubscriberInterface
23
- {
24
- /**
25
- * OptionArray instance
26
- *
27
- * @since 2.0
28
- * @author Remy Perona
29
- *
30
- * @var OptionArray
31
- */
32
- private $option_array;
33
-
34
- /**
35
- * Assets instance
36
- *
37
- * @since 2.0
38
- * @author Remy Perona
39
- *
40
- * @var Assets
41
- */
42
- private $assets;
43
-
44
- /**
45
- * Image instance
46
- *
47
- * @since 2.0
48
- * @author Remy Perona
49
- *
50
- * @var Image
51
- */
52
- private $image;
53
-
54
- /**
55
- * Iframe instance
56
- *
57
- * @since 2.0
58
- * @author Remy Perona
59
- *
60
- * @var Iframe
61
- */
62
- private $iframe;
63
-
64
- /**
65
- * Constructor
66
- *
67
- * @since 2.0
68
- * @author Remy Perona
69
- *
70
- * @param OptionArray $option_array OptionArray instance.
71
- * @param Assets $assets Assets instance.
72
- * @param Image $image Image instance.
73
- * @param Iframe $iframe Iframe instance.
74
- */
75
- public function __construct(OptionArray $option_array, Assets $assets, Image $image, Iframe $iframe)
76
- {
77
- $this->option_array = $option_array;
78
- $this->assets = $assets;
79
- $this->image = $image;
80
- $this->iframe = $iframe;
81
- }
82
-
83
- /**
84
- * @inheritDoc
85
- */
86
- public function getSubscribedEvents()
87
- {
88
- return [
89
- 'wp_footer' => [
90
- [ 'insertLazyloadScript', ROCKET_LL_INT_MAX ],
91
- ['insertYoutubeThumbnailScript', ROCKET_LL_INT_MAX ],
92
- ],
93
- 'wp_head' => ['insertNoJSStyle', ROCKET_LL_INT_MAX ],
94
- 'wp_enqueue_scripts' => ['insertYoutubeThumbnailStyle', ROCKET_LL_INT_MAX],
95
- 'template_redirect' => ['lazyload', 2],
96
- 'rocket_lazyload_html' => 'lazyloadResponsive',
97
- 'init' => 'lazyloadSmilies',
98
- ];
99
- }
100
-
101
- /**
102
- * Inserts the lazyload script in the footer
103
- *
104
- * @since 2.0
105
- * @author Remy Perona
106
- *
107
- * @return void
108
- */
109
- public function insertLazyloadScript()
110
- {
111
- if (! $this->option_array->get('images') && ! $this->option_array->get('iframes')) {
112
- return;
113
- }
114
-
115
- if (! $this->shouldLazyload()) {
116
- return;
117
- }
118
-
119
- /**
120
- * Filters the threshold at which lazyload is triggered
121
- *
122
- * @since 1.2
123
- * @author Remy Perona
124
- *
125
- * @param int $threshold Threshold value.
126
- */
127
- $threshold = apply_filters('rocket_lazyload_threshold', 300);
128
-
129
- /**
130
- * Filters the use of the polyfill for intersectionObserver
131
- *
132
- * @since 3.3
133
- * @author Remy Perona
134
- *
135
- * @param bool $polyfill True to use the polyfill, false otherwise.
136
- */
137
- $polyfill = apply_filters('rocket_lazyload_polyfill', false);
138
-
139
- $script_args = [
140
- 'base_url' => ROCKET_LL_FRONT_JS_URL,
141
- 'version' => '12.0',
142
- 'polyfill' => $polyfill,
143
- ];
144
-
145
- $inline_args = [
146
- 'threshold' => $threshold,
147
- 'options' => [
148
- 'use_native' => 'true',
149
- ],
150
- ];
151
-
152
- if ($this->option_array->get('images') || $this->option_array->get('iframes')) {
153
- $inline_args['elements']['loading'] = '[loading=lazy]';
154
- }
155
-
156
- if ($this->option_array->get('images')) {
157
- $inline_args['elements']['background_image'] = '.rocket-lazyload';
158
- }
159
-
160
- /**
161
- * Filters the arguments array for the lazyload script options
162
- *
163
- * @since 2.0
164
- * @author Remy Perona
165
- *
166
- * @param array $inline_args Arguments used for the lazyload script options.
167
- */
168
- $inline_args = apply_filters('rocket_lazyload_script_args', $inline_args);
169
-
170
- echo '<script>' . $this->assets->getInlineLazyloadScript($inline_args) . '</script>';
171
- $this->assets->insertLazyloadScript($script_args);
172
- }
173
-
174
- /**
175
- * Inserts the Youtube thumbnail script in the footer
176
- *
177
- * @since 2.0
178
- * @author Remy Perona
179
- *
180
- * @return void
181
- */
182
- public function insertYoutubeThumbnailScript()
183
- {
184
- if (! $this->option_array->get('youtube')) {
185
- return;
186
- }
187
-
188
- if (! $this->shouldLazyload()) {
189
- return;
190
- }
191
-
192
- /**
193
- * Filters the resolution of the YouTube thumbnail
194
- *
195
- * @since 1.4.8
196
- * @author Arun Basil Lal
197
- *
198
- * @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault
199
- */
200
- $thumbnail_resolution = apply_filters('rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault');
201
-
202
- $this->assets->insertYoutubeThumbnailScript(
203
- [
204
- 'resolution' => $thumbnail_resolution,
205
- 'lazy_image' => (bool) $this->option_array->get('images'),
206
- ]
207
- );
208
- }
209
-
210
- /**
211
- * Inserts the no JS CSS compatibility in the header
212
- *
213
- * @since 2.0.3
214
- * @author Remy Perona
215
- *
216
- * @return void
217
- */
218
- public function insertNoJSStyle()
219
- {
220
- if (! $this->shouldLazyload()) {
221
- return;
222
- }
223
-
224
- $this->assets->insertNoJSCSS();
225
- }
226
-
227
- /**
228
- * Inserts the Youtube thumbnail CSS in the header
229
- *
230
- * @since 2.0
231
- * @author Remy Perona
232
- *
233
- * @return void
234
- */
235
- public function insertYoutubeThumbnailStyle()
236
- {
237
- if (! $this->option_array->get('youtube')) {
238
- return;
239
- }
240
-
241
- if (! $this->shouldLazyload()) {
242
- return;
243
- }
244
-
245
- $this->assets->insertYoutubeThumbnailCSS(
246
- [
247
- 'base_url' => ROCKET_LL_ASSETS_URL,
248
- 'responsive_embeds' => current_theme_supports('responsive-embeds'),
249
- ]
250
- );
251
- }
252
-
253
- /**
254
- * Checks if lazyload should be applied
255
- *
256
- * @since 2.0
257
- * @author Remy Perona
258
- *
259
- * @return bool
260
- */
261
- private function shouldLazyload()
262
- {
263
- if (is_admin() || is_feed() || is_preview() || ( defined('REST_REQUEST') && REST_REQUEST ) || ( defined('DONOTLAZYLOAD') && DONOTLAZYLOAD )) {
264
- return false;
265
- }
266
-
267
- if ($this->isPageBuilder()) {
268
- return false;
269
- }
270
-
271
- /**
272
- * Filters the lazyload application
273
- *
274
- * @since 2.0
275
- * @author Remy Perona
276
- *
277
- * @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
278
- */
279
- if (! apply_filters('do_rocket_lazyload', true)) { // WPCS: prefix ok.
280
- return false;
281
- }
282
-
283
- return true;
284
- }
285
-
286
- /**
287
- * Checks if current page is a page builder editor.
288
- *
289
- * @since 2.2.2
290
- * @author Remy Perona
291
- *
292
- * @return bool
293
- */
294
- private function isPageBuilder()
295
- {
296
- // Exclude Page Builders editors.
297
- $excluded_parameters = [
298
- 'fl_builder',
299
- 'et_fb',
300
- 'ct_builder',
301
- ];
302
-
303
- foreach ($excluded_parameters as $excluded) {
304
- if (isset($_GET[ $excluded ])) {
305
- return true;
306
- }
307
- }
308
-
309
- return false;
310
- }
311
-
312
- /**
313
- * Gets the content to lazyload
314
- *
315
- * @since 2.0
316
- * @author Remy Perona
317
- *
318
- * @return void
319
- */
320
- public function lazyload()
321
- {
322
- if (! $this->shouldLazyload()) {
323
- return;
324
- }
325
-
326
- ob_start([$this, 'lazyloadBuffer']);
327
- }
328
-
329
- /**
330
- * Applies lazyload on the provided content
331
- *
332
- * @since 2.0
333
- * @author Remy Perona
334
- *
335
- * @param string $html HTML content.
336
- * @return string
337
- */
338
- public function lazyloadBuffer($html)
339
- {
340
- $buffer = $this->ignoreScripts($html);
341
- $buffer = $this->ignoreNoscripts($buffer);
342
-
343
- if ($this->option_array->get('images')) {
344
- $html = $this->image->lazyloadImages($html, $buffer);
345
- $html = $this->image->lazyloadPictures($html, $buffer);
346
- $html = $this->image->lazyloadBackgroundImages($html, $buffer);
347
- }
348
-
349
- if ($this->option_array->get('iframes')) {
350
- $args = [
351
- 'youtube' => $this->option_array->get('youtube'),
352
- ];
353
-
354
- $html = $this->iframe->lazyloadIframes($html, $buffer, $args);
355
- }
356
-
357
- return $html;
358
- }
359
-
360
- /**
361
- * Applies lazyload on responsive images attributes srcset and sizes
362
- *
363
- * @since 2.0
364
- * @author Remy Perona
365
- *
366
- * @param string $html Image HTML.
367
- * @return string
368
- */
369
- public function lazyloadResponsive($html)
370
- {
371
- return $this->image->lazyloadResponsiveAttributes($html);
372
- }
373
-
374
- /**
375
- * Applies lazyload on WordPress smilies
376
- *
377
- * @since 2.0
378
- * @author Remy Perona
379
- *
380
- * @return void
381
- */
382
- public function lazyloadSmilies()
383
- {
384
- if (! $this->shouldLazyload()) {
385
- return;
386
- }
387
-
388
- if (! $this->option_array->get('images')) {
389
- return;
390
- }
391
-
392
- $filters = [
393
- 'the_content' => 10,
394
- 'the_excerpt' => 10,
395
- 'comment_text' => 20,
396
- ];
397
-
398
- foreach ($filters as $filter => $prio) {
399
- if (! has_filter($filter)) {
400
- continue;
401
- }
402
-
403
- remove_filter($filter, 'convert_smilies', $prio);
404
- add_filter($filter, [$this->image, 'convertSmilies'], $prio);
405
- }
406
- }
407
-
408
- /**
409
- * Remove inline scripts from the HTML to parse
410
- *
411
- * @param string $html HTML content.
412
- * @return string
413
- */
414
- private function ignoreScripts($html)
415
- {
416
- return preg_replace('/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html);
417
- }
418
-
419
- /**
420
- * Remove noscript tags from the HTML to parse
421
- *
422
- * @param string $html HTML content.
423
- * @return string
424
- */
425
- private function ignoreNoscripts($html)
426
- {
427
- return preg_replace('#<noscript>(?:.+)</noscript>#Umsi', '', $html);
428
- }
429
- }
 
 
 
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Subscriber;
4
+
5
+ use RocketLazyLoadPlugin\EventManagement\SubscriberInterface;
6
+ use RocketLazyLoadPlugin\Options\OptionArray;
7
+ use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Assets;
8
+ use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Image;
9
+ use RocketLazyLoadPlugin\Dependencies\RocketLazyload\Iframe;
10
+
11
+ /**
12
+ * Lazyload Subscriber
13
+ *
14
+ * @since 2.0
15
+ * @author Remy Perona
16
+ */
17
+ class LazyloadSubscriber implements SubscriberInterface {
18
+
19
+ /**
20
+ * OptionArray instance
21
+ *
22
+ * @since 2.0
23
+ * @author Remy Perona
24
+ *
25
+ * @var OptionArray
26
+ */
27
+ private $option_array;
28
+
29
+ /**
30
+ * Assets instance
31
+ *
32
+ * @since 2.0
33
+ * @author Remy Perona
34
+ *
35
+ * @var Assets
36
+ */
37
+ private $assets;
38
+
39
+ /**
40
+ * Image instance
41
+ *
42
+ * @since 2.0
43
+ * @author Remy Perona
44
+ *
45
+ * @var Image
46
+ */
47
+ private $image;
48
+
49
+ /**
50
+ * Iframe instance
51
+ *
52
+ * @since 2.0
53
+ * @author Remy Perona
54
+ *
55
+ * @var Iframe
56
+ */
57
+ private $iframe;
58
+
59
+ /**
60
+ * Constructor
61
+ *
62
+ * @since 2.0
63
+ * @author Remy Perona
64
+ *
65
+ * @param OptionArray $option_array OptionArray instance.
66
+ * @param Assets $assets Assets instance.
67
+ * @param Image $image Image instance.
68
+ * @param Iframe $iframe Iframe instance.
69
+ */
70
+ public function __construct( OptionArray $option_array, Assets $assets, Image $image, Iframe $iframe ) {
71
+ $this->option_array = $option_array;
72
+ $this->assets = $assets;
73
+ $this->image = $image;
74
+ $this->iframe = $iframe;
75
+ }
76
+
77
+ /**
78
+ * Returns an array of events that this subscriber wants to listen to.
79
+ *
80
+ * @return array
81
+ */
82
+ public function getSubscribedEvents() {
83
+ return [
84
+ 'wp_footer' => [
85
+ [ 'insertLazyloadScript', \ROCKET_LL_INT_MAX ],
86
+ [ 'insertYoutubeThumbnailScript', \ROCKET_LL_INT_MAX ],
87
+ ],
88
+ 'wp_head' => [ 'insertNoJSStyle', \ROCKET_LL_INT_MAX ],
89
+ 'wp_enqueue_scripts' => [ 'insertYoutubeThumbnailStyle', \ROCKET_LL_INT_MAX ],
90
+ 'template_redirect' => [ 'lazyload', 2 ],
91
+ 'rocket_lazyload_html' => 'lazyloadResponsive',
92
+ 'init' => 'lazyloadSmilies',
93
+ ];
94
+ }
95
+
96
+ /**
97
+ * Inserts the lazyload script in the footer
98
+ *
99
+ * @since 2.0
100
+ * @author Remy Perona
101
+ *
102
+ * @return void
103
+ */
104
+ public function insertLazyloadScript() {
105
+ if ( ! $this->option_array->get( 'images' ) && ! $this->option_array->get( 'iframes' ) ) {
106
+ return;
107
+ }
108
+
109
+ if ( ! $this->shouldLazyload() ) {
110
+ return;
111
+ }
112
+
113
+ /**
114
+ * Filters the threshold at which lazyload is triggered
115
+ *
116
+ * @since 1.2
117
+ * @author Remy Perona
118
+ *
119
+ * @param int $threshold Threshold value.
120
+ */
121
+ $threshold = apply_filters( 'rocket_lazyload_threshold', 300 );
122
+
123
+ /**
124
+ * Filters the use of the polyfill for intersectionObserver
125
+ *
126
+ * @since 3.3
127
+ * @author Remy Perona
128
+ *
129
+ * @param bool $polyfill True to use the polyfill, false otherwise.
130
+ */
131
+ $polyfill = apply_filters( 'rocket_lazyload_polyfill', false );
132
+
133
+ $script_args = [
134
+ 'base_url' => ROCKET_LL_FRONT_JS_URL,
135
+ 'version' => '12.0',
136
+ 'polyfill' => $polyfill,
137
+ ];
138
+
139
+ $inline_args = [
140
+ 'threshold' => $threshold,
141
+ ];
142
+
143
+ /**
144
+ * Filters the use of native lazyload
145
+ *
146
+ * @since 2.3.3
147
+ * @param bool $use_native True to enable native lazyload usage.
148
+ */
149
+ if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
150
+ $inline_args['options'] = [
151
+ 'use_native' => 'true',
152
+ ];
153
+ }
154
+
155
+ if ( $this->option_array->get( 'images' ) || $this->option_array->get( 'iframes' ) ) {
156
+ // This filter is documented in src/Subscriber/LazyloadSubscriber.php.
157
+ if ( apply_filters( 'rocket_use_native_lazyload', false ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
158
+ $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : [];
159
+ $inline_args['elements']['loading'] = '[loading=lazy]';
160
+ }
161
+ }
162
+
163
+ if ( $this->option_array->get( 'images' ) ) {
164
+ $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : [];
165
+ $inline_args['elements']['image'] = 'img[data-lazy-src]';
166
+ $inline_args['elements']['background_image'] = '.rocket-lazyload';
167
+ }
168
+
169
+ if ( $this->option_array->get( 'iframes' ) ) {
170
+ $inline_args['elements'] = isset( $inline_args['elements'] ) ? $inline_args['elements'] : [];
171
+ $inline_args['elements']['iframe'] = 'iframe[data-lazy-src]';
172
+ }
173
+
174
+ /**
175
+ * Filters the arguments array for the lazyload script options
176
+ *
177
+ * @since 2.0
178
+ * @author Remy Perona
179
+ *
180
+ * @param array $inline_args Arguments used for the lazyload script options.
181
+ */
182
+ $inline_args = apply_filters( 'rocket_lazyload_script_args', $inline_args );
183
+
184
+ echo '<script>' . $this->assets->getInlineLazyloadScript( $inline_args ) . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
185
+ $this->assets->insertLazyloadScript( $script_args );
186
+ }
187
+
188
+ /**
189
+ * Inserts the Youtube thumbnail script in the footer
190
+ *
191
+ * @since 2.0
192
+ * @author Remy Perona
193
+ *
194
+ * @return void
195
+ */
196
+ public function insertYoutubeThumbnailScript() {
197
+ if ( ! $this->option_array->get( 'youtube' ) ) {
198
+ return;
199
+ }
200
+
201
+ if ( ! $this->shouldLazyload() ) {
202
+ return;
203
+ }
204
+
205
+ /**
206
+ * Filters the resolution of the YouTube thumbnail
207
+ *
208
+ * @since 1.4.8
209
+ * @author Arun Basil Lal
210
+ *
211
+ * @param string $thumbnail_resolution The resolution of the thumbnail. Accepted values: default, mqdefault, sddefault, hqdefault, maxresdefault
212
+ */
213
+ $thumbnail_resolution = apply_filters( 'rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault' );
214
+
215
+ $this->assets->insertYoutubeThumbnailScript(
216
+ [
217
+ 'resolution' => $thumbnail_resolution,
218
+ 'lazy_image' => (bool) $this->option_array->get( 'images' ),
219
+ ]
220
+ );
221
+ }
222
+
223
+ /**
224
+ * Inserts the no JS CSS compatibility in the header
225
+ *
226
+ * @since 2.0.3
227
+ * @author Remy Perona
228
+ *
229
+ * @return void
230
+ */
231
+ public function insertNoJSStyle() {
232
+ if ( ! $this->shouldLazyload() ) {
233
+ return;
234
+ }
235
+
236
+ $this->assets->insertNoJSCSS();
237
+ }
238
+
239
+ /**
240
+ * Inserts the Youtube thumbnail CSS in the header
241
+ *
242
+ * @since 2.0
243
+ * @author Remy Perona
244
+ *
245
+ * @return void
246
+ */
247
+ public function insertYoutubeThumbnailStyle() {
248
+ if ( ! $this->option_array->get( 'youtube' ) ) {
249
+ return;
250
+ }
251
+
252
+ if ( ! $this->shouldLazyload() ) {
253
+ return;
254
+ }
255
+
256
+ $this->assets->insertYoutubeThumbnailCSS(
257
+ [
258
+ 'base_url' => ROCKET_LL_ASSETS_URL,
259
+ 'responsive_embeds' => current_theme_supports( 'responsive-embeds' ),
260
+ ]
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Checks if lazyload should be applied
266
+ *
267
+ * @since 2.0
268
+ * @author Remy Perona
269
+ *
270
+ * @return bool
271
+ */
272
+ private function shouldLazyload() {
273
+ if ( is_admin() || is_feed() || is_preview() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || ( defined( 'DONOTLAZYLOAD' ) && DONOTLAZYLOAD ) ) {
274
+ return false;
275
+ }
276
+
277
+ if ( $this->isPageBuilder() ) {
278
+ return false;
279
+ }
280
+
281
+ /**
282
+ * Filters the lazyload application
283
+ *
284
+ * @since 2.0
285
+ * @author Remy Perona
286
+ *
287
+ * @param bool $do_rocket_lazyload True to apply lazyload, false otherwise.
288
+ */
289
+ if ( ! apply_filters( 'do_rocket_lazyload', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals
290
+ return false;
291
+ }
292
+
293
+ return true;
294
+ }
295
+
296
+ /**
297
+ * Checks if current page is a page builder editor.
298
+ *
299
+ * @since 2.2.2
300
+ * @author Remy Perona
301
+ *
302
+ * @return bool
303
+ */
304
+ private function isPageBuilder() {
305
+ // Exclude Page Builders editors.
306
+ $excluded_parameters = [
307
+ 'fl_builder',
308
+ 'et_fb',
309
+ 'ct_builder',
310
+ ];
311
+
312
+ foreach ( $excluded_parameters as $excluded ) {
313
+ if ( isset( $_GET[ $excluded ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
314
+ return true;
315
+ }
316
+ }
317
+
318
+ return false;
319
+ }
320
+
321
+ /**
322
+ * Gets the content to lazyload
323
+ *
324
+ * @since 2.0
325
+ * @author Remy Perona
326
+ *
327
+ * @return void
328
+ */
329
+ public function lazyload() {
330
+ if ( ! $this->shouldLazyload() ) {
331
+ return;
332
+ }
333
+
334
+ ob_start( [ $this, 'lazyloadBuffer' ] );
335
+ }
336
+
337
+ /**
338
+ * Applies lazyload on the provided content
339
+ *
340
+ * @since 2.0
341
+ * @author Remy Perona
342
+ *
343
+ * @param string $html HTML content.
344
+ * @return string
345
+ */
346
+ public function lazyloadBuffer( $html ) {
347
+ $buffer = $this->ignoreScripts( $html );
348
+ $buffer = $this->ignoreNoscripts( $buffer );
349
+
350
+ if ( $this->option_array->get( 'images' ) ) {
351
+ $html = $this->image->lazyloadImages( $html, $buffer );
352
+ $html = $this->image->lazyloadPictures( $html, $buffer );
353
+ $html = $this->image->lazyloadBackgroundImages( $html, $buffer );
354
+ }
355
+
356
+ if ( $this->option_array->get( 'iframes' ) ) {
357
+ $args = [
358
+ 'youtube' => $this->option_array->get( 'youtube' ),
359
+ ];
360
+
361
+ $html = $this->iframe->lazyloadIframes( $html, $buffer, $args );
362
+ }
363
+
364
+ return $html;
365
+ }
366
+
367
+ /**
368
+ * Applies lazyload on responsive images attributes srcset and sizes
369
+ *
370
+ * @since 2.0
371
+ * @author Remy Perona
372
+ *
373
+ * @param string $html Image HTML.
374
+ * @return string
375
+ */
376
+ public function lazyloadResponsive( $html ) {
377
+ return $this->image->lazyloadResponsiveAttributes( $html );
378
+ }
379
+
380
+ /**
381
+ * Applies lazyload on WordPress smilies
382
+ *
383
+ * @since 2.0
384
+ * @author Remy Perona
385
+ *
386
+ * @return void
387
+ */
388
+ public function lazyloadSmilies() {
389
+ if ( ! $this->shouldLazyload() ) {
390
+ return;
391
+ }
392
+
393
+ if ( ! $this->option_array->get( 'images' ) ) {
394
+ return;
395
+ }
396
+
397
+ $filters = [
398
+ 'the_content' => 10,
399
+ 'the_excerpt' => 10,
400
+ 'comment_text' => 20,
401
+ ];
402
+
403
+ foreach ( $filters as $filter => $prio ) {
404
+ if ( ! has_filter( $filter ) ) {
405
+ continue;
406
+ }
407
+
408
+ remove_filter( $filter, 'convert_smilies', $prio );
409
+ add_filter( $filter, [ $this->image, 'convertSmilies' ], $prio );
410
+ }
411
+ }
412
+
413
+ /**
414
+ * Remove inline scripts from the HTML to parse
415
+ *
416
+ * @param string $html HTML content.
417
+ * @return string
418
+ */
419
+ private function ignoreScripts( $html ) {
420
+ return preg_replace( '/<script\b(?:[^>]*)>(?:.+)?<\/script>/Umsi', '', $html );
421
+ }
422
+
423
+ /**
424
+ * Remove noscript tags from the HTML to parse
425
+ *
426
+ * @param string $html HTML content.
427
+ * @return string
428
+ */
429
+ private function ignoreNoscripts( $html ) {
430
+ return preg_replace( '#<noscript>(?:.+)</noscript>#Umsi', '', $html );
431
+ }
432
+ }
src/Subscriber/ThirdParty/AMPSubscriber.php CHANGED
@@ -1,73 +1,74 @@
1
- <?php
2
- /**
3
- * AMP plugin compatibility subscrber
4
- *
5
- * @package RocketLazyload
6
- */
7
-
8
- namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
9
-
10
- use RocketLazyLoadPlugin\EventManagement\EventManager;
11
- use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;
12
-
13
- defined('ABSPATH') || die('Cheatin\' uh?');
14
-
15
- /**
16
- * Manages compatibility with the AMP plugin
17
- *
18
- * @since 2.0
19
- * @author Remy Perona
20
- */
21
- class AMPSubscriber implements EventManagerAwareSubscriberInterface
22
- {
23
- /**
24
- * @inheritDoc
25
- */
26
- public function getSubscribedEvents()
27
- {
28
- return [
29
- 'wp' => 'disableIfAMP',
30
- ];
31
- }
32
-
33
- /**
34
- * {@inheritdoc}
35
- */
36
- public function setEventManager(EventManager $event_manager)
37
- {
38
- $this->event_manager = $event_manager;
39
- }
40
-
41
- /**
42
- * Disable if on AMP page
43
- *
44
- * @since 2.0.2
45
- * @author Remy Perona
46
- *
47
- * @return void
48
- */
49
- public function disableIfAMP()
50
- {
51
- if ($this->isAmpEndpoint()) {
52
- $this->event_manager->addCallback('do_rocket_lazyload', '__return_false');
53
- $this->event_manager->addCallback('do_rocket_lazyload_iframes', '__return_false');
54
- }
55
- }
56
-
57
- /**
58
- * Checks if current page uses AMP
59
- *
60
- * @since 2.0
61
- * @author Remy Perona
62
- *
63
- * @return boolean
64
- */
65
- private function isAmpEndpoint()
66
- {
67
- if (function_exists('is_amp_endpoint') && \is_amp_endpoint()) {
68
- return true;
69
- }
70
-
71
- return false;
72
- }
73
- }
 
1
+ <?php
2
+
3
+ namespace RocketLazyLoadPlugin\Subscriber\ThirdParty;
4
+
5
+ use RocketLazyLoadPlugin\EventManagement\EventManager;
6
+ use RocketLazyLoadPlugin\EventManagement\EventManagerAwareSubscriberInterface;
7
+
8
+ /**
9
+ * Manages compatibility with the AMP plugin
10
+ *
11
+ * @since 2.0
12
+ * @author Remy Perona
13
+ */
14
+ class AMPSubscriber implements EventManagerAwareSubscriberInterface {
15
+
16
+ /**
17
+ * EventManager instance
18
+ *
19
+ * @var EventManager
20
+ */
21
+ protected $event_manager;
22
+
23
+ /**
24
+ * Returns an array of events that this subscriber wants to listen to.
25
+ *
26
+ * @return array
27
+ */
28
+ public function getSubscribedEvents() {
29
+ return [
30
+ 'wp' => 'disableIfAMP',
31
+ ];
32
+ }
33
+
34
+ /**
35
+ * Set the WordPress event manager for the subscriber.
36
+ *
37
+ * @param EventManager $event_manager EventManager instance.
38
+ * @return void
39
+ */
40
+ public function setEventManager( EventManager $event_manager ) {
41
+ $this->event_manager = $event_manager;
42
+ }
43
+
44
+ /**
45
+ * Disable if on AMP page
46
+ *
47
+ * @since 2.0.2
48
+ * @author Remy Perona
49
+ *
50
+ * @return void
51
+ */
52
+ public function disableIfAMP() {
53
+ if ( $this->isAmpEndpoint() ) {
54
+ $this->event_manager->addCallback( 'do_rocket_lazyload', '__return_false' );
55
+ $this->event_manager->addCallback( 'do_rocket_lazyload_iframes', '__return_false' );
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Checks if current page uses AMP
61
+ *
62
+ * @since 2.0
63
+ * @author Remy Perona
64
+ *
65
+ * @return boolean
66
+ */
67
+ private function isAmpEndpoint() {
68
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
69
+ return true;
70
+ }
71
+
72
+ return false;
73
+ }
74
+ }
src/rocket-lazyload-requirements-check.php CHANGED
@@ -1,143 +1,143 @@
1
- <?php
2
- /**
3
- * Check if current requirements are met
4
- *
5
- * @package RocketLazyloadPlugin
6
- */
7
-
8
- defined('ABSPATH') || die('Cheatin&#8217; uh?');
9
-
10
- /**
11
- * Class to check if the current WordPress and PHP versions meet our requirements
12
- *
13
- * @since 2.0
14
- * @author Remy Perona
15
- */
16
- class Rocket_Lazyload_Requirements_Check
17
- {
18
- /**
19
- * Plugin Name
20
- *
21
- * @var string
22
- */
23
- private $plugin_name;
24
-
25
- /**
26
- * Plugin version
27
- *
28
- * @var string
29
- */
30
- private $plugin_version;
31
-
32
- /**
33
- * Required WordPress version
34
- *
35
- * @var string
36
- */
37
- private $wp_version;
38
-
39
- /**
40
- * Required PHP version
41
- *
42
- * @var string
43
- */
44
- private $php_version;
45
-
46
- /**
47
- * Constructor
48
- *
49
- * @since 3.0
50
- * @author Remy Perona
51
- *
52
- * @param array $args {
53
- * Arguments to populate the class properties.
54
- *
55
- * @type string $plugin_name Plugin name.
56
- * @type string $wp_version Required WordPress version.
57
- * @type string $php_version Required PHP version.
58
- * }
59
- */
60
- public function __construct($args)
61
- {
62
- foreach (array('plugin_name', 'plugin_version', 'wp_version', 'php_version') as $setting) {
63
- if (isset($args[ $setting ])) {
64
- $this->$setting = $args[ $setting ];
65
- }
66
- }
67
- }
68
-
69
- /**
70
- * Checks if all requirements are ok, if not, display a notice and the rollback
71
- *
72
- * @since 3.0
73
- * @author Remy Perona
74
- *
75
- * @return bool
76
- */
77
- public function check()
78
- {
79
- if (! $this->phpPasses() || ! $this->wpPasses()) {
80
- add_action('admin_notices', array($this, 'notice'));
81
-
82
- return false;
83
- }
84
-
85
- return true;
86
- }
87
-
88
- /**
89
- * Checks if the current PHP version is equal or superior to the required PHP version
90
- *
91
- * @since 3.0
92
- * @author Remy Perona
93
- *
94
- * @return bool
95
- */
96
- private function phpPasses()
97
- {
98
- return version_compare(PHP_VERSION, $this->php_version) >= 0;
99
- }
100
-
101
- /**
102
- * Checks if the current WordPress version is equal or superior to the required PHP version
103
- *
104
- * @since 3.0
105
- * @author Remy Perona
106
- *
107
- * @return bool
108
- */
109
- private function wpPasses()
110
- {
111
- global $wp_version;
112
-
113
- return version_compare($wp_version, $this->wp_version) >= 0;
114
- }
115
-
116
- /**
117
- * Displays a notice if requirements are not met.
118
- *
119
- * @since 2.0
120
- * @author Remy Perona
121
- */
122
- public function notice()
123
- {
124
- if (! current_user_can('manage_options')) {
125
- return;
126
- }
127
-
128
- // Translators: %1$s = Plugin name, %2$s = Plugin version.
129
- $message = '<p>' . sprintf(__('To function properly, %1$s %2$s requires at least:', 'rocket-lazy-load'), $this->plugin_name, $this->plugin_version) . '</p><ul>';
130
-
131
- if (! $this->phpPasses()) {
132
- // Translators: %1$s = PHP version required.
133
- $message .= '<li>' . sprintf(__('PHP %1$s. To use this %2$s version, please ask your web host how to upgrade your server to PHP %1$s or higher.', 'rocket-lazy-load'), $this->php_version, $this->plugin_name) . '</li>';
134
- }
135
-
136
- if (! $this->wpPasses()) {
137
- // Translators: %1$s = WordPress version required.
138
- $message .= '<li>' . sprintf(__('WordPress %1$s. To use this %2$s version, please upgrade WordPress to version %1$s or higher.', 'rocket-lazy-load'), $this->wp_version, $this->plugin_name) . '</li>';
139
- }
140
-
141
- echo '<div class="notice notice-error">' . $message . '</div>';
142
- }
143
- }
1
+ <?php
2
+ /**
3
+ * Check if current requirements are met
4
+ *
5
+ * @package RocketLazyloadPlugin
6
+ */
7
+
8
+ defined('ABSPATH') || die('Cheatin&#8217; uh?');
9
+
10
+ /**
11
+ * Class to check if the current WordPress and PHP versions meet our requirements
12
+ *
13
+ * @since 2.0
14
+ * @author Remy Perona
15
+ */
16
+ class Rocket_Lazyload_Requirements_Check
17
+ {
18
+ /**
19
+ * Plugin Name
20
+ *
21
+ * @var string
22
+ */
23
+ private $plugin_name;
24
+
25
+ /**
26
+ * Plugin version
27
+ *
28
+ * @var string
29
+ */
30
+ private $plugin_version;
31
+
32
+ /**
33
+ * Required WordPress version
34
+ *
35
+ * @var string
36
+ */
37
+ private $wp_version;
38
+
39
+ /**
40
+ * Required PHP version
41
+ *
42
+ * @var string
43
+ */
44
+ private $php_version;
45
+
46
+ /**
47
+ * Constructor
48
+ *
49
+ * @since 3.0
50
+ * @author Remy Perona
51
+ *
52
+ * @param array $args {
53
+ * Arguments to populate the class properties.
54
+ *
55
+ * @type string $plugin_name Plugin name.
56
+ * @type string $wp_version Required WordPress version.
57
+ * @type string $php_version Required PHP version.
58
+ * }
59
+ */
60
+ public function __construct($args)
61
+ {
62
+ foreach (array('plugin_name', 'plugin_version', 'wp_version', 'php_version') as $setting) {
63
+ if (isset($args[ $setting ])) {
64
+ $this->$setting = $args[ $setting ];
65
+ }
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Checks if all requirements are ok, if not, display a notice and the rollback
71
+ *
72
+ * @since 3.0
73
+ * @author Remy Perona
74
+ *
75
+ * @return bool
76
+ */
77
+ public function check()
78
+ {
79
+ if (! $this->phpPasses() || ! $this->wpPasses()) {
80
+ add_action('admin_notices', array($this, 'notice'));
81
+
82
+ return false;
83
+ }
84
+
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Checks if the current PHP version is equal or superior to the required PHP version
90
+ *
91
+ * @since 3.0
92
+ * @author Remy Perona
93
+ *
94
+ * @return bool
95
+ */
96
+ private function phpPasses()
97
+ {
98
+ return version_compare(PHP_VERSION, $this->php_version) >= 0;
99
+ }
100
+
101
+ /**
102
+ * Checks if the current WordPress version is equal or superior to the required PHP version
103
+ *
104
+ * @since 3.0
105
+ * @author Remy Perona
106
+ *
107
+ * @return bool
108
+ */
109
+ private function wpPasses()
110
+ {
111
+ global $wp_version;
112
+
113
+ return version_compare($wp_version, $this->wp_version) >= 0;
114
+ }
115
+
116
+ /**
117
+ * Displays a notice if requirements are not met.
118
+ *
119
+ * @since 2.0
120
+ * @author Remy Perona
121
+ */
122
+ public function notice()
123
+ {
124
+ if (! current_user_can('manage_options')) {
125
+ return;
126
+ }
127
+
128
+ // Translators: %1$s = Plugin name, %2$s = Plugin version.
129
+ $message = '<p>' . sprintf(__('To function properly, %1$s %2$s requires at least:', 'rocket-lazy-load'), $this->plugin_name, $this->plugin_version) . '</p><ul>';
130
+
131
+ if (! $this->phpPasses()) {
132
+ // Translators: %1$s = PHP version required.
133
+ $message .= '<li>' . sprintf(__('PHP %1$s. To use this %2$s version, please ask your web host how to upgrade your server to PHP %1$s or higher.', 'rocket-lazy-load'), $this->php_version, $this->plugin_name) . '</li>';
134
+ }
135
+
136
+ if (! $this->wpPasses()) {
137
+ // Translators: %1$s = WordPress version required.
138
+ $message .= '<li>' . sprintf(__('WordPress %1$s. To use this %2$s version, please upgrade WordPress to version %1$s or higher.', 'rocket-lazy-load'), $this->wp_version, $this->plugin_name) . '</li>';
139
+ }
140
+
141
+ echo '<div class="notice notice-error">' . $message . '</div>';
142
+ }
143
+ }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit8cab473e8d87c25ebc69a5ad0b41d433::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInita1fa2cadbdc54957d6856ff382bb6726::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,196 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
10
+ 'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
11
+ 'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
12
+ 'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
13
+ 'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
14
+ 'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
15
+ 'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
16
+ 'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
17
+ 'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
18
+ 'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
19
+ 'Composer\\Installers\\CiviCrmInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
20
+ 'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
21
+ 'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
22
+ 'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
23
+ 'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
24
+ 'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
25
+ 'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
26
+ 'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
27
+ 'Composer\\Installers\\DframeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
28
+ 'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
29
+ 'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
30
+ 'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
31
+ 'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
32
+ 'Composer\\Installers\\EliasisInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
33
+ 'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
34
+ 'Composer\\Installers\\EzPlatformInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
35
+ 'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
36
+ 'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
37
+ 'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php',
38
+ 'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
39
+ 'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
40
+ 'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php',
41
+ 'Composer\\Installers\\ItopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
42
+ 'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
43
+ 'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
44
+ 'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
45
+ 'Composer\\Installers\\KnownInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
46
+ 'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
47
+ 'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
48
+ 'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
49
+ 'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
50
+ 'Composer\\Installers\\LavaLiteInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
51
+ 'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
52
+ 'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
53
+ 'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
54
+ 'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
55
+ 'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
56
+ 'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
57
+ 'Composer\\Installers\\MantisBTInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
58
+ 'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
59
+ 'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
60
+ 'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
61
+ 'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
62
+ 'Composer\\Installers\\ModxInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
63
+ 'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
64
+ 'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
65
+ 'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
66
+ 'Composer\\Installers\\OsclassInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
67
+ 'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
68
+ 'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
69
+ 'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
70
+ 'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
71
+ 'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
72
+ 'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
73
+ 'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
74
+ 'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php',
75
+ 'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
76
+ 'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
77
+ 'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
78
+ 'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
79
+ 'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
80
+ 'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
81
+ 'Composer\\Installers\\Redaxo5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
82
+ 'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
83
+ 'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
84
+ 'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
85
+ 'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
86
+ 'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
87
+ 'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
88
+ 'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
89
+ 'Composer\\Installers\\SyliusInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
90
+ 'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
91
+ 'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
92
+ 'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
93
+ 'Composer\\Installers\\TaoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
94
+ 'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
95
+ 'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
96
+ 'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
97
+ 'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
98
+ 'Composer\\Installers\\VgmcpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
99
+ 'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
100
+ 'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
101
+ 'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
102
+ 'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
103
+ 'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
104
+ 'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
105
+ 'Interop\\Container\\ContainerInterface' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
106
+ 'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
107
+ 'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
108
+ 'League\\Container\\Argument\\ArgumentResolverInterface' => $vendorDir . '/league/container/src/Argument/ArgumentResolverInterface.php',
109
+ 'League\\Container\\Argument\\ArgumentResolverTrait' => $vendorDir . '/league/container/src/Argument/ArgumentResolverTrait.php',
110
+ 'League\\Container\\Argument\\RawArgument' => $vendorDir . '/league/container/src/Argument/RawArgument.php',
111
+ 'League\\Container\\Argument\\RawArgumentInterface' => $vendorDir . '/league/container/src/Argument/RawArgumentInterface.php',
112
+ 'League\\Container\\Container' => $vendorDir . '/league/container/src/Container.php',
113
+ 'League\\Container\\ContainerAwareInterface' => $vendorDir . '/league/container/src/ContainerAwareInterface.php',
114
+ 'League\\Container\\ContainerAwareTrait' => $vendorDir . '/league/container/src/ContainerAwareTrait.php',
115
+ 'League\\Container\\ContainerInterface' => $vendorDir . '/league/container/src/ContainerInterface.php',
116
+ 'League\\Container\\Definition\\AbstractDefinition' => $vendorDir . '/league/container/src/Definition/AbstractDefinition.php',
117
+ 'League\\Container\\Definition\\CallableDefinition' => $vendorDir . '/league/container/src/Definition/CallableDefinition.php',
118
+ 'League\\Container\\Definition\\ClassDefinition' => $vendorDir . '/league/container/src/Definition/ClassDefinition.php',
119
+ 'League\\Container\\Definition\\ClassDefinitionInterface' => $vendorDir . '/league/container/src/Definition/ClassDefinitionInterface.php',
120
+ 'League\\Container\\Definition\\DefinitionFactory' => $vendorDir . '/league/container/src/Definition/DefinitionFactory.php',
121
+ 'League\\Container\\Definition\\DefinitionFactoryInterface' => $vendorDir . '/league/container/src/Definition/DefinitionFactoryInterface.php',
122
+ 'League\\Container\\Definition\\DefinitionInterface' => $vendorDir . '/league/container/src/Definition/DefinitionInterface.php',
123
+ 'League\\Container\\Exception\\NotFoundException' => $vendorDir . '/league/container/src/Exception/NotFoundException.php',
124
+ 'League\\Container\\ImmutableContainerAwareInterface' => $vendorDir . '/league/container/src/ImmutableContainerAwareInterface.php',
125
+ 'League\\Container\\ImmutableContainerAwareTrait' => $vendorDir . '/league/container/src/ImmutableContainerAwareTrait.php',
126
+ 'League\\Container\\ImmutableContainerInterface' => $vendorDir . '/league/container/src/ImmutableContainerInterface.php',
127
+ 'League\\Container\\Inflector\\Inflector' => $vendorDir . '/league/container/src/Inflector/Inflector.php',
128
+ 'League\\Container\\Inflector\\InflectorAggregate' => $vendorDir . '/league/container/src/Inflector/InflectorAggregate.php',
129
+ 'League\\Container\\Inflector\\InflectorAggregateInterface' => $vendorDir . '/league/container/src/Inflector/InflectorAggregateInterface.php',
130
+ 'League\\Container\\ReflectionContainer' => $vendorDir . '/league/container/src/ReflectionContainer.php',
131
+ 'League\\Container\\ServiceProvider\\AbstractServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractServiceProvider.php',
132
+ 'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => $vendorDir . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php',
133
+ 'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php',
134
+ 'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php',
135
+ 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php',
136
+ 'League\\Container\\ServiceProvider\\ServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/ServiceProviderInterface.php',
137
+ 'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => $vendorDir . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php',
138
+ 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
139
+ 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
140
+ 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
141
+ 'RocketLazyLoadPlugin\\Admin\\AdminPage' => $baseDir . '/src/Admin/AdminPage.php',
142
+ 'RocketLazyLoadPlugin\\Admin\\ImagifyNotice' => $baseDir . '/src/Admin/ImagifyNotice.php',
143
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/Interop/Container/ContainerInterface.php',
144
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\ContainerException' => $baseDir . '/src/Dependencies/Interop/Container/Exception/ContainerException.php',
145
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\NotFoundException' => $baseDir . '/src/Dependencies/Interop/Container/Exception/NotFoundException.php',
146
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' => $baseDir . '/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php',
147
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait' => $baseDir . '/src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php',
148
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgument' => $baseDir . '/src/Dependencies/League/Container/Argument/RawArgument.php',
149
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' => $baseDir . '/src/Dependencies/League/Container/Argument/RawArgumentInterface.php',
150
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Container' => $baseDir . '/src/Dependencies/League/Container/Container.php',
151
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareInterface' => $baseDir . '/src/Dependencies/League/Container/ContainerAwareInterface.php',
152
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareTrait' => $baseDir . '/src/Dependencies/League/Container/ContainerAwareTrait.php',
153
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/League/Container/ContainerInterface.php',
154
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\AbstractDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/AbstractDefinition.php',
155
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\CallableDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/CallableDefinition.php',
156
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinition' => $baseDir . '/src/Dependencies/League/Container/Definition/ClassDefinition.php',
157
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinitionInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php',
158
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactory' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionFactory.php',
159
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactoryInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php',
160
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionInterface' => $baseDir . '/src/Dependencies/League/Container/Definition/DefinitionInterface.php',
161
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Exception\\NotFoundException' => $baseDir . '/src/Dependencies/League/Container/Exception/NotFoundException.php',
162
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareInterface' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerAwareInterface.php',
163
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareTrait' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerAwareTrait.php',
164
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerInterface' => $baseDir . '/src/Dependencies/League/Container/ImmutableContainerInterface.php',
165
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\Inflector' => $baseDir . '/src/Dependencies/League/Container/Inflector/Inflector.php',
166
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregate' => $baseDir . '/src/Dependencies/League/Container/Inflector/InflectorAggregate.php',
167
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface' => $baseDir . '/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php',
168
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ReflectionContainer' => $baseDir . '/src/Dependencies/League/Container/ReflectionContainer.php',
169
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractServiceProvider' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php',
170
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php',
171
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php',
172
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregate' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php',
173
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php',
174
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php',
175
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => $baseDir . '/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php',
176
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerExceptionInterface' => $baseDir . '/src/Dependencies/Psr/Container/ContainerExceptionInterface.php',
177
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerInterface' => $baseDir . '/src/Dependencies/Psr/Container/ContainerInterface.php',
178
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface' => $baseDir . '/src/Dependencies/Psr/Container/NotFoundExceptionInterface.php',
179
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Assets' => $baseDir . '/src/Dependencies/RocketLazyload/Assets.php',
180
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Iframe' => $baseDir . '/src/Dependencies/RocketLazyload/Iframe.php',
181
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Image' => $baseDir . '/src/Dependencies/RocketLazyload/Image.php',
182
+ 'RocketLazyLoadPlugin\\EventManagement\\EventManager' => $baseDir . '/src/EventManagement/EventManager.php',
183
+ 'RocketLazyLoadPlugin\\EventManagement\\EventManagerAwareSubscriberInterface' => $baseDir . '/src/EventManagement/EventManagerAwareSubscriberInterface.php',
184
+ 'RocketLazyLoadPlugin\\EventManagement\\SubscriberInterface' => $baseDir . '/src/EventManagement/SubscriberInterface.php',
185
+ 'RocketLazyLoadPlugin\\Options\\AbstractOptions' => $baseDir . '/src/Options/AbstractOptions.php',
186
+ 'RocketLazyLoadPlugin\\Options\\OptionArray' => $baseDir . '/src/Options/OptionArray.php',
187
+ 'RocketLazyLoadPlugin\\Options\\Options' => $baseDir . '/src/Options/Options.php',
188
+ 'RocketLazyLoadPlugin\\Plugin' => $baseDir . '/src/Plugin.php',
189
+ 'RocketLazyLoadPlugin\\ServiceProvider\\AdminServiceProvider' => $baseDir . '/src/ServiceProvider/AdminServiceProvider.php',
190
+ 'RocketLazyLoadPlugin\\ServiceProvider\\ImagifyNoticeServiceProvider' => $baseDir . '/src/ServiceProvider/ImagifyNoticeServiceProvider.php',
191
+ 'RocketLazyLoadPlugin\\ServiceProvider\\LazyloadServiceProvider' => $baseDir . '/src/ServiceProvider/LazyloadServiceProvider.php',
192
+ 'RocketLazyLoadPlugin\\ServiceProvider\\OptionServiceProvider' => $baseDir . '/src/ServiceProvider/OptionServiceProvider.php',
193
+ 'RocketLazyLoadPlugin\\ServiceProvider\\SubscribersServiceProvider' => $baseDir . '/src/ServiceProvider/SubscribersServiceProvider.php',
194
+ 'RocketLazyLoadPlugin\\Subscriber\\AdminPageSubscriber' => $baseDir . '/src/Subscriber/AdminPageSubscriber.php',
195
+ 'RocketLazyLoadPlugin\\Subscriber\\ImagifyNoticeSubscriber' => $baseDir . '/src/Subscriber/ImagifyNoticeSubscriber.php',
196
+ 'RocketLazyLoadPlugin\\Subscriber\\LazyloadSubscriber' => $baseDir . '/src/Subscriber/LazyloadSubscriber.php',
197
+ 'RocketLazyLoadPlugin\\Subscriber\\ThirdParty\\AMPSubscriber' => $baseDir . '/src/Subscriber/ThirdParty/AMPSubscriber.php',
198
+ 'RocketLazyload\\Assets' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Assets.php',
199
+ 'RocketLazyload\\Iframe' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Iframe.php',
200
+ 'RocketLazyload\\Image' => $vendorDir . '/wp-media/rocket-lazyload-common/src/Image.php',
201
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit8cab473e8d87c25ebc69a5ad0b41d433
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit8cab473e8d87c25ebc69a5ad0b41d433
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit8cab473e8d87c25ebc69a5ad0b41d433', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit8cab473e8d87c25ebc69a5ad0b41d433', '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\ComposerStaticInit8cab473e8d87c25ebc69a5ad0b41d433::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInita1fa2cadbdc54957d6856ff382bb6726
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInita1fa2cadbdc54957d6856ff382bb6726', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInita1fa2cadbdc54957d6856ff382bb6726', '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\ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit8cab473e8d87c25ebc69a5ad0b41d433
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'R' =>
@@ -57,11 +57,207 @@ class ComposerStaticInit8cab473e8d87c25ebc69a5ad0b41d433
57
  ),
58
  );
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  public static function getInitializer(ClassLoader $loader)
61
  {
62
  return \Closure::bind(function () use ($loader) {
63
- $loader->prefixLengthsPsr4 = ComposerStaticInit8cab473e8d87c25ebc69a5ad0b41d433::$prefixLengthsPsr4;
64
- $loader->prefixDirsPsr4 = ComposerStaticInit8cab473e8d87c25ebc69a5ad0b41d433::$prefixDirsPsr4;
 
65
 
66
  }, null, ClassLoader::class);
67
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'R' =>
57
  ),
58
  );
59
 
60
+ public static $classMap = array (
61
+ 'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
62
+ 'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
63
+ 'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
64
+ 'Composer\\Installers\\AsgardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
65
+ 'Composer\\Installers\\AttogramInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
66
+ 'Composer\\Installers\\BaseInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
67
+ 'Composer\\Installers\\BitrixInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
68
+ 'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
69
+ 'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
70
+ 'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
71
+ 'Composer\\Installers\\CiviCrmInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
72
+ 'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
73
+ 'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
74
+ 'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
75
+ 'Composer\\Installers\\Concrete5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
76
+ 'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
77
+ 'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
78
+ 'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
79
+ 'Composer\\Installers\\DframeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
80
+ 'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
81
+ 'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
82
+ 'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
83
+ 'Composer\\Installers\\ElggInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
84
+ 'Composer\\Installers\\EliasisInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
85
+ 'Composer\\Installers\\ExpressionEngineInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
86
+ 'Composer\\Installers\\EzPlatformInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
87
+ 'Composer\\Installers\\FuelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
88
+ 'Composer\\Installers\\FuelphpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
89
+ 'Composer\\Installers\\GravInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/GravInstaller.php',
90
+ 'Composer\\Installers\\HuradInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
91
+ 'Composer\\Installers\\ImageCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
92
+ 'Composer\\Installers\\Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Installer.php',
93
+ 'Composer\\Installers\\ItopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
94
+ 'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
95
+ 'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
96
+ 'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
97
+ 'Composer\\Installers\\KnownInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
98
+ 'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
99
+ 'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
100
+ 'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
101
+ 'Composer\\Installers\\LaravelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
102
+ 'Composer\\Installers\\LavaLiteInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
103
+ 'Composer\\Installers\\LithiumInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
104
+ 'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
105
+ 'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
106
+ 'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
107
+ 'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
108
+ 'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
109
+ 'Composer\\Installers\\MantisBTInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MantisBTInstaller.php',
110
+ 'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
111
+ 'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
112
+ 'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
113
+ 'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
114
+ 'Composer\\Installers\\ModxInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
115
+ 'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
116
+ 'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
117
+ 'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
118
+ 'Composer\\Installers\\OsclassInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
119
+ 'Composer\\Installers\\OxidInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
120
+ 'Composer\\Installers\\PPIInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
121
+ 'Composer\\Installers\\PhiftyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
122
+ 'Composer\\Installers\\PhpBBInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
123
+ 'Composer\\Installers\\PimcoreInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
124
+ 'Composer\\Installers\\PiwikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
125
+ 'Composer\\Installers\\PlentymarketsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
126
+ 'Composer\\Installers\\Plugin' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Plugin.php',
127
+ 'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
128
+ 'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
129
+ 'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
130
+ 'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
131
+ 'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
132
+ 'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
133
+ 'Composer\\Installers\\Redaxo5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
134
+ 'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
135
+ 'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
136
+ 'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
137
+ 'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
138
+ 'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
139
+ 'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
140
+ 'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
141
+ 'Composer\\Installers\\SyliusInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyliusInstaller.php',
142
+ 'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
143
+ 'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
144
+ 'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
145
+ 'Composer\\Installers\\TaoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
146
+ 'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
147
+ 'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
148
+ 'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
149
+ 'Composer\\Installers\\VanillaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
150
+ 'Composer\\Installers\\VgmcpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
151
+ 'Composer\\Installers\\WHMCSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
152
+ 'Composer\\Installers\\WolfCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
153
+ 'Composer\\Installers\\WordPressInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
154
+ 'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
155
+ 'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
156
+ 'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
157
+ 'Interop\\Container\\ContainerInterface' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/ContainerInterface.php',
158
+ 'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
159
+ 'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
160
+ 'League\\Container\\Argument\\ArgumentResolverInterface' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverInterface.php',
161
+ 'League\\Container\\Argument\\ArgumentResolverTrait' => __DIR__ . '/..' . '/league/container/src/Argument/ArgumentResolverTrait.php',
162
+ 'League\\Container\\Argument\\RawArgument' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgument.php',
163
+ 'League\\Container\\Argument\\RawArgumentInterface' => __DIR__ . '/..' . '/league/container/src/Argument/RawArgumentInterface.php',
164
+ 'League\\Container\\Container' => __DIR__ . '/..' . '/league/container/src/Container.php',
165
+ 'League\\Container\\ContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ContainerAwareInterface.php',
166
+ 'League\\Container\\ContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ContainerAwareTrait.php',
167
+ 'League\\Container\\ContainerInterface' => __DIR__ . '/..' . '/league/container/src/ContainerInterface.php',
168
+ 'League\\Container\\Definition\\AbstractDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/AbstractDefinition.php',
169
+ 'League\\Container\\Definition\\CallableDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/CallableDefinition.php',
170
+ 'League\\Container\\Definition\\ClassDefinition' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinition.php',
171
+ 'League\\Container\\Definition\\ClassDefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/ClassDefinitionInterface.php',
172
+ 'League\\Container\\Definition\\DefinitionFactory' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactory.php',
173
+ 'League\\Container\\Definition\\DefinitionFactoryInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionFactoryInterface.php',
174
+ 'League\\Container\\Definition\\DefinitionInterface' => __DIR__ . '/..' . '/league/container/src/Definition/DefinitionInterface.php',
175
+ 'League\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/league/container/src/Exception/NotFoundException.php',
176
+ 'League\\Container\\ImmutableContainerAwareInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareInterface.php',
177
+ 'League\\Container\\ImmutableContainerAwareTrait' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerAwareTrait.php',
178
+ 'League\\Container\\ImmutableContainerInterface' => __DIR__ . '/..' . '/league/container/src/ImmutableContainerInterface.php',
179
+ 'League\\Container\\Inflector\\Inflector' => __DIR__ . '/..' . '/league/container/src/Inflector/Inflector.php',
180
+ 'League\\Container\\Inflector\\InflectorAggregate' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregate.php',
181
+ 'League\\Container\\Inflector\\InflectorAggregateInterface' => __DIR__ . '/..' . '/league/container/src/Inflector/InflectorAggregateInterface.php',
182
+ 'League\\Container\\ReflectionContainer' => __DIR__ . '/..' . '/league/container/src/ReflectionContainer.php',
183
+ 'League\\Container\\ServiceProvider\\AbstractServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractServiceProvider.php',
184
+ 'League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/AbstractSignatureServiceProvider.php',
185
+ 'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/BootableServiceProviderInterface.php',
186
+ 'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregate.php',
187
+ 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderAggregateInterface.php',
188
+ 'League\\Container\\ServiceProvider\\ServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/ServiceProviderInterface.php',
189
+ 'League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => __DIR__ . '/..' . '/league/container/src/ServiceProvider/SignatureServiceProviderInterface.php',
190
+ 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
191
+ 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
192
+ 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
193
+ 'RocketLazyLoadPlugin\\Admin\\AdminPage' => __DIR__ . '/../..' . '/src/Admin/AdminPage.php',
194
+ 'RocketLazyLoadPlugin\\Admin\\ImagifyNotice' => __DIR__ . '/../..' . '/src/Admin/ImagifyNotice.php',
195
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/ContainerInterface.php',
196
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/Exception/ContainerException.php',
197
+ 'RocketLazyLoadPlugin\\Dependencies\\Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/../..' . '/src/Dependencies/Interop/Container/Exception/NotFoundException.php',
198
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/ArgumentResolverInterface.php',
199
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/ArgumentResolverTrait.php',
200
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgument' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/RawArgument.php',
201
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Argument/RawArgumentInterface.php',
202
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Container' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Container.php',
203
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerAwareInterface.php',
204
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerAwareTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerAwareTrait.php',
205
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ContainerInterface.php',
206
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\AbstractDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/AbstractDefinition.php',
207
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\CallableDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/CallableDefinition.php',
208
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinition' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/ClassDefinition.php',
209
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\ClassDefinitionInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/ClassDefinitionInterface.php',
210
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactory' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionFactory.php',
211
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionFactoryInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionFactoryInterface.php',
212
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Definition\\DefinitionInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Definition/DefinitionInterface.php',
213
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Exception\\NotFoundException' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Exception/NotFoundException.php',
214
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerAwareInterface.php',
215
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerAwareTrait' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerAwareTrait.php',
216
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ImmutableContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ImmutableContainerInterface.php',
217
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\Inflector' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/Inflector.php',
218
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregate' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/InflectorAggregate.php',
219
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/Inflector/InflectorAggregateInterface.php',
220
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ReflectionContainer' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ReflectionContainer.php',
221
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractServiceProvider' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php',
222
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\AbstractSignatureServiceProvider' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/AbstractSignatureServiceProvider.php',
223
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/BootableServiceProviderInterface.php',
224
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregate' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php',
225
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php',
226
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/ServiceProviderInterface.php',
227
+ 'RocketLazyLoadPlugin\\Dependencies\\League\\Container\\ServiceProvider\\SignatureServiceProviderInterface' => __DIR__ . '/../..' . '/src/Dependencies/League/Container/ServiceProvider/SignatureServiceProviderInterface.php',
228
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/ContainerExceptionInterface.php',
229
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\ContainerInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/ContainerInterface.php',
230
+ 'RocketLazyLoadPlugin\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/../..' . '/src/Dependencies/Psr/Container/NotFoundExceptionInterface.php',
231
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Assets' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Assets.php',
232
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Iframe' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Iframe.php',
233
+ 'RocketLazyLoadPlugin\\Dependencies\\RocketLazyload\\Image' => __DIR__ . '/../..' . '/src/Dependencies/RocketLazyload/Image.php',
234
+ 'RocketLazyLoadPlugin\\EventManagement\\EventManager' => __DIR__ . '/../..' . '/src/EventManagement/EventManager.php',
235
+ 'RocketLazyLoadPlugin\\EventManagement\\EventManagerAwareSubscriberInterface' => __DIR__ . '/../..' . '/src/EventManagement/EventManagerAwareSubscriberInterface.php',
236
+ 'RocketLazyLoadPlugin\\EventManagement\\SubscriberInterface' => __DIR__ . '/../..' . '/src/EventManagement/SubscriberInterface.php',
237
+ 'RocketLazyLoadPlugin\\Options\\AbstractOptions' => __DIR__ . '/../..' . '/src/Options/AbstractOptions.php',
238
+ 'RocketLazyLoadPlugin\\Options\\OptionArray' => __DIR__ . '/../..' . '/src/Options/OptionArray.php',
239
+ 'RocketLazyLoadPlugin\\Options\\Options' => __DIR__ . '/../..' . '/src/Options/Options.php',
240
+ 'RocketLazyLoadPlugin\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php',
241
+ 'RocketLazyLoadPlugin\\ServiceProvider\\AdminServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/AdminServiceProvider.php',
242
+ 'RocketLazyLoadPlugin\\ServiceProvider\\ImagifyNoticeServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/ImagifyNoticeServiceProvider.php',
243
+ 'RocketLazyLoadPlugin\\ServiceProvider\\LazyloadServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/LazyloadServiceProvider.php',
244
+ 'RocketLazyLoadPlugin\\ServiceProvider\\OptionServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/OptionServiceProvider.php',
245
+ 'RocketLazyLoadPlugin\\ServiceProvider\\SubscribersServiceProvider' => __DIR__ . '/../..' . '/src/ServiceProvider/SubscribersServiceProvider.php',
246
+ 'RocketLazyLoadPlugin\\Subscriber\\AdminPageSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/AdminPageSubscriber.php',
247
+ 'RocketLazyLoadPlugin\\Subscriber\\ImagifyNoticeSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/ImagifyNoticeSubscriber.php',
248
+ 'RocketLazyLoadPlugin\\Subscriber\\LazyloadSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/LazyloadSubscriber.php',
249
+ 'RocketLazyLoadPlugin\\Subscriber\\ThirdParty\\AMPSubscriber' => __DIR__ . '/../..' . '/src/Subscriber/ThirdParty/AMPSubscriber.php',
250
+ 'RocketLazyload\\Assets' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Assets.php',
251
+ 'RocketLazyload\\Iframe' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Iframe.php',
252
+ 'RocketLazyload\\Image' => __DIR__ . '/..' . '/wp-media/rocket-lazyload-common/src/Image.php',
253
+ );
254
+
255
  public static function getInitializer(ClassLoader $loader)
256
  {
257
  return \Closure::bind(function () use ($loader) {
258
+ $loader->prefixLengthsPsr4 = ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726::$prefixLengthsPsr4;
259
+ $loader->prefixDirsPsr4 = ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726::$prefixDirsPsr4;
260
+ $loader->classMap = ComposerStaticInita1fa2cadbdc54957d6856ff382bb6726::$classMap;
261
 
262
  }, null, ClassLoader::class);
263
  }
vendor/composer/installed.json CHANGED
@@ -1,31 +1,34 @@
1
  [
2
  {
3
  "name": "composer/installers",
4
- "version": "v1.7.0",
5
- "version_normalized": "1.7.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/composer/installers.git",
9
- "reference": "141b272484481432cda342727a427dc1e206bfa0"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
14
- "reference": "141b272484481432cda342727a427dc1e206bfa0",
15
  "shasum": ""
16
  },
17
  "require": {
18
- "composer-plugin-api": "^1.0"
19
  },
20
  "replace": {
21
  "roundcube/plugin-installer": "*",
22
  "shama/baton": "*"
23
  },
24
  "require-dev": {
25
- "composer/composer": "1.0.*@dev",
26
- "phpunit/phpunit": "^4.8.36"
 
 
 
27
  },
28
- "time": "2019-08-12T15:00:31+00:00",
29
  "type": "composer-plugin",
30
  "extra": {
31
  "class": "Composer\\Installers\\Plugin",
@@ -61,6 +64,7 @@
61
  "Kanboard",
62
  "Lan Management System",
63
  "MODX Evo",
 
64
  "Mautic",
65
  "Maya",
66
  "OXID",
@@ -115,6 +119,7 @@
115
  "shopware",
116
  "silverstripe",
117
  "sydes",
 
118
  "symfony",
119
  "typo3",
120
  "wordpress",
@@ -154,7 +159,8 @@
154
  "MIT"
155
  ],
156
  "description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
157
- "homepage": "https://github.com/container-interop/container-interop"
 
158
  },
159
  {
160
  "name": "league/container",
@@ -276,17 +282,17 @@
276
  },
277
  {
278
  "name": "wp-media/rocket-lazyload-common",
279
- "version": "v2.5.1",
280
- "version_normalized": "2.5.1.0",
281
  "source": {
282
  "type": "git",
283
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
284
- "reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e"
285
  },
286
  "dist": {
287
  "type": "zip",
288
- "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
289
- "reference": "a5f1b59f822fd31bc7cb0fc368edecba96ceb71e",
290
  "shasum": ""
291
  },
292
  "require": {
@@ -304,7 +310,7 @@
304
  "symfony/yaml": "2.8.*",
305
  "wp-coding-standards/wpcs": "^2.0.0"
306
  },
307
- "time": "2019-09-06T13:51:56+00:00",
308
  "type": "library",
309
  "installation-source": "dist",
310
  "autoload": {
1
  [
2
  {
3
  "name": "composer/installers",
4
+ "version": "v1.9.0",
5
+ "version_normalized": "1.9.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/composer/installers.git",
9
+ "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
14
+ "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
15
  "shasum": ""
16
  },
17
  "require": {
18
+ "composer-plugin-api": "^1.0 || ^2.0"
19
  },
20
  "replace": {
21
  "roundcube/plugin-installer": "*",
22
  "shama/baton": "*"
23
  },
24
  "require-dev": {
25
+ "composer/composer": "1.6.* || 2.0.*@dev",
26
+ "composer/semver": "1.0.* || 2.0.*@dev",
27
+ "phpunit/phpunit": "^4.8.36",
28
+ "sebastian/comparator": "^1.2.4",
29
+ "symfony/process": "^2.3"
30
  },
31
+ "time": "2020-04-07T06:57:05+00:00",
32
  "type": "composer-plugin",
33
  "extra": {
34
  "class": "Composer\\Installers\\Plugin",
64
  "Kanboard",
65
  "Lan Management System",
66
  "MODX Evo",
67
+ "MantisBT",
68
  "Mautic",
69
  "Maya",
70
  "OXID",
119
  "shopware",
120
  "silverstripe",
121
  "sydes",
122
+ "sylius",
123
  "symfony",
124
  "typo3",
125
  "wordpress",
159
  "MIT"
160
  ],
161
  "description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
162
+ "homepage": "https://github.com/container-interop/container-interop",
163
+ "abandoned": "psr/container"
164
  },
165
  {
166
  "name": "league/container",
282
  },
283
  {
284
  "name": "wp-media/rocket-lazyload-common",
285
+ "version": "v2.5.8",
286
+ "version_normalized": "2.5.8.0",
287
  "source": {
288
  "type": "git",
289
  "url": "https://github.com/wp-media/rocket-lazyload-common.git",
290
+ "reference": "7c8d2c718b3ac177c171164133502fbf0928f220"
291
  },
292
  "dist": {
293
  "type": "zip",
294
+ "url": "https://api.github.com/repos/wp-media/rocket-lazyload-common/zipball/7c8d2c718b3ac177c171164133502fbf0928f220",
295
+ "reference": "7c8d2c718b3ac177c171164133502fbf0928f220",
296
  "shasum": ""
297
  },
298
  "require": {
310
  "symfony/yaml": "2.8.*",
311
  "wp-coding-standards/wpcs": "^2.0.0"
312
  },
313
+ "time": "2020-05-13T15:14:47+00:00",
314
  "type": "library",
315
  "installation-source": "dist",
316
  "autoload": {
vendor/composer/installers/composer.json CHANGED
@@ -31,7 +31,7 @@
31
  "iTop",
32
  "Joomla",
33
  "Kanboard",
34
- "Known",
35
  "Kohana",
36
  "Lan Management System",
37
  "Laravel",
@@ -40,6 +40,7 @@
40
  "Magento",
41
  "majima",
42
  "Mako",
 
43
  "Mautic",
44
  "Maya",
45
  "MODX",
@@ -63,6 +64,7 @@
63
  "SilverStripe",
64
  "SMF",
65
  "SyDES",
 
66
  "symfony",
67
  "Thelia",
68
  "TYPO3",
@@ -95,11 +97,14 @@
95
  "roundcube/plugin-installer": "*"
96
  },
97
  "require": {
98
- "composer-plugin-api": "^1.0"
99
  },
100
  "require-dev": {
101
- "composer/composer": "1.0.*@dev",
102
- "phpunit/phpunit": "^4.8.36"
 
 
 
103
  },
104
  "scripts": {
105
  "test": "phpunit"
31
  "iTop",
32
  "Joomla",
33
  "Kanboard",
34
+ "Known",
35
  "Kohana",
36
  "Lan Management System",
37
  "Laravel",
40
  "Magento",
41
  "majima",
42
  "Mako",
43
+ "MantisBT",
44
  "Mautic",
45
  "Maya",
46
  "MODX",
64
  "SilverStripe",
65
  "SMF",
66
  "SyDES",
67
+ "Sylius",
68
  "symfony",
69
  "Thelia",
70
  "TYPO3",
97
  "roundcube/plugin-installer": "*"
98
  },
99
  "require": {
100
+ "composer-plugin-api": "^1.0 || ^2.0"
101
  },
102
  "require-dev": {
103
+ "composer/composer": "1.6.* || 2.0.*@dev",
104
+ "composer/semver": "1.0.* || 2.0.*@dev",
105
+ "phpunit/phpunit": "^4.8.36",
106
+ "sebastian/comparator": "^1.2.4",
107
+ "symfony/process": "^2.3"
108
  },
109
  "scripts": {
110
  "test": "phpunit"
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php CHANGED
@@ -126,6 +126,7 @@ abstract class BaseInstaller
126
  protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
  {
128
  foreach ($paths as $path => $names) {
 
129
  if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
130
  return $path;
131
  }
126
  protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
  {
128
  foreach ($paths as $path => $names) {
129
+ $names = (array) $names;
130
  if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
131
  return $path;
132
  }
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php CHANGED
@@ -58,25 +58,15 @@ class CakePHPInstaller extends BaseInstaller
58
  }
59
 
60
  $repositoryManager = $this->composer->getRepositoryManager();
61
- if ($repositoryManager) {
62
- $repos = $repositoryManager->getLocalRepository();
63
- if (!$repos) {
64
- return false;
65
- }
66
- $cake3 = new $multiClass(array(
67
- new $constraintClass($matcher, $version),
68
- new $constraintClass('!=', '9999999-dev'),
69
- ));
70
- $pool = new Pool('dev');
71
- $pool->addRepository($repos);
72
- $packages = $pool->whatProvides('cakephp/cakephp');
73
- foreach ($packages as $package) {
74
- $installed = new $constraintClass('=', $package->getVersion());
75
- if ($cake3->matches($installed)) {
76
- return true;
77
- }
78
- }
79
  }
80
- return false;
 
 
 
 
 
 
81
  }
82
  }
58
  }
59
 
60
  $repositoryManager = $this->composer->getRepositoryManager();
61
+ if (! $repositoryManager) {
62
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
+
65
+ $repos = $repositoryManager->getLocalRepository();
66
+ if (!$repos) {
67
+ return false;
68
+ }
69
+
70
+ return $repos->findPackage('cakephp/cakephp', new $constraintClass($matcher, $version)) !== null;
71
  }
72
  }
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php CHANGED
@@ -9,12 +9,14 @@ class DrupalInstaller extends BaseInstaller
9
  'theme' => 'themes/{$name}/',
10
  'library' => 'libraries/{$name}/',
11
  'profile' => 'profiles/{$name}/',
 
12
  'drush' => 'drush/{$name}/',
13
  'custom-theme' => 'themes/custom/{$name}/',
14
  'custom-module' => 'modules/custom/{$name}/',
15
  'custom-profile' => 'profiles/custom/{$name}/',
16
  'drupal-multisite' => 'sites/{$name}/',
17
- 'console' => 'console/{$name}/',
18
  'console-language' => 'console/language/{$name}/',
 
19
  );
20
  }
9
  'theme' => 'themes/{$name}/',
10
  'library' => 'libraries/{$name}/',
11
  'profile' => 'profiles/{$name}/',
12
+ 'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
13
  'drush' => 'drush/{$name}/',
14
  'custom-theme' => 'themes/custom/{$name}/',
15
  'custom-module' => 'modules/custom/{$name}/',
16
  'custom-profile' => 'profiles/custom/{$name}/',
17
  'drupal-multisite' => 'sites/{$name}/',
18
+ 'console' => 'console/{$name}/',
19
  'console-language' => 'console/language/{$name}/',
20
+ 'config' => 'config/sync/',
21
  );
22
  }
vendor/composer/installers/src/Composer/Installers/Installer.php CHANGED
@@ -63,6 +63,7 @@ class Installer extends LibraryInstaller
63
  'lithium' => 'LithiumInstaller',
64
  'magento' => 'MagentoInstaller',
65
  'majima' => 'MajimaInstaller',
 
66
  'mako' => 'MakoInstaller',
67
  'maya' => 'MayaInstaller',
68
  'mautic' => 'MauticInstaller',
@@ -95,6 +96,7 @@ class Installer extends LibraryInstaller
95
  'silverstripe' => 'SilverStripeInstaller',
96
  'smf' => 'SMFInstaller',
97
  'sydes' => 'SyDESInstaller',
 
98
  'symfony1' => 'Symfony1Installer',
99
  'tao' => 'TaoInstaller',
100
  'thelia' => 'TheliaInstaller',
63
  'lithium' => 'LithiumInstaller',
64
  'magento' => 'MagentoInstaller',
65
  'majima' => 'MajimaInstaller',
66
+ 'mantisbt' => 'MantisBTInstaller',
67
  'mako' => 'MakoInstaller',
68
  'maya' => 'MayaInstaller',
69
  'mautic' => 'MauticInstaller',
96
  'silverstripe' => 'SilverStripeInstaller',
97
  'smf' => 'SMFInstaller',
98
  'sydes' => 'SyDESInstaller',
99
+ 'sylius' => 'SyliusInstaller',
100
  'symfony1' => 'Symfony1Installer',
101
  'tao' => 'TaoInstaller',
102
  'thelia' => 'TheliaInstaller',
vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+
6
+ class MantisBTInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'plugin' => 'plugins/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to CamelCase
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
18
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
19
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
20
+
21
+ return $vars;
22
+ }
23
+ }
vendor/composer/installers/src/Composer/Installers/Plugin.php CHANGED
@@ -8,10 +8,20 @@ use Composer\Plugin\PluginInterface;
8
 
9
  class Plugin implements PluginInterface
10
  {
 
11
 
12
  public function activate(Composer $composer, IOInterface $io)
13
  {
14
- $installer = new Installer($io, $composer);
15
- $composer->getInstallationManager()->addInstaller($installer);
 
 
 
 
 
 
 
 
 
16
  }
17
  }
8
 
9
  class Plugin implements PluginInterface
10
  {
11
+ private $installer;
12
 
13
  public function activate(Composer $composer, IOInterface $io)
14
  {
15
+ $this->installer = new Installer($io, $composer);
16
+ $composer->getInstallationManager()->addInstaller($this->installer);
17
+ }
18
+
19
+ public function deactivate(Composer $composer, IOInterface $io)
20
+ {
21
+ $composer->getInstallationManager()->removeInstaller($this->installer);
22
+ }
23
+
24
+ public function uninstall(Composer $composer, IOInterface $io)
25
+ {
26
  }
27
  }
vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class SyliusInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'themes/{$name}/',
8
+ );
9
+ }
vendor/wp-media/rocket-lazyload-common/composer.lock CHANGED
@@ -1,7 +1,7 @@
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#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
  "content-hash": "50d22d9d649b94602548d48acb4ef4ae",
@@ -9,21 +9,24 @@
9
  "packages-dev": [
10
  {
11
  "name": "antecedent/patchwork",
12
- "version": "2.1.8",
13
  "source": {
14
  "type": "git",
15
  "url": "https://github.com/antecedent/patchwork.git",
16
- "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7"
17
  },
18
  "dist": {
19
  "type": "zip",
20
- "url": "https://api.github.com/repos/antecedent/patchwork/zipball/3bb81ace3914c220aa273d1c0603d5e1b454c0d7",
21
- "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7",
22
  "shasum": ""
23
  },
24
  "require": {
25
  "php": ">=5.4.0"
26
  },
 
 
 
27
  "type": "library",
28
  "notification-url": "https://packagist.org/downloads/",
29
  "license": [
@@ -46,20 +49,20 @@
46
  "runkit",
47
  "testing"
48
  ],
49
- "time": "2018-02-19T18:52:50+00:00"
50
  },
51
  {
52
  "name": "brain/monkey",
53
- "version": "2.3.1",
54
  "source": {
55
  "type": "git",
56
  "url": "https://github.com/Brain-WP/BrainMonkey.git",
57
- "reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776"
58
  },
59
  "dist": {
60
  "type": "zip",
61
- "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
62
- "reference": "74cdccad5dbb7edc59f59e1ad6ef392f83a34776",
63
  "shasum": ""
64
  },
65
  "require": {
@@ -68,7 +71,9 @@
68
  "php": ">=5.6.0"
69
  },
70
  "require-dev": {
71
- "phpunit/phpunit": "~5.7.9"
 
 
72
  },
73
  "type": "library",
74
  "extra": {
@@ -92,9 +97,9 @@
92
  "authors": [
93
  {
94
  "name": "Giuseppe Mazzapica",
95
- "role": "Developer",
96
  "email": "giuseppe.mazzapica@gmail.com",
97
- "homepage": "https://gmazzap.me"
 
98
  }
99
  ],
100
  "description": "Mocking utility for PHP functions and WordPress plugin API",
@@ -110,7 +115,7 @@
110
  "test",
111
  "testing"
112
  ],
113
- "time": "2019-07-26T19:00:28+00:00"
114
  },
115
  {
116
  "name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -282,16 +287,16 @@
282
  },
283
  {
284
  "name": "mockery/mockery",
285
- "version": "1.2.3",
286
  "source": {
287
  "type": "git",
288
  "url": "https://github.com/mockery/mockery.git",
289
- "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031"
290
  },
291
  "dist": {
292
  "type": "zip",
293
- "url": "https://api.github.com/repos/mockery/mockery/zipball/4eff936d83eb809bde2c57a3cea0ee9643769031",
294
- "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031",
295
  "shasum": ""
296
  },
297
  "require": {
@@ -305,7 +310,7 @@
305
  "type": "library",
306
  "extra": {
307
  "branch-alias": {
308
- "dev-master": "1.0.x-dev"
309
  }
310
  },
311
  "autoload": {
@@ -343,7 +348,7 @@
343
  "test double",
344
  "testing"
345
  ],
346
- "time": "2019-08-07T15:01:07+00:00"
347
  },
348
  {
349
  "name": "myclabs/deep-copy",
@@ -389,16 +394,16 @@
389
  },
390
  {
391
  "name": "phpcompatibility/php-compatibility",
392
- "version": "9.3.0",
393
  "source": {
394
  "type": "git",
395
  "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
396
- "reference": "06cc8d2c2ed62a70f52963dbdf5eaa1ec0fe34c5"
397
  },
398
  "dist": {
399
  "type": "zip",
400
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/06cc8d2c2ed62a70f52963dbdf5eaa1ec0fe34c5",
401
- "reference": "06cc8d2c2ed62a70f52963dbdf5eaa1ec0fe34c5",
402
  "shasum": ""
403
  },
404
  "require": {
@@ -443,20 +448,20 @@
443
  "phpcs",
444
  "standards"
445
  ],
446
- "time": "2019-08-28T15:29:06+00:00"
447
  },
448
  {
449
  "name": "phpcompatibility/phpcompatibility-paragonie",
450
- "version": "1.1.0",
451
  "source": {
452
  "type": "git",
453
  "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
454
- "reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936"
455
  },
456
  "dist": {
457
  "type": "zip",
458
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
459
- "reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936",
460
  "shasum": ""
461
  },
462
  "require": {
@@ -495,7 +500,7 @@
495
  "polyfill",
496
  "standards"
497
  ],
498
- "time": "2019-08-28T15:58:19+00:00"
499
  },
500
  {
501
  "name": "phpcompatibility/phpcompatibility-wp",
@@ -695,33 +700,33 @@
695
  },
696
  {
697
  "name": "phpspec/prophecy",
698
- "version": "1.8.1",
699
  "source": {
700
  "type": "git",
701
  "url": "https://github.com/phpspec/prophecy.git",
702
- "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
703
  },
704
  "dist": {
705
  "type": "zip",
706
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
707
- "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
708
  "shasum": ""
709
  },
710
  "require": {
711
  "doctrine/instantiator": "^1.0.2",
712
  "php": "^5.3|^7.0",
713
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
714
- "sebastian/comparator": "^1.1|^2.0|^3.0",
715
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
716
  },
717
  "require-dev": {
718
- "phpspec/phpspec": "^2.5|^3.2",
719
  "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
720
  },
721
  "type": "library",
722
  "extra": {
723
  "branch-alias": {
724
- "dev-master": "1.8.x-dev"
725
  }
726
  },
727
  "autoload": {
@@ -754,7 +759,7 @@
754
  "spy",
755
  "stub"
756
  ],
757
- "time": "2019-06-13T12:50:23+00:00"
758
  },
759
  {
760
  "name": "phpunit/php-code-coverage",
@@ -1144,6 +1149,7 @@
1144
  "mock",
1145
  "xunit"
1146
  ],
 
1147
  "time": "2017-06-30T09:13:00+00:00"
1148
  },
1149
  {
@@ -1661,16 +1667,16 @@
1661
  },
1662
  {
1663
  "name": "squizlabs/php_codesniffer",
1664
- "version": "3.4.2",
1665
  "source": {
1666
  "type": "git",
1667
  "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1668
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
1669
  },
1670
  "dist": {
1671
  "type": "zip",
1672
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
1673
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
1674
  "shasum": ""
1675
  },
1676
  "require": {
@@ -1708,20 +1714,20 @@
1708
  "phpcs",
1709
  "standards"
1710
  ],
1711
- "time": "2019-04-10T23:49:02+00:00"
1712
  },
1713
  {
1714
  "name": "symfony/polyfill-ctype",
1715
- "version": "v1.12.0",
1716
  "source": {
1717
  "type": "git",
1718
  "url": "https://github.com/symfony/polyfill-ctype.git",
1719
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4"
1720
  },
1721
  "dist": {
1722
  "type": "zip",
1723
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
1724
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4",
1725
  "shasum": ""
1726
  },
1727
  "require": {
@@ -1733,7 +1739,7 @@
1733
  "type": "library",
1734
  "extra": {
1735
  "branch-alias": {
1736
- "dev-master": "1.12-dev"
1737
  }
1738
  },
1739
  "autoload": {
@@ -1766,11 +1772,11 @@
1766
  "polyfill",
1767
  "portable"
1768
  ],
1769
- "time": "2019-08-06T08:03:45+00:00"
1770
  },
1771
  {
1772
  "name": "symfony/yaml",
1773
- "version": "v2.8.50",
1774
  "source": {
1775
  "type": "git",
1776
  "url": "https://github.com/symfony/yaml.git",
@@ -1820,31 +1826,29 @@
1820
  },
1821
  {
1822
  "name": "webmozart/assert",
1823
- "version": "1.5.0",
1824
  "source": {
1825
  "type": "git",
1826
  "url": "https://github.com/webmozart/assert.git",
1827
- "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
1828
  },
1829
  "dist": {
1830
  "type": "zip",
1831
- "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
1832
- "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
1833
  "shasum": ""
1834
  },
1835
  "require": {
1836
  "php": "^5.3.3 || ^7.0",
1837
  "symfony/polyfill-ctype": "^1.8"
1838
  },
 
 
 
1839
  "require-dev": {
1840
  "phpunit/phpunit": "^4.8.36 || ^7.5.13"
1841
  },
1842
  "type": "library",
1843
- "extra": {
1844
- "branch-alias": {
1845
- "dev-master": "1.3-dev"
1846
- }
1847
- },
1848
  "autoload": {
1849
  "psr-4": {
1850
  "Webmozart\\Assert\\": "src/"
@@ -1866,20 +1870,20 @@
1866
  "check",
1867
  "validate"
1868
  ],
1869
- "time": "2019-08-24T08:43:50+00:00"
1870
  },
1871
  {
1872
  "name": "wp-coding-standards/wpcs",
1873
- "version": "2.1.1",
1874
  "source": {
1875
  "type": "git",
1876
  "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
1877
- "reference": "bd9c33152115e6741e3510ff7189605b35167908"
1878
  },
1879
  "dist": {
1880
  "type": "zip",
1881
- "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908",
1882
- "reference": "bd9c33152115e6741e3510ff7189605b35167908",
1883
  "shasum": ""
1884
  },
1885
  "require": {
@@ -1887,12 +1891,12 @@
1887
  "squizlabs/php_codesniffer": "^3.3.1"
1888
  },
1889
  "require-dev": {
1890
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
1891
  "phpcompatibility/php-compatibility": "^9.0",
1892
  "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
1893
  },
1894
  "suggest": {
1895
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
1896
  },
1897
  "type": "phpcodesniffer-standard",
1898
  "notification-url": "https://packagist.org/downloads/",
@@ -1902,7 +1906,7 @@
1902
  "authors": [
1903
  {
1904
  "name": "Contributors",
1905
- "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
1906
  }
1907
  ],
1908
  "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
@@ -1911,7 +1915,7 @@
1911
  "standards",
1912
  "wordpress"
1913
  ],
1914
- "time": "2019-05-21T02:50:00+00:00"
1915
  }
1916
  ],
1917
  "aliases": [],
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": "50d22d9d649b94602548d48acb4ef4ae",
9
  "packages-dev": [
10
  {
11
  "name": "antecedent/patchwork",
12
+ "version": "2.1.12",
13
  "source": {
14
  "type": "git",
15
  "url": "https://github.com/antecedent/patchwork.git",
16
+ "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea"
17
  },
18
  "dist": {
19
  "type": "zip",
20
+ "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b98e046dd4c0acc34a0846604f06f6111654d9ea",
21
+ "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea",
22
  "shasum": ""
23
  },
24
  "require": {
25
  "php": ">=5.4.0"
26
  },
27
+ "require-dev": {
28
+ "phpunit/phpunit": ">=4"
29
+ },
30
  "type": "library",
31
  "notification-url": "https://packagist.org/downloads/",
32
  "license": [
49
  "runkit",
50
  "testing"
51
  ],
52
+ "time": "2019-12-22T17:52:09+00:00"
53
  },
54
  {
55
  "name": "brain/monkey",
56
+ "version": "2.4.0",
57
  "source": {
58
  "type": "git",
59
  "url": "https://github.com/Brain-WP/BrainMonkey.git",
60
+ "reference": "b3ce8b619c26db6abd01b9dcfd6a2c0254060956"
61
  },
62
  "dist": {
63
  "type": "zip",
64
+ "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/b3ce8b619c26db6abd01b9dcfd6a2c0254060956",
65
+ "reference": "b3ce8b619c26db6abd01b9dcfd6a2c0254060956",
66
  "shasum": ""
67
  },
68
  "require": {
71
  "php": ">=5.6.0"
72
  },
73
  "require-dev": {
74
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4",
75
+ "phpcompatibility/php-compatibility": "^9.3.0",
76
+ "phpunit/phpunit": "^5.7.9 || ^6.0 || ^7.0"
77
  },
78
  "type": "library",
79
  "extra": {
97
  "authors": [
98
  {
99
  "name": "Giuseppe Mazzapica",
 
100
  "email": "giuseppe.mazzapica@gmail.com",
101
+ "homepage": "https://gmazzap.me",
102
+ "role": "Developer"
103
  }
104
  ],
105
  "description": "Mocking utility for PHP functions and WordPress plugin API",
115
  "test",
116
  "testing"
117
  ],
118
+ "time": "2019-11-24T16:03:21+00:00"
119
  },
120
  {
121
  "name": "dealerdirect/phpcodesniffer-composer-installer",
287
  },
288
  {
289
  "name": "mockery/mockery",
290
+ "version": "1.3.1",
291
  "source": {
292
  "type": "git",
293
  "url": "https://github.com/mockery/mockery.git",
294
+ "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be"
295
  },
296
  "dist": {
297
  "type": "zip",
298
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be",
299
+ "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be",
300
  "shasum": ""
301
  },
302
  "require": {
310
  "type": "library",
311
  "extra": {
312
  "branch-alias": {
313
+ "dev-master": "1.3.x-dev"
314
  }
315
  },
316
  "autoload": {
348
  "test double",
349
  "testing"
350
  ],
351
+ "time": "2019-12-26T09:49:15+00:00"
352
  },
353
  {
354
  "name": "myclabs/deep-copy",
394
  },
395
  {
396
  "name": "phpcompatibility/php-compatibility",
397
+ "version": "9.3.5",
398
  "source": {
399
  "type": "git",
400
  "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
401
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
402
  },
403
  "dist": {
404
  "type": "zip",
405
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
406
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
407
  "shasum": ""
408
  },
409
  "require": {
448
  "phpcs",
449
  "standards"
450
  ],
451
+ "time": "2019-12-27T09:44:58+00:00"
452
  },
453
  {
454
  "name": "phpcompatibility/phpcompatibility-paragonie",
455
+ "version": "1.3.0",
456
  "source": {
457
  "type": "git",
458
  "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
459
+ "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c"
460
  },
461
  "dist": {
462
  "type": "zip",
463
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c",
464
+ "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c",
465
  "shasum": ""
466
  },
467
  "require": {
500
  "polyfill",
501
  "standards"
502
  ],
503
+ "time": "2019-11-04T15:17:54+00:00"
504
  },
505
  {
506
  "name": "phpcompatibility/phpcompatibility-wp",
700
  },
701
  {
702
  "name": "phpspec/prophecy",
703
+ "version": "v1.10.3",
704
  "source": {
705
  "type": "git",
706
  "url": "https://github.com/phpspec/prophecy.git",
707
+ "reference": "451c3cd1418cf640de218914901e51b064abb093"
708
  },
709
  "dist": {
710
  "type": "zip",
711
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
712
+ "reference": "451c3cd1418cf640de218914901e51b064abb093",
713
  "shasum": ""
714
  },
715
  "require": {
716
  "doctrine/instantiator": "^1.0.2",
717
  "php": "^5.3|^7.0",
718
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
719
+ "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
720
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
721
  },
722
  "require-dev": {
723
+ "phpspec/phpspec": "^2.5 || ^3.2",
724
  "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
725
  },
726
  "type": "library",
727
  "extra": {
728
  "branch-alias": {
729
+ "dev-master": "1.10.x-dev"
730
  }
731
  },
732
  "autoload": {
759
  "spy",
760
  "stub"
761
  ],
762
+ "time": "2020-03-05T15:02:03+00:00"
763
  },
764
  {
765
  "name": "phpunit/php-code-coverage",
1149
  "mock",
1150
  "xunit"
1151
  ],
1152
+ "abandoned": true,
1153
  "time": "2017-06-30T09:13:00+00:00"
1154
  },
1155
  {
1667
  },
1668
  {
1669
  "name": "squizlabs/php_codesniffer",
1670
+ "version": "3.5.5",
1671
  "source": {
1672
  "type": "git",
1673
  "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1674
+ "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6"
1675
  },
1676
  "dist": {
1677
  "type": "zip",
1678
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
1679
+ "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
1680
  "shasum": ""
1681
  },
1682
  "require": {
1714
  "phpcs",
1715
  "standards"
1716
  ],
1717
+ "time": "2020-04-17T01:09:41+00:00"
1718
  },
1719
  {
1720
  "name": "symfony/polyfill-ctype",
1721
+ "version": "v1.17.0",
1722
  "source": {
1723
  "type": "git",
1724
  "url": "https://github.com/symfony/polyfill-ctype.git",
1725
+ "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9"
1726
  },
1727
  "dist": {
1728
  "type": "zip",
1729
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
1730
+ "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
1731
  "shasum": ""
1732
  },
1733
  "require": {
1739
  "type": "library",
1740
  "extra": {
1741
  "branch-alias": {
1742
+ "dev-master": "1.17-dev"
1743
  }
1744
  },
1745
  "autoload": {
1772
  "polyfill",
1773
  "portable"
1774
  ],
1775
+ "time": "2020-05-12T16:14:59+00:00"
1776
  },
1777
  {
1778
  "name": "symfony/yaml",
1779
+ "version": "v2.8.52",
1780
  "source": {
1781
  "type": "git",
1782
  "url": "https://github.com/symfony/yaml.git",
1826
  },
1827
  {
1828
  "name": "webmozart/assert",
1829
+ "version": "1.8.0",
1830
  "source": {
1831
  "type": "git",
1832
  "url": "https://github.com/webmozart/assert.git",
1833
+ "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
1834
  },
1835
  "dist": {
1836
  "type": "zip",
1837
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
1838
+ "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
1839
  "shasum": ""
1840
  },
1841
  "require": {
1842
  "php": "^5.3.3 || ^7.0",
1843
  "symfony/polyfill-ctype": "^1.8"
1844
  },
1845
+ "conflict": {
1846
+ "vimeo/psalm": "<3.9.1"
1847
+ },
1848
  "require-dev": {
1849
  "phpunit/phpunit": "^4.8.36 || ^7.5.13"
1850
  },
1851
  "type": "library",
 
 
 
 
 
1852
  "autoload": {
1853
  "psr-4": {
1854
  "Webmozart\\Assert\\": "src/"
1870
  "check",
1871
  "validate"
1872
  ],
1873
+ "time": "2020-04-18T12:12:48+00:00"
1874
  },
1875
  {
1876
  "name": "wp-coding-standards/wpcs",
1877
+ "version": "2.2.1",
1878
  "source": {
1879
  "type": "git",
1880
  "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
1881
+ "reference": "b5a453203114cc2284b1a614c4953456fbe4f546"
1882
  },
1883
  "dist": {
1884
  "type": "zip",
1885
+ "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b5a453203114cc2284b1a614c4953456fbe4f546",
1886
+ "reference": "b5a453203114cc2284b1a614c4953456fbe4f546",
1887
  "shasum": ""
1888
  },
1889
  "require": {
1891
  "squizlabs/php_codesniffer": "^3.3.1"
1892
  },
1893
  "require-dev": {
1894
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
1895
  "phpcompatibility/php-compatibility": "^9.0",
1896
  "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
1897
  },
1898
  "suggest": {
1899
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
1900
  },
1901
  "type": "phpcodesniffer-standard",
1902
  "notification-url": "https://packagist.org/downloads/",
1906
  "authors": [
1907
  {
1908
  "name": "Contributors",
1909
+ "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
1910
  }
1911
  ],
1912
  "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
1915
  "standards",
1916
  "wordpress"
1917
  ],
1918
+ "time": "2020-02-04T02:52:06+00:00"
1919
  }
1920
  ],
1921
  "aliases": [],
vendor/wp-media/rocket-lazyload-common/src/Assets.php CHANGED
@@ -10,64 +10,62 @@ namespace RocketLazyload;
10
  /**
11
  * Class containing the methods to return or print the assets needed for lazyloading
12
  */
13
- class Assets
14
- {
15
- /**
16
- * Inserts the lazyload script in the HTML
17
- *
18
- * @param array $args Array of arguments to populate the lazyload script tag.
19
- * @return void
20
- */
21
- public function insertLazyloadScript($args = [])
22
- {
23
- echo $this->getLazyloadScript($args);
24
- }
25
-
26
- /**
27
- * Gets the inline lazyload script configuration
28
- *
29
- * @param array $args Array of arguments to populate the lazyload script options.
30
- * @return string
31
- */
32
- public function getInlineLazyloadScript($args = [])
33
- {
34
- $defaults = [
35
- 'elements' => [
36
- 'img',
37
- 'iframe',
38
- ],
39
- 'threshold' => 300,
40
- 'options' => [],
41
- ];
42
-
43
- $allowed_options = [
44
- 'container' => 1,
45
- 'thresholds' => 1,
46
- 'data_bg' => 1,
47
- 'class_error' => 1,
48
- 'load_delay' => 1,
49
- 'auto_unobserve' => 1,
50
- 'callback_enter' => 1,
51
- 'callback_exit' => 1,
52
- 'callback_reveal' => 1,
53
- 'callback_error' => 1,
54
- 'callback_finish' => 1,
55
- 'use_native' => 1,
56
- ];
57
-
58
- $args = wp_parse_args($args, $defaults);
59
- $script = '';
60
-
61
- $args['options'] = array_intersect_key($args['options'], $allowed_options);
62
-
63
- $script .= 'window.lazyLoadOptions = {
64
- elements_selector: "' . esc_attr(implode(',', $args['elements'])) . '",
65
  data_src: "lazy-src",
66
  data_srcset: "lazy-srcset",
67
  data_sizes: "lazy-sizes",
68
  class_loading: "lazyloading",
69
  class_loaded: "lazyloaded",
70
- threshold: ' . esc_attr($args['threshold']) . ',
71
  callback_loaded: function(element) {
72
  if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
73
  if (element.classList.contains("lazyloaded") ) {
@@ -80,22 +78,22 @@ class Assets
80
  }
81
  }';
82
 
83
- if (! empty($args['options'])) {
84
- $script .= ',' . PHP_EOL;
85
 
86
- foreach ($args['options'] as $option => $value) {
87
- $script .= $option . ': ' . $value . ',';
88
- }
 
 
 
89
 
90
- $script = rtrim($script, ',');
91
- }
92
 
93
- $script .= '};';
94
-
95
- $script .= '
96
  window.addEventListener(\'LazyLoad::Initialized\', function (e) {
97
  var lazyLoadInstance = e.detail.instance;
98
-
99
  if (window.MutationObserver) {
100
  var observer = new MutationObserver(function(mutations) {
101
  var image_count = 0;
@@ -121,7 +119,7 @@ class Assets
121
  image_count += images.length;
122
  iframe_count += iframes.length;
123
  rocketlazy_count += rocket_lazy.length;
124
-
125
  if(is_image){
126
  image_count += 1;
127
  }
@@ -136,164 +134,157 @@ class Assets
136
  lazyLoadInstance.update();
137
  }
138
  } );
139
-
140
  var b = document.getElementsByTagName("body")[0];
141
  var config = { childList: true, subtree: true };
142
-
143
  observer.observe(b, config);
144
  }
145
  }, false);';
146
 
147
- return $script;
148
- }
149
-
150
- /**
151
- * Returns the lazyload inline script
152
- *
153
- * @param array $args Array of arguments to populate the lazyload script options.
154
- * @return string
155
- */
156
- public function getLazyloadScript($args = [])
157
- {
158
- $defaults = [
159
- 'base_url' => '',
160
- 'version' => '',
161
- 'polyfill' => false,
162
- ];
163
-
164
- $args = wp_parse_args($args, $defaults);
165
- $min = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
166
- $script = '';
167
-
168
- if (isset($args['polyfill']) && $args['polyfill']) {
169
- $script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
170
- }
171
-
172
- /**
173
- * Filters the script tag for the lazyload script
174
- *
175
- * @since 2.2.6
176
- *
177
- * @param $script_tag HTML tag for the lazyload script.
178
- */
179
- $script .= apply_filters('rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>');
180
-
181
- return $script;
182
- }
183
-
184
- /**
185
- * Inserts in the HTML the script to replace the Youtube thumbnail by the iframe.
186
- *
187
- * @param array $args Array of arguments to populate the script options.
188
- * @return void
189
- */
190
- public function insertYoutubeThumbnailScript($args = [])
191
- {
192
- echo $this->getYoutubeThumbnailScript($args);
193
- }
194
-
195
- /**
196
- * Returns the Youtube Thumbnail inline script
197
- *
198
- * @param array $args Array of arguments to populate the script options.
199
- * @return string
200
- */
201
- public function getYoutubeThumbnailScript($args = [])
202
- {
203
- $defaults = [
204
- 'resolution' => 'hqdefault',
205
- 'lazy_image' => false,
206
- ];
207
-
208
- $allowed_resolutions = [
209
- 'default' => [
210
- 'width' => 120,
211
- 'height' => 90,
212
- ],
213
- 'mqdefault' => [
214
- 'width' => 320,
215
- 'height' => 180,
216
- ],
217
- 'hqdefault' => [
218
- 'width' => 480,
219
- 'height' => 360,
220
- ],
221
- 'sddefault' => [
222
- 'width' => 640,
223
- 'height' => 480,
224
- ],
225
-
226
- 'maxresdefault' => [
227
- 'width' => 1280,
228
- 'height' => 720,
229
- ],
230
- ];
231
-
232
- $args['resolution'] = ( isset($args['resolution']) && isset($allowed_resolutions[ $args['resolution'] ]) ) ? $args['resolution'] : 'hqdefault';
233
-
234
- $args = wp_parse_args($args, $defaults);
235
-
236
- $image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
237
-
238
- if (isset($args['lazy_image']) && $args['lazy_image']) {
239
- $image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
240
- }
241
-
242
- return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"https://www.youtube.com/embed/ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.id)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\”allow\”, \”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\”),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
243
- }
244
-
245
- /**
246
- * Inserts the CSS to style the Youtube thumbnail container
247
- *
248
- * @param array $args Array of arguments to populate the CSS.
249
- * @return void
250
- */
251
- public function insertYoutubeThumbnailCSS($args = [])
252
- {
253
- wp_register_style('rocket-lazyload', false);
254
- wp_enqueue_style('rocket-lazyload');
255
- wp_add_inline_style('rocket-lazyload', $this->getYoutubeThumbnailCSS($args));
256
- }
257
-
258
- /**
259
- * Returns the CSS for the Youtube Thumbnail
260
- *
261
- * @param array $args Array of arguments to populate the CSS.
262
- * @return string
263
- */
264
- public function getYoutubeThumbnailCSS($args = [])
265
- {
266
- $defaults = [
267
- 'base_url' => '',
268
- 'responsive_embeds' => true,
269
- ];
270
-
271
- $args = wp_parse_args($args, $defaults);
272
-
273
- $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}';
274
-
275
- if ($args['responsive_embeds']) {
276
- $css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}';
277
- }
278
-
279
- return $css;
280
- }
281
-
282
- /**
283
- * Inserts the CSS needed when Javascript is not enabled to keep the display correct
284
- */
285
- public function insertNoJSCSS()
286
- {
287
- echo $this->getNoJSCSS();
288
- }
289
-
290
- /**
291
- * Returns the CSS to correctly display images when JavaScript is disabled
292
- *
293
- * @return string
294
- */
295
- public function getNoJSCSS()
296
- {
297
- return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
298
- }
299
  }
10
  /**
11
  * Class containing the methods to return or print the assets needed for lazyloading
12
  */
13
+ class Assets {
14
+
15
+ /**
16
+ * Inserts the lazyload script in the HTML
17
+ *
18
+ * @param array $args Array of arguments to populate the lazyload script tag.
19
+ * @return void
20
+ */
21
+ public function insertLazyloadScript( $args = [] ) {
22
+ echo $this->getLazyloadScript( $args );
23
+ }
24
+
25
+ /**
26
+ * Gets the inline lazyload script configuration
27
+ *
28
+ * @param array $args Array of arguments to populate the lazyload script options.
29
+ * @return string
30
+ */
31
+ public function getInlineLazyloadScript( $args = [] ) {
32
+ $defaults = [
33
+ 'elements' => [
34
+ 'img',
35
+ 'iframe',
36
+ ],
37
+ 'threshold' => 300,
38
+ 'options' => [],
39
+ ];
40
+
41
+ $allowed_options = [
42
+ 'container' => 1,
43
+ 'thresholds' => 1,
44
+ 'data_bg' => 1,
45
+ 'class_error' => 1,
46
+ 'load_delay' => 1,
47
+ 'auto_unobserve' => 1,
48
+ 'callback_enter' => 1,
49
+ 'callback_exit' => 1,
50
+ 'callback_reveal' => 1,
51
+ 'callback_error' => 1,
52
+ 'callback_finish' => 1,
53
+ 'use_native' => 1,
54
+ ];
55
+
56
+ $args = wp_parse_args( $args, $defaults );
57
+ $script = '';
58
+
59
+ $args['options'] = array_intersect_key( $args['options'], $allowed_options );
60
+
61
+ $script .= 'window.lazyLoadOptions = {
62
+ elements_selector: "' . esc_attr( implode( ',', $args['elements'] ) ) . '",
 
 
63
  data_src: "lazy-src",
64
  data_srcset: "lazy-srcset",
65
  data_sizes: "lazy-sizes",
66
  class_loading: "lazyloading",
67
  class_loaded: "lazyloaded",
68
+ threshold: ' . esc_attr( $args['threshold'] ) . ',
69
  callback_loaded: function(element) {
70
  if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) {
71
  if (element.classList.contains("lazyloaded") ) {
78
  }
79
  }';
80
 
81
+ if ( ! empty( $args['options'] ) ) {
82
+ $script .= ',' . PHP_EOL;
83
 
84
+ foreach ( $args['options'] as $option => $value ) {
85
+ $script .= $option . ': ' . $value . ',';
86
+ }
87
+
88
+ $script = rtrim( $script, ',' );
89
+ }
90
 
91
+ $script .= '};';
 
92
 
93
+ $script .= '
 
 
94
  window.addEventListener(\'LazyLoad::Initialized\', function (e) {
95
  var lazyLoadInstance = e.detail.instance;
96
+
97
  if (window.MutationObserver) {
98
  var observer = new MutationObserver(function(mutations) {
99
  var image_count = 0;
119
  image_count += images.length;
120
  iframe_count += iframes.length;
121
  rocketlazy_count += rocket_lazy.length;
122
+
123
  if(is_image){
124
  image_count += 1;
125
  }
134
  lazyLoadInstance.update();
135
  }
136
  } );
137
+
138
  var b = document.getElementsByTagName("body")[0];
139
  var config = { childList: true, subtree: true };
140
+
141
  observer.observe(b, config);
142
  }
143
  }, false);';
144
 
145
+ return $script;
146
+ }
147
+
148
+ /**
149
+ * Returns the lazyload inline script
150
+ *
151
+ * @param array $args Array of arguments to populate the lazyload script options.
152
+ * @return string
153
+ */
154
+ public function getLazyloadScript( $args = [] ) {
155
+ $defaults = [
156
+ 'base_url' => '',
157
+ 'version' => '',
158
+ 'polyfill' => false,
159
+ ];
160
+
161
+ $args = wp_parse_args( $args, $defaults );
162
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
163
+ $script = '';
164
+
165
+ if ( isset( $args['polyfill'] ) && $args['polyfill'] ) {
166
+ $script .= '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry"></script>';
167
+ }
168
+
169
+ /**
170
+ * Filters the script tag for the lazyload script
171
+ *
172
+ * @since 2.2.6
173
+ *
174
+ * @param $script_tag HTML tag for the lazyload script.
175
+ */
176
+ $script .= apply_filters( 'rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>' );
177
+
178
+ return $script;
179
+ }
180
+
181
+ /**
182
+ * Inserts in the HTML the script to replace the Youtube thumbnail by the iframe.
183
+ *
184
+ * @param array $args Array of arguments to populate the script options.
185
+ * @return void
186
+ */
187
+ public function insertYoutubeThumbnailScript( $args = [] ) {
188
+ echo $this->getYoutubeThumbnailScript( $args );
189
+ }
190
+
191
+ /**
192
+ * Returns the Youtube Thumbnail inline script
193
+ *
194
+ * @param array $args Array of arguments to populate the script options.
195
+ * @return string
196
+ */
197
+ public function getYoutubeThumbnailScript( $args = [] ) {
198
+ $defaults = [
199
+ 'resolution' => 'hqdefault',
200
+ 'lazy_image' => false,
201
+ ];
202
+
203
+ $allowed_resolutions = [
204
+ 'default' => [
205
+ 'width' => 120,
206
+ 'height' => 90,
207
+ ],
208
+ 'mqdefault' => [
209
+ 'width' => 320,
210
+ 'height' => 180,
211
+ ],
212
+ 'hqdefault' => [
213
+ 'width' => 480,
214
+ 'height' => 360,
215
+ ],
216
+ 'sddefault' => [
217
+ 'width' => 640,
218
+ 'height' => 480,
219
+ ],
220
+
221
+ 'maxresdefault' => [
222
+ 'width' => 1280,
223
+ 'height' => 720,
224
+ ],
225
+ ];
226
+
227
+ $args['resolution'] = ( isset( $args['resolution'] ) && isset( $allowed_resolutions[ $args['resolution'] ] ) ) ? $args['resolution'] : 'hqdefault';
228
+
229
+ $args = wp_parse_args( $args, $defaults );
230
+
231
+ $image = '<img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '">';
232
+
233
+ if ( isset( $args['lazy_image'] ) && $args['lazy_image'] ) {
234
+ $image = '<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"><noscript><img src="https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpg" alt="" width="' . $allowed_resolutions[ $args['resolution'] ]['width'] . '" height="' . $allowed_resolutions[ $args['resolution'] ]['height'] . '"></noscript>';
235
+ }
236
+
237
+ return "<script>function lazyLoadThumb(e){var t='{$image}',a='<div class=\"play\"></div>';return t.replace(\"ID\",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement(\"iframe\"),t=\"ID?autoplay=1\";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute(\"src\",t.replace(\"ID\",this.dataset.src)),e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"allowfullscreen\",\"1\"),e.setAttribute(\"allow\", \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"),this.parentNode.replaceChild(e,this)}document.addEventListener(\"DOMContentLoaded\",function(){var e,t,a=document.getElementsByClassName(\"rll-youtube-player\");for(t=0;t<a.length;t++)e=document.createElement(\"div\"),e.setAttribute(\"data-id\",a[t].dataset.id),e.setAttribute(\"data-query\", a[t].dataset.query),e.setAttribute(\"data-src\", a[t].dataset.src),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});</script>";
238
+ }
239
+
240
+ /**
241
+ * Inserts the CSS to style the Youtube thumbnail container
242
+ *
243
+ * @param array $args Array of arguments to populate the CSS.
244
+ * @return void
245
+ */
246
+ public function insertYoutubeThumbnailCSS( $args = [] ) {
247
+ wp_register_style( 'rocket-lazyload', false );
248
+ wp_enqueue_style( 'rocket-lazyload' );
249
+ wp_add_inline_style( 'rocket-lazyload', $this->getYoutubeThumbnailCSS( $args ) );
250
+ }
251
+
252
+ /**
253
+ * Returns the CSS for the Youtube Thumbnail
254
+ *
255
+ * @param array $args Array of arguments to populate the CSS.
256
+ * @return string
257
+ */
258
+ public function getYoutubeThumbnailCSS( $args = [] ) {
259
+ $defaults = [
260
+ 'base_url' => '',
261
+ 'responsive_embeds' => true,
262
+ ];
263
+
264
+ $args = wp_parse_args( $args, $defaults );
265
+
266
+ $css = '.rll-youtube-player{position:relative;padding-bottom:56.23%;height:0;overflow:hidden;max-width:100%;}.rll-youtube-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;background:0 0}.rll-youtube-player img{bottom:0;display:block;left:0;margin:auto;max-width:100%;width:100%;position:absolute;right:0;top:0;border:none;height:auto;cursor:pointer;-webkit-transition:.4s all;-moz-transition:.4s all;transition:.4s all}.rll-youtube-player img:hover{-webkit-filter:brightness(75%)}.rll-youtube-player .play{height:72px;width:72px;left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;background:url(' . $args['base_url'] . 'img/youtube.png) no-repeat;cursor:pointer}';
267
+
268
+ if ( $args['responsive_embeds'] ) {
269
+ $css .= '.wp-has-aspect-ratio .rll-youtube-player{position:absolute;padding-bottom:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}';
270
+ }
271
+
272
+ return $css;
273
+ }
274
+
275
+ /**
276
+ * Inserts the CSS needed when Javascript is not enabled to keep the display correct
277
+ */
278
+ public function insertNoJSCSS() {
279
+ echo $this->getNoJSCSS();
280
+ }
281
+
282
+ /**
283
+ * Returns the CSS to correctly display images when JavaScript is disabled
284
+ *
285
+ * @return string
286
+ */
287
+ public function getNoJSCSS() {
288
+ return '<noscript><style id="rocket-lazyload-nojs-css">.rll-youtube-player, [data-lazy-src]{display:none !important;}</style></noscript>';
289
+ }
 
 
 
 
 
 
 
290
  }
vendor/wp-media/rocket-lazyload-common/src/Iframe.php CHANGED
@@ -10,193 +10,223 @@ namespace RocketLazyload;
10
  /**
11
  * A class to provide the methods needed to lazyload iframes in WP Rocket and Lazyload by WP Rocket
12
  */
13
- class Iframe
14
- {
15
- /**
16
- * Finds iframes in the HTML provided and call the methods to lazyload them
17
- *
18
- * @param string $html Original HTML.
19
- * @param string $buffer Content to parse.
20
- * @param array $args Array of arguments to use.
21
- * @return string
22
- */
23
- public function lazyloadIframes($html, $buffer, $args = [])
24
- {
25
- $defaults = [
26
- 'youtube' => false,
27
- ];
28
-
29
- $args = wp_parse_args($args, $defaults);
30
-
31
- if (! preg_match_all('@<iframe(?<atts>\s.+)>.*</iframe>@iUs', $buffer, $iframes, PREG_SET_ORDER) ) {
32
- return $html;
33
- }
34
-
35
- $iframes = array_unique($iframes, SORT_REGULAR);
36
-
37
- foreach ($iframes as $iframe) {
38
- if ($this->isIframeExcluded($iframe)) {
39
- continue;
40
- }
41
-
42
- // Given the previous regex pattern, $iframe['atts'] starts with a whitespace character.
43
- if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $iframe['atts'], $atts)) {
44
- continue;
45
- }
46
-
47
- $iframe['src'] = trim($atts['src']);
48
-
49
- if ('' === $iframe['src']) {
50
- continue;
51
- }
52
-
53
- if ($args['youtube']) {
54
- $iframe_lazyload = $this->replaceYoutubeThumbnail($iframe);
55
- }
56
-
57
- if (empty($iframe_lazyload)) {
58
- $iframe_lazyload = $this->replaceIframe($iframe);
59
- }
60
-
61
- $html = str_replace($iframe[0], $iframe_lazyload, $html);
62
-
63
- unset($iframe_lazyload);
64
- }
65
-
66
- return $html;
67
- }
68
-
69
- /**
70
- * Checks if the provided iframe is excluded from lazyload
71
- *
72
- * @param array $iframe Array of matched patterns.
73
- * @return boolean
74
- */
75
- public function isIframeExcluded($iframe)
76
- {
77
-
78
- foreach ($this->getExcludedPatterns() as $excluded_pattern) {
79
- if (strpos($iframe[0], $excluded_pattern) !== false) {
80
- return true;
81
- }
82
- }
83
-
84
- return false;
85
- }
86
-
87
- /**
88
- * Gets patterns excluded from lazyload for iframes
89
- *
90
- * @since 2.1.1
91
- *
92
- * @return array
93
- */
94
- private function getExcludedPatterns()
95
- {
96
- /**
97
- * Filters the patterns excluded from lazyload for iframes
98
- *
99
- * @since 2.1.1
100
- *
101
- * @param array $excluded_patterns Array of excluded patterns.
102
- */
103
- return apply_filters(
104
- 'rocket_lazyload_iframe_excluded_patterns',
105
- [
106
- 'gform_ajax_frame',
107
- 'data-no-lazy=',
108
- 'recaptcha/api/fallback',
109
- 'loading="eager"',
110
- ]
111
- );
112
- }
113
-
114
- /**
115
- * Applies lazyload on the iframe provided
116
- *
117
- * @param array $iframe Array of matched elements.
118
- * @return string
119
- */
120
- private function replaceIframe($iframe)
121
- {
122
- /**
123
- * Filter the LazyLoad placeholder on src attribute
124
- *
125
- * @since 1.0
126
- *
127
- * @param string $placeholder placeholder that will be printed.
128
- */
129
- $placeholder = apply_filters('rocket_lazyload_placeholder', 'about:blank');
130
-
131
- $placeholder_atts = str_replace($iframe['src'], $placeholder, $iframe['atts']);
132
- $iframe_lazyload = str_replace($iframe['atts'], $placeholder_atts . ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url($iframe['src']) . '"', $iframe[0]);
133
-
134
- if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $iframe_lazyload)) {
135
- $iframe_lazyload = str_replace('<iframe', '<iframe loading="lazy"', $iframe_lazyload);
136
- }
137
-
138
- /**
139
- * Filter the LazyLoad HTML output on iframes
140
- *
141
- * @since 1.0
142
- *
143
- * @param array $html Output that will be printed.
144
- */
145
- $iframe_lazyload = apply_filters('rocket_lazyload_iframe_html', $iframe_lazyload);
146
- $iframe_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
147
-
148
- return $iframe_lazyload;
149
- }
150
-
151
- /**
152
- * Replaces the iframe provided by the Youtube thumbnail
153
- *
154
- * @param array $iframe Array of matched elements.
155
- * @return bool|string
156
- */
157
- private function replaceYoutubeThumbnail($iframe)
158
- {
159
- $youtube_id = $this->getYoutubeIDFromURL($iframe['src']);
160
-
161
- if (! $youtube_id) {
162
- return false;
163
- }
164
-
165
- $query = wp_parse_url(htmlspecialchars_decode($iframe['src']), PHP_URL_QUERY);
166
-
167
- /**
168
- * Filter the LazyLoad HTML output on Youtube iframes
169
- *
170
- * @since 2.11
171
- *
172
- * @param array $html Output that will be printed.
173
- */
174
- $youtube_lazyload = apply_filters('rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-id="' . esc_attr($youtube_id) . '" data-query="' . esc_attr($query) . '"></div>');
175
- $youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
176
-
177
- return $youtube_lazyload;
178
- }
179
-
180
- /**
181
- * Gets the Youtube ID from the URL provided
182
- *
183
- * @param string $url URL to search.
184
- * @return bool|string
185
- */
186
- public function getYoutubeIDFromURL($url)
187
- {
188
- $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be|youtube\.com|youtube-nocookie\.com)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
189
- $result = preg_match($pattern, $url, $matches);
190
-
191
- if (! $result) {
192
- return false;
193
- }
194
-
195
- // exclude playlist.
196
- if ('videoseries' === $matches[1]) {
197
- return false;
198
- }
199
-
200
- return $matches[1];
201
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  }
10
  /**
11
  * A class to provide the methods needed to lazyload iframes in WP Rocket and Lazyload by WP Rocket
12
  */
13
+ class Iframe {
14
+
15
+ /**
16
+ * Finds iframes in the HTML provided and call the methods to lazyload them
17
+ *
18
+ * @param string $html Original HTML.
19
+ * @param string $buffer Content to parse.
20
+ * @param array $args Array of arguments to use.
21
+ * @return string
22
+ */
23
+ public function lazyloadIframes( $html, $buffer, $args = [] ) {
24
+ $defaults = [
25
+ 'youtube' => false,
26
+ ];
27
+
28
+ $args = wp_parse_args( $args, $defaults );
29
+
30
+ if ( ! preg_match_all( '@<iframe(?<atts>\s.+)>.*</iframe>@iUs', $buffer, $iframes, PREG_SET_ORDER ) ) {
31
+ return $html;
32
+ }
33
+
34
+ $iframes = array_unique( $iframes, SORT_REGULAR );
35
+
36
+ foreach ( $iframes as $iframe ) {
37
+ if ( $this->isIframeExcluded( $iframe ) ) {
38
+ continue;
39
+ }
40
+
41
+ // Given the previous regex pattern, $iframe['atts'] starts with a whitespace character.
42
+ if ( ! preg_match( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $iframe['atts'], $atts ) ) {
43
+ continue;
44
+ }
45
+
46
+ $iframe['src'] = trim( $atts['src'] );
47
+
48
+ if ( '' === $iframe['src'] ) {
49
+ continue;
50
+ }
51
+
52
+ if ( $args['youtube'] ) {
53
+ $iframe_lazyload = $this->replaceYoutubeThumbnail( $iframe );
54
+ }
55
+
56
+ if ( empty( $iframe_lazyload ) ) {
57
+ $iframe_lazyload = $this->replaceIframe( $iframe );
58
+ }
59
+
60
+ $html = str_replace( $iframe[0], $iframe_lazyload, $html );
61
+
62
+ unset( $iframe_lazyload );
63
+ }
64
+
65
+ return $html;
66
+ }
67
+
68
+ /**
69
+ * Checks if the provided iframe is excluded from lazyload
70
+ *
71
+ * @param array $iframe Array of matched patterns.
72
+ * @return boolean
73
+ */
74
+ public function isIframeExcluded( $iframe ) {
75
+
76
+ foreach ( $this->getExcludedPatterns() as $excluded_pattern ) {
77
+ if ( strpos( $iframe[0], $excluded_pattern ) !== false ) {
78
+ return true;
79
+ }
80
+ }
81
+
82
+ return false;
83
+ }
84
+
85
+ /**
86
+ * Gets patterns excluded from lazyload for iframes
87
+ *
88
+ * @since 2.1.1
89
+ *
90
+ * @return array
91
+ */
92
+ private function getExcludedPatterns() {
93
+ /**
94
+ * Filters the patterns excluded from lazyload for iframes
95
+ *
96
+ * @since 2.1.1
97
+ *
98
+ * @param array $excluded_patterns Array of excluded patterns.
99
+ */
100
+ return apply_filters(
101
+ 'rocket_lazyload_iframe_excluded_patterns',
102
+ [
103
+ 'gform_ajax_frame',
104
+ 'data-no-lazy=',
105
+ 'recaptcha/api/fallback',
106
+ 'loading="eager"',
107
+ 'data-skip-lazy',
108
+ 'skip-lazy',
109
+ ]
110
+ );
111
+ }
112
+
113
+ /**
114
+ * Applies lazyload on the iframe provided
115
+ *
116
+ * @param array $iframe Array of matched elements.
117
+ * @return string
118
+ */
119
+ private function replaceIframe( $iframe ) {
120
+ /**
121
+ * Filter the LazyLoad placeholder on src attribute
122
+ *
123
+ * @since 1.0
124
+ *
125
+ * @param string $placeholder placeholder that will be printed.
126
+ */
127
+ $placeholder = apply_filters( 'rocket_lazyload_placeholder', 'about:blank' );
128
+
129
+ $placeholder_atts = str_replace( $iframe['src'], $placeholder, $iframe['atts'] );
130
+ $iframe_lazyload = str_replace( $iframe['atts'], $placeholder_atts . ' data-rocket-lazyload="fitvidscompatible" data-lazy-src="' . esc_url( $iframe['src'] ) . '"', $iframe[0] );
131
+
132
+ if ( ! preg_match( '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $iframe_lazyload ) ) {
133
+ $iframe_lazyload = str_replace( '<iframe', '<iframe loading="lazy"', $iframe_lazyload );
134
+ }
135
+
136
+ /**
137
+ * Filter the LazyLoad HTML output on iframes
138
+ *
139
+ * @since 1.0
140
+ *
141
+ * @param array $html Output that will be printed.
142
+ */
143
+ $iframe_lazyload = apply_filters( 'rocket_lazyload_iframe_html', $iframe_lazyload );
144
+ $iframe_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
145
+
146
+ return $iframe_lazyload;
147
+ }
148
+
149
+ /**
150
+ * Replaces the iframe provided by the Youtube thumbnail
151
+ *
152
+ * @param array $iframe Array of matched elements.
153
+ * @return bool|string
154
+ */
155
+ private function replaceYoutubeThumbnail( $iframe ) {
156
+ $youtube_id = $this->getYoutubeIDFromURL( $iframe['src'] );
157
+
158
+ if ( ! $youtube_id ) {
159
+ return false;
160
+ }
161
+
162
+ $query = wp_parse_url( htmlspecialchars_decode( $iframe['src'] ), PHP_URL_QUERY );
163
+
164
+ $youtube_url = $this->changeYoutubeUrlForYoutuDotBe( $iframe['src'] );
165
+ $youtube_url = $this->cleanYoutubeUrl( $iframe['src'] );
166
+ /**
167
+ * Filter the LazyLoad HTML output on Youtube iframes
168
+ *
169
+ * @since 2.11
170
+ *
171
+ * @param array $html Output that will be printed.
172
+ */
173
+ $youtube_lazyload = apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '"></div>' );
174
+ $youtube_lazyload .= '<noscript>' . $iframe[0] . '</noscript>';
175
+
176
+ return $youtube_lazyload;
177
+ }
178
+
179
+ /**
180
+ * Gets the Youtube ID from the URL provided
181
+ *
182
+ * @param string $url URL to search.
183
+ * @return bool|string
184
+ */
185
+ public function getYoutubeIDFromURL( $url ) {
186
+ $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be|youtube\.com|youtube-nocookie\.com)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
187
+ $result = preg_match( $pattern, $url, $matches );
188
+
189
+ if ( ! $result ) {
190
+ return false;
191
+ }
192
+
193
+ // exclude playlist.
194
+ if ( 'videoseries' === $matches[1] ) {
195
+ return false;
196
+ }
197
+
198
+ return $matches[1];
199
+ }
200
+
201
+ /**
202
+ * Changes URL youtu.be/ID to youtube.com/embed/ID
203
+ *
204
+ * @param string $url URL to replace.
205
+ * @return string Unchanged URL or modified URL.
206
+ */
207
+ public function changeYoutubeUrlForYoutuDotBe( $url ) {
208
+ $pattern = '#^(?:https?:)?(?://)?(?:www\.)?(?:youtu\.be)/(?:embed/|v/|watch/?\?v=)?([\w-]{11})#iU';
209
+ $result = preg_match( $pattern, $url, $matches );
210
+
211
+ if ( ! $result ) {
212
+ return $url;
213
+ }
214
+
215
+ return 'https://www.youtube.com/embed/' . $matches[1];
216
+ }
217
+
218
+ /**
219
+ * Cleans Youtube URL. Keeps only scheme, host and path.
220
+ *
221
+ * @param string $url URL to be cleaned.
222
+ * @return string Cleaned URL
223
+ */
224
+ public function cleanYoutubeUrl( $url ) {
225
+ $parsed_url = wp_parse_url( $url, -1 );
226
+ $scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] . '://' : '//';
227
+ $host = isset( $parsed_url['host'] ) ? $parsed_url['host'] : '';
228
+ $path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '';
229
+
230
+ return $scheme . $host . $path;
231
+ }
232
  }
vendor/wp-media/rocket-lazyload-common/src/Image.php CHANGED
@@ -10,465 +10,456 @@ namespace RocketLazyload;
10
  /**
11
  * A class to provide the methods needed to lazyload images in WP Rocket and Lazyload by WP Rocket
12
  */
13
- class Image
14
- {
15
- /**
16
- * Finds the images to be lazyloaded and call the callback method to replace them.
17
- *
18
- * @param string $html Original HTML.
19
- * @param string $buffer Content to parse.
20
- * @return string
21
- */
22
- public function lazyloadImages($html, $buffer)
23
- {
24
- if (! preg_match_all('#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER)) {
25
- return $html;
26
- }
27
-
28
- $images = array_unique($images, SORT_REGULAR);
29
-
30
- foreach ($images as $image) {
31
- $image = $this->canLazyload($image);
32
-
33
- if (! $image) {
34
- continue;
35
- }
36
-
37
- $image_lazyload = $this->replaceImage($image);
38
- $image_lazyload .= $this->noscript($image[0]);
39
- $html = str_replace($image[0], $image_lazyload, $html);
40
-
41
- unset($image_lazyload);
42
- }
43
-
44
- return $html;
45
- }
46
-
47
- /**
48
- * Applies lazyload on background images defined in style attributes
49
- *
50
- * @param string $html Original HTML.
51
- * @param string $buffer Content to parse.
52
- * @return string
53
- */
54
- public function lazyloadBackgroundImages($html, $buffer)
55
- {
56
- if (! preg_match_all('#<(?<tag>div|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER)) {
57
- return $html;
58
- }
59
-
60
- foreach ($elements as $element) {
61
- if ($this->isExcluded($element['before'] . $element['after'], $this->getExcludedAttributes())) {
62
- continue;
63
- }
64
-
65
- if (! preg_match('#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url)) {
66
- continue;
67
- }
68
-
69
- $url['url'] = trim($url['url'], '\'" ');
70
-
71
- if ($this->isExcluded($url['url'], $this->getExcludedSrc())) {
72
- continue;
73
- }
74
-
75
- $lazy_bg = $this->addLazyCLass($element[0]);
76
- $lazy_bg = str_replace($url[0], '', $lazy_bg);
77
- $lazy_bg = str_replace('<' . $element['tag'], '<' . $element['tag'] . ' data-bg="url(' . esc_attr($url['url']) . ')"', $lazy_bg);
78
-
79
- $html = str_replace($element[0], $lazy_bg, $html);
80
- unset($lazy_bg);
81
- }
82
-
83
- return $html;
84
- }
85
-
86
- /**
87
- * Add the identifier class to the element
88
- *
89
- * @param string $element Element to add the class to.
90
- * @return string
91
- */
92
- private function addLazyClass($element)
93
- {
94
- if (preg_match('#class=["\']?(?<classes>[^"\'>]*)["\']?#is', $element, $class)) {
95
- $classes = str_replace($class['classes'], $class['classes'] . ' rocket-lazyload', $class[0]);
96
- $element = str_replace($class[0], $classes, $element);
97
-
98
- return $element;
99
- }
100
-
101
- return preg_replace('#<(img|div|section|li|span)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element);
102
- }
103
-
104
- /**
105
- * Applies lazyload on picture elements found in the HTML.
106
- *
107
- * @param string $html Original HTML.
108
- * @param string $buffer Content to parse.
109
- * @return string
110
- */
111
- public function lazyloadPictures($html, $buffer)
112
- {
113
- if (! preg_match_all('#<picture(?:.*)?>(?<sources>.*)</picture>#iUs', $buffer, $pictures, PREG_SET_ORDER)) {
114
- return $html;
115
- }
116
-
117
- $pictures = array_unique($pictures, SORT_REGULAR);
118
- $excluded = array_merge($this->getExcludedAttributes(), $this->getExcludedSrc());
119
-
120
- foreach ($pictures as $picture) {
121
- if ($this->isExcluded($picture[0], $excluded)) {
122
- continue;
123
- }
124
-
125
- if (preg_match_all('#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER)) {
126
- $sources = array_unique($sources, SORT_REGULAR);
127
-
128
- $lazy_sources = 0;
129
-
130
- foreach ($sources as $source) {
131
- $lazyload_srcset = preg_replace('/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0]);
132
- $html = str_replace($source[0], $lazyload_srcset, $html);
133
-
134
- unset($lazyload_srcset);
135
- $lazy_sources++;
136
- }
137
- }
138
-
139
- if (0 === $lazy_sources) {
140
- continue;
141
- }
142
-
143
- if (! preg_match('#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img)) {
144
- continue;
145
- }
146
-
147
- $img = $this->canLazyload($img);
148
-
149
- if (! $img) {
150
- continue;
151
- }
152
-
153
- $img_lazy = $this->replaceImage($img);
154
- $html = str_replace($img[0], $img_lazy, $html);
155
-
156
- unset($img_lazy);
157
- }
158
-
159
- return $html;
160
- }
161
-
162
- /**
163
- * Checks if the image can be lazyloaded
164
- *
165
- * @param Array $image Array of image data coming from Regex.
166
- * @return bool|Array
167
- */
168
- private function canLazyload($image)
169
- {
170
- if ($this->isExcluded($image['atts'], $this->getExcludedAttributes())) {
171
- return false;
172
- }
173
-
174
- // Given the previous regex pattern, $image['atts'] starts with a whitespace character.
175
- if (! preg_match('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $image['atts'], $atts)) {
176
- return false;
177
- }
178
-
179
- $image['src'] = trim($atts['src']);
180
-
181
- if ('' === $image['src']) {
182
- return false;
183
- }
184
-
185
- if ($this->isExcluded($image['src'], $this->getExcludedSrc())) {
186
- return false;
187
- }
188
-
189
- // Don't apply LazyLoad on images from WP Retina x2.
190
- if (function_exists('wr2x_picture_rewrite')) {
191
- if (wr2x_get_retina(trailingslashit(ABSPATH) . wr2x_get_pathinfo_from_image_src(trim($image['src'], '"')))) {
192
- return false;
193
- }
194
- }
195
-
196
- return $image;
197
- }
198
-
199
- /**
200
- * Checks if the provided string matches with the provided excluded patterns
201
- *
202
- * @param string $string String to check.
203
- * @param array $excluded_values Patterns to match against.
204
- * @return boolean
205
- */
206
- public function isExcluded($string, $excluded_values)
207
- {
208
- if (! is_array($excluded_values)) {
209
- (array) $excluded_values;
210
- }
211
-
212
- if (empty($excluded_values)) {
213
- return false;
214
- }
215
-
216
- foreach ($excluded_values as $excluded_value) {
217
- if (strpos($string, $excluded_value) !== false) {
218
- return true;
219
- }
220
- }
221
-
222
- return false;
223
- }
224
-
225
- /**
226
- * Returns the list of excluded attributes
227
- *
228
- * @return array
229
- */
230
- public function getExcludedAttributes()
231
- {
232
- /**
233
- * Filters the attributes used to prevent lazylad from being applied
234
- *
235
- * @since 1.0
236
- * @author Remy Perona
237
- *
238
- * @param array $excluded_attributes An array of excluded attributes.
239
- */
240
- return apply_filters(
241
- 'rocket_lazyload_excluded_attributes',
242
- [
243
- 'data-src=',
244
- 'data-no-lazy=',
245
- 'data-lazy-original=',
246
- 'data-lazy-src=',
247
- 'data-lazysrc=',
248
- 'data-lazyload=',
249
- 'data-bgposition=',
250
- 'data-envira-src=',
251
- 'fullurl=',
252
- 'lazy-slider-img=',
253
- 'data-srcset=',
254
- 'class="ls-l',
255
- 'class="ls-bg',
256
- 'soliloquy-image',
257
- 'loading="eager"',
258
- 'swatch-img',
259
- 'data-height-percentage',
260
- 'data-large_image',
261
- 'avia-bg-style-fixed',
262
- ]
263
- );
264
- }
265
-
266
- /**
267
- * Returns the list of excluded src
268
- *
269
- * @return array
270
- */
271
- public function getExcludedSrc()
272
- {
273
- /**
274
- * Filters the src used to prevent lazylad from being applied
275
- *
276
- * @since 1.0
277
- * @author Remy Perona
278
- *
279
- * @param array $excluded_src An array of excluded src.
280
- */
281
- return apply_filters(
282
- 'rocket_lazyload_excluded_src',
283
- [
284
- '/wpcf7_captcha/',
285
- 'timthumb.php?src',
286
- 'woocommerce/assets/images/placeholder.png',
287
- ]
288
- );
289
- }
290
-
291
- /**
292
- * Replaces the original image by the lazyload one
293
- *
294
- * @param array $image Array of matches elements.
295
- * @return string
296
- */
297
- private function replaceImage($image)
298
- {
299
- $width = 0;
300
- $height = 0;
301
-
302
- if (preg_match('@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts)) {
303
- $width = absint($atts['width']);
304
- }
305
-
306
- if (preg_match('@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts)) {
307
- $height = absint($atts['height']);
308
- }
309
-
310
- $placeholder_atts = preg_replace('@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder($width, $height) . '"', $image['atts']);
311
-
312
- $image_lazyload = str_replace($image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0]);
313
-
314
- if (! preg_match('@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload)) {
315
- $image_lazyload = str_replace('<img', '<img loading="lazy"', $image_lazyload);
316
- }
317
-
318
- /**
319
- * Filter the LazyLoad HTML output
320
- *
321
- * @since 1.0
322
- *
323
- * @param string $html Output that will be printed
324
- */
325
- $image_lazyload = apply_filters('rocket_lazyload_html', $image_lazyload);
326
-
327
- return $image_lazyload;
328
- }
329
-
330
- /**
331
- * Returns the HTML tag wrapped inside noscript tags
332
- *
333
- * @param string $element Element to wrap.
334
- * @return string
335
- */
336
- private function noscript($element)
337
- {
338
- return '<noscript>' . $element . '</noscript>';
339
- }
340
-
341
- /**
342
- * Applies lazyload on srcset and sizes attributes
343
- *
344
- * @param string $html HTML image tag.
345
- * @return string
346
- */
347
- public function lazyloadResponsiveAttributes($html)
348
- {
349
- $html = preg_replace('/[\s|"|\'](srcset)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
350
- $html = preg_replace('/[\s|"|\'](sizes)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html);
351
-
352
- return $html;
353
- }
354
-
355
- /**
356
- * Finds patterns matching smiley and call the callback method to replace them with the image
357
- *
358
- * @param string $text Content to search in.
359
- * @return string
360
- */
361
- public function convertSmilies($text)
362
- {
363
- global $wp_smiliessearch;
364
-
365
- if (! get_option('use_smilies') || empty($wp_smiliessearch)) {
366
- return $text;
367
- }
368
-
369
- $output = '';
370
- // HTML loop taken from texturize function, could possible be consolidated.
371
- $textarr = preg_split('/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between.
372
- $stop = count($textarr);// loop stuff.
373
-
374
- // Ignore proessing of specific tags.
375
- $tags_to_ignore = 'code|pre|style|script|textarea';
376
- $ignore_block_element = '';
377
-
378
- for ($i = 0; $i < $stop; $i++) {
379
- $content = $textarr[ $i ];
380
-
381
- // If we're in an ignore block, wait until we find its closing tag.
382
- if ('' === $ignore_block_element && preg_match('/^<(' . $tags_to_ignore . ')>/', $content, $matches)) {
383
- $ignore_block_element = $matches[1];
384
- }
385
-
386
- // If it's not a tag and not in ignore block.
387
- if ('' === $ignore_block_element && strlen($content) > 0 && '<' !== $content[0]) {
388
- $content = preg_replace_callback($wp_smiliessearch, [$this, 'translateSmiley'], $content);
389
- }
390
-
391
- // did we exit ignore block.
392
- if ('' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content) {
393
- $ignore_block_element = '';
394
- }
395
-
396
- $output .= $content;
397
- }
398
-
399
- return $output;
400
- }
401
-
402
- /**
403
- * Replace matches by smiley image, lazyloaded
404
- *
405
- * @param array $matches Array of matches.
406
- * @return string
407
- */
408
- private function translateSmiley($matches)
409
- {
410
- global $wpsmiliestrans;
411
-
412
- if (count($matches) === 0) {
413
- return '';
414
- }
415
-
416
- $smiley = trim(reset($matches));
417
- $img = $wpsmiliestrans[ $smiley ];
418
-
419
- $matches = [];
420
- $ext = preg_match('/\.([^.]+)$/', $img, $matches) ? strtolower($matches[1]) : false;
421
- $image_exts = ['jpg', 'jpeg', 'jpe', 'gif', 'png'];
422
-
423
- // Don't convert smilies that aren't images - they're probably emoji.
424
- if (! in_array($ext, $image_exts, true)) {
425
- return $img;
426
- }
427
-
428
- /**
429
- * Filter the Smiley image URL before it's used in the image element.
430
- *
431
- * @since 2.9.0
432
- *
433
- * @param string $smiley_url URL for the smiley image.
434
- * @param string $img Filename for the smiley image.
435
- * @param string $site_url Site URL, as returned by site_url().
436
- */
437
- $src_url = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url());
438
-
439
- // Don't LazyLoad if process is stopped for these reasons.
440
- if (is_feed() || is_preview()) {
441
- return sprintf(' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url($src_url), esc_attr($smiley));
442
- }
443
-
444
- return sprintf(' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $this->getPlaceholder(), esc_url($src_url), esc_attr($smiley));
445
- }
446
-
447
- /**
448
- * Returns the placeholder for the src attribute
449
- *
450
- * @since 1.2
451
- * @author Remy Perona
452
- *
453
- * @param int $width Width of the placeholder image. Default 0.
454
- * @param int $height Height of the placeholder image. Default 0.
455
- * @return string
456
- */
457
- public function getPlaceholder($width = 0, $height = 0)
458
- {
459
- $width = 0 === $width ? 0 : absint($width);
460
- $height = 0 === $height ? 0 : absint($height);
461
-
462
- $placeholder = str_replace(' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E");
463
- /**
464
- * Filter the image lazyLoad placeholder on src attribute
465
- *
466
- * @since 1.1
467
- *
468
- * @param string $placeholder Placeholder that will be printed.
469
- * @param int $width Placeholder width.
470
- * @param int $height Placeholder height.
471
- */
472
- return apply_filters('rocket_lazyload_placeholder', $placeholder, $width, $height);
473
- }
474
  }
10
  /**
11
  * A class to provide the methods needed to lazyload images in WP Rocket and Lazyload by WP Rocket
12
  */
13
+ class Image {
14
+
15
+ /**
16
+ * Finds the images to be lazyloaded and call the callback method to replace them.
17
+ *
18
+ * @param string $html Original HTML.
19
+ * @param string $buffer Content to parse.
20
+ * @return string
21
+ */
22
+ public function lazyloadImages( $html, $buffer ) {
23
+ if ( ! preg_match_all( '#<img(?<atts>\s.+)\s?/?>#iUs', $buffer, $images, PREG_SET_ORDER ) ) {
24
+ return $html;
25
+ }
26
+
27
+ $images = array_unique( $images, SORT_REGULAR );
28
+
29
+ foreach ( $images as $image ) {
30
+ $image = $this->canLazyload( $image );
31
+
32
+ if ( ! $image ) {
33
+ continue;
34
+ }
35
+
36
+ $image_lazyload = $this->replaceImage( $image );
37
+ $image_lazyload .= $this->noscript( $image[0] );
38
+ $html = str_replace( $image[0], $image_lazyload, $html );
39
+
40
+ unset( $image_lazyload );
41
+ }
42
+
43
+ return $html;
44
+ }
45
+
46
+ /**
47
+ * Applies lazyload on background images defined in style attributes
48
+ *
49
+ * @param string $html Original HTML.
50
+ * @param string $buffer Content to parse.
51
+ * @return string
52
+ */
53
+ public function lazyloadBackgroundImages( $html, $buffer ) {
54
+ if ( ! preg_match_all( '#<(?<tag>div|figure|section|span|li)\s+(?<before>[^>]+[\'"\s])?style\s*=\s*([\'"])(?<styles>.*?)\3(?<after>[^>]*)>#is', $buffer, $elements, PREG_SET_ORDER ) ) {
55
+ return $html;
56
+ }
57
+
58
+ foreach ( $elements as $element ) {
59
+ if ( $this->isExcluded( $element['before'] . $element['after'], $this->getExcludedAttributes() ) ) {
60
+ continue;
61
+ }
62
+
63
+ if ( ! preg_match( '#background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?#is', $element['styles'], $url ) ) {
64
+ continue;
65
+ }
66
+
67
+ $url['url'] = trim( $url['url'], '\'" ' );
68
+
69
+ if ( $this->isExcluded( $url['url'], $this->getExcludedSrc() ) ) {
70
+ continue;
71
+ }
72
+
73
+ $lazy_bg = $this->addLazyCLass( $element[0] );
74
+ $lazy_bg = str_replace( $url[0], '', $lazy_bg );
75
+ $lazy_bg = str_replace( '<' . $element['tag'], '<' . $element['tag'] . ' data-bg="url(' . esc_attr( $url['url'] ) . ')"', $lazy_bg );
76
+
77
+ $html = str_replace( $element[0], $lazy_bg, $html );
78
+ unset( $lazy_bg );
79
+ }
80
+
81
+ return $html;
82
+ }
83
+
84
+ /**
85
+ * Add the identifier class to the element
86
+ *
87
+ * @param string $element Element to add the class to.
88
+ * @return string
89
+ */
90
+ private function addLazyClass( $element ) {
91
+ if ( preg_match( '#class=["\']?(?<classes>[^"\'>]*)["\']?#is', $element, $class ) ) {
92
+ if ( empty( $class['classes'] ) ) {
93
+ return str_replace( $class[0], 'class="rocket-lazyload"', $element );
94
+ }
95
+
96
+ $classes = str_replace( $class['classes'], $class['classes'] . ' rocket-lazyload', $class[0] );
97
+
98
+ return str_replace( $class[0], $classes, $element );
99
+ }
100
+
101
+ return preg_replace( '#<(img|div|figure|section|li|span)([^>]*)>#is', '<\1 class="rocket-lazyload"\2>', $element );
102
+ }
103
+
104
+ /**
105
+ * Applies lazyload on picture elements found in the HTML.
106
+ *
107
+ * @param string $html Original HTML.
108
+ * @param string $buffer Content to parse.
109
+ * @return string
110
+ */
111
+ public function lazyloadPictures( $html, $buffer ) {
112
+ if ( ! preg_match_all( '#<picture(?:.*)?>(?<sources>.*)</picture>#iUs', $buffer, $pictures, PREG_SET_ORDER ) ) {
113
+ return $html;
114
+ }
115
+
116
+ $pictures = array_unique( $pictures, SORT_REGULAR );
117
+ $excluded = array_merge( $this->getExcludedAttributes(), $this->getExcludedSrc() );
118
+
119
+ foreach ( $pictures as $picture ) {
120
+ if ( $this->isExcluded( $picture[0], $excluded ) ) {
121
+ continue;
122
+ }
123
+
124
+ if ( preg_match_all( '#<source(?<atts>\s.+)>#iUs', $picture['sources'], $sources, PREG_SET_ORDER ) ) {
125
+ $sources = array_unique( $sources, SORT_REGULAR );
126
+
127
+ $lazy_sources = 0;
128
+
129
+ foreach ( $sources as $source ) {
130
+ $lazyload_srcset = preg_replace( '/([\s"\'])srcset/i', '\1data-lazy-srcset', $source[0] );
131
+ $html = str_replace( $source[0], $lazyload_srcset, $html );
132
+
133
+ unset( $lazyload_srcset );
134
+ $lazy_sources++;
135
+ }
136
+ }
137
+
138
+ if ( 0 === $lazy_sources ) {
139
+ continue;
140
+ }
141
+
142
+ if ( ! preg_match( '#<img(?<atts>\s.+)\s?/?>#iUs', $picture[0], $img ) ) {
143
+ continue;
144
+ }
145
+
146
+ $img = $this->canLazyload( $img );
147
+
148
+ if ( ! $img ) {
149
+ continue;
150
+ }
151
+
152
+ $img_lazy = $this->replaceImage( $img );
153
+ $html = str_replace( $img[0], $img_lazy, $html );
154
+
155
+ unset( $img_lazy );
156
+ }
157
+
158
+ return $html;
159
+ }
160
+
161
+ /**
162
+ * Checks if the image can be lazyloaded
163
+ *
164
+ * @param Array $image Array of image data coming from Regex.
165
+ * @return bool|Array
166
+ */
167
+ private function canLazyload( $image ) {
168
+ if ( $this->isExcluded( $image['atts'], $this->getExcludedAttributes() ) ) {
169
+ return false;
170
+ }
171
+
172
+ // Given the previous regex pattern, $image['atts'] starts with a whitespace character.
173
+ if ( ! preg_match( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', $image['atts'], $atts ) ) {
174
+ return false;
175
+ }
176
+
177
+ $image['src'] = trim( $atts['src'] );
178
+
179
+ if ( '' === $image['src'] ) {
180
+ return false;
181
+ }
182
+
183
+ if ( $this->isExcluded( $image['src'], $this->getExcludedSrc() ) ) {
184
+ return false;
185
+ }
186
+
187
+ // Don't apply LazyLoad on images from WP Retina x2.
188
+ if ( function_exists( 'wr2x_picture_rewrite' ) ) {
189
+ if ( wr2x_get_retina( trailingslashit( ABSPATH ) . wr2x_get_pathinfo_from_image_src( trim( $image['src'], '"' ) ) ) ) {
190
+ return false;
191
+ }
192
+ }
193
+
194
+ return $image;
195
+ }
196
+
197
+ /**
198
+ * Checks if the provided string matches with the provided excluded patterns
199
+ *
200
+ * @param string $string String to check.
201
+ * @param array $excluded_values Patterns to match against.
202
+ * @return boolean
203
+ */
204
+ public function isExcluded( $string, $excluded_values ) {
205
+ if ( ! is_array( $excluded_values ) ) {
206
+ (array) $excluded_values;
207
+ }
208
+
209
+ if ( empty( $excluded_values ) ) {
210
+ return false;
211
+ }
212
+
213
+ foreach ( $excluded_values as $excluded_value ) {
214
+ if ( strpos( $string, $excluded_value ) !== false ) {
215
+ return true;
216
+ }
217
+ }
218
+
219
+ return false;
220
+ }
221
+
222
+ /**
223
+ * Returns the list of excluded attributes
224
+ *
225
+ * @return array
226
+ */
227
+ public function getExcludedAttributes() {
228
+ /**
229
+ * Filters the attributes used to prevent lazylad from being applied
230
+ *
231
+ * @since 1.0
232
+ * @author Remy Perona
233
+ *
234
+ * @param array $excluded_attributes An array of excluded attributes.
235
+ */
236
+ return apply_filters(
237
+ 'rocket_lazyload_excluded_attributes',
238
+ [
239
+ 'data-src=',
240
+ 'data-no-lazy=',
241
+ 'data-lazy-original=',
242
+ 'data-lazy-src=',
243
+ 'data-lazysrc=',
244
+ 'data-lazyload=',
245
+ 'data-bgposition=',
246
+ 'data-envira-src=',
247
+ 'fullurl=',
248
+ 'lazy-slider-img=',
249
+ 'data-srcset=',
250
+ 'class="ls-l',
251
+ 'class="ls-bg',
252
+ 'soliloquy-image',
253
+ 'loading="eager"',
254
+ 'swatch-img',
255
+ 'data-height-percentage',
256
+ 'data-large_image',
257
+ 'avia-bg-style-fixed',
258
+ 'data-skip-lazy',
259
+ 'skip-lazy',
260
+ ]
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Returns the list of excluded src
266
+ *
267
+ * @return array
268
+ */
269
+ public function getExcludedSrc() {
270
+ /**
271
+ * Filters the src used to prevent lazylad from being applied
272
+ *
273
+ * @since 1.0
274
+ * @author Remy Perona
275
+ *
276
+ * @param array $excluded_src An array of excluded src.
277
+ */
278
+ return apply_filters(
279
+ 'rocket_lazyload_excluded_src',
280
+ [
281
+ '/wpcf7_captcha/',
282
+ 'timthumb.php?src',
283
+ 'woocommerce/assets/images/placeholder.png',
284
+ ]
285
+ );
286
+ }
287
+
288
+ /**
289
+ * Replaces the original image by the lazyload one
290
+ *
291
+ * @param array $image Array of matches elements.
292
+ * @return string
293
+ */
294
+ private function replaceImage( $image ) {
295
+ $width = 0;
296
+ $height = 0;
297
+
298
+ if ( preg_match( '@[\s"\']width\s*=\s*(\'|")(?<width>.*)\1@iUs', $image['atts'], $atts ) ) {
299
+ $width = absint( $atts['width'] );
300
+ }
301
+
302
+ if ( preg_match( '@[\s"\']height\s*=\s*(\'|")(?<height>.*)\1@iUs', $image['atts'], $atts ) ) {
303
+ $height = absint( $atts['height'] );
304
+ }
305
+
306
+ $placeholder_atts = preg_replace( '@\ssrc\s*=\s*(\'|")(?<src>.*)\1@iUs', ' src="' . $this->getPlaceholder( $width, $height ) . '"', $image['atts'] );
307
+
308
+ $image_lazyload = str_replace( $image['atts'], $placeholder_atts . ' data-lazy-src="' . $image['src'] . '"', $image[0] );
309
+
310
+ if ( ! preg_match( '@\sloading\s*=\s*(\'|")(?:lazy|auto)\1@i', $image_lazyload ) && apply_filters( 'rocket_use_native_lazyload', false ) ) {
311
+ $image_lazyload = str_replace( '<img', '<img loading="lazy"', $image_lazyload );
312
+ }
313
+
314
+ /**
315
+ * Filter the LazyLoad HTML output
316
+ *
317
+ * @since 1.0
318
+ *
319
+ * @param string $html Output that will be printed
320
+ */
321
+ $image_lazyload = apply_filters( 'rocket_lazyload_html', $image_lazyload );
322
+
323
+ return $image_lazyload;
324
+ }
325
+
326
+ /**
327
+ * Returns the HTML tag wrapped inside noscript tags
328
+ *
329
+ * @param string $element Element to wrap.
330
+ * @return string
331
+ */
332
+ private function noscript( $element ) {
333
+ return '<noscript>' . $element . '</noscript>';
334
+ }
335
+
336
+ /**
337
+ * Applies lazyload on srcset and sizes attributes
338
+ *
339
+ * @param string $html HTML image tag.
340
+ * @return string
341
+ */
342
+ public function lazyloadResponsiveAttributes( $html ) {
343
+ $html = preg_replace( '/[\s|"|\'](srcset)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html );
344
+ $html = preg_replace( '/[\s|"|\'](sizes)\s*=\s*("|\')([^"|\']+)\2/i', ' data-lazy-$1=$2$3$2', $html );
345
+
346
+ return $html;
347
+ }
348
+
349
+ /**
350
+ * Finds patterns matching smiley and call the callback method to replace them with the image
351
+ *
352
+ * @param string $text Content to search in.
353
+ * @return string
354
+ */
355
+ public function convertSmilies( $text ) {
356
+ global $wp_smiliessearch;
357
+
358
+ if ( ! get_option( 'use_smilies' ) || empty( $wp_smiliessearch ) ) {
359
+ return $text;
360
+ }
361
+
362
+ $output = '';
363
+ // HTML loop taken from texturize function, could possible be consolidated.
364
+ $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between.
365
+ $stop = count( $textarr );// loop stuff.
366
+
367
+ // Ignore proessing of specific tags.
368
+ $tags_to_ignore = 'code|pre|style|script|textarea';
369
+ $ignore_block_element = '';
370
+
371
+ for ( $i = 0; $i < $stop; $i++ ) {
372
+ $content = $textarr[ $i ];
373
+
374
+ // If we're in an ignore block, wait until we find its closing tag.
375
+ if ( '' === $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
376
+ $ignore_block_element = $matches[1];
377
+ }
378
+
379
+ // If it's not a tag and not in ignore block.
380
+ if ( '' === $ignore_block_element && strlen( $content ) > 0 && '<' !== $content[0] ) {
381
+ $content = preg_replace_callback( $wp_smiliessearch, [ $this, 'translateSmiley' ], $content );
382
+ }
383
+
384
+ // did we exit ignore block.
385
+ if ( '' !== $ignore_block_element && '</' . $ignore_block_element . '>' === $content ) {
386
+ $ignore_block_element = '';
387
+ }
388
+
389
+ $output .= $content;
390
+ }
391
+
392
+ return $output;
393
+ }
394
+
395
+ /**
396
+ * Replace matches by smiley image, lazyloaded
397
+ *
398
+ * @param array $matches Array of matches.
399
+ * @return string
400
+ */
401
+ private function translateSmiley( $matches ) {
402
+ global $wpsmiliestrans;
403
+
404
+ if ( count( $matches ) === 0 ) {
405
+ return '';
406
+ }
407
+
408
+ $smiley = trim( reset( $matches ) );
409
+ $img = $wpsmiliestrans[ $smiley ];
410
+
411
+ $matches = [];
412
+ $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
413
+ $image_exts = [ 'jpg', 'jpeg', 'jpe', 'gif', 'png' ];
414
+
415
+ // Don't convert smilies that aren't images - they're probably emoji.
416
+ if ( ! in_array( $ext, $image_exts, true ) ) {
417
+ return $img;
418
+ }
419
+
420
+ /**
421
+ * Filter the Smiley image URL before it's used in the image element.
422
+ *
423
+ * @since 2.9.0
424
+ *
425
+ * @param string $smiley_url URL for the smiley image.
426
+ * @param string $img Filename for the smiley image.
427
+ * @param string $site_url Site URL, as returned by site_url().
428
+ */
429
+ $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
430
+
431
+ // Don't LazyLoad if process is stopped for these reasons.
432
+ if ( is_feed() || is_preview() ) {
433
+ return sprintf( ' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url( $src_url ), esc_attr( $smiley ) );
434
+ }
435
+
436
+ return sprintf( ' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $this->getPlaceholder(), esc_url( $src_url ), esc_attr( $smiley ) );
437
+ }
438
+
439
+ /**
440
+ * Returns the placeholder for the src attribute
441
+ *
442
+ * @since 1.2
443
+ * @author Remy Perona
444
+ *
445
+ * @param int $width Width of the placeholder image. Default 0.
446
+ * @param int $height Height of the placeholder image. Default 0.
447
+ * @return string
448
+ */
449
+ public function getPlaceholder( $width = 0, $height = 0 ) {
450
+ $width = 0 === $width ? 0 : absint( $width );
451
+ $height = 0 === $height ? 0 : absint( $height );
452
+
453
+ $placeholder = str_replace( ' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E" );
454
+ /**
455
+ * Filter the image lazyLoad placeholder on src attribute
456
+ *
457
+ * @since 1.1
458
+ *
459
+ * @param string $placeholder Placeholder that will be printed.
460
+ * @param int $width Placeholder width.
461
+ * @param int $height Placeholder height.
462
+ */
463
+ return apply_filters( 'rocket_lazyload_placeholder', $placeholder, $width, $height );
464
+ }
 
 
 
 
 
 
 
 
 
465
  }