bstat Beta 3 Release

UPDATE: bstat has been updated.

Beta 2 never went public. This is beta 3.

Changes

This documentation supersedes any previous documentation.

The bstat_pulse() function has been improved and now uses your CSS for appearance. Call bstat_pulse_style() to add my default styles inline if you don’t want to modify your CSS. Also, bstat_pulse() now has two switches to control what it displays. Please take a look at the usage guide below for how to call this function now.

Also, take note of new example of how to call the bstat_hitit function: “if(is_home())” has changed to “if(!is_single())”. This corrects a problem with the way bstat was recording activity on any page with more than one story (search, archive, etc).

The next two features are for Zach. Links generated by the functions now use your WordPress permalink preferences instead of the ?p=XXX stuff.

It is now possible to exclude certain IP numbers from your hit counting. You’ll see controls for this in the bstat submenu of the options tab.

Search engine highlighting snuck into the last release, but has been buggy for some. It’s disabled in this release and will eventually be folded into a new plugin called bsuggestive. Yes, it’s bsuggestive. If you’d like to play with it, you can uncomment the likely looking line at the bottom.

There’s some ad tracking code in there, but I’m leaving it undocumented for now.

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_single()) $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>All incoming search terms for this post</h3>
<small><?php bstat_refsforpost($id, " ", " -"); ?></small>
  • bstat_pulse

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

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
display_text (acceptable values: 0 or 1), switch to display stats for total views and average views per day
display_credit (acceptable values: 0 or 1), switch to display “powered by bstat” credit

Example:

<?php bstat_pulse_style(); ?>
<h3>Story pulse</h3><?php bstat_pulse($id, 525, 1, 1); ?>

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.

  • bstat_pulse_style

    outputs an inline stylesheet for use with bstat_pulse. Suggestion: activate this to see what the default styles are, then add them to your site’s stylesheet and work from there.

Options

The bstat submenu of the options tab has three 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.

  • Ignore hits from these IP numbers.

    Sites with low traffic may find that activity by authors severely skews the stats tracking. Enter an IP address here to ignore it.

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

Related:

14 Comments

  1. Pingback by   Wordpress Plugin: bStat by Blogging Pro on July 6, 2005 4:10 pm

    [...] bStat Beta 3 has been released. It looks like this Wordpress plugin keeps track of how many views each page on your blog gets and creates a graph based on the amount of views. It even has a blacklist system as well as a system to block by IP address. [...]

  2. Pingback by WordPress Italy » Blog Archive » Plugin WordPress: bStat Beta 3 on July 6, 2005 4:50 pm

    [...] E’ stato rilasciato bStat Beta 3. Sembra che questo plugin per WordPress tenga traccia delle volte che ciascuna pagina viene visualizzata creando anche un grafico. Il plugin permette anche di escludere dalle statistiche determinati indirizzi IP. [...]

  3. Pingback by Blogging Pro China » Wordpress Plugin: bStat on July 6, 2005 7:41 pm

    [...]   bStat Beta 3可以记录每页的访问人数并生成一个小型图表,类似这样: [...]

  4. Comment by Justin on July 6, 2005 11:41 pm

    Is this where you want bug reports? In the bstat submenu of the manage tab, the links under “Top (Non-Search Engine) Referrers” broke when I upgraded.

    I *think* I fixed this without causing any new problems by changing line 566 of bstat.php to read:
    $url = ($baseurl . ($row->url));

  5. Comment by Casey on July 8, 2005 7:23 pm

    Justin was right. I’ve fixed the code in the zip file.

  6. Pingback by MaisonBisson.com » Blog Archive » bStat Features on July 8, 2005 10:21 pm

    [...] The documentation for the current release (b3, as of July 10, 2005) explains the public functions and their use. I believe they reveal themselves in their names, so here’s a list of the most of them: [...]

  7. Comment by Shelby on July 9, 2005 2:04 am

    Is there a way you can make the bstats show up as a lonk off the main dashboard page instead of under manage?

  8. Comment by Pete Quily on July 12, 2005 5:57 am

    Hi,

    got this error message when I installed your plugin in my wp 1.51 blog under top stories, top referrers and pulse any suggestions?

    Pete

    WordPress database error: [Table 'creation.wp_bstat_hits' doesn't exist]
    SELECT a.post_id AS post_id, LEFT(b.post_title, 60) AS title, ROUND((SUM(a.hits_reads)) / ((TO_DAYS(NOW()) - TO_DAYS(MIN(a.bstat_date))) + 1)) AS sort_order, CONCAT(’
    Tot: ‘, SUM(a.hits_reads), ‘, Avg: ‘, ROUND((SUM(a.hits_reads)) / ((TO_DAYS(NOW()) - TO_DAYS(MIN(a.bstat_date))) + 1)), ‘, Max: ‘, MAX(a.hits_reads), ”) AS note FROM wp_bstat_hits a, wp_posts b WHERE a.post_id = b.ID GROUP BY a.post_id ORDER BY sort_order DESC LIMIT 50

  9. Comment by Casey on July 12, 2005 7:22 am

    Pete,

    the error you mention is because the plugin hasn’t created its tables yet. Take a look at step 4 in the quick start directions above and be sure to follow the bit about going to the bStat submenu of the options tab.

  10. Comment by Oliver Marshall on August 9, 2005 4:25 am

    Hi,

    Two things. I have an odd error. The bstat tab in both the Manage section and the Options seems to want/have to be the last tab. If i have another plugin that comes after it, the bstat tab just displays the content of that other plugin. In my case, i have Photopress installed. With the photopress tab present, the bstat tab displays the photopress info. If i disable the last plugin, making bstat the last tab, it works fine.

    Also, is there a way to just display the number of views of a page on that page? I mean, i would like to have “Viewed xxx times” at the bottom/top of each blog article, rather than the graph.

    Ta

    Olly

  11. Pingback by ??wordpress » ????bstat Beta 3 Release on August 12, 2005 12:33 am

    [...] 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. 有多种函数可提供调用 如: 1.当日最人气的文章 2.本周被搜索的关键词 等等 more detail [...]

  12. Comment by peter on August 14, 2005 5:05 am

    that is great,thank you for you good work

  13. Comment by 1stPixel on August 25, 2005 3:52 pm

    Fatal error: Cannot redeclare bstat_add_menu() (previously declared in c:\wamp\www\pixelficker\wp-content\plugins\bstat\bstat.php:40) in c:\wamp\www\pixelficker\wp-content\plugins\bstat\bstat.php on line 39

  14. Pingback by » Another Nice Touch: Right-Click For Error Code »  InsideMicrosoft - part of the Blog News Channel on August 16, 2007 2:14 am

    [...] A line including an external stats counter, one I didn’t use, was included in some code for the bstats plugin I use to show the incoming search terms (among other things). The code was occasionally forcing [...]

Comments RSS TrackBack Identifier URI

Sorry, the comment form is closed at this time.

 

User contributed tags for this post:

google earth activation (667) - google earth activation key (507) - google earth license key (485) - google earth key (405) - google earth download (403) - kenchoch yahoo com (338) - google earth activation code (324) - google earth activate (285) - google earth plus activation (203) - Google Earth com (180) - google earth pro license key (173) - Google Earth Plus activation key (143) - google earth plus activation code (125) - google earth (124) - Google Earth Pro (119) - google eart plus license key (113) - License Key Google Earth (110) - google earth 3 beta (103) - Google Earth license (102) - google earth activate key (102) - google earth plus activate (97) - google earth license code (92) - google earth plus license key (89) - google earth licence key (76) - Google Earth Plus Serial (73) - download google earth plus (70) - google eart licence plus hack (61) - licence key google earth (61) - google earth view (55) - key Google Earth plus (54) - activate google earth plus (52) - google yahoo com (48) - google earth activate code (48) - google Earth beta activation key (46) - Google Earth Plus key (43) - license key for google earth (41) - google earth licence code (41) - google earth plus download (41) - google earth License Key serial (39) - activate google earth (38) - google activation key (38) - google earth pro 3 beta (37) - google earth plus license key password (36) - license key for google earth plus (36) - google earth 3 beta serial (36) - bstat (35) - google earth 3 activation (34) - google earth beta 3 (34) - download google earth pro (33) - license key google earth plus (33) - google earth beta 3 serial (31) - Google Eart Pro Key Code (31) - bstat plugin (29) - google earth pro beta 3 (29) - all (28) - google earth blacklist (27) - GoogleEarth License Key (26) - Google Earth Release 4 BETA (26) - google eart pro 3 beta (26) - google earth kenchoch yahoo com (25) - googleearth key (25) - licence key for google earth (25) - sex co il (23) - google earth 3 plus activation (22) - google earth plus serial key (21) - 89 com (20) - google earth activate key code (20) - Google Earth Pro Beta 4 licence Key (20) - kenchoch (19) - google eart license key (19) - google earth activation key download (19) - google earth licence (19) - Licence key for google earth plus (19) - google earth beta license key (18) - google erth plus com (17) - activation google earth (17) - Google Eart Home beta (16) - key google earth (16) - download google earth pro 3 beta (16) - license key for google earth pro (16) - google eart 3 beta (16) - google eart plus serial (16) - earth plus license key (16) - licence key earth pro (16) - activation code for google earth plus (15) - download google earth pro 3 (14) - Google Earth Pro 4 kenchoch yahoo com (14) - activation key google earth (14) - google earth code activation (14) - google earth plus activation hack (14) - licence google earth (14) - bstat download (14) - google earth pro key (13) - activation GOOGLE EARTH PLUS (13) - activation key google earth plus (13) - WWW SEX CO IL (13) - googleearth plus code (12) - google earth plus id (12) - google earth plus activation code Site (12) - google earth activation number (12) - Google Earth beta (12) - licence google key (12) - Licence Key Google Earth Plus (12) - google eart pro beta (12) - license key de google earth pro (11) - google earth plus login (11) - license key (11) - google earth plus licence key (11) - bstats (11) - google earth key numbers pro installation (10) - activate google earth pro (10) - google earth pro serial (10) - google earth 3 key (10) - google eart plus activation code (10) - google earth pro 3 beta download (10) - google earth activate license key (10) - google eart os x beta (10) - google maps beta (10) - google earth plus activate key (10) - google earth plus serial activate (10) - goole earth key (9) - licence key for global earth pro (9) - bstat zip (9) - license key of google earth (9) - license google earth plus (9) - key (9) - chernobil google heart (9) - earth license key (8) - google earth pro 3 (8) - License Key to Google Earth Pro (8) - google earth name and key activation (8) - licence key google earth pro (8) - WWW GOOGLE EARTH COM (8) - google earth beta mac OS X download opera skype windows (8) - key google earth pro (8) - code google earth plus (8) - google earth pro 4 license key (8) - Google Earth Plus activation code download (8) - google earth beta LICENCE KEY (7) - GoogleEarth license (7) - bstat php (7) - sex300 (7) - activation code google earth plus (7) - google earth license number (7) - key f r gogle earth plus (6) - google eart plus codes (6) - google earth url (6) - google earth plus license code (6) - google earth plus activation code serial (6) - wordpress plugin (6) -