Support » Plugin: WP User Avatar » Bug in line 1432 of class-wp-user-avatar-functions.php

  • In line 1432 of class-wp-user-avatar-functions.php, you are using the get_avatar_data() function to get get the URL of the user’s gravatar. Unless a size is specified here, the function returns a default size of 96px. This is resulting in a rather tiny-looking (96px) avatar in the output of the [avatar_upload] shortcode. To fix this, you would need to do something like:

    1432 $args = get_avatar_data($id_or_email, array( size=>$size ));

    …where $size is the size passed on from line 245 of the wpua_avatar_html() function in class-avatar.php. You’ve got 150px set there, but the result is still 96px because of the bug described above.

    Ideally, instead of hard-coding a size (e.g., 150px) in this line of wpua_avatar_html(), the size would be made equal to the width that is set in the plugin settings. That would be the expected behavior.

    N.B. Fixing this opens up another can of worms where avatars in other parts of the site (e.g., the activity section on the admin dashboard) are now too big. So this will have to be addressed at the same time. People with themes that do not set CSS widths for avatars could be severely affected.

    I hope this is helpful.

    • This topic was modified 8 months, 3 weeks ago by lflier.
    • This topic was modified 8 months, 3 weeks ago by lflier.
  • The topic ‘Bug in line 1432 of class-wp-user-avatar-functions.php’ is closed to new replies.