This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 3
3
🚀 A PHP library that aims to help you concentrate on web performance optimization.
4
4
5
5
- ** Package** : [ @shinsenter/defer .php] ( https://packagist.org/packages/shinsenter/defer.php )
6
- - ** Version** : 2.2 .0
6
+ - ** Version** : 2.4 .0
7
7
- ** Author
** : Mai Nhut Tan
< [email protected] >
8
8
- ** Copyright** : 2021 AppSeeds < https://code.shin.company/ >
9
9
- ** License** : [ MIT] ( https://raw.githubusercontent.com/shinsenter/defer.php/master/LICENSE )
@@ -383,7 +383,9 @@ Only few options of this library are applicable to AMP pages (minifying HTML con
383
383
384
384
### Laravel package
385
385
386
- Under development.
386
+ [ https://github.com/shinsenter/defer-laravel/ ] ( https://github.com/shinsenter/defer-laravel/ )
387
+
388
+ 🚀 A Laravel package that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.
387
389
388
390
389
391
## Support my activities
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ public function skipLazyloading($attr = 'src')
229
229
230
230
if (!empty ($ value )) {
231
231
foreach ($ blacklist as $ keyword ) {
232
- if (strstr ($ value , $ keyword ) !== true ) {
232
+ if (strstr ($ value , $ keyword ) !== false ) {
233
233
return true ;
234
234
}
235
235
}
@@ -243,7 +243,7 @@ public function skipLazyloading($attr = 'src')
243
243
244
244
if (!empty ($ text )) {
245
245
foreach ($ blacklist as $ keyword ) {
246
- if (strstr ($ text , $ keyword ) !== true ) {
246
+ if (strstr ($ text , $ keyword ) !== false ) {
247
247
return true ;
248
248
}
249
249
}
Original file line number Diff line number Diff line change @@ -287,7 +287,9 @@ public function lazyload()
287
287
{
288
288
// Only defer when it is a CSS node
289
289
// and "onload" attribute is not provided
290
- if (!$ this ->isCss () || $ this ->node ->hasAttribute ('onload ' )) {
290
+ if (!$ this ->isCss () ||
291
+ $ this ->node ->hasAttribute ('onload ' ) ||
292
+ $ this ->skipLazyloading ('href ' )) {
291
293
return false ;
292
294
}
293
295
Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ public function shouldLazyload()
195
195
*/
196
196
public function lazyload ()
197
197
{
198
- if ($ this ->isDeferJs () || $ this ->isCriticalJavascript ()) {
198
+ if ($ this ->isDeferJs () ||
199
+ $ this ->isCriticalJavascript () ||
200
+ $ this ->skipLazyloading ('src ' )) {
199
201
return false ;
200
202
}
201
203
Original file line number Diff line number Diff line change 68
68
'iframe_placeholder ' => 'about:blank ' ,
69
69
70
70
// Splash screen
71
- 'custom_splash_screen ' => '' ,
71
+ 'custom_splash_screen ' => '<div id="loading"></div> ' ,
72
72
73
73
// Blacklists
74
+ 'ignore_lazyload_paths ' => [
75
+ 'jquery ' ,
76
+ ],
74
77
'ignore_lazyload_css_class ' => [
75
78
'zoom-lens ' ,
76
79
],
You can’t perform that action at this time.
0 commit comments