• Hi,

    I have been experiencing a intermittent and peculiar issue on my platform.
    Sometimes after logging into the platform I or other users noticed that the name displayed in the “my account” section of the admin bar display information of another user. If however, the profile section was accessed all the personal information were shown correctly.

    Issue has not caused any significant problems as usually if session is refreshed correct information start to appear in the “my-account” section of the admin bar. As mentioned, issue is intermittent and does not happen often, but it worries me cannot get to the bottom of the problem. I’ve also noticed that when wrong user information are displayed in the admin bar the privileges on the platform are usually restricted as if platform adjusted to that particular user permissions.

    Could you please let me know what could be causing these problems? Do you know how information displayed in the admin bar “my-account” differ to your profile.php? Why is system pulling this from 2 different sources? How best I can troubleshoot the problem to get to the bottom of it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Are you using any caching plugins?

    Thread Starter adamkolenda

    (@adamkolenda)

    Hi Steven,

    No, I don’t , still I use only my credentials on the same machine/browser so that would not be related. I have done some further diginin and believe that this might have been related to the customer snipped I’ve added to force first and last name to be displayed instead of user login.

    This is the snipped:

    function force_pretty_displaynames($user_login, $user) {
    
        $outcome = trim(get_user_meta($user->ID, 'first_name', true) . " " . get_user_meta($user->ID, 'last_name', true));
        if (!empty($outcome) && ($user->data->display_name!=$outcome)) {
            wp_update_user( array ('ID' => $user->ID, 'display_name' => $outcome));    
        }
    }
    add_action('wp_login','force_pretty_displaynames',10,2);

    I have now disabled it and hopping that this resolves the problem, however as issue was intermittent, I could not confirm it as of yet.

    Do you believe that could have been related?

    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    No idea. If removing it fixes things, then yes. ?? And if you have any caching plugins, disable them while testing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress – my-account information in admin bar displaying someone else info’ is closed to new replies.