WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] One site in multisite shows incorrect gravatar next to admin comments (27 posts)

  1. rxcknrxll
    Member
    Posted 9 months ago #

    I have a multisite with one site in particular that is showing the wrong gravatar for it's user. A client of mine writes the blog while I handle the tech stuff, so we both have accounts on the website. When he comments on one of his own posts, his gravatar doesn't up. Mine shows up instead.

    His gravatar works fine everywhere except the comment section. I've confirmed that his correct email address is associated with each of this comments, but my gravatar is still showing up in place of his.

    I've tried deleting my profile, but that doesn't fix it. I've disabled all plugins, and I've reverted back to 2012 default theme. Nothing seems to fix it. For some reason, the site is pulling the gravatar for the network admin (me), not the gravatar associated with the person actually commenting.

    This isn't happening on any other site in the network. It's an isolated event as far as I've seen so far. Since I've ruled out the plugins and the theme, it's gotta be WordPress files, correct? I've also recently optimized the db, so I'm honestly not sure what to check next. Any insight is much appreciated!

  2. rxcknrxll
    Member
    Posted 8 months ago #

    Here's a link to a post where this can be seen:
    pagunview.com/2013/06/27/anti-theism-sign-up-here/

    Every comment by "Pagun" has my gravatar next to it, not Pagun's. He's using the right email address, and his gravatar works everywhere else on the website just fine. It just doesn't work on the comment section.

  3. rxcknrxll
    Member
    Posted 8 months ago #

    I've had three developers look at it. I've also had the theme developer Studiopress look at it. So far no one has any idea.

  4. Is this only happening on this site?

    I mean... if he leaves a comment anywhere else, does it happen?

  5. rxcknrxll
    Member
    Posted 8 months ago #

    I don't know if his gravatar works on other domains. I assume it does. I just know that it works on this website too...just not in the comment section. It's really got me tripped up.

    I found one post that has his correct gravatar on one comment and my gravatar on one of this other comments:
    http://pagunview.com/2013/01/01/the-times-just-might-be-a-changin-back/

    I checked both comments on that page, and he has the same email and name written on both of them. But for some reason a different gravatar shows up. What the heck could be causing this? I know it can't be the theme files, because even when I switch themes, it keeps happening.

  6. rxcknrxll
    Member
    Posted 8 months ago #

  7. rxcknrxll
    Member
    Posted 8 months ago #

    That image shows two comments by the same author. The top one displays the correct gravatar, the bottom one displays my gravatar. Both have the same email address and same name, but they display different gravatars.

    I just noticed something new. The comments preceding 9/15/13 (just about when we migrated the website into multisite) all display the wrong gravatar. All comments made since then have all posted the correct gravatar.

    So it's gotta be a db issue right? If so, what tables need repaired?

  8. The ... 'name' is different.

    The top gravatar, the correct one, is pagun

    The bad one is Pagun.

  9. rxcknrxll
    Member
    Posted 8 months ago #

    The gravatar is just associated with the email address, isn't it? In any case, what could be causing all the gravatars preceding a certain date to display the wrong image?

  10. Yeah, but I'm trying to grab for oddities. Most people let auto-fill handle it, or if you're logged IN, it should never ever change (or rather, if it changed, it would change for all posts). Example. At one point my display name here was Ipstenu. WHen I changed it to this, it changed for every post I ever made. WP is the same way.

    I know this. If you make a comment with one email, and then CHANGE the email in wp-admin, it doesn't fix the gravatar... Caching somewhere in there.

    But the fact that the 'right' ID has lowercase name, and the 'wrong' does not makes me think something in there is to do with this.

  11. rxcknrxll
    Member
    Posted 8 months ago #

    I noticed that too. I've tried changing the name, and it doesn't fix it.

  12. rxcknrxll
    Member
    Posted 8 months ago #

    Bottom line, every comment prior to Sept 15 shows the wrong gravatar. I'm starting to think more and more that it has to be a database issue. The wrong gravatar is being called for some reason. Is there a way to reboot this? A db search and replace or something like that?

  13. rxcknrxll
    Member
    Posted 8 months ago #

    I even just installed WP User Avatar plugin, which basically takes gravatar out of the mix and associated a picture you upload directly to the website with that user.

    I uploaded the avatar directly to the website, and it STILL doesn't show his avatar next to his comments.

    Again...everything on or before Sept 15 shows the wrong avatar. Everything since then shows the correct avatar.

    This has to be a database issue, right? But when I look in the db tables, I see the same thing I see in the dashboard. The correct name and email are being used, but for some reason it's referencing a different avatar.

    Does anyone have any idea what could be causing this?

  14. Run a DB omptimize and repair.

    I don't really know if it's a DB issue. I've never seen it before.

    I don't know if his gravatar works on other domains. I assume it does. I just know that it works on this website too...just not in the comment section. It's really got me tripped up.

    Please DO test this on other domains.

    Also are you 100% sure he left those comments as the logged in user? I'm really serious about checking this, becuase if so, there is NO WAY WP would have pulled in a different capitalization. I think that's going to be the key to solving this.

    Are you using a plugin with comments, like Jetpack comments or Disqus? Maybe his account there is what's jacked...

  15. rxcknrxll
    Member
    Posted 8 months ago #

    I've optimized and repaired db. That didn't change anything. I've confirmed that the gravatar works just fine on other domains.

    We're not using any comment system like Disqus, etc. Just native WP comments.

  16. rxcknrxll
    Member
    Posted 8 months ago #

    I've noticed I can go in and simply repost the comments. Since I'm posting now, the right gravatar shows up. Very time consuming fix for this issue though.

    If I go to the admin section and change the email address of an existing comment, it continues displaying my gravatar. Then I change it back to the correct email address, and it just goes right on showing my gravatar no matter what.

    It seems the gravatar is assigned to the comment at some point, and after the gravatar is attached to a comment, it's set in stone. Is there any way to "reboot" the gravatars? Can I cause the db to pull the gravatar again, hopefully pulling the correct image this time?

  17. rxcknrxll
    Member
    Posted 8 months ago #

    I just took all the content from this website and imported it into a test site on the same multisite network. I set up both users in advance and then imported the content. ALL the comments from pagun on the new import display the wrong gravatar.

    To me this means something must be happening when the content is imported. It's taking the super admin gravatar and assigning it to every comment. This new import displays the wrong gravatar on ALL posts.

    So in other words, there seems to be an issue with my multisite as a whole, not just this particular subsite. I'm still at a loss as to what to try next!

  18. This new import displays the wrong gravatar on ALL posts.

    *boggle*

    I have NEVER seen this before.

    try this... Install an single site, and import the busted site's data there.

  19. rxcknrxll
    Member
    Posted 8 months ago #

    I've never seen it before either. I've been working with WordPress sites for a long time. Totally has me stumped.

    I had a guy jump on the database and fix it. He did some search and replace query...not sure exactly what he did, but it's fixed now. I'm still left wondering what the heck happened to begin with!

  20. rxcknrxll
    Member
    Posted 8 months ago #

    Since the site's been fixed, I'm inclined to mark the topic resolved. But if Mika or anyone else have any insight into what could have caused, I'd still love to hear it so I can prevent this weirdness from happening again.

    I'll upload this to a standalone install just to see if it's a multisite thing or what the heck is going on.

  21. rxcknrxll
    Member
    Posted 8 months ago #

  22. rxcknrxll
    Member
    Posted 8 months ago #

    When I import the content into a standalone install, it works fine. Gravatars all seem normal. It's gotta be something with multisite. What's more I must have done something to screw up this particular site, because none of the other sites in my multisite are having this issue.

  23. I had a guy jump on the database and fix it. He did some search and replace query...not sure exactly what he did, but it's fixed now.

    GRAB HIM AND MAKE HIM EXPLAIN WHAT HE DID!

  24. rslawrence
    Member
    Posted 7 months ago #

    We had the same issue with the wrong avatar showing up on old, imported comments. Turned out to be due to the old value in the user_id column of wp_comments not matching the id for that user on the new site. Apparently this isn't updated during import. I used SQL to update the value to the correct id, and now the correct avatar shows.

  25. How on earth did you import?

  26. rxcknrxll
    Member
    Posted 7 months ago #

    The guy I had fix my site does not speak English very well. Dude definitely knows WordPress, but unfortunately I can't parse his explanation to me. He basically said there was something about the way we created user accounts in multisite that caused the site to not recognize the correct user in the comments section. The gravatar worked everywhere else across the site...just not in the comments section.

    I know that's not helpful lol. Sorry I can't provide more insight.

    I had even installed wp user avatar plugin that allows you to import your own image directly to the site, overriding the gravatar. Again, it worked just fine except in the comments section.

  27. Kenn Wilson
    Member
    Posted 6 months ago #

    I just found this thread while trying to track down this exact issue on a site I'm working on myself. Here's what happened and how I fixed it.

    I'm spinning off a particular category on an existing WP site into it's own blog, so I had exported posts in that single category only, then imported them normally into a new WP installation. Content and comments came over fine, except that comments were showing the wrong Gravatar and Twitter handle (which I was storing using custom comment metadata).

    After reading this thread I checked for a user ID in the comments table, which I found stored in addition to the name/email (column: user_id). The comments for all WP account holders were set to 1 (my own account ID). I suspect this is due to my not creating new user accounts before importing the content from the other site.

    So name and email are stored in the comment record itself, not pulled from the users table via the association, but the comment is still associated with the user record and this association is what's used for the Gravatar and any custom metadata.

    The good news is that the fix is easy. For each WP account affected, I located the user ID assigned after creating their accounts on the new site, then updated their comment records on the new site to insert this ID.

    The SQL I used:

    UPDATE wp_comments SET user_id = 2 WHERE comment_author_email = 'name@example.com';

    You'll need to do this for each WP account affected by the problem (and be sure to use the appropriate user ID and email for each).

Reply

You must log in to post.

About this Topic

Tags