Skip to:

new performance testing plugin: Browser Timer

  • _ck_


    This is a very early beta release for advanced users who may find it useful.

    (works in 0.9 and 1.x)

    example log:

    While my bb-benchmark plugin will tell you how long it’s taking your server to make pages, you really have no idea how long it’s taking your users to browse your forums and see those pages.

    ie. 200ms on the server side may be 5 seconds with javascript on the visitors side

    You can time your own browser, but often you have many things already cached and might use a faster browser or live much closer to your server than someone else across the country or the other side of the world.

    So now you can know exactly how long it’s taking for them to see your pages.

    It’s very accurate in my testing, within 100ms typically.

    Basically it works by using a sort of “round trip” timer.

    You can add a geo-location database and it will tell you what country the visitor is in, which helps to understand why a time may be so high/low.

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

  • _ck_


    Once properly configured and running, administrators can get easy access to the log by just adding ?browsertimer to the forum url.

    The view right now is very basic and looks like this:

    I’ve done some fancy parsing of the user-agent to attempt to strip it down to the useful bits. (in the example the IP addresses are partially obscured for visitor privacy)



    Currently there are only four settings and all but the first are optional.

    Edit the top of the plugin to see them:


    That is where the log is kept.

    Obviously the directory must be chmod 777 on your server.

    For that reason I STRONGLY recommend you put it ABOVE the web root.

    The default setting will do that:


    but since it may confuse people, adjust it as you will.

    ie. /home/username/public_html/

    is the webroot on many servers but not all by any means

    you could in theory make


    and chmod 777 that directory, and it will work with the default setting.


    This setting just throws away entries longer than 20 seconds or less than 100ms which are typically bogus. For example Google has a nasty habit now of parsing javascript no matter how obfuscated it may be to extract URLs, and sure enough it will follow the browser timer, giving you really high, weird numbers.


    This allows you to control what pages are timed.

    I’d leave it alone for now but someone may have specific interest in mind.


    This is where the geo-location magic happens, it’s optional, and will tell you what country the visitor is in with about 90% accuracy.

    false = country lookup off

    or set it to ='ip2c';

    and download this program called IP2C

    extract these two files and put them in the same directory:


    (ip-to-country.bin is very large, it’s one big database)




    I have an account on

    My home directory is

    So, I figured that this should be my setting in browser-timer.php


    I set the permission for browser-timer to 777.

    I created a file called browsertime.log

    But when I go to , I get log open error

    Is it just me?





    Ah, you almost have the log location concept but not quite.

    I am going to assume you are trying to put the log file in the same directory as the plugin. I really don’t advise this at all for security reasons but if you are just doing short term testing and will delete it later it could be temporarily acceptable.

    So, in that case my-plugins/browser-timer/ must be chmod 777

    (the sub-directory /browser-timer/ I mean)

    Now is the path to the file really


    Because that doesn’t seem quite right. I see it’s off a subdomain but still, I’ll not certain.

    Try changing


    to just plain


    (don’t forget leave the dot afterwards)

    If that doesn’t work, what’s the full path to my-plugins/browser-timer/ that you see in your FTP program (if it hopefully shows the full path). If not, we can take a peek at phpinfo.

    What I’d really rather see is you putting the log in a subdirectory ABOVE your web root (aka Document Root).

    But give that a try for now and let me know.



    By the way, your site is using 69 queries on the front page, that is VERY very bad. Something is wrong. It’s probably not loading all your options at once and some other issues that 1.0 has.

    You probably should be focusing on bb-benchmark instead of this plugin.

    Also make sure you install this mini-plugin to try to reduce the queries:



    Hello again.

    I cannot get it to work yet. Jolly well!

    So, my Filezilla path is: /

    But my FTP is

    I have changed this to what you’ve told me: $browsertimer['log']=$_SERVER['DOCUMENT_ROOT'].'/'

    Then I’ve tried the other option as well: $browsertimer['log']=$_SERVER['DOCUMENT_ROOT'].'/'

    I thought that I might have been on to something. But I wasn’t.

    Thank you for your help, again!





    Your server must have some fancy virtual host mapping.

    By the way I just noticed you said this “I created a file called browsertime.log”

    delete that file you made because it may have permissions that PHP cannot modify for some reason depending on your host – let the PHP code make the file

    Well we can take the lazy way out:


    That should almost certainly work and be right in the plugin directory.



    I have deleted the .log file. I’ve made the modifications in browser-timer.php


    The weird thing is that I can no longer see the .log file being created and I get the same log open error

    My permissions on the folder are 777, as I said before.

    Another thing is that I am getting a 550 Permission Denied in Filezilla when I try chmod, but it’s ok in their filemanager. Even Filezilla tells me that I have 777.

    Any other ideas?




    Okay let’s assume the host is doing something weird.

    Make a temporary file in the same directory that you want the log to be.

    ie. test.php

    put this in the file

    <?php echo __FILE__; ?>

    Then access it from the web, ie.

    Whatever it shows you, change the ending test.php part to browsertimer.log

    and then put it inside

    $browsertimer['log']='full line here';

    Now that has to work, as long as the my-plugins/browser-timer/ directory is chmod 777.



    Oh and it just dawned on me.

    If you have an empty log (ie. no visitors) you’ll always get an open log error.

    So be sure to load the front page as a test first.



    Well, now this is…interesting.

    I uploaded the test.php


    I get this: `Internal Server Error</p>

    <p>Directory “(removed for security)/” is writeable by group`

    Which had one good thing to it: it gave me my server directory.

    But anyhow, after that I tried again the I discovered that is working, without the extra modification that you’ve suggested.

    Simply $browsertimer['log']=dirname(__FILE__).'/browsertimer.log'; and it worked.

    I obviously modified the line to $browsertimer['log']='(removed for security)/'; and it worked just as well.

    Now, my uneducated conclusion was that as long as I had one file called browsertimer.log in my entire forum folder the two expression would output the same result. The 2nd on the other hand is the best one.

    What would your conclusion be?

    Thank you anyway.





    Ah, your server has some kind of security option that does not allow code to execute directly from chmod 777 directories.

    The first option would actually work better as far as not knowing the real directory or if you ever changed servers or directory names

    ie. $browsertimer['log']=dirname(__FILE__).'/browsertimer.log';

    Sorry this took so long to get going for you but don’t forget to work on why the queries are so high, that’s far more important.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar