- - - By CrazyStat - - -

26. April 2012

How to include CrazyStat in WordPress

Filed under: CrazyStat,PHP,Wordpress — Tags: , , , , , — Christopher Kramer @ 00:52

Of course it is possible to include CrazyStat in wordpress. I will describe here how it can be done. This approach assumes you have your own wordpress installation and can edit templates. It might not work this way if your blog is hosted on or similar. But I guess using CrazyStat in these cases would still be possible. Contact me if you need to know how and I will have a closer look.

So I assume you have a running wordpress installation and installed CrazyStat like described in the readme (at least steps 1-6 of quick install instructions). I assume you have a backup of your wordpress installation (at least the themes folder).

So the question is where to put the include code:

<?php @include_once("stat/src/include.php"); ?>

Log into the wordpress admin panel and click appearance/editor (German: Design/Editor). Make sure you selected the correct theme in the dropdown menu on the top right.

In case you do not want to use a counter

Click on “footer.php” on the right. You will see some HTML / PHP code in the editor. Put your cursor just before </body> (which should be quite at the end).  This is the best place to insert the CrazyStat code:

<?php @include_once("stat/src/include.php"); ?>

The path is seen from the wordpress root-directory. This code assumes you installed CrazyStat in the wordpress root-directory under “stat”. In case you installed it one level higher, you would need to use:

<?php @include_once("../stat/src/include.php"); ?>

Save your changes.

You might also need to adjust $config_rel_path. See config-documentation for details.

In case you want to use a counter

In this case, you’d need to find the place in your template where you want to place the counter. This should normally be somewhere after <body> in header.php, before </body> in footer.php or in sidebar.php. Unfortunately you need some HTML experience to find the correct place here. Use the same code as above.

In case you have problems

Please ask in the CrazyStat support forum in case you have problems or questions (no registration required at the moment!).

I hope I could clarify this for some people. Maybe I will do a wordpress plugin sometime. If you think this would be a great idea, tell me in the comments.

Alternative option: Use the WordPress plugin mzz-include-CrazyStat (Update 2017-02-17)

The problems with the solution described above are:

  • Whenever the theme is updated, the change of the footer.php might get lost.
  • If you switch to another theme, you need to add the CrazyStat code again.

To solve these problems, CrazyStat user Morgan Jassen developed a small helper plugin that just inserts the include code:

Find it here:

I just found this today and have not tried it yet, but think it is the better option. Thanks, Morgan!


Try my Open Source PHP visitor analytics script CrazyStat.

26. December 2011

CrazyStat development to get more open (Bugtracker, Wiki, FAQ, SVN)

Filed under: CrazyStat — Tags: , , , , , , — Christopher Kramer @ 15:17

Bug Tracker

I plan to start a public bug tracker for CrazyStat. I think this makes it easier for you to report bugs and feature requests and easier for me to manage those. I also plan a way so you can vote for new features.

Please let me know what your favourite bug tracker is. At the moment I favor redmine, but I’m not sure yet. Redmine also includes a nice wiki and project planning capabilities.

FAQ Script

Another idea of mine is to use a FAQ-script for CrazyStat. This makes asking and answering questions a lot easier. Some scripts can also handle translations which would be a great help to create FAQ in multiple languages. At the moment I think phpMyFAQ is the best solution for CrazyStat as it

  • supports multiple languages
  • supports community asking, answering and translation but also moderation and anti-spam
  • can export the FAQ into PDF/XHTML so it can be shipped in static format with CrazyStat as it is at the moment

If you have any good/bad experience with any FAQ script please let me know.

Of course it would be perfect if bug tracker, wiki and FAQ would be nicely integrated.

Public SVN

At the moment I develop CrazyStat in a SVN which is private only, but I think to make the development of CrazyStat more open, it will be necessary to open the SVN. Somebody proposed to use git, but I think at the moment git does not offer much that CrazyStat development needs compared to what SVN offers. Let me know if you disagree.

Bulletin Board / Forum

Some discussion around open-source software like user support might be more suitable to be done on a forum instead of a bugtracker or wiki. Of course phpBB is classic here, I would also consider something that is tightly integrated with the other software (bugtracker etc.).

Sourceforge project?

Somebody also proposed that I should open a sourceforge project for CrazyStat. I really like sourceforge and I think that might be a good idea, although I also love having full control over all the systems I use. But I think by opening a sourcforge project, I might get all those tools I discuss here quite easily and well integrated.

Update: I opened a sourforge project for CrazyStat now. Not much on there up to now, though. I think I will use Sourceforge for SVN, but I am not sure about the other tools. Although they are integrated nicely, they are also very limited in functionality.

Your feedback

Please let me know what tools you think an open source project like CrazyStat needs, which ones you favour and so on.