Fall Sale! Code FALL2024 takes 25% OFF our Pro Plugins & Books »
Web Dev + WordPress + Security

BlogStats PCC Plugin

[ BlogStats PCC ] Announcing the BlogStats PCC plugin for WordPress! BlogStats PCC is the easy way to display the total number of posts, comments, categories, as well as several other great statistics for your WordPress-powered website. With BlogStats PCC, you display only the information you want, where you want — inside or outside of the WordPress loop. Completely customizable, BlogStats PCC will display any combination of statistics you choose. This plugin is highly flexible, simple to use, open source, and completely free.

Update: BlogStats PCC has been rebuilt with all new features and options. Check out Simple Blog Stats for all the action! </update>

BlogStats PCC update

New version of BlogStats PCC now available! The new version now provides all of these great site statistics:

  • Total number of posts
  • Total number of comments
  • Total number of categories
  • Total number of members
  • Total number of guests
  • Total number of pages
  • Date of most recent update
  • Most recent commentator
  • Most recent post

Display any or all of the provided site statistics — customize your own set to provide only the statistics you want!

Installation and Usage

  1. Copy blogstats-pcc.php to /wp-content/plugins/
  2. Upload and activate via WordPress plugin admin panel
  3. Use the following tags to display your stats anywhere:
Display the entire set of statistics in a nice list format:
<?php if (function_exists('fullstats')) { fullstats(); } ?>

Display the total number of posts, comments, and categories:
<?php if (function_exists('blogstats')) { blogstats(); } ?>

Display the total number of posts:
<?php if (function_exists('poststats')) { poststats(); } ?>

Display the total number of comments:
<?php if (function_exists('commstats')) { commstats(); } ?>

Display the total number of categories:
<?php if (function_exists('catstats')) { catstats(); } ?>

Display the total number of registered users:
<?php if (function_exists('regusers')) { regusers(); } ?>

Display the total number of unregistered users:
<?php if (function_exists('userstats')) { userstats(); } ?>

Display the total number of individual, static pages:
<?php if (function_exists('pagestats')) { pagestats(); } ?>

Display the date of the most recent post modification:
<?php if (function_exists('modstats')) { modstats(); } ?>

Display a link to the most recently published blog post:
<?php if (function_exists('recpost')) { recpost(); } ?>

Display the name of the most recent commentator as a link:
<?php if (function_exists('reccomm')) { reccomm(); } ?>

Display the date of the last update in your blog's default date format:
<?php if (function_exists('recstats')) { recstats(); } ?>
Check it out: Simple Blog Stats »

About the Author
Jeff Starr = Creative thinker. Passionate about free and open Web.
.htaccess made easy: Improve site performance and security.

110 responses to “BlogStats PCC Plugin”

  1. Perishable 2008/01/27 8:05 am

    My pleasure :)

  2. Statistics for number of tags? I’m missing that one, or am I overlooking something?

  3. Perishable 2008/02/05 1:37 am

    jack, you are right — I definitely need to add statistics for “total number of tags”.. As mentioned in the email, I will look into adding this feature to the BlogStats plugin just as soon as time allows. Hopefully, within the next couple of days!

  4. Hello Perishable,

    Any news on the number of tags option?

    Also I found that there is a mismatch between the amount of pages and posts total.
    WordPress says that there are 992 posts and 9 pages, while Blogstats says there are 1001 posts, using the poststats() function and the latest version of your plugin.

    Any idea how or why this is?

  5. Perishable 2008/05/28 5:22 am

    Hi jack, if you are referring to Blogstats functionality on WP 2.5, I haven’t yet tested it. I am working on it, but with my current workload it may be awhile longer before I can get there. As for the issue at hand, it seems that the poststats() function is combining the total number of pages and posts in WP 2.5? If so, this information will be useful in determining the cause of the discrepancy. Without diving into it right now, I would guess that WP 2.5 changed another parameter in the database. I will look into it as soon as possible..

  6. So is it working on 2.5.1 properly now???

    Did any one test it???

  7. Perishable 2008/05/31 1:53 pm

    sam, although I have yet to test it myself, BlogStats should work fine with WordPress 2.5+. The only exception (to my knowledge) is that the total post count combines the total number of posts with the total number of pages (see comment #88). If you can live with that until I find time to update the plugin, everything should work fine.

  8. Godparadise 2008/06/20 3:00 am

    Good Job for BlogStats PCC Plugin !!

    If you want to add a Tags number counter at this plugin, add this on your plugin page :

    // total number of tags
    function tagstats() {
              global $wpdb;
              global $numtags;
              $wp_test = get_bloginfo ('version');
              if($wp_test >= 2.3) {
              $numtags = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = 'post_tag'");
              }
              if (0 < $numtags) $numtags = number_format($numtags);
              echo $numtags . ' Tags';
    }

    and after, add this on your template :

    <?php if (function_exists('tagstats')) { tagstats(); } ?>

    Look at the bottom of rssparadise for exemple !!

  9. Perishable 2008/06/23 4:01 pm

    @Godparadise: that is great! I will definitely be implementing that functionality in the next version of Blogstats PCC! Thank you for helping improve the Blogstats plugin by sharing this with us! :)
    Cheers,
    Jeff

  10. Great plugin! Just wondering though if there’s a bug? When displaying the number of posts, it looks like it includes posts and pages. Is there a way to only have it display the number of posts? Thanks!

  11. Jeff Starr 2008/12/17 5:49 pm

    @Josh: Yes, you are correct; until I find time for an update, check this comment (and the subsequent comment) for an easy fix.

  12. Ah, I should have read a bit more! Thanks for that, it was an easy fix!

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
GA Pro: Add Google Analytics to WordPress like a pro.
Thoughts
I disabled AI in Google search results. It was making me lazy.
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources. Also: “The Web” is not a valid answer.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.