bstat Beta 1 Release

UPDATE: bstat has been updated.

I’ve finally added a clean admin interface to my bstat WordPress stats tracking plugin and cleaned up the code for release as a public beta.

Quick Start Installation

  • Download and unzip bstat.zip
     
  • Place bstat.php in you wp-content/plugins directory
     
  • Place spacer.gif in your wp-content directory
     
  • Log in to your WordPress admin panel and activate the plugin, then visit the new bstat submenu of the options tab. This will allow bstat to create its database tables.
     
  • Add the bstat_hitit function to the footer.php of your theme (or in some other place where it will be called once for each page load). This starts the counting; you can see the results in the bstat submenu of the manage tab of the WordPress admin panel.

In order to view the bstat results on your public pages, you’ll need to the bstat display functions to your pages.

Using bstat Functions

  • bstat_hitit

It is essential that bstat_hitit be activated once (and only once) for every page load. In most themes (including the default and classic), it works perfectly when added to the bottom of the footer.php file.

<?php // this is the part that makes the bstats plugin work...
	global $id;
	if (is_home()) $id = 0;
	bstat_hitit($id, “read”);
	?>

(be careful of any “curly quotes” that might have been inserted in code samples)

Other functions are used to display lists of top stories, recently commented stories, recent comments, recent incoming search terms, etc. Most of these functions take similar arguments and output their results in similar ways.

Today’s Stats

  • bstat_todaypop
  • bstat_todayrefs

The functions bstat_todaypop and bstat_todayrefs each take the same arguments.

Usage:
bstat_todaypop({count}, “{before}”, “{after}”);

count is the total number of results to output
before is a string to output before each result
after is a string to output after each result

Example:

<h2>Today's Most Popular</h2>
<ul><?php bstat_todaypop(15, “<li>”, “</li>\n”); ?></ul>

Recent Stats

  • bstat_recentpop
  • bstat_recentrefs

The functions bstat_recentpop and bstat_recentrefs each take the same arguments.

Usage:
bstat_recentrefs({count}, “{days}”, “{before}”, “{after}”);

count is the total number of results to output
days is the number of days back to look
before is a string to output before each result
after is a string to output after each result

Example:

<h2>Incoming Search Terms This Week</h2>
<ul><?php bstat_recentrefs(15, 7, “<li>”, “</li>\n”); ?></ul>

Recent Discussion

  • bstat_discussionbypost
  • bstat_discussionbycomment

The functions bstat_discussionbypost and bstat_discussionbycomment each take the same arguments.

Usage:
bstat_discussionbypost({count}, “{before}”, “{after}”);

count is the total number of results to output
before is a string to output before each result
after is a string to output after each result

Example:

<h2>Incoming Search Terms This Week</h2>
<ul><?php bstat_discussionbypost(15, “<li>”, “</li>\n”); ?></ul>

Special Functions

  • bstat_refsforpost

Usage:
bstat_refsforpost({post_id}, “{before}”, “{after}”);

post_id is the post_id for the story, usually provided by a WP variable
before is a string to output before each result
after is a string to output after each result

Example:

<h3>Top incoming search terms for this post</h3>
<small><?php bstat_refsforpost($id, “ ”, “ -”); ?></small>
  • bstat_pulse

Usage:
bstat_pulse({post_id}, {max_width});

post_id is the post_id for the story, usually provided by a WP variable
max_width is the maximum width the graph maw run

Example:

<h3>Story pulse</h3>
<div style='height: 110px; text-align:center;'>
<?php echo bstat_pulse($id, 525); ?></div><br />

Function Descriptions

  • bstat_hitit

    The hamster on a wheel that makes it all work. It records hits for each page load, and hits for each incoming search term.
     

  • bstat_todaypop

    displays top stories for today only.
     

  • bstat_recentpop

    displays top stories for the past x days. This function reveals more useful data on sites with low traffic, but is somewhat slower than bstat_todaypop.
     

  • bstat_todayrefs

    displays top incoming search terms for today only.
     

  • bstat_recentrefs

    displays top incoming search terms for the past x days. This function reveals more useful data on sites with low traffic, but is somewhat slower than bstat_todayrefs.
     

  • bstat_refsforpost

    displays all incoming search terms for a specific post.
     

  • bstat_discussionbypost

    displays recently commented posts. Each post will appear only once.
     

  • bstat_discussionbycomment

    displays recent comments (and commenter). Better on sites with lots of community interaction.
     

  • bstat_pulse

    displays the “pulse” graph of hits over time.

Options

The bstat submenu of the options tab has two configurable settings:

  • Make accurate pulse graphs

    The graphs look best when you’ve got a few months of history to feed them. To fill out the graphs for new stories (and when you’re new to bstat), the pulse function will do some simple interpolation. The question here is if you want it to look jittery (and somewhat less accurate) or smooth (and more accurate). I prefer the jittery look, but you can do what you want.
     

  • Filter incoming search terms using comment moderation and blacklist words.

    Referrer spam is as much of a problem as trackback spam. There are a few tricks in bstat to prevent the problem, but here’s one you can configure. Selecting this option tells bstat to not display search terms that contain words in your moderation list or blacklist.

Tags: , , , , , , , , , , , , , ,

5 Comments to “bstat Beta 1 Release”

  1. This plugin doesn’t work well when wp-email plugin is installed. After installing bstat, I tried the wp-email function and got the followings:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND bstat_date = '2005-11-11' LIMIT 1' at line 3]
    SELECT * FROM wp_bstat_hits WHERE post_id = AND bstat_date = ’2005-11-11′ LIMIT 1

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1, 0, 0)' at line 2]
    INSERT INTO wp_bstat_hits (bstat_date, post_id, hits_reads, hits_ads1, hits_ads2) VALUES (’2005-11-11′, , 1, 0, 0);

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND bstat_date = '2005-11-11' AND ref = 'http://www.samtsai.com/wp-email.php?' at line 3]
    SELECT * FROM wp_bstat_refs WHERE post_id = AND bstat_date = ’2005-11-11′ AND ref = ‘http://www.samtsai.com/wp-email.php?p=32′ LIMIT 1

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1, '0', 'http://www.samtsai.com/wp-email.php?p=32')' at line 2]
    INSERT INTO wp_bstat_refs (bstat_date, post_id, hits, issearchengine, ref) VALUES (’2005-11-11′, , 1, ’0′, ‘http://www.samtsai.com/wp-email.php?p=32′);

  2. I can’t retrieve the url for downloading the bstat.. do you have the valid url since i need it for my site. thanks in advance

  3. @robinson:

    There’s a note at the top of the story explaining that bStat has been updated (it’s also been renamed to bSuite). The current version is here (as of July 31, 2007).

  4. Thanks, I made the plugin my self since I think it just collect the parameter from the url referer.. just from major search engine.. Thanks a lot anyway.. have your success always…

  5. please send me the exact result date of bstat 2010

User contributed tags for this post:

google heart beta (73) - googles earth com (56) - googles (54) - googles es (49) - googles hearth (44) - google s heart (42) - google eart beta (33) - googles earth (32) - bstat (29) - wpa kill instructions (24) - google s heart download (23) - googles eart (23) - googles hearth com (22) - download google s heart (18) - you prno beta (18) - bstat_refsforpost (18) - google earth select server (18) - bstat wordpress (17) - ofoto hack (14) - EART BETA (13) - google eart beta download (13) - google hearth beta (12) - hacking ofoto (11) - wordpress incoming search terms (10) - google hearth (10) - bstat plugin (10) - ofoto passwords (9) - bstat.php (9) - top incoming search terms for this post (9) - bstat wp (8) - maps.googles.es (8) - bstat plugin download (8) - Google s hearth com (8) - 1 (8) - Top incoming search terms for this post plugin (8) - google eart beta version 4 (8) - WordPress database error You have an error in your SQL  (8) - bstat wp plugin (8) - Google Eart Select server (8) - download bstat plugin (7) - eart beta 4 (7) - download bstat wordpress plugin (7) - bstat.zip (7) - DOWNLOAD GOOGLE HEARTH (7) - WPA Kill beta (6) - WWW GOOGLES EARTH COM (6) - Google hearth en beta (6) - all incoming search term (6) - bstats download (6) - hacking ofoto passwords (6) - Incoming Search Terms wordpress (6) - wordpress plugin (6) - google hearth load (6) - bstat_recentpop (6) - download google heart beta (6) - wpa kill download (6) - download bstat (5) - hack ofoto passwords (5) - Make accurate pulse graphs (5) - google heart beta download (5) - hack ofoto (5) - earth com beta (5) - download bstat wordpress (5) - WWW GOOGLES ES (4) - google heart load (4) - wpa kill error 326 (4) - WWW GOOGLES EARTH DOWNLOADS (4) - wordpress bstat error use near AND bstat date (4) - bstat_recentrefs (4) - select server google heart (4) - googles world com (4) - BSTAT MYSQL ERROR WORDPRESS (4) - wpa kill instruction (4) - Top incoming search terms wordpress post (4) - google beta hearth (4) - eart 4 beta (4) - WPA_Kill error 326 (4) - WWW googles earth (4) - wordpress plugin view incoming search term (4) - GOOGLE HEARTH LOADING (4) - bstat error (4) - load google heart (4) - google heart select server (4) - bstat wordpress plugin (3) - wp bstat (3) - wpa_kill run-time error 326 (3) - google hack you have an error in your sql (3) - dell server btu output (3) - Incoming Search Terms (3) - WPA-KILL error 326 (3) - download plugin bstat (3) - bstat_todaypop (3) - WPA_Kill runtime error (3) - bstat todaypop (3) - wpa_kill runtime error 326 (3) - wpa-kill runtime-error (3) - php incoming search terms (3) - wpakill runtime error 326 (3) - plugin to display incoming search terms for this post (3) - bstat plugin free download (2) - wpa kill zip (2) - google beta hearts (2) - story pulse bstat function (2) - Google Eart H3 (2) - WordPress database error bstat (2) - earh beta (2) - eart select server (2) - google heart selct sever (2) - beta Google Hearth (2) - how to use wpa kill (2) - google heart server (2) - maps googles es (2) - earth com 3 beta download (2) - google eart 4 beta (2) - shuttle beta download wordpress (2) - wpa kill 2 beta download (2) - www.googles earth.com (2) - incoming search terms for wordpress (2) - wpa kill load (2) - free download google earth beta4.2 (2) - bstat database (2) - wpakill instructions (2) - wordpress Top Incoming Search Terms (2) - Top incoming search terms for this post wordpress (2) - wordpress recently commented stories (2) - of eart beta (2) - incoming search term plugin (2) - googles heart (2) - wp_bstat_refs (2) - bstat 4.0 beta (2) - download version google hearth beta (2) - google heart beta 2 (2) - how much btu output dell server (2) - wpa kill directions (2) - download google earth3 beta (2) - bsuite only post post id 0 and 1 only (2) - similar al google heart (2) - beta serwer 1459 (2) - google eart beta4 (2) - MySQL server version for the right syntax to use near a (2) -