Php function for mobile or desktop
-
Hi, I created two php functions inserted in functions.php of my theme.
I decided to insert only on mobile a CSS class to the first image to exclude this image from the lazy load.
I created a similar function but only for desktop, by inserting a CSS class to the first three images.
These functions work correctly if I am a logged in user.
If I’m not logged in I don’t see these different CSS classes for mobile and desktop.
I also tried to enable “Cache Mobile”, I cleared the cache. Unfortunately there are no different CSS classes for mobile and desktop.
Why?
Thanks for support
-
Hi,
May I know how did your php detects mobile/desktop ?
Best regards,
I have used
wp_is_mobile()
wordpress hookHi,
I assume it works when LSCWP OFF ?
please enable debug log , do you see line like this ?
h2y] ?? ------GET HTTP/1.1 (HTTPS) / h2y] Query String: h2y] User Agent: Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Mobile Safari/537.36 Edg/87.0.664.55 h2y] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 h2y] Accept Encoding: br,gzip h2y] X-LSCACHE: true h2y] LSCACHE_VARY_VALUE: ismobile+webp
in particular, the last line.
Best regards,
Yes, it works with LSCWP disabled.
This is part of the log you asked me:
?? ------POST HTTP/1.1 (HTTPS) /wp-admin/admin-ajax.php Query String: HTTP_REFERER: https://www.corriereromagna.it/ [Ctrl] X Cache_control -> no Cache ( Admin page ) ?? ------GET HTTP/1.1 (HTTPS) / Query String: HTTP_REFERER: https://www.corriereromagna.it/pwa-sw.js LSCACHE_VARY_COOKIE: wp-postpass_1210fe7aa655465465646 LSCACHE_VARY_VALUE: ismobile [Ctrl] not cacheable before ctrl finalize [Router] get_role: [Vary] role id: failed, guest [Router] get_role: [Core] Silence Comment due to REST/AJAX ?? X-LiteSpeed-Cache-Control: no-cache [Optm] bypass: Not frontend HTML type End response
I also found other code with “LSCACHE_VARY_VALUE” like:
LSCACHE_VARY_VALUE: +webp
LSCACHE_VARY_VALUE: ismobile
I have not found anything like “User Agent”, “Accept Encoding”, “Accept” and “X-LSCACHE”
Sorry, I have debug advanced enabled.
Here is the log:12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] ?? ------POST HTTP/1.1 (HTTPS) /wp-admin/admin-ajax.php 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] Query String: 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] HTTP_REFERER: https://www.corriereromagna.it/ 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] Accept: application/json, text/javascript, */*; q=0.01 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] Accept Encoding: gzip, deflate, br 12/07/20 02:31:44.024 [xx.xx.xxx.xxx:xxx 1 Ue8] X-LSCACHE: true 12/07/20 02:31:44.165 [xx.xx.xxx.xxx:xxx 1 Ue8] [Media] init 12/07/20 02:31:44.165 [xx.xx.xxx.xxx:xxx 1 Ue8] [LQIP] init 12/07/20 02:31:44.165 [xx.xx.xxx.xxx:xxx 1 Ue8] [CDN] init 12/07/20 02:31:44.165 [xx.xx.xxx.xxx:xxx 1 Ue8] ? Task init 12/07/20 02:31:44.165 [xx.xx.xxx.xxx:xxx 1 Ue8] [Router] LSCWP_CTRL bypassed empty 12/07/20 02:31:44.341 [xx.xx.xxx.xxx:xxx 1 Ue8] [Ctrl] X Cache_control -> no Cache ( Admin page ) => LiteSpeed\Control::set_nocache(( Admin page ))@362 => LiteSpeed\Admin->admin_init()@72 => WP_Hook->apply_filters(ARRAY)@287 12/07/20 02:31:44.354 [xx.xx.xxx.xxx:xxx 1 Ue8] [Core] CHK html bypass: miss footer const 12/07/20 02:31:44.354 [xx.xx.xxx.xxx:xxx 1 Ue8] [Ctrl] not cacheable before ctrl finalize 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Router] get_role: 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Vary] role id: failed, guest 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Router] get_role: 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Vary] no custimzed vary 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Core] Silence Comment due to REST/AJAX 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] ?? X-LiteSpeed-Cache-Control: no-cache 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Core] CHK html bypass: miss footer const 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Media] bypass: Not frontend HTML type 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] GUI bypassed by no counter 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] [Optm] bypass: Not frontend HTML type 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] CDN bypass 12/07/20 02:31:44.355 [xx.xx.xxx.xxx:xxx 1 Ue8] End response
I used chrome developer tools to simulate an iPhone
-
This reply was modified 3 years, 11 months ago by
marcorroma.
-
This reply was modified 3 years, 11 months ago by
marcorroma.
Hi,
the above log is for (HTTPS) /wp-admin/admin-ajax.php
please looking for the log of main request.
Best regards,
I’m sorry.
Here is the log, here should be what you ask me:12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] ?? ------POST HTTP/1.1 (HTTPS) /wp-admin/admin-ajax.php 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] Query String: 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] HTTP_REFERER: https://www.mywebsite.com/vigili-del-fuoco-riminesi-in-soccorso-agli-alluvionati-foto/ 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] Accept: application/json, text/javascript, */*; q=0.01 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] Accept Encoding: gzip, deflate, br 12/11/20 12:41:52.223 [151.61.198.53:57658 1 5dU] X-LSCACHE: true 12/11/20 12:41:52.378 [151.61.198.53:57658 1 5dU] [Media] init 12/11/20 12:41:52.379 [151.61.198.53:57658 1 5dU] [LQIP] init 12/11/20 12:41:52.379 [151.61.198.53:57658 1 5dU] [CDN] init 12/11/20 12:41:52.379 [151.61.198.53:57658 1 5dU] ? Task init 12/11/20 12:41:52.379 [151.61.198.53:57658 1 5dU] [Router] LSCWP_CTRL bypassed empty 12/11/20 12:41:52.563 [151.61.198.53:57658 1 5dU] [Ctrl] X Cache_control -> no Cache ( Admin page ) => LiteSpeed\Control::set_nocache(( Admin page ))@362 => LiteSpeed\Admin->admin_init()@72 => WP_Hook->apply_filters(ARRAY)@287 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Core] CHK html bypass: miss footer const 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Ctrl] not cacheable before ctrl finalize 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Router] get_role: 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Vary] role id: failed, guest 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Router] get_role: 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Vary] no custimzed vary 12/11/20 12:41:52.573 [151.61.198.53:57658 1 5dU] [Core] Silence Comment due to REST/AJAX 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] ?? X-LiteSpeed-Cache-Control: no-cache 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] [Core] CHK html bypass: miss footer const 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] [Media] bypass: Not frontend HTML type 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] GUI bypassed by no counter 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] [Optm] bypass: Not frontend HTML type 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] CDN bypass 12/11/20 12:41:52.574 [151.61.198.53:57658 1 5dU] End response -------------------------------------------------------------------------------- 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] ?? ------GET HTTP/1.1 (HTTPS) /vigili-del-fuoco-riminesi-in-soccorso-agli-alluvionati-foto/ 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] Query String: 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] HTTP_REFERER: https://www.mywebsite.com/ 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] Accept: */* 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] Accept Encoding: gzip, deflate, br 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] X-LSCACHE: true 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] LSCACHE_VARY_COOKIE: wp-postpass_1210fe7aab86f3f889015bb505b638c6 12/11/20 12:42:06.924 [151.61.198.53:57658 1 Ytb] LSCACHE_VARY_VALUE: ismobile 12/11/20 12:42:07.006 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.006 [151.61.198.53:57658 1 Ytb] [Media] init 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] [Avatar] init 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] [LQIP] init 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] [CDN] init 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] ? Task init 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] [Router] LSCWP_CTRL bypassed empty 12/11/20 12:42:07.007 [151.61.198.53:57658 1 Ytb] [GUI] init 12/11/20 12:42:07.054 [151.61.198.53:57658 1 Ytb] [Ctrl] X Cache_control init on 12/11/20 12:42:07.441 [151.61.198.53:57658 1 Ytb] [Core] Footer hook called 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Core] Footer check failed: 7-<meta name="generator" content="Powered by WPBakery Page Builder - drag and drop page builder for Wo 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Vary] role id: failed, guest 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] [Vary] no custimzed vary 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] ?? X-LiteSpeed-Cache-Control: public,max-age=259200 12/11/20 12:42:07.460 [151.61.198.53:57658 1 Ytb] ?? X-LiteSpeed-Tag: 080_HTTP.200,080_post,080_URL.98fd58da2f581cb0ae7fa9ccdd7c28b4,080_Po.185337,080_ 12/11/20 12:42:07.463 [151.61.198.53:57658 1 Ytb] [Core] Footer check passed 12/11/20 12:42:07.463 [151.61.198.53:57658 1 Ytb] [Media] finalize 12/11/20 12:42:07.463 [151.61.198.53:57658 1 Ytb] [Media] Lazyload Class excludes --- array ( 0 => 'nolazyload', 1 => 'byline-avatar', ) 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Alluvione_Nonantola-stampa1.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Alluvione_Nonantola-stampa8-125x125.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Alluvione_Nonantola-stampa7-125x125.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Alluvione_Nonantola-stampa6-125x125.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Alluvione_Nonantola-stampa5-125x125.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/e-steps-da-sn-Davide-Giosue-Lippolis-Marco-Di-Felice-Nidhal-Louhichi-Fabrizio-Gaudenzi-400x215.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/bastianini-festa-5-400x267.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/09/calcio-20-400x300.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/render-cerchi-luminosi-400x220.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/04/TAMPONI-COVID19-0772-1-400x300.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2020/12/Tackle_Pagina_1-400x247.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [Media] lazyload found: https://www.mywebsite.com/wp-content/uploads/2019/11/prima-abbonamento.jpg 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 1140x760 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 125x125 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 125x125 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 125x125 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 125x125 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x215 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x267 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x300 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x220 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x300 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 400x247 12/11/20 12:42:07.465 [151.61.198.53:57658 1 Ytb] [LQIP] _generate_placeholder local [size] 170x225 12/11/20 12:42:07.466 [151.61.198.53:57658 1 Ytb] [Media] Iframe Lazyload Class excludes --- array ( 0 => 'fluid-width-video-wrapper', 1 => 'nolazyload', ) 12/11/20 12:42:07.467 [151.61.198.53:57658 1 Ytb] [Media] found iframe: https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Frimini.news.notizie%2F%3Fref%3Dbookmarks&width=103&layout=button_count&action=like&size=large&share=false&height=21&appId=2157063590996897 12/11/20 12:42:07.467 [151.61.198.53:57658 1 Ytb] GUI bypassed by no counter 12/11/20 12:42:07.467 [151.61.198.53:57658 1 Ytb] [Router] get_role: 12/11/20 12:42:07.467 [151.61.198.53:57658 1 Ytb] [Optm] start 12/11/20 12:42:07.468 [151.61.198.53:57658 1 Ytb] [Data] Loaded hash2src [{"inl":true,"src":":root{ --base-gutter:15px;--base-gutter-x2:30px;--thumbnail-radius:0px;--entry-content-max-w:800px;--color-primary:#33b3d3;--color-secondary:#111;--color-tertiary:#19b4cf;--color-primary-start:rgba( 51, 179, 211, 0.95 );--color-primary-end:rgba( 56, 51, 211, 0.95 );--color-primary-start70:rgba( 51, 179, 211, 0.7 );--color-primary-end70:rgba( 56, 51, 211, 0.7 );--color-primary-light:#c2e8f2;--color-primary-light-start:rgba( 194, 232, 242, 0.95 );--color-primary-light-end:rgba( 196, 194, 242, 0.95 );--color-primary-light-start70:rgba( 194, 232, 242, 0.7 );--color-primary-light-end70:rgba( 196, 194, 242, 0.7 );--color-primary5:rgba( 51, 179, 211, 0.05 );--color-primary10:rgba( 51, 179, 211, 0.1 );--color-primary30:rgba( 51, 179, 211, 0.3 );--color-primary50:rgba( 51, 179, 211, 0.5 );--color-primary70:rgba( 51, 179, 211, 0.7 );--color-primary-darken5:#2aa4c3;--color-primary-darken10:#2592ae;--color-primary-darken30:#134c5a;--color-primary-darken50:#010506;--color-primary-darken70:#000000;--color-primary-hue10:#3398d3;--color-primary-hue25:#3370d3;--color-primary-hue50:#3833d3;--gradient:0;--gradient-orientation:diagonal;--gradient-intensity:50;--color-gray:#b0b0b0;--color-gray-hover:#414141;--primary-border-color:#3370d3;--color-border:rgba( 95, 131, 137, 0.1 );--color-border-hover:rgba( 95, 131, 137, 0.65 );--color-border-light:rgba( 255, 255, 255, 0.15 );--bg-gray:#f2f5f6;--bg-light-gray:#f7f9f9;--bg-dark-gray:#eaeaea; }"},{"src":"https:\/\/www.mywebsite.com\/wp-includes\/css\/dist\/block-library\/style.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-slider\/public\/assets\/css\/unslider.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-slider\/public\/assets\/css\/slider.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/call-to-action-for-pwa\/assets\/css\/pwaforwp-button.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/wp-post-blocks\/css\/style.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/pwa-for-wp\/assets\/css\/pwaforwp-main.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/css\/bootstrap.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/css\/themicons.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/css\/flexslider.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/inc\/css\/style.min.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat-child\/style.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/uploads\/newsbeat-child\/css\/custom.css"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/complianz-gdpr\/assets\/css\/cookieconsent.min.css"},{"inl":true,"src":".s-h-m .site-branding-wrapper{ margin-left: 0; text-align: left;}"},{"inl":true,"src":"\n ul li.pwaforwp-installable-btn-class a{\n color:#ffffff !important; \n width:100% !important;\n }\n .pwaforwp-installable-btn-class{\n background: #283593; \n } \n "},{"inl":true,"src":"\n\t\t.twitter-tweet.cmplz-blocked-content-container {\n\t\t\tpadding: 10px 40px;\n\t\t}\n\t"},{"inl":true,"src":"\n\t\t.instagram-media.cmplz-placeholder-element > div {\n\t\t\tmax-width: 100%;\n\t\t}\n\t"}] 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.469 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Util] external 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to js files excluded [hit] adsbygoogle 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to js excluded [hit] adsbygoogle 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.470 [151.61.198.53:57658 1 Ytb] [Optm] _parse_js bypassed due to inline js 12/11/20 12:42:07.471 [151.61.198.53:57658 1 Ytb] [Data] Loaded hash2src [{"src":"https:\/\/www.mywebsite.com\/wp-includes\/js\/jquery\/jquery.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-slider\/public\/assets\/js\/unslider.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-slider\/public\/assets\/js\/jquery.event.move.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-slider\/public\/assets\/js\/jquery.event.swipe.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads\/public\/assets\/js\/advanced.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-responsive\/public\/assets\/js\/script.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-pro\/assets\/advanced-ads-pro.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-pro\/modules\/cache-busting\/inc\/base.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/call-to-action-for-pwa\/assets\/js\/calltoaction-for-pwa.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/advanced-ads-tracking-2.0.0-alpha.3\/public\/assets\/js\/dist\/tracking.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/wp-post-blocks\/js\/script.min.js"},{"src":"https:\/\/www.mywebsite.com\/pwa-register-sw.js"},{"src":"https:\/\/www.mywebsite.com\/wp-includes\/js\/hoverIntent.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/js_composer\/assets\/lib\/bower\/flexslider\/jquery.flexslider-min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/js\/jquery.fitvids.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/js\/bootstrap.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/js\/raf.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/themes\/newsbeat\/js\/custom.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-includes\/js\/comment-reply.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/complianz-gdpr\/assets\/js\/cookieconsent.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/complianz-gdpr\/assets\/js\/postscribe.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-content\/plugins\/complianz-gdpr\/assets\/js\/complianz.min.js"},{"src":"https:\/\/www.mywebsite.com\/wp-includes\/js\/wp-embed.min.js"}] 12/11/20 12:42:07.472 [151.61.198.53:57658 1 Ytb] [CSS] existing ccss /home/mywebsite.com/public_html/wp-content/litespeed/ccss/post.mobile.css 12/11/20 12:42:07.477 [151.61.198.53:57658 1 Ytb] CDN bypass 12/11/20 12:42:07.477 [151.61.198.53:57658 1 Ytb] End response -------------------------------------------------------------------------------- 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] ?? ------POST HTTP/1.1 (HTTPS) /wp-admin/admin-ajax.php 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] Query String: 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] HTTP_REFERER: https://www.mywebsite.com/vigili-del-fuoco-riminesi-in-soccorso-agli-alluvionati-foto/ 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] Accept: application/json, text/javascript, */*; q=0.01 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] Accept Encoding: gzip, deflate, br 12/11/20 12:42:08.130 [151.61.198.53:57658 1 KYA] X-LSCACHE: true 12/11/20 12:42:08.254 [151.61.198.53:57658 1 KYA] [Media] init 12/11/20 12:42:08.254 [151.61.198.53:57658 1 KYA] [LQIP] init 12/11/20 12:42:08.254 [151.61.198.53:57658 1 KYA] [CDN] init 12/11/20 12:42:08.254 [151.61.198.53:57658 1 KYA] ? Task init 12/11/20 12:42:08.254 [151.61.198.53:57658 1 KYA] [Router] LSCWP_CTRL bypassed empty 12/11/20 12:42:08.406 [151.61.198.53:57658 1 KYA] [Ctrl] X Cache_control -> no Cache ( Admin page ) => LiteSpeed\Control::set_nocache(( Admin page ))@362 => LiteSpeed\Admin->admin_init()@72 => WP_Hook->apply_filters(ARRAY)@287 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Core] CHK html bypass: miss footer const 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Ctrl] not cacheable before ctrl finalize 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Router] get_role: 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Vary] role id: failed, guest 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Router] get_role: 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Vary] no custimzed vary 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Core] Silence Comment due to REST/AJAX 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] ?? X-LiteSpeed-Cache-Control: no-cache 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Core] CHK html bypass: miss footer const 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Media] bypass: Not frontend HTML type 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] GUI bypassed by no counter 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] [Optm] bypass: Not frontend HTML type 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] CDN bypass 12/11/20 12:42:08.415 [151.61.198.53:57658 1 KYA] End response --------------------------------------------------------------------------------
Hi,
I think it correctly detects the mobile page by this log
LSCACHE_VARY_VALUE: ismobile
where is your CSS inserted ? it’s inline CSS ? or separated CSS file or something ?
please try reset to default and only enable mobile cache , and see how it goes
best regards,
Hello!
The code is a php function inserted in the functions of my theme.
Can you replicate the problem on your test site?Hi,
I am not sure how to “replicate” it on my site…
Is it possible you can provide the code you used so we can have better understanding ?
or please try add this check , see if LSCWP actually correctly detected mobile
Best regards,
Can I send you the code privately?
Hi,
sure , please send mail to
support at litespeedtech.com
with reference link to this post
Best regards,
-
This reply was modified 3 years, 11 months ago by
- The topic ‘Php function for mobile or desktop’ is closed to new replies.