Support » Plugin: Google Analytics for WordPress by MonsterInsights » Undefined property: WP_User::$user_level

  • Using version 4.1.3
    Turned on debug so that I could check a theme I am working on and noticed persistent Undefined property: WP_User::$user_level at 1ine 1355

    To get the plugin to stop with the debug notices I inserted a isset test on $current_user->user_level

    Not sure what the implications are. (new to php and wp)

    I’m running in maintenance mode which could be the problem.

    function yoast_ga_do_tracking() {
    $current_user = wp_get_current_user();

    if (0 == $current_user->ID)
    return true;
    // stop debug notices fix
    if (!isset($current_user->user_level)) {
    return true;

  • The topic ‘Undefined property: WP_User::$user_level’ is closed to new replies.