I have just started using StatPress today. It’s such a great plugin for tracking my WordPress based website. I was depending on WordPress.com stat to track my website visitor, but I think I don’t have to anymore. One thing missing from this plugin, I think, is the ability to exclude admin to track. When people make a website where enable people to register on their website, they still want to track the logged-in user activity but him. This plugin can track logged-in users and exclude certain IP address but it can’t exclude admin to be tracked; maybe I missed it, but I couldn’t find it. Well, I don’t always maintain my website from my home; I use my laptop and I might do it anywhere.
I’ve done the modification for it myself. This is what I do:
1. adding the user role variable inside the “iriStatAppend” function
global $user_level;
2. modify line 1188 (StatPress version 1.3.2) from
if ((!is_user_logged_in()) OR (get_option('statpress_collectloggeduser')=='checked')) {
become
if ((!is_user_logged_in()) OR (get_option('statpress_collectloggeduser')=='checked' && $user_level < 8)) {
the user_level < 8 means you’re not an admin, admin user_level is 8 and above. You can find more about this at WordPress Codex.