If the mixed content fixer is active (data-rsssl marker in the source), the plugin probably loads the gravatar image through ajax after the page load.
You can fix that by adding a few lines of code to your theme’s functions.php:
add_filter( 'get_avatar', 'rsssl_fix_mix_content_avatar' );
function rsssl_fix_mix_content_avatar($avatar, $id_or_email, $size, $alt, $args){
return str_replace('http://', 'https://', $avatar);
}
Not exactly:
ArgumentCountError thrown
Too few arguments to function rsssl_fix_mix_content_avatar(), 1 passed in public_html/wp-includes/class-wp-hook.php on line 300 and exactly 5 expected
I forgot the number of variables in the filter:
add_filter( 'get_avatar', 'rsssl_fix_mix_content_avatar', 10, 5);
function rsssl_fix_mix_content_avatar($avatar, $id_or_email, $size, $alt, $args){
return str_replace('http://', 'https://', $avatar);
}
Yes, that works now. Is there any better way to place it other than the theme? We’d like to be able to update the theme. Can you put this in the plugin?
Glad to hear that works.
You can add it as a mu-plugin, create a php file in the mu-plugins folder, and add this code. Then it will run always.
You can read how to do that here:
https://gregrickaby.com/2013/10/create-mu-plugin-for-wordpress/
I’ll have to take a look why this function does not return the https url by default when the site_url is https. If it’s a generic issue it is a candidate for addition. But as the next update is already scheduled for next week, this won’t be until September.