10.09.2008
StatPress
Although my blog is in german, i’m going to write this entry in english, as its possible audience will probably rather understand english than german.
I, like many other bloggers, use the “StatPress” Plugin from Daniele Lippi. It is a great plugin, i really like it. Unfortunatelly though, it seems as there is no more progress. His last reply on his own forum was 2 months ago – Chrome is out and not yet recognized.
Also are there some bugs in the Plugin code that have been solved in the forum but not been officially published. I wondered whether the project was still alive – no anwser.
This is sad and i decided to do something against it. Two simple steps!
Update, 13.09.2008: The plan has changed, i’m doing this as a “new” plugin now: StatPress Reloaded. More information to follow soon!
1. At the end of this entry you will find a list of changes to make to your statpress.php in order to fix known and solved bugs.
2. I will maintain the definition files myself. I’m going to need your help with that, so that we can all benefit from it:
So, what did i do? I took the existing definition files and uploaded them to my webserver. Then i wrote a little script that enables you to a) search in these files and b) download these files.
That means: Whenever you come across a spider, an user-agent, a OS or search engine that is not yet recognized by StatPress you go to http://matrixagents.org/projects/statpressbase/, do a quick check if it’s already in the latest definition files and if it’s already in, simply download the newest copy. (The download is generated automatically – what you search will always be what you get by downloading!)
If your check doesn’t return a result however, it means that you need to tell me about it. Then i can properly add your new discovery and as soon as i uploaded the new files, everybody can get them.
I will post in the comments to this entry when updating, so you could subscribe to it’s comments if you want notification.
To send in your new spiders and browsers and so on, either use the “Kontakt” form or send an email to statpress at my domain. (I hope you get it, i’d just like to avoid spam.
)
I’m looking forward to your reactions and contribution! And if you like the idea – spread the word!

I sure do like this I will link to it from my blog!
Thanks for this good work!
Thanks for the feedback! In an email i got the suggestion to fork the whole thing and add it as a “new” Plugin to wordpress.org myself – as it’s GPL that should be no problem.
Still considering to do so, would you like it?
@AgentSmith
I think that is a good idea of making a new plugin, I’m sure you could give Daniel credit.
I have a Wordpress.org account and am familiar with the SVN system it uses to post plugins (as I have a plugin already up there). Let me know…
Allright then, i’ll do it. Hope Daniel will understand – when he want’s to continue his work, he can always get everything i’m going to do while this project lasts.
I’ll post here in the comments when the plugin is ready and online!
I was starting to get slightly worried that Daniele wasn’t updating the plugin much more recently, and I’ve had to start taking the definition files into my own hands and manually updating them whenever I saw a new a new spider.
If you are going to go ahead with relaunching the plugin, I’d be glad to help out with it.
PS: The broken “page viewed” link is only broken when you use permalinks, otherwise it’s working fine. First thing might be to add a function to check whether permalinks are in use, and if so don’t add the /?
Good to hear, i’ll send you an email in the next days!
I already noticed that the “fix” i provide hear seems to make problems without permalinks. I’ll try to tak care of it. The “plugin request” at wordpress.org is already opened, i’m only waiting for them to accept it – in the meantime, i’ll try to fix the fix.
Here you go:
http://wordpress.org/extend/plugins/statpress-reloaded/
Hello AgentSmith,
Thank you so much for taking up this project for the rest of us! There was one primary grievance I had with the original Statpress, and others shared the same view. It can be summarized by this post from the original Statpress support forum:
http://www.irisco.it/forums/topic.php?id=28&replies=11
Basically, it’s just unoptimized database usage. I know this turned many people away from StatPress onto something else (Google Analytics, Wordpress Stats, etc.). Can addressing this issue be one of your priorities in the upcoming release(s)? :-)
Hi Rishi,
I’m aware of the problem and the thread you mentioned. The next, probably quick, step will be the use of VARCHAR over TEXT and such like – i’m not sure however, how quickly i’m going to begin normalizing the tables. But it also is on my to-do list, of course.
Hi, first of all, thanks for continueing the plugin, great work!
I am using the plugin for a long time now.
Few questions for a very basic theme without sidebar and widgets:
-Is it possible to put the stats in the footer ? (or elsewhere on a page)
If yes, how do I do that?
-How to use the PHP function StatPress_Print() ?
I can’t figure out how to use the given example: StatPress_Print(“%totalvisits% total visits.”);
Many thanks, if you could get things clearer for me.
Hello DeeS,
of course you can put it in the footer!
All you need to do is to edit your “footer.php” and put the
StatPress_Print("%totalvisits% total visits.");whereever you want it to show up. But remember, it needs to be surrounded by < ?php and ?> – so if you put it in a a place that is not already surrounded by the php-Tags, you need to add them as well.
I hope that helps, if not, don’t hesitate to ask again!
Thanks for he help, but it didn’t work, the way you explained.
When I put
It didn’t work….
I noticed there was a space between the < and the ?php ,
Then I changed the code to
(basicly just left out the space)
And it worked !
Thanks again for your help and for keeping the plugin up to date.
I noticed the codeparts aren’t showing….
Now that’s weird – I didn’t type the space between the two parts. Maybe a feature to prevent what happened in your comment. Whatever, I’m glad it works for you now – I’ll try to clarify the instructions with the next release!
Upon using StatPressUpdate it hangs at this point:
Updating Search engines…
…null-ed!
$qry = $wpdb->get_results(“SELECT id, referrer FROM $table_name”); <— at this point in SQL.
btw– You may want to add WHERE referrer != ” to the end, it may cut down on some unnecessary operations.
I just tested it again – the update progress works fine here. Could you send me the exakt error that MySQL gave you?
I’ll take a look at all the queries to see where i can save computing time – thanks for the hint!
Bug report: In order for google chrome to show up as chrome (or as I like it to show up “Google Chrome) it has to be before Safari in the def file. Also you should put the files in the root of the trunk dir the same dir as the readme file…
Thanks, the user-agent definitions are not too good when the order can do such things. I will try to find another solution for that, but I’ll put up a fixed version soon.
Not quite sure about your second remark – that’s the way i did it. Do you mean i should put the content of “wp-statpress” on the same level as readme.txt?
Hi, in response to the update progress SQL– it doesn’t give any errors. It just hangs and doesn’t continue the operations. I placed the same exact code in a separate sandbox area running the Wordpress library — and it would update the database without any problems. I cleared cache/cookies, all that, upgraded to the 1.4.1. and deactivate/delete/reupload/reactivated, still to no avail. Strange, indeed. Also on the topic of the searches; I’m sure you know already, but the parsing of search engine terms is lacking. It only parses MSN, Yahoo, and a very small portion of actual Google strings, the rest go without notice. I haven’t had much time to check why, but I assume it involves: list($searchengine,$search_phrase)=explode(“|”,iriGetSE($rk->referrer));
@AgentSmith
Yes, that’s exactly what I mean! And I just downloaded it again it’s fixed!
@bfowle: Yep, the problem with search engine terms is also known. Problem is, that all this stuff is pretty much tied together, so it’s not easy to just take care of one of these issues without adressing the other ones – but i will look into it!
@trm96: Alright then, as i told you, i’m new to the WP.org style of SVN-usage.
@AgentSmith
lol Don’t worry about it, it took me a while to learn the ins and outs of it myself.
You really need a message board for all this.
Haha, I agree with trm96. How about a simple PHP BB forum with categories like support, suggestions, release info, etc? That would be advantageous for all of us with a renewed interest in using StatPress (Reloaded)
You’re right, I’ll set the forum up asap, probably some time tomorrow. Comment count on my little blog now boosted enough.
Here you go: http://matrixagents.org/phpBB/index.php
*going to type “StatPress Reloaded”-page text now*
Very nice work. Thanks for informing me
Dear AgentSmith,
From last StatPress version (not StatPress-Reloaded), I’ve problem with my database. StatPress caused my database overload because of huge records. So, can you make me sure that in this version, it won’t be happen anymore?
Once again, thanks for your great works!
Hi ARS,
reducing the size of the records is now on the top of my list. I fixed some of the worst bugs and have begun restructuring the database. It may take some time, but with the next big update, this problem hopefully should be solved!
Cheers!
Thank you _so much_ for updating this plugin.
Thx!
keep up the good work!
Hi. Tanks for this great plugin.
I was translated this plugin to persian(farsi) language.
i will send the translated file for you if you want.
i was just wondering : on the widget where you can display hits, OS, ip etc etc etc , Is there any way to show pageviews, i tried the obvious %pageviews% but it didnt work,
any help would be apreciated
d
Hi,
give %thistotalpages% a try!
Regards!
no doesnt work? any other ideas?
Do the other values work? Are you using the latest version?
ye i believe its the latest version.
all the other values work. i just get the
%thistotalpages% displaying and not the actual value it calls
This is weird, I will have to take a look at it and probably need to do a bugfix. I will inform you about the result of my investigations asap.
its working now.. my mistake.. many appologies
No problem, all that counts is that it’s working now.
Guten Tag !
You just need to add this in the top posts function :
I’m using the top posts widgets, but it displays the feeds and home in the list which is not very sexy
AND urlrequested LIKE ‘%p=%’
Then it will only grab the posts.
Also, i found the export function seems not to work, files returned are empty.
And finally a question : is there a way to get all “search terms” ? it’s funny to browse them but the search page brings only limited results (50 max) and you can’t search for * or empty value (could be an improvement)
Thanks
Hi,
I’ll include your top posts modification in the next update, it’s better indeed.
The export works fine for me, could you give some details about your setup?
Currently there is no way, but I’ll add 100, 200 and all to the search page.
Danke schon
For the export i tried again, it’s working for a few days range but if i want more than 3 months data the file is empty. It may be a server limitation, using too much memory or something.
If i select delete visits after a certain time, does it just delete info about visitors or it deletes search terms,… ?
– Woods
Yes, unfortunatelly statpress is very memory-consuming.
It’s deleting the complete entries with all the information they’re carrying, like search terms for example.
A complete restructuring to deal with both these problems was planned but I had to pause working on it for not having enough time at the moment.
I’m just wondering..
is there anyway to display total hits/pageviews only for that day in the widget?
%thistotalpages% seems to display all of the counted hits.
Thanks agentsmith!
%pagestoday% should do that!
Hi,
I am using your plugin and was wondering whether you could fix an issue regarding the monthly targets. The formula is (excerpt):
/ date(“d”, current_time(‘timestamp’)) * date(‘d’, mktime(0, 0, 0, date(‘m’, current_time(‘timestamp’))+1, 0, date(‘Y’, current_time(‘timestamp’))))
This uses the whole days of the month to normalise the hit rate over the entire month. However, since it uses whole days it is totally wrong early in the month and especially right after midnight. I think a more correct implementation (and also easier) would be to replace this with:
/ (time() – mktime(0,0,0,date(‘m’),date(‘1′),date(‘Y’))) * (86400 * date(‘t’))
Great work on the plugin, though! Thanks for the effort!
Thanks for this, I’ll release an update with this fix included tomorrow!
dear friend
thanks for the plugin but i had a question
i want yesterday visits and this months visits to apear in the statpress widget
but i could not find any taag for that?
there it is in the admin panel so it should have the ability to add this to items in the front end.
please help me for this
There currently is no tag for this, but I will add one for the next version.