Follow Me on Twitter!

Last Update: 25 January 2008

Plugin Name: Site Statistics
Version: 1.7
Plugin URI: http://www.cypherhackz.net/plugins-themes/site-statistics/
Description: Show your site statistics. Posts, comments, categories, last post, last commentator and last modified.
Author: Fauzi Mohd Darus
Author URI: http://www.cypherhackz.net/

Demo:

Posts: 775
Comments: 7,397
Categories: 150
Last Post: Firefox 3.6 – Open New Tabs in Far Right
Last Commentator: Mathilde Sheriff
Last Modified: February 8, 2010 @ 9:08 pm (GMT 8)

Download:

How to Install

  1. Download the plugin file.
  2. Extract file cypher_site-statistics.zip.
  3. Upload site-statistics.php to your Wordpress plugin folder.
  4. Activate the plugin in your Plugins admin panel.
  5. Put this function <?php cypher_sitestats(); ?> in your sidebar.php
  6. Done!

How to Upgrade

  1. Download the plugin file.
  2. Extract file cypher_site-statistics.zip.
  3. Upload site-statistics.php to your Wordpress plugin folder to replace the previous version plugin.
  4. Done!

Version History

  • 1.7
    - Fix the category issue. Thanks to Fabian Terh.
  • 1.6
    - Change from categories to terms table. Wordpress 2.3 compatible.
  • 1.5
    - Fix count posts issue. Thanks to Martin.
  • 1.4
    - Compatible with Wordpress 2.1
  • 1.3
    - Only display approved comments.
    - Last Modified is now easier to read.
  • 1.2
    - Include permalinks instead of using Wordpress post IDs.
  • 1.0
    - Initial Release

As a part of 70-431 and 350-030, students have to learn the evaluation and determination of site statistics. Usually the pros in 640-822 and 642-642 series also learn this but not until they are done with 70-294 too.

48 Responses to “WP Plugin: Site Statistics”

  1. Spearhead
    December 1st, 2006 | 11:47 pm | Reply

    Very good! Thank you very much!
    非常好的插件,值得大家使用!

  2. CypherHackz
    December 2nd, 2006 | 3:21 am | Reply

    No problem and thanks for the comment. :)

  3. Martin
    February 15th, 2007 | 4:26 pm | Reply

    Hello there. I am using your plugin on my site and I really think it’s very good, but:

    The point “posts” in the list do not only count the posts! It also counts the sites. So how can deal with that? I just wanted the posts to be counted! Maybe it would be good to add the point “sites” to this list. So that the sites are counted seperately!?

    I am not the pro in php – better said a lil noob :d

    Thanks for answer – u can also send me an e-mail but please use no slang, my english is not that good! ;)

  4. Martin
    February 15th, 2007 | 4:40 pm | Reply

    solved the problem alone :d

  5. CypherHackz
    February 15th, 2007 | 7:31 pm | Reply

    dear martin,

    could you please give me more details about your problem and how you solve it? thank you. :d

  6. Martin
    February 15th, 2007 | 7:44 pm | Reply

    the code which defines to display the number of posts not only counts the posts. The sites are also counted. That means that the number displayed is posts + sites. That was the Problem.

    I changed your code a lil bit ::
    $numpages = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'page'");

    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'");
    if (0 get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
    if (0 get_var("SELECT COUNT(*) FROM $wpdb->categories");
    if (0 posts: ' . $numposts . 'Comments: ' . $numcomms . 'Cats: ' . $numcats . '';

    By trying this you will see, that the pages are also listed and seperately counted.

    I hope u could unterstand my bad english?! Hope that i could help with the changed code!? :d

  7. CypherHackz
    February 15th, 2007 | 7:51 pm | Reply

    i got it. i’ve checked back the plugin and it is incorrect. i will edit it and will release the next version. thanks for bring up this issue. :)>-

  8. Martin
    February 15th, 2007 | 7:55 pm | Reply

    :d/ … :d

  9. CypherHackz
    February 15th, 2007 | 8:05 pm | Reply

    plugin updated. thanks to you man. btw i put your link in the version history.

  10. Martin
    February 15th, 2007 | 8:10 pm | Reply

    Wow. getting prominent by editing 2 lines of php … thnx … :)>-

  11. Ktb
    June 24th, 2007 | 7:21 am | Reply

    i’ve followed your tutorial.
    a thousand times approx.
    and all i get is this!

    Fatal error: Call to undefined function: cypher_sitestats() in /home/jenny/public_html/dirtycandie/home.php on line 256

    grrrrrr! :((

  12. CypherHackz
    June 24th, 2007 | 12:22 pm | Reply

    are you sure? have you activated the plugin? :-?

  13. Ktb
    June 25th, 2007 | 10:28 am | Reply

    Yeah i Did. :(

  14. CypherHackz
    June 25th, 2007 | 4:14 pm | Reply

    it seems like the function is not working because the plugin is not activate. did you use the latest version?

  15. Ktb
    June 26th, 2007 | 11:23 am | Reply

    YAY!
    I got it working.
    It didn’t have to do with the activation,
    something wierd.
    Thanks for the code, I love it.

  16. CypherHackz
    June 26th, 2007 | 11:37 am | Reply

    lol… but im glad to hear that. :d

  17. oggin
    July 21st, 2007 | 7:47 pm | Reply

    10x for your very nice plugin!

  18. منتديات
    August 18th, 2007 | 5:46 pm | Reply

    thanks

  19. Jay
    September 28th, 2007 | 10:29 am | Reply

    On my site it is showing this error

    WordPress database error: [Table 'wastedre_wordpress.wp_categories' doesn't exist]
    SELECT COUNT(*) FROM wp_categories

    Does anyone know how to fix that? Thanks

  20. Rick
    September 28th, 2007 | 1:36 pm | Reply

    I got the same error as Jay, but the fix is straightforward. The error occurs because WP2.3 uses “terms” instead of “categories” for the taxonomy and changes the SQL table “wp_categories” to “wp_terms” as part of the upgrade.

    The fix is to alter line 23 in site-statistics.php from:

    $numcats = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->categories”);

    to:

    $numcats = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->terms”);

    This works for me with no further modification needed. Let me know if it does for you too.

  21. Jay
    September 28th, 2007 | 2:20 pm | Reply

    Yeah that worked, thanks Rick

  22. CypherHackz
    October 26th, 2007 | 12:09 pm | Reply

    Rick – Thanks for the fix. I don’t have time to check the code because I have other works and need to study for my exam. Anyway, thanks again. Will release the new update soon.

  23. Fabian
    January 20th, 2008 | 6:14 pm | Reply

    Um why does the category shows “38″ when I have only 3 categories?

  24. CypherHackz
    January 21st, 2008 | 6:51 pm | Reply

    I already know about it but don’t have time to fix this plugin. I am really2 sorry for that.

  25. timmie
    January 25th, 2008 | 4:49 am | Reply

    hello.. i read the comment above and saw that someone is also having category issues.. where exactly is the problem maybe we could fix it ourselves if it’s simple? i’m having the same problem and i do want to use the plugin but i want to fix the category number first. thanks :D

  26. CypherHackz
    January 25th, 2008 | 11:35 pm | Reply

    New version has been released. Please download the latest version. :)

  27. Anoynmous
    May 17th, 2008 | 6:14 am | Reply

    Have you thought about making this into a sidebar widget for those who use widgets?

  28. CypherHackz
    May 19th, 2008 | 7:23 pm | Reply

    Yeah but not now because kinda busy lately. But thanks for you suggestion. :)

  29. nadiyah
    June 3rd, 2008 | 8:12 am | Reply

    I was wondering… how do you change the date and time where it says “Last Modified”?

  30. rule strategy poker
    July 28th, 2008 | 12:14 am | Reply

    poker rule rules poker rule rules

  31. hentai pic medusa
    September 5th, 2008 | 9:56 am | Reply

    medusa hentai pic pic hentai medusa

  32. مركز تحميل
    October 7th, 2008 | 8:27 pm | Reply

    poker rule rules poker rule rules

  33. karen
    July 23rd, 2009 | 4:18 pm | Reply

    is there a way i can put it inside a widget? aw :(

  34. Karen
    July 25th, 2009 | 9:53 pm | Reply

    is there any code for this that i could put inside the widget than just on the side?

  35. CypherHackz
    July 26th, 2009 | 12:50 am | Reply

    I am sorry. So far, there is no widget available for this plugin.

  36. Ayah
    March 4th, 2010 | 11:01 pm | Reply

    thank youuuuu

Leave a Reply