• Resolved youssef2016

    (@youssef2016)


    Hello,

    Since the last update (6.3), wp_is_mobile() is ignored by LiteSpeed ​​Cache and does wrong behavior (displaying desktop js, css, etc in mobile), I went back to version (6.2.0.1) and the problem went away so I checked That’s the problem with the new update.

    I hope the problem is resolved as soon as possible.

    Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support qtwrk

    (@qtwrk)

    please provide the report number

    you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter youssef2016

    (@youssef2016)

    Report number: IVVFEGKK

    Report date: 07/24/2024 11:22:27

    Plugin Support qtwrk

    (@qtwrk)

    when you say ignored , could you please be more specific what is the full context here ?

    like you have some custom code that uses this function ? I mean , what’s the full story about your usage with it ?

    Thread Starter youssef2016

    (@youssef2016)

    <? if( wp_is_mobile() ) { ?>
    <script src="/Assets/js/mobile.js?v=1.0"></script>
    <? } else { ?>
    <script src="/Assets/js/desktop.js?v=1.0"></script>
    <? } ?>

    I use it like this example, and plugin give me desktop.js on mobile.

    Plugin Support qtwrk

    (@qtwrk)

    now that is weird if you open the same URL with query string like ?test attach to it , does it give correct response ?

    Thread Starter youssef2016

    (@youssef2016)

    Yes, it gives the correct js file

    Plugin Support qtwrk

    (@qtwrk)

    if you do a purge all , then first access on mobile , does it give correct file ?

    Thread Starter youssef2016

    (@youssef2016)

    No, but if I changed the version ?v=1.0 then purge all, first access on mobile gives the correct file

    Plugin Support qtwrk

    (@qtwrk)

    okay , please try , change that ?v=1.0 to something , like v=1.1 or v=2.0

    purge all

    first access on mobile , check the file , refresh page and make sure cache hit

    then open it again in desktop , see what it shows

    then test it reverse , purge all , access on desktop , refresh page and make sure cache hit , then check on mobile again.

    Thread Starter youssef2016

    (@youssef2016)

    <? if( wp_is_mobile() ) { ?>
    <script src="/Assets/js/mobile.js?v=1.0"></script>
    <? } else { ?>
    <script src="/Assets/js/desktop.js?v=1.0"></script>
    <? } ?>

    This code is in header.php file, and it used to display separate js file for mobile & desktop, when I change ?v=1.0 to any version like 1.1 or 1.5, the first access on mobile gives mobile.js and cache hit then on refresh page multiple times it gives desktop.js on mobile, The problem occurs on version (6.3) but if I go back to (6.2.0.1) the problem went away.

    Plugin Support qtwrk

    (@qtwrk)

    that is weird, I am not aware of changes on mobile detection between these 2 version

    please create a ticket by mail to support at litespeedtech.com with reference link to this topic , we will investigate further.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘wp_is_mobile() Problem’ is closed to new replies.