Released: Mobile Smart Plugin for WordPress v0.2

March 22nd, 2010


About the Author

Dan Smart photo
I’m Dan Smart, a 32 year old website developer, based in Swansea, UK. I have worked in the software development industry for over 10 years, with experience in web development, mobile handset development, and mobile networks. My current focus is web development, working freelance with a number of clients, working both on design and implementation of websites and web applications with systems such as Wordpress, Joomla, and CodeIgniter. When I’m not developing websites and software, I am a keen runner, involved with mime performance group Innovo Physical Theatre, and also actively involved in my local church.

* Follow me on Twitter or contact me


Version 0.2 has just been released of the Mobile Smart plugin, which is a plugin to help mobile site development in WordPress.

Download through the WordPress.org plugin repository: http://www.wordpress.org/extend/plugins/mobile-smart/ (note: link will open in new window/tab).

Mobile Smart currently contains the following functionality:

  • Switch your theme to a mobile-ready theme if a mobile device is detected
  • New: Manual Switcher – to allow your user to manually switch between desktop and mobile versions. Available in 3 versions: widget, option to automatically insert into footer, or template tag.
  • Template functions to help determine which tier of mobile device (touch/smartphone/other) is viewing your site, to allow conditional content inclusion.
  • Adds device and tier specific CSS selectors to the body_class, to allow conditional CSS (e.g. so in the same way you have “.single” that you can target “.iphone” or “.mobile-tier-touch”.)

Any feedback gladly welcomed.

10 Responses to “Released: Mobile Smart Plugin for WordPress v0.2”

|
  1. Istvan says:

    Hi, I have found an error in vers. 2.1.25 at line 297 in mobile-smart.php
    “__e” should be replaced with “__” or the plugin won’t save the options.

    Anyway I have fixed that error but accessing my website from Safari (with iPhone user agent) it shows me the default theme. Any idea?

  2. Dan says:

    Thanks Istvan, your debugging is much appreciated. I’ll incorporate this in a fix release shortly.

    Accessing the website from Safari was having problems as the switcher had missed a case and assumed you were also using the footer switcher. I’ve added a fix for that too, and will release this updated version shortly.

    Many thanks for your feedback,

    Dan

  3. Istvan says:

    Hi! I have tested the new version but I’m unable to see the switcher. I have tried it both from the option in the admin panel and inserting the php code in my theme but none showed the link to the mobile version.

    To be honest, I have tried it on a site with Cache enabled but also after many minutes (when cache should have expired) it doesn’t show the link.

    You can maybe install here on you site so we can see how it works… a sort of live demo.

    P.S. in the readme file the is a ‘?’ missing at the end of the php code.

  4. Dan says:

    Thanks again Istvan for your active feedback and participation in this plugin.

    Can you let me know which options you enabled to add the switcher?

    I’ve now got the plugin installed on this site – you can see that currently I have a small bug on the site (rather than with the plugin) when it comes to the blog (I’ve left this bug in deliberately for the moment) – this bug shows that the “Switch to mobile version” link usually appears in the footer, but because of a lack of a cleared div, it pops up at the bottom of the right sidebar – this is sometimes the cause of the problem.

    You can also see that it is implemented inside a div with the id of “mobilesmart_switcher” – you can view the source of your page to show whether it is appearing in there.

    Otherwise, I’m guessing it may be related to the cache.

    Hope this helps – feel free to come back with any responses,

    Dan

  5. Dan says:

    PS I’ve fixed the readme file also, should appear soon in the 0.2.1 version.

  6. Jesse Lane says:

    Using your theme switcher – love the easy way to add the link to “Switch to Desktop Version” on our mobile theme – but after clicking it and then on the Desktop theme clicking a link it goes back to the Mobile Theme.
    Shouldn’t it remember the users choice to view in Desktop Version, at least for that browsing session?

    Also – how can I set the theme to NOT display our mobile theme on a tablet, specifically the iPad?

    Thanks!

    Jesse

  7. Dan says:

    Hi Jesse,

    Yes it should remember the user’s choice to stay in Desktop mode – it has a cookie stored to do that. If you’re happy to send me a link to your website, I can have a look at what’s going on, or email me at dan (at) dansmart.co.uk.

    For the iPad, I’ll have to put together some custom code for you – you’ll have to mod the plugin slightly, so let me know if you’re comfortable doing this, otherwise I can make you a custom bundle. I’m planning on releasing an update soon that’ll add this functionality in by a checkbox, to enable/disable switching on a tablet (iPad etc).

    Best,

    Dan

  8. Jesse Lane says:

    Thanks Dan! Just emailed you.

  9. Philip Jones says:

    Hi Dan,

    Love the plugin. Thanks.

    I am working on functionality so that mobile visitors to my site can, for some pages, be presented with different content to those who use a big-screen browser (desktop/tablet). I’m doing this using a custom field which can contain the address of a mobile-counterpart page.

    My PHP code will check if the custom field is populated (with the alternative page). If so, and if the mobilesmart plugin says that this is a mobile visitor, then switch to that alternative page.

    From your FAQs I’ve got the idea that I use something like:
    if ($mobile_smart->isTierTouch() == MOBILE_DEVICE_TIER_TOUCH)

    But I’m not clear about what tier I need to use for *any* non desktop and non-tablet device. Please can you clarify this for me…

    Thanks,

    Philip

  10. Dan says:

    Hi Philip,

    To achieve what you’re looking for you can do the following:

    if ($mobile_smart->switcher_isMobile())
    {
      // check your field here
    }
    

    I should also note that this functionality will be available in the upcoming premium Mobile Smart Pro plugin, hopefully available within the next week.

    Best,

    Dan

|

Leave a Reply


Switch to mobile version