• Resolved Matt Robertson

    (@everydaymarksman)


    Hey all,

    Starting a few days ago, I noticed that the gravatar icon for my users who had not uploaded their own image switched away from the custom one I installed to the generic Gravatar logo, like this: https://cdn.wpbeginner.com/wp-content/uploads/2012/08/gravatarlogo.jpg

    I sequentially deactivated my plugins and determined that Autoptimize is the culprit. However, I’ve had this combination of theme and plugins for months with no issues. I also noticed several other sites I frequent suddenly having the same blue logo in their comment sections rather than their usual site logos.

    Is this a known issue?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    No, haven’t heard of this before. Don’t see how I can set a custom one in Settings -> Reading either, so guess this is done with a plugin? I would do your standard AO troubleshooting here; disable just CSS or just JS or just HTML or just Image optimization (incl. lazyload) to see which one is causing this and drill down to see how to work around that (e.g. by excluding CSS or JS from optimization).

    If you can provide your site’s URL I’ll be happy to assist in that process 🙂

    frank

    Thread Starter Matt Robertson

    (@everydaymarksman)

    It’s a bit of PHP I added with snippets.

    add_filter( ‘avatar_defaults’, ‘generic_new_gravatar’ );
    function generic_new_gravatar ($avatar_defaults) {
    $myavatar = ‘gravatar-url’;
    $avatar_defaults[$myavatar] = “Default Gravatar”;
    return $avatar_defaults;
    }

    I’ve used this for a long time without an issue. It simply adds it to the Settings –> Discussion page as an option for selection.

    I followed the steps you suggested and disabled each of the CSS, JS, and HTML one at a time. I went through and turned every possible option, actually. Nothing fixed the error except turning Autoptimize off completely.

    That’s why this one seems to be a head-scratcher. Again, I’ve used this configuration for months without a problem at all, and then it suddenly started happening.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    So you just replace the default Gravatar URL with your own? And all of a sudden you don’t see your own default, but Gravatar’s again? _very_ weird, I don’t see how AO would cause that I’m afraid …

    As a workaround you could hook into the autoptimize_html_after_minify filter and str_replace Gravatar default with your default one? Something like;

    
    add_filter('autoptimize_html_after_minify','replace_gravatar');
    function replace_gravatar($htmlIn) {
        return str_replace( '<default gravatar image url>', '<your default image url>', $htmlIn );
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Generic Gravatar issue?’ is closed to new replies.