• Resolved hommealone

    (@hommealone)


    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://www.ads-software.com/plugins/php-browser-detection/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    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

    (@hommealone)

    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.

    (@mindshare)

    Probably you didn’t get the new version. Please double check.

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    Actually, hang on I might have forgot to push a file…

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    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

    (@hommealone)

    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

    (@hommealone)

    After that update, my entire site crashed, including the admin back-end.

    Thread Starter hommealone

    (@hommealone)

    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

    (@hommealone)

    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.

    (@mindshare)

    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 www.ads-software.com, is always available directly from the repo: https://www.ads-software.com/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

    (@hommealone)

    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

    (@hommealone)

    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.

    (@mindshare)

    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.