Title: Trouble getting browser version
Last modified: August 22, 2016

---

# Trouble getting browser version

 *  Resolved [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/)
 * Hi,
 * $browser_version is generating 0.0 instead of current browser version.
 * In my functions.php file I have a little function to print javascript variables
   into the head of the document so they’ll be available to other scripts. It is
   intended to pass the browser name and version to my js script.
 * It is working partially; it prints the script tag into the head and gets the 
   browser name right, but shows the browser version as 0.0 instead of the current
   version. Can anyone spot what is wrong, or help me to troubleshoot the problem?
 * Here is the code from my functions file:
 * _________________
 *     ```
       // add js variables to the head
       // Add content to wp_head()
       function oursitename_head_script() {
       	global $browser_name, $browser_version;
       	$browser_name = get_browser_name();
       	$browser_version = get_browser_version();
           echo '<script type="text/javascript">var browserName = "'.$browser_name.'"; var browserVersion = "'.$browser_version.'";</script>';
           echo PHP_EOL;
       }
       add_action( 'wp_head', 'oursitename_head_script' );
       ```
   
 * _____________
 * The site is: bestofyourtown.com
 * Thanks!
 * [https://wordpress.org/plugins/php-browser-detection/](https://wordpress.org/plugins/php-browser-detection/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867920)
 * Hi hommealone,
 * This is now fixed, try the new version that I’m uploading right now. Should be
   available in a few minutes. Thanks for reporting the issue!
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867923)
 * Hi,
 * I just updated the plugin to the new version and I’m afraid I’m still getting
   0.0
 * Sorry…
 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867925)
 * Probably you didn’t get the new version. Please double check.
 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867926)
 * Actually, hang on I might have forgot to push a file…
 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867927)
 * Nope I just made sure. The current version on WP.org is fixed. Please delete 
   the old plugin and completely reinstall it to be sure.
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867931)
 * After my update 10 minutes ago, my plugins page now shows that I have version
   3.1.2 and that 3.1.3 is now available. Will update to that and let you know…
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867932)
 * After that update, my entire site crashed, including the admin back-end.
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867936)
 * Hey guys, I need a working version of the plugin. Can you send me an old version
   via email please so I can get my site back? I don’t care if the version is reported
   wrong for the time being! paul [at] insitewebsite (dot) com
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867941)
 * Hey folks,
 * You put a faulty version of your plugin on line; let me know that it was available;
   heard that I was having trouble with it; then left for the weekend? Not cool.
 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867946)
 * Hey there! We definitely don’t mean to leave you hanging but let’s clarify one
   thing first: this is free software and we aren’t responsible for anything that
   happens to your site.
 * That said, every previous version of this, and every other plugin on WordPress.
   org, is always available directly from the repo: [https://wordpress.org/plugins/php-browser-detection/developers/](https://wordpress.org/plugins/php-browser-detection/developers/)
 * So feel free to roll back to any previous version. The issue you are describing
   is likely either that you are using an older PHP version or that the plugin is
   causing your hosting account to run out of memory. If you provide any more info
   we can try and help you debug that. But please don’t be so accusatory about the
   completely unpaid work we put in to this project.
 * Try deactivating all other plugins and temporarily activating the default WordPress
   theme. If the plugin still causes an error then it is indeed a bug. Otherwise
   the issue probably lies someplace else. If using the default theme and no other
   plugins still results in a fatal error let us know what PHP version you have 
   and how much ram you have accessible.
 * Thanks.
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5867947)
 * Thanks, and please understand that I do greatly appreciate that you’ve made this
   plugin and made it freely available. When you put the update online, told me 
   about it, heard that I had trouble, and then stopped responding on a Friday evening,
   I panicked and got flustered, what with a white screen where my website had been
   and all. Sorry for my over-reaction. Thanks for the plugin and for getting back
   to me.
 * Thanks for pointing me at the repository for the previous version; exactly what
   I needed for a temporary rollback.
 * I am running PHP version 5.4.37 ( so,above the V. 5.3 required).
 * Will try again over the weekend or Monday to upgrade to the latest version and
   will let you know if I run into a problem again.
 * Thanks again,
    – hommealone
 *  Thread Starter [hommealone](https://wordpress.org/support/users/hommealone/)
 * (@hommealone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5868004)
 * Happy to report that I’ve updated successfully to version 3.1.3 and everything
   is working.
 * Thanks again!
    – hommealone
 *  Plugin Author [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * (@mindshare)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5868020)
 * Glad you figured the issue.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Trouble getting browser version’ is closed to new replies.

 * ![](https://ps.w.org/php-browser-detection/assets/icon-256x256.png?rev=999338)
 * [PHP Browser Detection](https://wordpress.org/plugins/php-browser-detection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-browser-detection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-browser-detection/)
 * [Active Topics](https://wordpress.org/support/plugin/php-browser-detection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-browser-detection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-browser-detection/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [Mindshare Labs, Inc.](https://wordpress.org/support/users/mindshare/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/trouble-getting-browser-version/#post-5868020)
 * Status: resolved