Support » Fixing WordPress » How do I hack the Stats plugin?

  • Resolved pad


    My blog is all about user registrations, and I’ve just found out that 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']) )

    Change it to this:

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

    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 ‘How do I hack the Stats plugin?’ is closed to new replies.