WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Mindshare Labs, Inc. v3.1.8

PHP Browser Detection

PHP Browser Detection is a WordPress plugin used to detect a user's browser. Please report any bugs on the support forums.

PHP Browser Detection

The facts

Rating
4.1★ from 16
Active installs
600+
Price
Free
Last updated
8 Sep 2015
Added
Jan 2010
Tested up to
WP 4.3.34
Downloads
46,888

Our analysis

AI-assisted

PHP Browser Detection is a WordPress plugin designed to identify the user's browser and device type. It allows you to implement conditional logic in your site, such as serving different CSS files for Internet Explorer or displaying tailored content based on the user's device. The plugin provides various template tags for checking specific browsers and devices, including desktops, tablets, and mobile phones.

This plugin is suitable for developers or site owners who need to customise their site's appearance or functionality based on the user's browser or device. It can help improve user experience by ensuring that content is displayed correctly across different platforms.

Best for: This plugin suits developers looking to enhance user experience based on browser detection.

What it does well

  • Detects various browsers and devices
  • Supports conditional CSS and content display
  • Includes template tags for easy integration

Where it falls short

  • Last updated in September 2015
  • Tested up to WordPress 4.3.34
  • Automatic updates for browscap.ini are disabled

Verdict

PHP Browser Detection offers useful functionality for customising content based on browser type, but its outdated status may limit its effectiveness with newer WordPress versions.

From the developer

Mindshare Labs, Inc.'s own description of PHP Browser Detection, lightly tidied.

Version 3 adds support for is_tablet(), is_desktop(), and is_browser() as well as numerous bug fixes and code improvements. As of version 3.1.2 automatic updates of browscap.ini are disabeld until we can deal with memory usage issues.

PHP Browser Detection is a WordPress plugin used to detect a user’s browser. It can be used to send conditional CSS files for Internet Explorer, display different content or custom messages anywhere on the page, or to swap out Flash for an image for iPhones.

Template Tags:

Test for specific browsers:

$version is optional. Include a major version number, a single integer – 3,4,5, etc… Or leave it empty to test for any version.

<?php if(is_firefox($version)) { /* your code here */ }; ?>

<?php if(is_safari($version)) { /* your code here */ }; ?>

<?php if(is_chrome($version)) { /* your code here */ }; ?>

<?php if(is_opera($version)) { /* your code here */ }; ?>

<?php if(is_ie($version)) { /* your code here */ }; ?>

<?php if(is_browser($name, $version)) { /* your code here */ }; ?>

Check for mobile, tablet, iPhone, iPad, iPod, etc…

<?php if(is_desktop()) { /* your code here */ }; ?>

<?php if(is_tablet()) { /* your code here */ }; ?>

<?php if(is_iphone($version)) { /* your code here */ }; ?>

<?php if(is_ipad($version)) { /* your code here */ }; ?>

<?php if(is_ipod($version)) { /* your code here */ }; ?>

<?php if(is_mobile()) { /* your code here */ }; ?>

Check for greater than / less than a specific version…

Less than or equal to Firefox 19:
< ?php if(is_firefox() && get_browser_version()

Less than or equal to IE 10:
< ?php if(is_ie() && get_browser_version()

Greater than or equal to Safari 4:
= 4) { /* your code here */ }; ?>

these are just a few examples, but this syntax will work for any browser or version.

Check specific versions…

Is the browser IE6?

Is the browser IE10?

Read the full description on the official page →

Tagged as