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: , , , , , , , , , , , , , ,

4 Comments

  1. Comment by sam on November 11, 2005 3:30 am

    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. Comment by robinson on July 31, 2007 11:08 am

    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. Comment by Casey Bisson on July 31, 2007 4:21 pm

    @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. Comment by robinson on August 4, 2007 6:09 am

    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…

Comments RSS TrackBack Identifier URI

Leave a comment

 

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 (28) - wpa kill instructions (24) - google s heart download (23) - googles eart (23) - googles hearth com (22) - google earth select server (18) - download google s heart (18) - you prno beta (17) - bstat wordpress (17) - ofoto hack (14) - google eart beta download (13) - EART BETA (12) - google hearth beta (12) - hacking ofoto (11) - bstat_refsforpost (10) - google hearth (10) - ofoto passwords (9) - wordpress incoming search terms (9) - WordPress database error You have an error in your SQL  (8) - 1 (8) - maps.googles.es (8) - bstat.php (8) - google eart beta version 4 (8) - Google s hearth com (8) - Google Eart Select server (8) - eart beta 4 (7) - DOWNLOAD GOOGLE HEARTH (7) - download google heart beta (6) - Incoming Search Terms wordpress (6) - google hearth load (6) - WWW GOOGLES EARTH COM (6) - wordpress plugin (6) - hacking ofoto passwords (6) - all incoming search term (6) - WPA Kill beta (6) - wpa kill download (6) - Google hearth en beta (6) - hack ofoto passwords (5) - bstat_recentpop (5) - bstat wp plugin (5) - earth com beta (5) - download bstat (5) - hack ofoto (5) - google heart beta download (5) - BSTAT MYSQL ERROR WORDPRESS (4) - WWW googles earth (4) - wordpress bstat error use near AND bstat date (4) - bstat error (4) - wpa kill instruction (4) - googles world com (4) - WWW GOOGLES ES (4) - google heart select server (4) - WWW GOOGLES EARTH DOWNLOADS (4) - bstats download (4) - eart 4 beta (4) - select server google heart (4) - google beta hearth (4) - google heart load (4) - load google heart (4) - top incoming search terms for this post (4) - Top incoming search terms for this post plugin (4) - Make accurate pulse graphs (4) - all (4) - Top incoming search terms wordpress post (4) - GOOGLE HEARTH LOADING (4) - wordpress plugin view incoming search term (4) - bstat_recentrefs (3) - Incoming Search Terms (3) - bstat todaypop (3) - bstat wp (3) - plugin to display incoming search terms for this post (3) - dell server btu output (3) - wpakill runtime error 326 (3) - WPA_Kill runtime error (3) - bstat_todaypop (3) - google hack you have an error in your sql (3) - php incoming search terms (3) - wpa-kill runtime-error (3) - wpa kill 2 beta download (2) - how to use wpa kill (2) - google heart server (2) - google eart 4beta (2) - free download plug in bstat (2) -  (2) - download version google hearth beta (2) - wpa kill zip (2) - you.prno (2) - story pulse bstat function (2) - bstat plugin free download (2) - google beta hearts (2) - beta Google Hearth (2) - maps googles es (2) - earth com 3 beta download (2) - incoming search term plugin (2) - shuttle beta download wordpress (2) - earh beta (2) - google heart selct sever (2) - GOOGLE HACKING DATABASES SYNTAX SEARCH TERMS (2) - Google Eart H3 (2) - WPA_KILL run-time error (2) - google eart 4 beta (2) - wpakill instructions (2) - WPA_Kill error 326 (2) - googles heart (2) - bstat_pulse (2) - MySQL server version for the right syntax to use near a (2) - incoming search terms for wordpress (2) - wpa kill load (2) - incoming search term wp plugin (2) - bstat database (2) - wordpress recently commented stories (2) - Top incoming search terms for this post wordpress (2) - HEARTH BETA (2) - bstat 4.0 beta (2) - google heart beta 2 (2) - how much btu output dell server (2) - wpa kill directions (2) - www.googles earth.com (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) - free download google earth beta4.2 (2) - google eart beta4 (2) - google beta 1 (2) - googles eart com (2) - of eart beta (2) - eart select server (2) - server google heart (2) - blogpulse (2) - WordPress database error mail Check the manual that cor (2) -