WordPress.org

Ready to get started?Download WordPress

Forums

Device Theme Switcher
[resolved] Reliability of user agent sniffing (8 posts)

  1. AndrewMunro
    Member
    Posted 2 years ago #

    First of, great plugin. I love how simple it is. I've just been on a 3 hour mission, installing every mobile detection script plugin I could get my hands on, and every single ones littered my admin with undefined indexes, deprecated functions and all sorts. Not yours though!

    I've done a lot of reading and the general consensus is that user agent sniffing is not a good method of detection as devices can easily spoof other devices to get around and all sorts. What are your thoughts on this? Is it our only option at the moment?

    http://wordpress.org/extend/plugins/device-theme-switcher/

  2. James Mehorter
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andrea,

    First off, thank you! Secondly - I'm sorry I'm just now seeing this post (2 weeks later) guess I'm not getting these support posts in my email anymore :( Will have to look into that.

    To your question.. UserAgent sniffing does indeed have it's caveats; agent strings change all the time, new ones are introduced, sometimes they are no completely accurate... and so on. However, at this time that is the only reliable method for detecting what device a user is on. The only other method is to detect the user's device width. Which is even more problematic.. for instance the iPad 3 resolution is larger than my desktop monitor :\

    Device Theme Switcher uses the MobileESP library to ascertain the users device based on the UserAgent String in the users browser. And I've found that the library is usually up-to-date, and does a great job of determining oddballs like Opera browser which has a nearly identical UserAgent on desktops and handhelds.

    Until it's mandatory for devices to identify themselves in a simpler mannor these are the methods we're stuck using. Let me know your thoughts!

    James

  3. Aaron
    Member
    Posted 2 years ago #

    my client who I created a web site for using this plugin is complaining that some of the older OS7 Blackberries are not getting picked up and shown the mobile site...

    Have you experienced this in your testing or has anyone else encountered this issue?

  4. James Mehorter
    Member
    Plugin Author

    Posted 2 years ago #

    Aaron, in the future please start a new support thread instead of piggybacking on another - they're two different topics.

    Moving on.. I have not heard anything about OS7 Blackberries not being detected. I will submit a ticket to the guys at MobileESP to check it out. Can you give me any more specifics about which Blackberry phones / OS's your client has noticed this on?

  5. AndrewMunro
    Member
    Posted 2 years ago #

    Thank you for the clarification on this. Looks like we're stuck with user agent sniffing then :) FYI just saw this notice appear since upgrading to 3.4 and activating your plugin.

    Notice: get_themes is deprecated since version 3.4! Use wp_get_themes() instead. in /wp-includes/functions.php on line 2705

  6. James Mehorter
    Member
    Plugin Author

    Posted 2 years ago #

    Hi again Andrea,

    Thanks for pointing that out. We're in the process of updating the plugin for WP 3.4 and including the latest MobileESP version. You can expect an update coming soon!

    Thanks,

    James

  7. AndrewMunro
    Member
    Posted 2 years ago #

    Thank you very much. And it's Andrew :)

  8. James Mehorter
    Member
    Plugin Author

    Posted 2 years ago #

    ANDREW! Sorry :\ .. I type to an Andrea quite often, my bad!

    I've released version 1.6 of Device Theme Switcher, which is updated to use the new Themes API, and corrects that PHP Notice you were seeing. Thanks again!

    James

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.