Support » Plugin: WP Statistics » Error After Update (parse-user-agent.php)

  • Resolved ensiyeh


    Good day,
    I have been using this plugin with no problems for a while now but since the new update I started getting blank page on my site which I noticed was for this plugin. I have deleted the plugin and installed the new version and this is the error I receive trying to activate it:
    Fatal error: Function name must be a string in /…/wp-content/plugins/wp-statistics/includes/functions/parse-user-agent.php on line 123

    Can you please help me resolve this.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Some of error from error-log

    Lost connection to MySQL server during query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_date DESC LIMIT require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    PHP Fatal error: Function name must be a string in /…./wp-content/plugins/wp-statistics/includes/functions/parse-user-agent.php on line 123

    Plugin Contributor Greg Ross


    What version of PHP are you running? What version of WP Statistics did you upgrade from?

    The first part of the error above (the Lost connection part) isn’t related to WP Statistics.


    I am also getting the same error at

    Plugin could not be activated because it triggered a fatal error.
    Fatal error: Function name must be a string in /…/wp-content/plugins/wp-statistics/includes/functions/parse-user-agent.php on line 123

    Plugin version: 9.3.1


    Running PHP version: 5.4.41

    Currently I have 9.3.1 installed. I am not sure what the previous one was.

    Plugin Contributor Greg Ross


    Can you try disabling your other plugins?

    Also try the following:

    1. Create a “test.php” file in the “wp-statistics/includes/functions” folder in your WP plugins directory.

    2. Add the following to the test.php:

    include( 'parse-user-agent.php' );
    print_r( parse_user_agent() );

    3. Access the file in a browser:

    http://[Your site name]/wp-content/plugins/wp-statistics/includes/functions/test.php

    It should output something like:

    Array ( [platform] => Windows [browser] => Firefox [version] => 38.0 )

    Hi Greg,

    I tried disabling all other plugins, it’s still not working.

    As for the PHP file it isn’t giving any output.

    Plugin Contributor Greg Ross


    Can you check your PHP error log and see if the script generated the same error as the plugin?

    If it did, it may be a bug in the version of PHP, does your hosting provider offer a newer version of PHP you can try?

    Plugin Contributor Greg Ross


    Also check to see if your PHP install has eAccelerator.

    Plugin Contributor Greg Ross


    Closing due to inactivity.

    I’m having this same error. Tried test.php as you mentioned here. Getting blank page for that.
    I’m running on php 5.4.42

    Any help will be appreciated.

    I replaced the “parse-user-agent.php“with another file from ver 7.0 ( and everything is working fine now.

    Hope this may help someone.

    Plugin Contributor Greg Ross


    Libin: are you using eAccelerator? If so it’s a bug in eAccelerator.

    If not, can you try a different version of PHP from your hosting provider?

    eAccelerator is not installed. I think 5.4.42 is a stable version. I will try to get a new php version.

    I changed the php version and It is fine. Ran into some other problems with the theme wich I am working on. Thanks for the help.

    Plugin Contributor Greg Ross


    @ensiyeh: No problem, there seems to be a bug with anonymous functions in PHP 5.4.? but I can’t reproduce it on my 5.4 install so it’s hard to track down.

    @libin: Let me know if you have any success with the new version.

    I’m going to do some work on the user parsing code to get rid of the anonymous function call and submit it back to the original author of the library.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Error After Update (parse-user-agent.php)’ is closed to new replies.