WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How do I hack the Stats plugin?

[Resolved] How do I hack the Stats plugin?

  • My blog is all about user registrations, and I’ve just found out that WP.com Stats ignores ANY logged in user. I thought it was just the admin.

    There must be a way to edit the plugin’s code to make it detect any logged in user that isn’t the admin? Right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ve reported this problem to them before, but they never seem to get around to fixing it… Annoying, I know.

    Find this code:

    if ( !empty($current_user->ID) || empty($options['blog_id']) )
    	return;

    Change it to this:

    if ( current_user_can('manage_options') || empty($options['blog_id']) )
    	return;

    This will make it only ignore users who have the “manage_options” capability, which is generally only administrators.

    Many, many thanks Otto.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How do I hack the Stats plugin?’ is closed to new replies.
Skip to toolbar