Running WordPress.com Stats version 1.8.1 on a self-hosted WordPress.org
I am looking to modify this plugin to prevent Super Admins and users of the Administrator role from being counted. I know I can disable the "Count the page views of registered users who are logged in" option in the plugin's settings, but that doesn't work for me because some of my visitors do register, and I'd like to utilize registrations more in the future. I want to count all visitors - logged in or out - except the main Admin account created during installation and my everyday Admin role account.
I found line 1298 of /plugins/stats/stats.php where stats_footer is added to the wp_footer hook. Upon adding an if statement around that which checked whether the user wasn't super_admin nor an administrator role, I got an error message about wp_get_current_user() being called but not yet defined. Would someone please let me know how to perform my task?
Edit: I've looked at these Codex pages: