# bSuite 4

### Contents

bSuite is a set of tools that help surface interesting and relevant posts, help your users navigate your content, and help authors develop and publish content. Take a look:

 cache-friendly stats search word highlighting related posts easy options

### Details

Hey! Here’s a cool thing: the list of pages and their contents up there is automatically generated using the shortcodes in this plugin.

This software is provided as-is, with no warranty of any kind — use it at your own risk and don’t blame me if it makes your mother complain about your haircut — under the terms of the GNU Public License.

### Bugs

I’m certain there are bugs in here, please report what you find in the comments below.

## 122 thoughts on “bSuite 4”

1. Thanks for a marvellous suite. – Wasn’t there a way of adding excerpts (configurable number of words) to the related posts list items a few years ago? I can’t remember, but would surely like to have the excerpts…-) – Anyway, great job, Casey!

• @Matthia Heil:
Thank you for the fompliment. I hope to have that feature working again soon.

2. Hi Casey,

I have a follow up question above. Regarding the code snippet to include “popular posts” without using the widget, I am getting a small error. From time to time, I get a blank list item. I think it has to do with pages (such as archives or category pages), which don’t have a “title” descriptor. Is there an argument to exclude all pages (archive and category pages) and just include “posts” in the most popular post listing?

3. Hi,

Thank you for a very fine suite of tools. I have localized it for the Danes. You are welcome to download the language files and include them in the distribution zip, if you like. Go to bSuite 4 nu på dansk and choose the link labelled Download.

Corrections are welcome, of course!

Cheers!

4. Hi, I’ve just tried installing this on a fresh installation of WordPress 2.7.1 but am getting the following error:
Warning: array_slice() [function.array-slice]: The first argument should be an array in [removed]/wp-content/plugins/bsuite/bsuite.php on line 2007
and I go to what should be the WordPress home page it takes me to the page for the first post. Any suggestions?

5. I tried the plugin on my site as I was interested in the feed option to display a feed with in a post. After I installed the plugin, (downloaded 4.05 I believe) I was greeted with an upgrade notice in the plugins admin of my blog. I clicked the auto upgrade of the three plugins, and noticed the bstat upgrader wouldn’t update. I keep getting an upgrade notice but every time I click the upgrade it still shows as needing an upgrade. The current version is showing 4.04

The bsuite tag importer won’t upgrade either. In fact when the plugin is activated and I click the upgrade link it deactivates the plugin. I then tried to upgrade before activating the plugin, then when it’s placed in active status it still shows as needing an upgrade, then the whole cycle starts again when I try to upgrade. The version is showing 4.04 with this plugin too. The only one that is 4.05 is the main bsuite plugin.

I could have lived with that, however, the feed short code caused each feed item to duplicate, one with clickable link to the feed, and one that was not. and every post on the site had a Warning error regarding an array that it was expecting but couldn’t find.

I had no choice but to deactivate all plugins.

I’m running WP 2.7.1 on a new installation of WP – the site is less than a week old with only a few posts.

… Scott

6. Casey, I still love your bSuite plugin, but I’m running into three problems— only one of which is seems particularly important.

I just upgraded and got this:
Warning: array_slice() expects parameter 1 to be array, boolean given in …/bsuite.php on line 2007

It only showed this in my top post, which seems like it could be weird. As a band-aid I’ve thrown an @ into line 2007

$posts = @array_slice($this->bsuggestive_bypageviews_getposts( $id ), 0, 5); I’m also getting this error in the settings window: WordPress database error: [Duplicate key name 'search'] ALTER TABLE taistel_bsuite4_search ADD FULLTEXT KEY search (content, title) Finally, bStat Upgrader and bSuite Tag Importer refuse to recognize that I’ve done the right thing and upgraded them. The plugins page still says they are at version 4.0.4 and that they can be upgraded. 7. i have install 4.0.5 version and i have this following warning in Bstat Report page: “Warning: max() [function.max]: Array must contain atleast one element in …/wp-content/plugins/bsuite/ui_stats.php on line 141″ • Jacob Hayn says: I too have theese PHP errors * Warning: min() [function.min]: Array must contain at least one element in /…/bsuite/ui_stats.php on line 141 and * Warning: max() [function.min]: Array must contain at least one element in /…/bsuite/ui_stats.php on line 141 This is due to poor error handling, please fix it. In my installation i fixed it by inserting the following code at line 138: if (empty($pageloads)) { $pageloads = array(0); } …here is a diff, if it helps to locate the right line:$ svn diff ui_stats.php
Index: ui_stats.php
===================================================================
— ui_stats.php (Revision 84)
+++ ui_stats.php (working copy)
@@ -135,6 +135,8 @@
GROUP BY hit_date DESC
LIMIT 31
) a” );
+
+if (empty($pageloads)) {$pageloads = array(0); }
?>
<?php

BTW: [include post_id="145" field="post_content"] <- this is an awesome feature, it really made my day, thx a lot

8. is this working with wp 2.7.1 ?

9. mario says:

hello Casey
when i installed this plug in i had THE SAME problem as jon described so i supposed that must be because u used some theme as my default…
i really love the suit so i guess there is something that colud be done to fix this!

btw

10. zild says:

Im also having this error.. how do i fix this?

Warning: array_slice() expects parameter 1 to be array, boolean given in …/bsuite.php on line 2007

11. nueman says:

Warning: array_slice() expects parameter 1 to be array, boolean given in …/public_html/wp-content/plugins/bsuite/bsuite.php on line 2007

what with this error?

12. keeira roney says:

well i keep having a dream that some ones drivi ng pass my house shooting at the house next to mine and they see me see them shoot and they start shooting at me and i just dont know what to do im scared to sleep in my room does this dream mens that it’s going to happen

13. Same happen to my site that Jon said. Need a solution/help.

14. Any luck on how to solve to issue that Jon said.

15. hmm, seems a usefull pluggin, I will give it a try on my wp blog.

16. When I try and install the 4.0.5 version I get:

Fatal error: Call to a member function on a non-object in /bsuite/importer_bstat.php on line 277

17. I got this error when I active it:

Plugin could not be activated because it triggered a fatal error.

Fatal error: Call to a member function bstat_insert_term() on a non-object in /home/*******/public_html/wp-content/plugins/bsuite/importer_bstat.php on line 277

Any one solve it why it happend?

18. @Chris & @Host & others: The error about importer_bstat.php is because the bStat upgrader is being activated before bSuite. The newly release 4.0.6 version removes the upgrader, so this shouldn’t be a problem in the future (unless you’re trying to upgrade a bSuite 3.x install). Simply delete importer_bstat.php and importer_tags.php and try reactivating.

19. I’ve fixed the situation that led to warnings about array_slice(). It was sloppy on my part, but you also may want to suppress warnings/error messages in your php install for security reasons.

20. EL says:

Hi Casey,

Bsuite calls an older duplicate version of JQuery from the WordPress installation when I use your plug-in on my site (I already have the most recent version installed for other programs). Is there a way to cancel the JQuery loading option in the head (this should be an options item in the settings configuration)?

• @EL: is the version of jquery you’re using registered with the wp scripts functions? If it is, bsuite should be using it.

21. EL says:

I did a little bit of reading on this, but have not figured out how to do it (use “wp_print_scripts,” “custom_add_javascript,” and “wp_enqueue_script” features in the functions.php file). I simply included a call for the script in the head section of the theme: custom and the jquery library. Everything is working, but I think the files are getting a little confused when I switch back and forth between the dashboard and the site itself. Any suggestions would be appreciated.

• @EL:

I think you’re on the right track. It’s probably loading different versions of jQuery in dashboard and on the site itself, but that shouldn’t be problematic. Can you say more about what you mean by “the files are getting confused”?

Your site looks great, btw. It doesn’t look like you have bSuite activated now, so I can’t see for myself the conflicts. I can point you to another theme that uses a lot of JS (and uses the WP functions to avoid conflicts): P2 http://wordpress.org/extend/themes/p2 . Take a look in the functions.php http://svn.automattic.com/wpcom-themes/p2/functions.php , specifically at these bits:

if (!is_admin()) add_action( 'wp_print_scripts', 'prologue_javascript' ); function prologue_javascript() { ... wp_enqueue_script( 'p2js', get_bloginfo('template_directory' ).'/inc/p2.js', array( 'jquery' ), '200903301' ); 

If you use the wp_register_script() function to register your version of jQuery, it will replace the built-in version. Something like this:

wp_register_script( 'jquery', get_bloginfo('template_directory' ).'/js/jquery-1.3.2.min.js', array(), '200904221' );

Then, for completeness, you should register and enqueue the other scripts used in your theme:

wp_register_script( 'theme_functions', get_bloginfo('template_directory' ).'/js/functions.js', array('jquery', 'theme_domtab'), '200904221' ); wp_register_script( 'theme_domtab', get_bloginfo('template_directory' ).'/js/domtab.js', array('jquery'), '200904221' ); wp_register_script( 'theme_featured', get_bloginfo('template_directory' ).'/js/featured.js', array('jquery', 'theme_scrollable', 'theme_functions'), '200904221' ); wp_register_script( 'theme_scrollable', get_bloginfo('template_directory' ).'/js/scrollable-1.0.2.min.js', array('jquery'), '200904221' ); wp_enqueue_script( 'theme_featured' );

(my guess about the dependencies of each script are just guesses and used to illustrate how it works.)

Once the JavaScript is being loaded via the WP functions, WordPress will automatically manage dependencies and eliminate redundancy. So if you have other plugins that call jQuery, they’ll all use the same jQuery that you registered.

22. EL says:

Thanks for the compliments, and for the valiant effort at getting the code right. I tried a few things out, and it broke my javascript. So for now, I think I’m going to leave things as they are. I have the code references in the section of the site, and this seems to be a one solution recommended in the WordPress codex. The documentation for wp_register_script, and wp_enqueue_script is minimal and almost non-existent. Someone needs to write some plain language description and upload it to the codex site.

Regarding possible conflicts, I have “firebug” running in the background, and I think “it” gets confused, and slows down the site (giving me the appearance of a conflict … just things running really slowly). I never had a bug, although I find all the javascript in the WordPress administration pages to be slow, quirky, and a tad buggy. I read they are working on a major overhall of the “script-loader.php” core file for WordPress 2.8, so I think they know there are some inconsistencies with how this is done. Most people are just running a theme with minimal adjustments, but I’ve been adding and discovering some features that I like with javascript, particularly with the many scripts that run on the jquery library.

Thanks for the help (as always).

23. Just upgraded to bsuite v 4.0.6. Until today everything was ok. Now I’m getting a non fatal error:
WordPress database error: [Duplicate key name 'search']
ALTER TABLE wp_bsuite4_search ADD FULLTEXT KEY search (content, title)

Any idea?

• @Franz:
It’s a bug in WP’s database table creation function, it doesn’t know how to handle fulltext indexes and so keeps trying to create them.

24. Saif says:

Hi

I’ve installed this on 4 of my sites and everything is great except the incoming search terms.

On three of my sites bstat is not recognizing any search terms that are used to find the sites. It still indicates that no search terms have been used to find the site from any search engine even though I know that is not the case as I access the sites through search terms myself.

Any idea what may be wrong?

Thanks

25. Baba says:

Really like this plug but is there anyway to exclude the related posts element from Pages? Love it on the Posts.
Thanks.

26. Saif says:

Any help on why my bstat searchphrases table is not populating?

27. Dusit says:

How to show the related post just only the single post page, now it show on both home page (bottom of each post) and single post page?

Thanks

28. Saif says:

Any feedback on why the search phrases table is not being populated?

29. Hi, I just install bsuite and absolutely loving it. I wanted to ask if exact matching of incoming search queries is possible? Currently all phrases are matched and it makes landing page ugly.

e.g. If search query is “restart x server on jaunty” then on the landing page plugin highlights all words containing x like extra, xmas, index etc. which shouldnt happen. Only word x should be highlighted. Can you please implement this idea?

Thanks for making great plugin
-EnLi

30. Hitendra says:

Hi,

I added bsuite to my local installation of wordpress, and it works fine.

When I have uploaded to my online webserver, it did run the stats until the 16th but after that it isn’t.

It tried clicking the force migration button but still the same. While the one on my system works fine.

Can you please let me know what might be possibly wrong.

Also, I cannot see the bstat tables either online or offline generated in the database.

Can you please let me know if i am missing something here.

Thanks

31. “Insert share links at bottom of posts” option is not visible in the admin area, and the template tag doesn’t seem to work! Running WP 2.8

32. Bsuite and Scriblio are exactly what I’m looking for to catalog my US comic/DVD/CD collections, but I would like to use a larger image for the icon or an image that can be clicked on which then opens with lightbox. I forget which items I own when I go to the shops, so a full catalog with images and descriptions are useful for viewing on my phone.

Where in the CSS or php is the image size handled? I’ve used firebug to debug the page, but I can’t find the relevant tags in the code.

Apart from this little niggle, it’s a great plugin combination for wordpress

33. Pingback: bSuite für WordPress

34. Hi,
I just activated this plugin and the page showed me:
PHP Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in D:\webs\chi\news\wp-content\plugins\bsuite\bsuite.php on line 2208 PHP Warning: Invalid argument supplied for foreach() in D:\webs\chi\news\wp-content\plugins\bsuite\widgets\cms.php on line 203 PHP Warning: Invalid argument supplied for foreach() in D:\webs\chi\news\wp-content\plugins\bsuite\widgets\cms.php on line 217
Can you tell me how can I correct this? Thanks!

• @Alec: You should turn off error reporting to the browser.

35. hello i’m using WP 2.7.1,
when active Bsuite 4 in “Manage Plugins” area it shows :

Plugin could not be activated because it triggered a fatal error.

i cannot upgrade to wp 2.8.5 because some code only works on 2.7.1

thnks 4 grat plugin

• I’d love to use the bSuite plugin, but none of the widgets are displaying in my sidebar. I have the widgets set to display on the default sidebar for individual posts. I’ve tried widgets on pages, xwidgets, and everything else. The bsuite widgets won’t display anywhere? Please help?

36. Brian says:

watching bstat reports for the longest time suddenly it just stopped collecting data. 0 page loads shown and 0 visitors. Google is also embedded on the page revealing visits all day long but nothing in the bstat reports. Does anyone know what happened?

• Two places to look: are you getting new hits in the “incoming” table? If so, then the cron may not be working. Otherwise, there’s a problem with the JavaScript collector.

37. If we want to change the number of related posts displayed from 5 to 3, do we edit the following numbers in the last two lines from 5 to 3 in the bsuite.php file:

// bsuggestive related posts
add_filter(‘save_post’, array(&$this, ‘bsuggestive_delete_cache’)); if( get_option( ‘bsuite_insert_related’ )){ add_filter(‘the_content’, array(&$this, ‘bsuggestive_bypageviews_the_content’), 5);

Thanks

38. hi,

i have trouble with bsuits now, why my bstat reports doesn’t work anymore?

0 page loads and 0 visitors in last 24 hours:

thanks.

39. Hi-
thank you for creating this great plug-in.
I only have one concern/question:
can we stop the plug in from automatically adding an id to the heading tags?

this creates invalid code so when I validate the html on pages, I have to turn the plug in off,
and manually remove all the id’s, then validate etc. I would rather just have the headings be left alone.

Sincerely,
Leah

40. Mike says:

The “post loop” widget is part of bsuite but I can’t find any documentation about it?

Thanks
Mike

41. Nick Ciske says:

Anyone else having issues with bSuite and WP 2.9.2? If I activate bSuite, I can’t view my edit pages/post screens in the admin.

• Nick Ciske says:

This is the new error I get when bSuite is activated: Notice: Trying to get property of non-object in /wp-includes/general-template.php on line 366

42. The Post Loop feature also seems to be broken using WP 2.9.2 … (incomplete) error message here when attempting to use the Post Loop widget:

Warning: Invalid argument supplied for foreach() in [serverpath] /public_html/wp-content/plugins/bsuite/widgets/cms.php on line 203

Unsure as to the root cause of this, not a bsuite expert but I do like the plugin’s features. Seems a shame to have to disable it

43. Hello, I’ve seen you create a bSuite Drop Folder Media Uploader plugin but I could not find any information of how it runs on your blog. Any detail ?

• @Li-An: yeah, I just posted it, but haven’t had time to document it. Short story: you can specify a directory on your host filesystem to watch. When new files are dropped there they get inserted into the blog. If you put the pictures in a named folder, it will create a post with that name and gallery with those pics. If the folder name is numeric, it will add the pics to the post with that ID number.