Quantcast
Channel: MaisonBisson.com » bsuite
Viewing all articles
Browse latest Browse all 25

bsuite Bug Fixes (release b2v6)

$
0
0

[innerindex]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


Viewing all articles
Browse latest Browse all 25

Trending Articles