WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
[resolved] Error when user is not logged in... (6 posts)

  1. whatadewitt
    Member
    Posted 3 years ago #

    I'm getting a strange error with the plugin whenever a user is NOT logged in...

    Notice: Undefined property: WP_User::$user_level in /[SERVER]/web/content/wp-content/plugins/google-analytics-for-wordpress/googleanalytics.php on line 1310

    Is there an easy way to fix this?

    Thanks,

    --d

  2. whatadewitt
    Member
    Posted 3 years ago #

    Would it be worth changing the line

    if (!$current_user)
    return true;

    to

    if (0 == $current_user->ID)
    return true;

    Thanks,

    --d

  3. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Does that fix your issue?

  4. whatadewitt
    Member
    Posted 3 years ago #

    It does!

  5. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Ok that'll be fixed in the next release.

  6. whatadewitt
    Member
    Posted 3 years ago #

    Thanks a lot!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic