MaisonBisson.com » search term highlighting http://maisonbisson.com A bunch of stuff I would have emailed you about. Sat, 14 Nov 2009 20:14:03 +0000 http://wordpress.org/?v=2.8.5.2 en hourly 1 bsuite Bug Fixes (release b2v7) http://maisonbisson.com/blog/bsuite/ http://maisonbisson.com/blog/bsuite/#comments Mon, 16 Apr 2007 13:14:17 +0000 Casey Bisson http://maisonbisson.com/blog/post/11613/#bsuite-bug-fixes-release-b2v7

Work on bsuite3 is progressing well, thanks to help from Zach and Matt, who are collaborating with me on completely rearchitecting how stats are collected and reported. This, however, is not bs3. It’s a transitional release intended to fix some bugs in b2 and make upgrading easier. This upgrade is recommended for all current bsuite users and new users.

bsuite Features

  • Tracks page loads (hits)
  • Tracks search terms used by visitors ariving at your site via search engines
  • Reports top-performing stories via a function that can be included in the sidebar
  • Reports recent comments via a function that can be included in the sidebar
  • Reports top search terms via a function that can be included in the sidebar
  • Outputs a pulse graph of activity on your site or specific stories
  • Lists related posts at the bottom of the current post’s content
  • Suggests posts that closely match the search criteria for visitors who arrive via search engines
  • Integrates bsuite_speedcache
  • Does some stuff with tags

Fixed/Changed/Added

  • As mentioned above, a huge-but-invisible feature here is that this version includes some pieces that will make it easy to transition to the new plugin.
  • MySQL errors while creating the tables should now be fixed. It’s my shame that these have persisted so long.
  • The plugin now “rebuilds the tags table” as soon as you activate it. This is a good thing, but if you’ve got a huge number of posts (or a really short max execution time) it might cause a problem (please leave a comment if it does).
  • The related posts feature now works even if you aren’t tagging your posts. If there are no tags, the post’s title is used as a search string.
  • This list is probably incomplete and in some other way inaccurate. It’s not intentional, I’m just sloppy. Please leave comments with bug reports or corrections, I’ll do what I can to fix them.
  • Finally, I’m now hosting the download on a new server, so it won’t be subject to .Mac’s bandwidth consumption limits.

Installation

  • Download and unzip bsuite.zip
  • Place bsuite.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 bsuite submenu of the options tab. This will allow bsuite to create its database tables.
  • Stats collection will start automatically; you can see the results in the new bsuite Reports submenu of your Dashboard
  • Once installed, be sure to enable the options and consider customizing the look by adding the bsuite CSS to your theme’s CSS (sample CSS here).
  • In order to view the stats reports reports on your public pages, you’ll need to add the display functions to your pages.

Upgrading

  • Upgrades from earlier versions of bsuite are easy, just replace the old bsuite.php file with the new one.
  • Don’t forget to visit the bsuite submenu of the options tab so you can setup any new features.

Commands

The bsuite submenu of the options has a few command buttons:

  • Clear bsuite_speedcache

    The cache improves performance, but can sometimes get stale before its time. This command clears it.

  • Rebuild bsuite tag index

    bsuite maintains its tag index with every story edit. Use this command to bring old-content into the index or if you’ve edited the content in way WP doesn’t know about.

Options

The bstat submenu of the options tab has a few configurable settings:

  • Minimum userlevel to view bsuite reports

    The options are restricted to administrators, but you can choose who can view the reports.

  • Output default CSS

    Some of the bsuite functions require CSS styles not found in the average style sheet. This will output default styles.

  • Default pulse graph style

    This sets how values are interpolated in drawing the pulse graph. Experiment with the options to see how they work.

  • This will insert a block of links at the tail of each (tagged) post’s content with links to related posts at your site.

  • Tag input format

    Name your style: square brackets or angle brackets / <tags> or [tags].

  • Highlight search words and offer search help

    The first part of this should be obvious, but the real trick here is using those search words to offer other related content from your site to visitors. It works (and looks) a lot like the option above, but the suggestions only appear when search words are detected.

  • 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 registered users at or above userlevel

    No author wants to skew their stats just by poking around their own site.

  • 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.

Tag Support

Until WordPress adopts a standardized way to manage tags, we’ll have to deal with things like this.

bsuite recognizes tags in three forms:

  • Any link with a rel=“tag” attribute
  • Any number of single tags like this: <tag>tag name</tag>
  • A block of comma-delimited tags like this: <tags>WordPress, WordPress Plugin</tags>

This appears to make it compatible with a number of existing tag management strategies now in use — including those used by Ecto and SimpleTags.

Tags are mapped to Technorati, but a future version will include an option to set other tag resolvers.

Using bsuite Functions

Function usage is unchanged from the last version. Among the things at the top of the list for bs3: widgets.

Known Bugs

None yet, but I’m sure I’m forgetting something. Report what you find in the comments below.

Money Grubbing

bsuite is GPL-licensed free software, but after some urging by friends, I’m opening the tip jar. If you use it and like it, let me know. And if you feel moved, leave a tip in the jar.

beta, blog pulse, bstat, bstats, bsuggestive, bsuite, bug, bug fix, bug fixes, bugs, fix, fixes, graph, plugin, pulse, recommendation system, recommendations, recommender, recommending, referrer, related content, search engine highlighting, search term, search term highlighting, sehl, stable, statistics, stats, stats tracking, tag, tag management, tag relationships, tags, usage, wordpress, wordpress plugin

]]>
http://maisonbisson.com/blog/bsuite/feed/ 85
bsuite Bug Fixes (release b2v6) http://maisonbisson.com/blog/bsuite/ http://maisonbisson.com/blog/bsuite/#comments Mon, 24 Jul 2006 16:39:28 +0000 Casey Bisson http://maisonbisson.com/blog/post/11390/

Update: bugfix release b2v7 available.

It’s been a while since I released a new version of bsuite, my multi-purpose WordPress plugin. I’d been hoping to finish up a series of new features, but those have been delayed and this is mostly just a collection of bugfixes. This update is recommended for all bsuite users.

bsuite Features

  • Tracks page loads (hits)
     
  • Tracks search terms used by visitors ariving at your site via search engines
     
  • Reports top-performing stories via a function that can be included in the sidebar
     
  • Reports recent comments via a function that can be included in the sidebar
     
  • Reports top search terms via a function that can be included in the sidebar
     
  • Outputs a pulse graph of activity on your site or specific stories
     
  • Highlights search words used by visitors ariving at your site via search engines
     
  • Lists related posts at the bottom of the current post’s content
     
  • Suggests posts that closely match the search criteria for visitors who arrive via search engines
     
  • Integrates bsuite_speedcache
     
  • Does some stuff with tags

Fixed/Changed/Added

  • The bsuite report consolidates the two uselessly differentiated top stories lists and adds a top movers list.
     
  • The report also includes a hugely updated Quick Stats section listing today’s current tally and a prediction of the day’s total along with other goodies.
     
  • The table definitions have been updated and optimized for better performance. Zach contributed some optimizations to the bstat_hitit() function and underlying MySQL queries, and you’ll also find a number of small code optimizations scattered throughout.
     
  • This version finally creates and configures it’s tables automatically upon activation. You no longer need to visit the plugin’s option screen for this to happen.
     
  • A fix to address a MySQL error for users running MySQL 5 has been long overdue. It’s in here.
     
  • Numbers in the reports are now formatted with commas or whatever local format you’ve set MySQL for, using MySQL’s FORMAT() function.
     
  • As requested, I’ve added a function — bstat_hits() — return just the hit count for a story or for the whole blog.
     
  • As requested, you can now manually clear the bsuite_speedcache.
     
  • As prompted, prodded, and cajoled, I’ve finally made a change to report hits to the front page (and other pages without post IDs).
     
  • I did a bunch of thinking about tags a while ago, and bsuite now keeps an index of tags in a separate table. I’ve got plans to use this for later features, but for now it’s just a curiosity that shouldn’t cause any problems.
     
  • You can now switch between <tags> or [tags] for compatibility with other plugins (such as noted here) and with WP2’s WYSIWYG editor.
     
  • The code now properly calls get_settings(’siteurl’) instead of get_settings(’home’) to build the URL for the spacer.gif that builds the pulse graph, fixing the problem where the graph wouldn’t display for some users.
     
  • Not changed, but at least answered: Eddie commented to explain that ‘–disable-bcmath’ can cause the undefined function errors some people were getting. A later release may incorporate Pramudita’s fix.
     
  • Also not in this version are the user-contributed tag features I’d gotten so excited about. These just aren’t ready for primetime, but people who want to hack about in alpha-ville will find all the supporting code in there.
     
  • This list is probably incomplete and in some other way inaccurate. It’s not intentional, I’m just sloppy. Please leave comments with bug reports or corrections, I’ll do what I can to fix them.
     
  • Finally, I’m now hosting the download on a new server, so it won’t be subject to .Mac’s bandwidth consumption limits.
     

Installation

Update: bugfix release b2v7 available.

  • Download and unzip bsuite.zip
     
  • Place bsuite.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 bsuite submenu of the options tab. This will allow bsuite to create its database tables.

    Stats collection will start automatically; you can see the results in the new bsuite Reports submenu of your Dashboard
     

  • Once installed, be sure to enable the options and consider customizing the look by adding the bsuite CSS to your theme’s CSS (sample CSS here).

In order to view the stats reports reports on your public pages, you’ll need to add the display functions to your pages.

Upgrading

Upgrades from earlier versions of bsuite are easy, just replace the old bsuite.php file with the new one.

If you’re upgrading from bstat (which is so old I was tempted to remove this part of the docs), be sure to delete or deactivate the old plugin before activating the new one. Don’t forget to visit the bsuite submenu of the options tab so you can setup all the new features.

Commands

The bstat submenu of the options has a few command buttons:

  • Clear bsuite_speedcache

    The cache improves performance, but can sometimes get stale before its time. This command clears it.
     

  • Rebuild bsuite tag index

    bsuite maintains its tag index with every story edit. Use this command to bring old-content into the index or if you’ve edited the content in way WP doesn’t know about.
     

Options

The bstat submenu of the options tab has a few configurable settings:

  • Minimum userlevel to view bsuite reports

    The options are restricted to users at userlevel 8 or above, but you can choose who can view the reports.
     

  • Output default CSS

    Some of the bsuite functions require CSS styles not found in the average style sheet. This will output default styles.
     

  • Default pulse graph style

    This sets how values are interpolated in drawing the pulse graph. Experiment with the options to see how they work.
     

  • Suggest related entries in post

    This will insert a block of links at the tail of each (tagged) post’s content with links to related posts at your site.
     

  • Tag input format

    Name your style: square brackets or angle brackets / <tags> or [tags].
     

  • Highlight search words and offer search help

    The first part of this should be obvious, but the real trick here is using those search words to offer other related content from your site to visitors. It works (and looks) a lot like the option above, but the suggestions only appear when search words are detected.
     

  • 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 registered users at or above userlevel

    No author wants to skew their stats just by poking around their own site.
     

  • 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.

Tag Support

Until WordPress adopts a standardized way to manage tags, we’ll have to deal with things like this.

bsuite recognizes tags in three forms:

  • Any link with a rel=“tag” attribute
     
  • Any number of single tags like this: <tag>tag name</tag>
     
  • A block of comma-delimited tags like this: <tags>WordPress, WordPress Plugin</tags>
     

This appears to make it compatible with a number of existing tag management strategies now in use — including those used by Ecto and SimpleTags.

Tags in <tag> and <tags> tags are mapped to Technorati, but a future version will include an option to set other tag resolvers.

Using bsuite Functions

Though many bsuite features require no coding or modifications to theme files, there are a number of public functions available 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

    displays top stories for today only.
     

  • bstat_todayrefs

    displays top incoming search terms for today only.
     

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

    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_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.
     

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

    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.
     

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_hits

    displays the current and average daily page loads.
     

Usage:
bstat_hits([{template}, [{post_id}, [{today_only}]]]);

template will be filled in with the appropriate values for %%hits%% and/or %%avg%%. If left blank, the default template is %%hits%% hits, about %%avg%% daily
post_id over-rides the detected post ID. Common values for this may include “0” to show stats for index pages, or “-1” to show stats for the entire blog (note that %%avg%% reports inaccurately with a “-1” value here)
today_only returns the count for today (note that %%avg%% doesn’t make much sense here)

Example:

<?php bstat_hits('%%hits%% hits, about %%avg%% daily') ?>

prints something like “791 hits, about 10 daily”

<?php bstat_hits('%%hits%% page loads today', -1, 1) ?>

prints something like “5,950 page loads today”

  • bstat_pulse

    displays the “pulse” graph of hits over time.
     

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

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
graph_accurate (acceptable values: 0 or 1), make smooth, accurate graphs or fuzzy (but not inaccurate) graphs

Example:

<h3>Story pulse</h3><?php bstat_pulse($id, 525, 1, 1, 1); ?>
  • 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.
     

This function is no longer necessary, as it is executed automatically via a plugin hook that runs every time the footer is called. Still, it’s around if you have content that you want to track outside that scope.

Example:

<?php // this is how it used to work, but it's automated now...
	global $id;
    if (!is_single() && !is_page()) $id = 0;
	bstat_hitit($id, “read”);
	?>

note: (be careful of any “curly quotes” that might have been accidentally/automagically inserted in code samples)

Known Bugs

None yet, but I’m sure I’m forgetting something. Report what you find in the comments below.

recommendation system, pulse, plugin, graph, fixes, fix, bugs, bug fixes, bug fix, bug, bsuite, bsuggestive, bstats, bstat, blog pulse, beta, recommendations, recommender, recommending, referrer, related content, search engine highlighting, search term, search term highlighting, sehl, statistics, stats, stats tracking, tag, tag management, tag relationships, tags, usage, wordpress, wordpress plugin

]]>
http://maisonbisson.com/blog/bsuite/feed/ 77
bsuite Bug Fixes (release b2v3) http://maisonbisson.com/blog/bsuite/ http://maisonbisson.com/blog/bsuite/#comments Thu, 15 Dec 2005 01:56:13 +0000 Casey Bisson http://maisonbisson.com/blog/?p=11032

I’ve fixed another bug in bsuite b2, my multi-purpose plugin. This update is recommended for all bsuite users.

Fixed

  • Previous versions would throw errors at the bottom of the page when the http referrer info included search words from a recognized search engine.
     

Installation

Follow the directions for the bsuite b2 release. The download link there will always fetch the current version.

Upgrades from earlier versions of bsuite are easy, just replace the old bsuite.php file with the new one. Upgrades from bstat follow the same directions as before.

bsuite Features

  • Tracks page loads (hits)
     
  • Tracks search terms used by visitors ariving at your site via search engines
     
  • Reports top-performing stories via a function that can be included in the sidebar
     
  • Reports recent comments via a function that can be included in the sidebar
     
  • Reports top search terms via a function that can be included in the sidebar
     
  • Outputs a pulse graph of activity on your site or specific stories
     
  • Highlights search words used by visitors ariving at your site via search engines NEW!
     
  • Lists related posts at the bottom of the current post’s content NEW!
     
  • Suggests posts that closely match the search criteria for visitors who arrive via search engines NEW!
     
  • Integrates bsuite_speedcache NEW!
     
  • Does some stuff with tags NEW!

search term highlighting, search engine highlighting, sehl, bsuggestive, recommendations, recommender, recommending, recommendation system, related content, tag, tags, tag management, tag relationships, beta, blog pulse, bsuite, bstat, bstats, graph, plugin, pulse, referrer, search term, statistics, stats, stats tracking, usage, wordpress, wordpress plugin, bug fix, fix, fixes, bug, bugs, beta, bug fixes

]]>
http://maisonbisson.com/blog/bsuite/feed/ 48
bsuite Bug Fixes (release b2b) http://maisonbisson.com/blog/bsuite/ http://maisonbisson.com/blog/bsuite/#comments Sat, 03 Dec 2005 16:17:38 +0000 Casey Bisson http://maisonbisson.com/blog/?p=10994

I’ve fixed a couple bugs in bsuite b2, released last week.

Fixes

Installation

Follow the directions for the bsuite b2 release. The download link there will always fetch the current version.

Upgrades from bsuite b2 are easy, just replace the old bsuite.php file with the new one. Upgrades from bstat follow the same directions as before.

bsuite Features

  • Tracks page loads (hits)
     
  • Tracks search terms used by visitors ariving at your site via search engines
     
  • Reports top-performing stories via a function that can be included in the sidebar
     
  • Reports recent comments via a function that can be included in the sidebar
     
  • Reports top search terms via a function that can be included in the sidebar
     
  • Outputs a “pulse” graph of activity on your site or specific stories
     
  • Highlights search words used by visitors ariving at your site via search engines NEW!
     
  • Lists related posts at the bottom of the current post’s content NEW!
     
  • Suggests posts that closely match the search criteria for visitors who arrive via search engines NEW!
     
  • Integrates bsuite_speedcache NEW!
     
  • Does some stuff with tags NEW!

search term highlighting, search engine highlighting, sehl, bsuggestive, recommendations, recommender, recommending, recommendation system, related content, tag, tags, tag management, tag relationships, beta, blog pulse, bsuite, bstat, bstats, graph, plugin, pulse, referrer, search term, statistics, stats, stats tracking, usage, wordpress, wordpress plugin, bug fix, fix, fixes, bug, bugs, beta, bug fixes

]]>
http://maisonbisson.com/blog/bsuite/feed/ 11
bsuite Features: The Photo Spread http://maisonbisson.com/blog/post/10991/bsuite-features-the-photo-spread/ http://maisonbisson.com/blog/post/10991/bsuite-features-the-photo-spread/#comments Thu, 01 Dec 2005 10:49:34 +0000 Casey Bisson http://maisonbisson.com/blog/?p=10991

bsuite features: search word highlighting and suggestions.

bsuite highlights the search words used to find blog posts in Google and other search engines, and uses those search terms to recommend other related posts at your WordPress site.

— – —

bsuite feature: related entries.

bsuite uses the tags of one post to recommend related posts in your WordPress blog.

— – —

bsuite feature: blog pulse.

bsuite includes an easy to use statistics engine that tracks the daily hits to every post and page.

beta, blog pulse, bstat, bstats, bsuggestive, bsuite, graph, plugin, pulse, recommendation system, recommendations, recommender, recommending, referrer, related content, search engine highlighting, search term, sehl, statistics, stats, stats tracking, tag, tag management, tag relationships, tags, usage, wordpress, wordpress plugin, search term highlighting

]]>
http://maisonbisson.com/blog/post/10991/bsuite-features-the-photo-spread/feed/ 11
bsuite WordPress Plugin (b2 release) http://maisonbisson.com/blog/bsuite/ http://maisonbisson.com/blog/bsuite/#comments Tue, 29 Nov 2005 01:52:05 +0000 Casey Bisson http://maisonbisson.com/blog/?p=10900

The first thing we all have to agree on is that bsuite is the replacement for bstat. The name change reflects that fact that the plugin is doing a lot more than simply track page loads. The most exciting new feature is a module I can’t help but call bsuggestive. It uses the tags of the current post to suggest related posts to your readers. And when readers arrive at your site via a search engine, it not only highlights the search words they used, but offers a list of other posts matching their search criteria.

Why “b2″? I released b1 privately a while ago, and I’ve been running it here at MaisonBisson since September.

bsuite Features

  • Tracks page loads (hits)
     
  • Tracks search terms used by visitors ariving at your site via search engines
     
  • Reports top-performing stories via a function that can be included in the sidebar
     
  • Reports recent comments via a function that can be included in the sidebar
     
  • Reports top search terms via a function that can be included in the sidebar
     
  • Outputs a “pulse” graph of activity on your site or specific stories
     
  • Highlights search words used by visitors ariving at your site via search engines NEW!
     
  • Lists related posts at the bottom of the current post’s content NEW!
     
  • Suggests posts that closely match the search criteria for visitors who arrive via search engines NEW!
     
  • Integrates bsuite_speedcache NEW!
     
  • Does some stuff with tags NEW!
     

Changes

This documentation supersedes any previous documentation.

I need to be honest, it’s been too long since the last public release for me to remember all the details. I haven’t really been keeping records on all this, so if you’ve been running the previous version and you discover a problem, please tell me about it.

The first change is that the plugin is now in a file named “bsuite.php”. As you install it you’ll need to deactivate the previous “bstat.php” version to avoid conflicts.

Another big change is that bsuite will now start tracking page loads as soon as it’s activated. You no longer need to put any code in your theme. But if you’re upgrading from a version where you already have that code in your theme, it also includes code to prevent it from double-counting any page loads.

The other functions from bstat b4 are all there, and I don’t believe there are any changes to the way they’re called.

The options submenu is almost entirely redesigned. It should be pretty self explanatory, but there’s documentation below.

Installation

Update: bugfix release b2v7 available.

  • Download and unzip bsuite.zip
     
  • Place bsuite.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 bsuite submenu of the options tab. This will allow bsuite to create its database tables.

    Stats collection will start automatically; you can see the results in the new bsuite Reports submenu of your Dashboard
     

  • Once installed, be sure to enable the options and consider customizing the look by adding the bsuite CSS to your theme’s CSS (sample CSS here).

In order to view the stats reports reports on your public pages, you’ll need to add the display functions to your pages.

Upgrading

If you’re upgrading from bstat, be sure to delete or deactivate the old plugin before activating the new one. And don’t forget to visit the bsuite submenu of the options tab so that it can create its new db tables.

Options

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

  • Minimum userlevel to view bsuite reports

    The options are restricted to users at userlevel 8 or above, but you can choose who can view the reports.
     

  • Output default CSS

    Some of the bsuite functions require CSS styles not found in the average style sheet. This will output default styles.
     

  • Default pulse graph style

    This sets how values are interpolated in drawing the pulse graph. Experiment with the options to see how they work.
     

  • Suggest related entries in post

    This will insert a block of links at the tail of each (tagged) post’s content with links to related posts at your site.
     

  • Highlight search words and offer search help

    The first part of this should be obvious, but the real trick here is using those search words to offer other related content from your site to visitors. It works (and looks) a lot like the option above, but the suggestions only appear when search words are detected.
     

  • 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 registered users at or above userlevel

    No author wants to skew their stats just by poking around their own site.
     

  • 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.

Tag Support

Until WordPress adopts a standardized way to manage tags, we’ll have to deal with things like this.

bsuite recognizes tags in three forms:

  • Any link with a rel=”tag” attribute
     
  • Any number of single tags like this: <tag>tag name</tag>
     
  • A block of comma-delimited tags like this: <tags>WordPress, WordPress Plugin</tags>
     

This appears to make it compatible with a number of existing tag management strategies now in use — including those used by Ecto and SimpleTags.

Tags in <tag> and <tags> tags are mapped to Technorati, but a future version will include an option to set other tag resolvers.

Using bsuite Functions

Though many bsuite features require no coding or modifications to theme files, there are a number of public functions available 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

    displays top stories for today only.
     

  • bstat_todayrefs

    displays top incoming search terms for today only.
     

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

    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_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.
     

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

    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.
     

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_pulse

    displays the "pulse" graph of hits over time.
     

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

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
graph_accurate (acceptable values: 0 or 1), make smooth, accurate graphs or fuzzy (but not inaccurate) graphs

Example:

<h3>Story pulse</h3><?php bstat_pulse($id, 525, 1, 1, 1); ?>
  • 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.
     

This function is no longer necessary, as it is executed automatically via a plugin hook that runs every time the footer is called. Still, it’s around if you have content that you want to track outside that scope.

Example:

<?php // this is how it used to work, but it's automated now...
	global $id;
    if (!is_single() && !is_page()) $id = 0;
	bstat_hitit($id, "read");
	?>

note: (be careful of any "curly quotes" that might have been accidentally/automagically inserted in code samples)

Known Bugs

The search word highlighting routine seems to still be buggy. Expect it to mis-recognize referrers, and one tester reported that it caused content not to display. Go ahead and enable it to see how cool it will be in b3, when it works, but I suggest disabling it for the moment.

Ryan Eby reminded me that I use a whole bunch of short PHP open tags (”<?” where I should have used “<?php”).

Zach pointed out that I’ve been sort of sloppy about using double-quotes where I should use single quotes and not single-quoting my array indices. All of this can add up to an unnecessary performance hit for high traffic sites (30,000 + daily page loads).

beta, blog pulse, bstat, bstats, bsuggestive, bsuite, graph, plugin, pulse, recommendation system, recommendations, recommender, recommending, referrer, related content, search engine highlighting, search term, search term highlighting, sehl, statistics, stats, stats tracking, tag, tag management, tag relationships, tags, usage, wordpress, wordpress plugin

]]>
http://maisonbisson.com/blog/bsuite/feed/ 115