WordPress StatPress plugin with empty table option

I use the StatPress plugin on this blog installation to gather some basic and live statistics of the visitors to my blog. I also use the WassUp plugin to capture some similar statistics. While both plugins have their own pros and cons, there is one thing that used to bother me about the StatPress plugin.

While there is an option to delete the older records from the table after a certain time, there is no option to empty the entire table of the stats. Why is this option required? Well, certain people like me host their blogs on servers which give a limited amount of database storage. Statistics plugins like WassUp and StatPress tend to accumulate a large amount of data and thereby take up a lot of database space.

WassUp has an option to empty the table whereas StatPress misses this functionality. I had to manually go into phpMyAdmin and empty the table. So, I decided to look into the plugin and try to add this functionality within it so that I could save myself from the hassle of going to a another software to manage the mess. I am no coder. I read through the entire code in statpress.php and made modifications as required.

I present to you, StatPress with empty table option.

statpress

As the above screenshot clearly shows, when you click on StatPress tab within your WordPress Dashboard, you will see an extra option called “Empty”. Clicking on it will delete all your stats from within the database and makes StatPress start afresh. However, please note that this action is permanent unless you have a previous backup. Once you click on Empty, it will empty your database without any further prompts or warnings.

DOWNLOAD : StatPress v 1.2.9.2 with Empty table option (79KB).

Those of you not wanting to undergo the exercise of downloading a new ZIP file of a plugin, deactivating the original StatPress 1.2.9.2 and reactivating this plugin may simply copy the entire code from the text file linked below.

DOWNLOAD : statpress.txt

Open the statpress.txt file. Either save it as statpress.php and overwrite the wp-content/plugins/wp-statpress/statpress.php file. Otherwise, from within your WordPress Dashboard, click on Plugins. Navigate to StatPress and click on Edit. Replace the entire text in the textbox on the next page with the text from the statpress.txt file you just downloaded.

Please note that I am in no way responsible to any damage or loss whatsoever the use of this modified plugin may cause to your installation. I am Jack of all trades, master of none. I don’t claim the code and modification is perfect. It is just a basic implementation. Take all precautions before you activate this plugin.

Finally, the development of StatPress seems to have stalled. There is another plugin StatPress Reloaded. Check it out.


Some other posts that might interest you :

  1. Migrate/move your WordPress blog to a new domain/server : Well since I just finished migrating this blog over to this new domain, I thought I’d just describe how I actually did it. Firstly, login to your existing blog, Goto Settings, Permalinks and activate the default permalink structure. I recommend doing this because I’ve been locked out a dozen times while updating my blog [...]...
  2. WordPress 2.8 Plugin Browser bug : Since WordPress 2.8 “Baker” went gold today, I decided to immediately upgrade. I took the essential backups and hit the automatic upgrade link in the WordPress Dashboard. Voila! WordPress 2.8 was up and running in an instant and seemed perfectly bug free. The reality though, was different. I decided to update some of my plugins as [...]...
  3. Lock and Hide your Windows XP folder the special folder way : This week I came across an article on Lifehacker providing a way to hide and lock a folder in Windows XP. The moment I read it, I fond out that they were using the same technique to hide files that I used to use in the start of 2005 to hide porn on my PC. Although [...]...
  4. I Like Wordpress!! : Well its been a breeze installing and configuring this software (wordpress) Its just too good. The themes are nice, the plugins are available!! Best of all, its free!! If you wanna host your blog… go register on some free blogging sites which offer Wordpress like blogsome.com. I’m falling in love with blog stuff!! ...
  5. Moving a user’s files/directory in Windows 7 : There was a time during the days of Windows XP, when you could simply right click on your My Documents folder, go to properties and relocate your entire documents folder. When Vista came, it brought with it a number of folders that were now associated with the user. This included Downloads, Searches, Music etc etc. [...]...

2 Comments

Post a Comment

Your email is never shared. Required fields are marked *