Third Mind | PHP Browser Detect plugin
2565
post-template-default,single,single-post,postid-2565,single-format-standard,ajax_leftright,page_not_loaded,,qode-title-hidden,side_area_uncovered_from_content,transparent_content,qode-child-theme-ver-1.0.0,qode-theme-ver-10.0,wpb-js-composer js-comp-ver-4.12,vc_responsive

PHP Browser Detect plugin

Word Press plugin: PHP Browser Detect

Great plugin if you want to detect a specific browser and/or browser version. An example of using this plugin would be upon detecting the browser version to ask the user to upgrade their browser version to support content on a page.

This was used on IDF’s video page http://www.primaryimmune.org/idf-reel-stories/. The page is using a plugin that has display issues with IE9 and earlier. We took it a step farther and not only sniffed for browser version but also post ID. The template for the page was being used for other pages on the site and we didn’t want the message to pop up for all pages, only the video page.

How to Use
Download and active the plugin. Grab a php snippet from the plugin website that matches your needs. Place it on the .php template page. View snippets here. Basically the code is an IF statement. For IDF I just had it echo an html string to prompt users to upgrade. I used Browserstack.com to test it out.

You can also sniff for specific devices with this plugin. Example, if site is being viewed on iPhone or iPad.