Support » Plugins and Hacks » Black Studio Touch Dropdown Menu » [Plugin: Black Studio Touch Dropdown Menu] Decide with wp_is_mobile() if plugin adds code at all?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marco Chiesi

    (@marcochiesi)


    This can be generally a good idea, but it has a major drawback. It doesn’t work if the site is using a page caching plugin (W3 Total Cache, WP Super Cache, and similar). In that case the wp_is_mobile() is called only when a user visits a page for the first time, while the following requests for the same page would be served from the cache without checking if it’s a mobile device or not.
    Maybe I could add an option or filter hook to manually allow the activation of server-side device detection, so that WordPress admins can use it. Or alternatively I could enable it by default and add an auto-detection for the most popular caching plugin, that disables the server-side device detection if needed.
    What do you think about it?

    You are right about the caching plugins problem.

    Would then suggest to only add an option/filter for admins via function.php

    Would not recommend to enable by default and detect popular plugins.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Black Studio Touch Dropdown Menu] Decide with wp_is_mobile() if plugin adds code at all?’ is closed to new replies.