WordPress.org

Forums

WP Biographia
[resolved] WP Biographia broke my Add Local Avatar plugin (5 posts)

  1. rlntls
    Member
    Posted 2 years ago #

    Hi there, I had installed and set up the add local avatar plugin, set all the twitter u/ns and the plugin looked good. I then added the WP Biographia Plugin which did not behave as expected, so I uninstalled it.The twitter avatars set in Add Local Avatar did not reappear. I reinstalled Add Local Avatar and although the twitter u/ns are still there, 'use avatars' and 'use twitter avatar' boxes are ticked as before, the plugin no longer works. I have tried clearing the u/n box, 'update'ing, and refilling the box, removing the plugin completely and reinstalling, to no avail. Also tried checking/unchecking the 'use avatar' box to try and coax the defaults back. This plugin has ridden roughshod over some setting or other, as I completely removed it and reinstalled the other plugin. Anybody got any ideas?

    http://wordpress.org/extend/plugins/wp-biographia/

  2. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there,

    I then added the WP Biographia Plugin which did not behave as expected

    In what way did WP Biographia not behave as expected?

    This plugin has ridden roughshod over some setting or other, as I completely removed it

    I'd be very surprised if this is the case. WP Biographia maintains all of its settings and options in a single entry in the wp_options table, with the exception of using some standard WordPress API filters to augment the user's profile.

    Having said that it may well be that there's a clash going on here, but I'd have to try this out to be sure. Is the "add local avatar" plugin you mention this one? http://wordpress.org/extend/plugins/add-local-avatar/. The WordPress API is so rich that sometimes a clash is inevitable, but most of the time it can be worked around.

    Please let me know and I'll see if I can work out what's happening.

    -Gary

  3. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    So I've just taken a look at this and I can't actually get the Add Local Avatar plugin to work with Twitter avatars. I've tried my account name, vicchi, I've tried the account name with the @ prefix, @vicchi, and I've tried the URL to my Twitter profile, http://twitter.com/vicchi. In all cases, the plugin's display of my Avatar Type remains firmly fixed on Global.

    As I'm testing out this on a local install and not on a publicly facing web server, I have WP_DEBUG enabled in my wp-config.php. I've noticed several things.

    In Add Local Avatar's admin screen, there's two deprecated WordPress API functions or function arguments being used.

    This may or may not be significant. It's normally just annoying if you have WP_DEBUG enabled.

    Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /Applications/MAMP/htdocs/live-vicchi.org/wp-includes/functions.php on line 2722
    
    Notice: get_usermeta is deprecated since version 3.0! Use get_user_meta() instead. in /Applications/MAMP/htdocs/live-vicchi.org/wp-includes/functions.php on line 2638
    
    Notice: get_usermeta is deprecated since version 3.0! Use get_user_meta() instead. in /Applications/MAMP/htdocs/live-vicchi.org/wp-includes/functions.php on line 2638

    What may be significant is that Add Local Avatar is calling the get_avatar filter with the incorrect number of arguments, which results in these message when displaying an Avatar ...

    Notice: Undefined offset: 0 in /Applications/MAMP/htdocs/live-vicchi.org/wp-content/plugins/add-local-avatar/avatars.php on line 725
    
    Notice: Undefined offset: 0 in /Applications/MAMP/htdocs/live-vicchi.org/wp-content/plugins/add-local-avatar/avatars.php on line 725
    
    Notice: get_user_by_email is deprecated since version 3.3! Use get_user_by('email') instead. in /Applications/MAMP/htdocs/live-vicchi.org/wp-includes/functions.php on line 2638
    
    Notice: get_usermeta is deprecated since version 3.0! Use get_user_meta() instead. in /Applications/MAMP/htdocs/live-vicchi.org/wp-includes/functions.php on line 2638
    
    Warning: Missing argument 5 for WP_Biographia::get_avatar() in /Applications/MAMP/htdocs/live-vicchi.org/wp-content/plugins/wp-biographia/wp-biographia.php on line 435

    If you look at /wp-includes/pluggable.php at line 1667 for WordPress v3.4.2 you can see that the get_avatar filter should be called with 5 arguments ...

    return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt);

    Compare this with /wp-content/plugins/add-local-avatar/avatars.php at line 1412, which is calling the get_avatar filter with only 4 arguments, missing out the final $alt argument ...

    return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default);

    Again, this may or may not be significant but until I can manage to get Add Local Avatar to work with Twitter avatars, it's going to make this very difficult to test and replicate your problem.

    I can see you've also posted about this in the Add Local Avatar support forum (http://wordpress.org/support/topic/plugin-add-local-avatar-another-plugin-has-broken-this-one?replies=1), so I'll cross post an edited version of this post so the plugin's author can (hopefully) see this and maybe chip in on how to get Twitter avatars working.

    -Gary

  4. rlntls
    Member
    Posted 2 years ago #

    Hi Gary,

    Thanks for your reply. Apologies if I came off rude at all with my OP. When I said the plugin did not behave as expected, I simply meant that I had probably not bothered to configure it properly - it added the bios to the home page posts, which was not what I wanted.

    My actual aim was to have the 2 plugins work together in that the twitter avatar would be in place (as it was) and then I could use your plugin to add more detailed author info such as twitter URLS etc.

    I believe the add local avatar plugin is fairly old and the support forum is something of a wasteland, so I daresay the plugin makes use of some deprecated functions (my WP is up to date).

    I have not managed to sort out the problem, so gave up and am currently using the 'Mystery Man' avatar and a simple bio provided by my theme.

    Perhaps you could add twitter avatars to this plugin ;)

  5. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for getting back to me and for the extra background; it's really helpful.

    I simply meant that I had probably not bothered to configure it properly - it added the bios to the home page posts, which was not what I wanted.

    You're absolutely right here. The default settings for a new install are to display the Biography Box on posts on the home page (amongst others) but this is easily configured in the plugin's admin settings/options.

    My actual aim was to have the 2 plugins work together in that the twitter avatar would be in place (as it was) and then I could use your plugin to add more detailed author info such as twitter URLS etc.

    WP Biographia always tries to do the right thing and use the WordPress API. Where user avatars are concerned, it uses the default way of managing avatars via get_avatar(), so it should work out of the box with WordPress's built in support for Gravatars as well as with any other plugin which plugs or overrides get_avatar() to provide other sources of avatar images. It also uses WordPress's built in filters to add the additional pieces of information to a user's profile, such as their Twitter ID. But WordPress is a very complex beast and sometimes two plugins don't always play nicely together, especially if one uses an older way of doing things, such as you've come across with Add Local Avatar.

    I have not managed to sort out the problem, so gave up and am currently using the 'Mystery Man' avatar and a simple bio provided by my theme.

    Are you 100% set on using Twitter avatars? If not, and if Gravatars don't give you what you're looking for, then maybe another local avatar plugin might work for you. If you want me to test out another plugin for compatibility, then I'll happily do so, just drop me an email.

    Perhaps you could add twitter avatars to this plugin ;)

    Maybe. But I think that's a job for another plugin entirely. One which interacts well with the standard get_avatar() so it works the way people will expect it to. It's not a straightforward task. Twitter's v1.0 API used to allow you to get a user's avatar image, but you couldn't use the URL in an img tag, you had to cache it and handle when the image was changed, plus the API call was rate limited. But the v1.0 API is now deprecated and the v1.1 API doesn't even appear to have a call to get a user's avatar image. Plus, even if you have a Twitter user's avatar, you'd need to degrade gracefully to a standard Gravatar and probably handle locally uploaded images as well. All of which Add Local Avatar tries to do, which is why we're having this conversation in the first place!

    So, for now. I'll mark this thread as resolved. But as I mentioned earlier, feel free to ping me by email and we'll see what we can work out between us.

    -Gary

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Biographia
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.