This page is sponsored by:

10/10 spots available | Order a Link now | Our Sponsorship Program

Overview:

This is a plugin to display number of blocked access attempts of Bad Behavior Plugin.

Original mysql function for BB1.5 is by Mark, while the function for 2.x is from the Bad Behavior source code.

Requirements:

Installing

  1. Download Bad Behavior Stats Plugin.
  2. Upload bb_stats.php to wp-content/plugins/ folder.
  3. Activate the Plugin in WP-Admin.
  4. Goto Options > BB Stats. If you are upgrading from an earlier version, it is recommended that you click Default Options so as to clean up any old options.
  5. Add <?php if (function_exists('bb_block_count')) bb_block_count(); ?> where you want to display the stats or enable the same from the Options page.

The Function:

bb_block_count()

The following options can be set through Options > BB Stats:

  • $bb_no_of_days - the number of days you set the $wp_bb_logging_duration variable in bad-behavior-wordpress.php. Default of both variables is 7. Applicable only for Bad Behavior 1.x
  • $add_footer - Automatically add stats to wp_footer() if the template contains the code of it.
  • $wp_dash - Enable widget for WP-Dash. Will be displayed only if you have WP-Dash installed.
  • $str - This is a textarea in which you can enter the text you want displayed on the site.

Customizing:

Add <?php if (function_exists('bb_block_count')) bb_block_count(); ?> where you want to display the stats.

It will display something like:

BBStats report: Bad Behavior has blocked 84 access attempts in the last 3 days.

Note: Using if (function_exists('bb_block_count')) in the above code ensures that your blog won’t break even if you deactivate the plugin.

 

You can customize the text that will be displayed by using the following:

  • Use %count% to display the number of block attempts.
  • Use %days% to display the number of days ($bb_no_of_days).
  • Use %bburl% to display a link to Bad Behavior page.
  • Use %bbstatsurl% to display a link to Bad Behavior Stats page.
  • Use %totalcount% to display the total number of access attempts. (Only if verbose logging is enabled for Bad Behavior)

The default value of the text area is:

<br />%bbstatsurl% report: %bburl% has blocked <strong>%count%</strong> access attempts in the last %days% days.

Feel free to modify it as you please. However, I do request you to mention both %bbstatsurl% and %bburl% in the text so as to add a link back. It is not mandatory, but highly appreciable :)

Additionally, Bad Behavior Stats also comes with a widget for WP-Dash that will allow you to display the statistics on the dashboard that WP-Dash creates. WP-Dash is a good alternative to the current WordPress dashboard. It is available as a plugin and is currently in beta state. Since, the author of it requested me to embed the widget code into my plugin, I guess I’m among the first authors to create a widget for WP-Dash.

I have also made available the function bb_block_count_noecho() which has a return value instead of a echo. You can use it as follows:

$str = bb_block_count_noecho();
echo $str;

Lastly, you can reset to default options by clicking on Default Options. I recommend you do this once during upgrade if you are upgrading from any older version as it will clean up old variables which the plugin used.

ChangeLog:

  • 2.1
    • Link to Bad Behavior homepage fixed
    • Title attributes added to the BBStats and Bad Behavior Links
    • New variable %totalcount% added for displaying total number of access attempts if verbose logging is enabled.
    • Now, admin functions and wp-dash functions are only declared if on the admin page and if wp-dash is installed respectively, thereby saving on processing time.
  • 2.0 - Compatibility Update
    • Plugin now works with Bad Behavior 1.x and 2.x
    • Only counts the number of blocked attempts.
    • Number of blocked attempts can now be viewed under Options >> BB Stats as well.
    • Few miscellaneous fixes
  • 1.6 - Made compatible with Bad Behavior 1.2. Now counts both 412 and 403 errors.
  • 1.5 - Yet another major update. You can now customize the text directly in the options panel. No more editting the plugin file. The code also has a widget for WP-Dash which will let you display the stats on the dashboard.
  • 1.4 - Big Update. Code added to template may need to be updated. Now all options are settable through Options >> BB Stats.
  • 1.3 - Mandatory Update.
    • Fixed the plugin to work with 1.1.2 of Bad Behavior.
    • Fixed the Cannot find table error that was being generated.
    • Now checks if Bad Behavior is installed / activated and generates the appropriate message.
    • Few miscellaneous fixes
  • 1.2 - Major change. Code added to template needs to be updated.
    • Added two more variables to the function viz. $bb_no_of_days and $only403.
    • You can now modify $add_footer in the plugin file to choose if you want to display the stats automatically in wp_footer.
    • Simplified install and upgrade as now you don’t need to edit the plugin file (unless you want the plugin to automatically insert the stats in footer).
  • 1.1 - Fixed a bug where number of days was not being displayed.
  • 1.0 - Release

To Do:

  • Pass $bb_no_of_days as an argument to the function (done with v1.2)
  • Variable to enable/disable automatic addition of stats to wp_footer (done with v1.2)
  • Options configurable in Admin > Options (done with v1.4)
  • Fetch and display the blocked access attempts’ details in WP Admin (done with v2.0)
  • WordPress Widget Support
  • Count total entries in the table

Downloads

Current Version is 2.1

I’ve spent a good deal of time and money developing and maintaining the plugin. If you like the plugin and find it useful and would like to donate something for my work please do click the Paypal Donate button below. The payment is secure. I haven’t filled in any amount. Feel free to donate what you please. Any amount is welcome. Thank you :)

License

All files and their contents are licensed under the GNU General Public License (GPL).

Questions or Bugs

Known Bug

Wordpress 1.5 (Strayhorn) has a bug which prevents multiple plugins from creating administration interfaces at the same time. If you have another plugin which creates an administration panel under Options, temporarily disable it, configure BB Stats, then re-enable the other plugin. Once configured, BB Stats will operate normally.

If you have any questions or would like to report any bugs then please use the support forum.

The comments from the past version of Bad Behavior Stats have been archived.

Related Posts

Comments:

  1. MHC says:

    w00t!!! It is ready! Ajay, you rock! I’ll be installing this in a few seconds!

    I will try sending a small donation to you in the next few days, I respect the work of software developers and recognize all the work and effort you guys put in your work. Whenever I can, I try to help.

    Again, thank you so much! Way cool!

  2. MHC says:

    Installed and your plugin works like a charm! Bravo!

  3. Ajay says:

    As I promised :)

    Thanks in advance for the donation, really will help now that I am going to be unemployed for quite a while. (ok this is shameless)

  4. djanoux says:

    thanks for the plugins but. I have problem when installed it.
    It display message “Please install / activate Bad Behavior”
    I has installed bad behaviour 2.0.1 and bad behaviour stast 1.6
    Wheri did wrong on installation?
    Thanks

  5. djanoux says:

    ah sorry. i miss the ver. 2.0. now with ver 2.0 is working great :)

  6. Michael Hampton says:

    Now can you please fix the URL for Bad Behavior? Thanks :)

  7. Ajay says:

    Hi Michael,

    Didn’t realize the change in the URL. Will release an update with the new URL :)

  8. Kitchen era says:

    The plugin works like a treat! Thanks again guys!

  9. Garry says:

    I wonder can I combine Bad Behaviour with Akismet on my blogs powered by wordpress?

  10. Ajay says:

    Just install both Garry

  11. Hobo Design says:

    Exactly what is this plugin supposed to do? I’m looking at plugins but this page seems a little vague (even with all the copy!) Maybe I’ve been up for a little too long!

  12. Alex says:

    Ajay, does it work ok with WordPress 2.2.1?

  13. Ajay says:

    I’m not sure about this. Haven’t had the opportunity to test it. Are you noticing any discrepancies?

  14. Marc says:

    I have a problem with Wordpress 2.2.1, has someone it running with this wp version?

  15. LcD says:

    How to use $add_footer to a custom made template?

  16. LCD says:

    I am using it with WordPress 2.2.1, and no problem

  17. Vijay says:

    For now, I am sticking with Akismet only. Once the comment spam goes up, I’ll probably start using bad behavior as well

  18. Yuriy says:

    I’m using it 2.2.1 too. All fine. So Marс it is running with this version.

  19. Julian says:

    Ajay, does it work ok with WordPress 2.2.1?

  20. Ajay says:

    I believe it does

  21. reise says:

    Julian, for me it works with WordPress 2.2.1

  22. Jason says:

    Nice plugin thanks a bunch for this, currently I have been using askimet to help with comments, which is good but I am look at other moderation solutions also.

  23. India says:

    Ajay, does it work ok with WordPress 2.2.1?

  24. Ajay says:

    I haven’t tested it with 2.2.1 or above. However, technically it should work. If you notice any problems, please do let me know…



Trackbacks & Pingbacks:

  1. Pingback from Bad Behavior Stats v2.0 » Ajay - On the Road called Life!

    [...] Read more and download the plugin>> Why search for it when you can bookmark it?These icons link to social bookmarking sites where readers can share and discover new web pages.   [...]

  2. Pingback from Weblog Tools Collection » Bad Behavior Stats v2.0

    [...] Read more and download the plugin>> tagged bad behavior, bad behavior stats, bad behaviour and stats   Related Posts from the Past: [...]

  3. Pingback from Weblog Tools Collection » WP-Plugin: Bad Behavior Stats v2.1

    [...] Read more and download the plugin>> tagged bad behavior, bad behavior stats and bad behaviour   Related Posts from the Past: [...]

  4. Pingback from Attack of the Bots! at Atsutane Dot Net

    [...] Attack of the Bots! Published 1 day ago - 0 Views in Software and Wordpress. BBStats report: Bad Behavior has blocked 93 access attempts in the last 7 days. [...]

  5. Pingback from Protect your Wordpress blog from Spam » Technology News, Computer, Security, SEO Discussion, Blogger Hub

    [...] Preventing spams is an important thing to do and here’s what you are supposed to do to avoid your Wordpress blog from getting hit by spammers. Since the first time using the Wordpress blog, I have found two very effective plugins which do the job very well. One is Bad Behavior and the other one is Spam Karma. I am currently using Bad Behavior on my blog. Optionally, you can add the Bad Behavior Stats Plugin to display the number of blocked attempts on your blog. [...]

  6. Pingback from No more bad behaviour! at Flex Daddy

    [...] Hopefully I’ll have no more spam (or at least minimal spam) to deal with, as I have just installed Bad Bevahiour 2 and the BBStats plugin for WordPress. It was just getting out of control! And to it’s credit it has already blocked 26 malicious attempts including a few spam comments. I’ll leave it running for a few weeks to see how it goes, but if you have any trouble accessing flexdaddy.info or posting a comment please let me know by sending an email to andrew [at] flexdaddy [dot] info. Filed under: General   |   [...]

  7. Pingback from Peekaboo / truly thankful

    [...] Wow and wow is all I can say about the Bad Behaviour plugin. Simply put, it kills spam dead. It stops the spam before it gets logged as a hit (and to the wp_comments table, I think). It rocks and I am so glad I am using it together with my Spam Karma plugin. It’s been over 3 days and SK2 has caught just 4 spammy comments since I turned Bad Behaviour on. Ordinarily, I would have been hit with a never-ending stream of ugly sites. I’m using Ajay D’Souza’s Bad Behaviour stats plugin, but I will turn it off because I thought it would provide detailed stats in the admin interface. I don’t want to create a page to display my stats to the public. Also, I think the spam comments that are slipping through are being stripped of the links. This is when I review the caught spams from the Spam Karma admin panel. I don’t know if that is thanks to Bad Behaviour too or not. Anyway, I didn’t get a whole lot of work done today. I did take care of administrative business like getting some paperwork in before the deadline struck (i.e. tomorrow) and printing a whole bunch of crap just to look busy. I had a meeting with my T and my group today which was alright. A bit much for one day, but I needed to hear it. It just struck me that December is around the corner and I literally had to pinch myself. Next thing I know, 2010 will be around the corner. It feels really surreal to have been away from my family for this long (going on 5 years in a month’s time). There’s only so much pictures can tell you about people and pictures haven’t done justice to bringing back the feel of family for me. [...]