• Resolved KTS915

    (@kts915)


    I use a plugin called Basic User Avatars to enable users to upload their own avatar from the front-end of the site. Unfortunately, WP First Letter Avatar does not seem to “see” these avatars, and so loads a first letter avatar for every user, regardless of whether or not they have already uploaded their own one.

    In addition, once WP First Letter Avatar is installed, it becomes impossible to upload an avatar using Basic User Avatars: after hitting that plugin’s Update button, nothing happens.

    https://www.ads-software.com/plugins/wp-first-letter-avatar/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author DanielAGW

    (@danielagw)

    Thanks for the report. I will do my best to look into this as soon as possible, but I have very busy schedule currently. I will look into this before the end of the week.

    Thread Starter KTS915

    (@kts915)

    Thanks for responding. There is absolutely no rush; I know what busy is like!

    Plugin Author DanielAGW

    (@danielagw)

    Hi,
    Updating the avatar works – just hit Browse, navigate to your avatar file and then click Update profile. The new avatar is saved in DB, but it is not displayed, because it is filtered from the very beginning by WP First Letter Avatar. But it is saved properly and will work after you deactivate my plugin.

    I looked into it and, honestly, I don’t think it is a good idea to add compatibility between these two plugins. They both work exactly the same way – they filter WP get_avatar hook, so they both work against each other. The one which gets executed later wins, the one that was executed earlier has no effect.

    There are many avatar plugins for WordPress and they all store their avatars differently, so I would have to include them all in my code, so that my code would “give way” to them all. Including all this exclusions is of course impossible, but even if it was – I don’t think it is a good idea. I think you should decide on one avatar system. WP First Letter Avatar gives you two options – look for Gravatar first, if no Gravatar found – use first letter avatar. If you want to add custom users avatar to the equation, that would be 3 options already available for just displaying the avatar. Prioritizing all these options to make them work in every environment (including compatibilty with other plugins that may interfere with them) would be a nightmare. So if you ask me, I think you should just decide on one avatar system/plugin. Having more of them is just like having multiple cache or SEO plugins – they will only get in each other’s way and nothing good will come out of this.

    However…
    If you really want to have WP First Letter Avatar + custom users avatar, with custom avatars having priority over letter avatars, you may want to try a small tweak. Because both plugins use get_avatar filter and it happens that they both use the same priority value (10), you can modify it in PHP file. So you can either decrease the priority of my plugin or increase the priority of the other avatar plugin.
    First option:
    Go to lines 80 and 85 of wp-first-letter-avatar.php in wp-first-letter-avatar plugin dir and change the 10 parameter in add_filter() functions to 9. You need to change it in these two lines.
    Second option:
    Go to line 73 of init.php file in basic-user-avatars plugin dir and change the 10 parameter in add_filter() functions to 11.

    After this modification, it will work the way you want it to work. User avatar first, if no avatar chosen by the user – WP First Letter Avatar takes over the avatar filter.

    I may consider adding a Priority field in plugin settings. That way advanced users could adjust priority of filter execution to make them compatible with any plugin that may interfere with their functionality (increase or decrease the priority). But I’m still not too sure about it; other plugins don’t have this feature.
    Really, from my experience – two plugins hooking into the same functions to get the same results, will always be problematic and should be avoided as much as possible.

    I hope you find this explanation satisfying!

    Cheers,
    Dan

    Thread Starter KTS915

    (@kts915)

    Dan,

    Thanks very much indeed for all this! I understand entirely why you wouldn’t want to build in support for other avatar plugins.

    For my sites, using Gravatars is a complete no-no. Similarly, all the other avatar plugins I’ve tried, apart from Basic User Avatars, give users access to some part of the WP admin pages (even if it’s just the media files), which again is a complete no-no. Basic User Avatars is the only one that keeps users entirely on the front-end of the site. So I have a particular use case.

    Of course, that doesn’t mean that you should modify your plugin just for me! But the workaround you’ve thoughtfully provided is very simple, and works well, so I’m very happy with it. Thank you!

    Plugin Author DanielAGW

    (@danielagw)

    Hi,
    I decided to go with the option to allow users to change filter priority. The feature is now integrated in my development version. When the next version of my plugin is released, you can freely update it and then go to plugin settings and change the filter priority. By default it is 10, so if you want your other avatar plugin to be executed AFTER my plugin, just go to my plugin settings and change the filter priority from 10 to 9 (or any other lower value).

    The update should be released sometime next week (probably around Friday-Saturday).

    Thanks for bringing this up.

    Cheers,
    Daniel

    Thread Starter KTS915

    (@kts915)

    Wow, thank you very much!

    Really like the filter priority update. Thank you so much for your generous decision Daniel.

    Plugin Author DanielAGW

    (@danielagw)

    Thanks hjun, I’m glad you find it useful too.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conflict with Basic User Avatars’ is closed to new replies.