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

Related:

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 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 (42) - google s heart (42) - google eart beta (33) - googles earth (32) - bstat (25) - wpa kill instructions (24) - google s heart download (23) - googles hearth com (22) - googles eart (20) - you porno beta (19) - google earth select server (18) - download google s heart (18) - bstat wordpress (17) - porno Beta (15) - you prno beta (15) - ofoto hack (13) - google hearth beta (12) - google eart beta download (12) - EART BETA (11) - hacking ofoto (11) - google hearth (10) - you.porno.beta (10) - wordpress incoming search terms (9) - ofoto passwords (9) - google eart beta version 4 (8) - WordPress database error You have an error in your SQL  (8) - Google Eart Select server (8) - Google s hearth com (8) - 1 (8) - eart beta 4 (7) - DOWNLOAD GOOGLE HEARTH (7) - hacking ofoto passwords (6) - download google heart beta (6) - google hearth load (6) - WPA Kill beta (6) - WWW GOOGLES EARTH COM (6) - all incoming search term (6) - wordpress plugin (6) - wpa kill download (6) - Google hearth en beta (6) - hack ofoto passwords (5) - maps.googles.es (5) - Incoming Search Terms wordpress (5) - hack ofoto (5) - google heart beta download (5) - earth com beta (5) - googles world com (4) - bstat_refsforpost (4) - all (4) - bstat_recentpop (4) - google beta hearth (4) - Top incoming search terms for this post plugin (4) - eart 4 beta (4) - WWW googles earth (4) - WWW GOOGLES EARTH DOWNLOADS (4) - bstats download (4) - google heart load (4) - sex (4) - wpa kill instruction (4) - WWW GOOGLES ES (4) - BSTAT MYSQL ERROR WORDPRESS (4) - load google heart (4) - GOOGLE HEARTH LOADING (4) - Make accurate pulse graphs (4) - wordpress bstat error use near AND bstat date (4) - google heart select server (4) - select server google heart (4) - wordpress plugin view incoming search term (4) - php incoming search terms (3) - bstat todaypop (3) - you porn beta (3) - google hack you have an error in your sql (3) - wpa-kill runtime-error (3) - dell server btu output (3) - bstat wp (3) - Incoming Search Terms (3) - beta Google Hearth (2) - wpa kill download xp update (2) - wpa kill zip (2) - wordpress bsuite INSERT INTO wp bstat hits bstat date p (2) - maps googles es (2) - eart beta download (2) - eart select server (2) - WordPress database error bstat (2) - bstat error (2) - googles hearth satellite (2) - bstat ref for post (2) - wordpress is home error (2) - ofoto search hack (2) - google beta hearts (2) - earth com 3 beta download (2) - google eart beta4 (2) - google beta 1 (2) - googles eart com (2) - You have an error in your SQL syntax Check the manual t (2) - googles heart (2) - free download google earth beta4.2 (2) - MySQL server version for the right syntax to use near a (2) - incoming search terms for wordpress (2) - wpa kill load (2) - bstat database (2) - wordpress recently commented stories (2) - of eart beta (2) - incoming search term plugin (2) - WPA_Kill runtime error (2) - beta serwer 1459 (2) - similar al google heart (2) - shuttle beta download wordpress (2) - earh beta (2) - google heart selct sever (2) - how to use wpa kill (2) - google heart server (2) - story pulse bstat function (2) - wpa kill 2 beta download (2) - wpa kill directions (2) - download version google hearth beta (2) - google eart 4 beta (2) - google heart beta 2 (2) - how much btu output dell server (2) - download google earth3 beta (2) - bsuite only post post id 0 and 1 only (2) - you porno libe beta (2) - manual de google hearth (2) - tags usage (2) - server google heart (2) - bstat recentpop (2) - incoming search terms plugin (2) - 2259356294879 (2) - btu output of dell servers (2) - php is home (2) - load google hearth (2) - hearth google beta (2) - google s heart load (2) - google s hearth (2) - google heart download beta (2) - h3 All incoming search terms for this post h3 plugin (2) - server btu output dell (2) - WordPress database error mail Check the manual that cor (2) - pulse function graph (2) - bstat.php (2) - count number of days back php (2) - blogpulse (2) - ofoto hack directory (2) - Google Hearth download (2) - incoming search term feed (2) - wordpress bstat (2) -