BuddyDev

Search

[Resolved] Avatar Mod Plugin Does Not Update wpDiscuz Comment Avatar

  • Participant
    Level: Initiated
    Posts: 7
    DB Media on #41543

    We have been using the Avatar Moderation plugin for our BuddyPress site. It works fine for everything except Avatars related to wpDiscuz comments. When an Avatar is approved via moderation, the placeholder Avatar (silhouette of person) shows up for wpDiscuz comments, but the approved version works on all other sections, like the BuddyPress profile section and members list. When I log in as the user and try to upload it again, it gives an error after cropping it, but if I change the name of the file to not have “bpfull” in the assigned image name, the error goes away and the approved Avatar appears in the wpDiscuz comments. Any suggestions to fix the problem would be appreciated.

  • Keymaster
    (BuddyDev Team)
    Posts: 22212
    Brajesh Singh on #41544

    Hi,
    Thank you for using the avatar moderator plugin.

    We haven’t tested it with wpDiscuzz and it was focused on BuddyPress only, so there may be the compatibility issue.

    We will need 2 working days to test and add support(if it is feasible for wpDicuzz or let you know what is the best way).

    Please allow us to get back to you by Monday.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    DB Media on #41556

    wpDiscuz is used by a lot of people and it has BuddyPress integration. Getting it to work, or at least giving some advice on what we can do on our end would be appreciated.

    • This reply was modified 1 year ago by DB Media.
    • This reply was modified 1 year ago by DB Media.
  • Keymaster
    (BuddyDev Team)
    Posts: 22212
    Brajesh Singh on #41559

    Hi,
    Thank you for the feedback. We will do our best to assit you.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 22212
    Brajesh Singh on #41620

    Hi,
    Thank yo for the patience.

    We have found the issue. When a new comment is created, WPDiscuz caches the comment on file system. That’s why the state of that specific comment is preserved as markup. You are seeing the unapproved avatar as that is the avatar that got stored with the comment.

    We are working on a solution to safely clear the cache. I am hopeful to have the compatibility. I will let you know in next 1-2 days.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    DB Media on #41624

    That is awesome! Thanks for finding the issue and working on a fix.

  • Keymaster
    (BuddyDev Team)
    Posts: 22212
    Brajesh Singh on #41779

    Hi,
    Hope you are doing well.
    Thank you for the patience.

    If you are comfortable with the code, Please put this code in your bp-custom.php

    
    */
    
    /**
     * Enforce use cache clearing on avatar approval.
     */
    add_action( 'bpavmod_avatar_approved', function ( $object ) {
    	if ( 'user' !== $object->item_type ) {
    		return;
    	}
    
    	$user = get_user_by( 'id', $object->item_id );
    	do_action( 'wpdiscuz_reset_users_cache', $user->ID . "_" . $user->user_email . "_" . $user->display_name );
    }, 20 );
    
    

    and try uploading a new avatar and going through the approval process. Does it work for the new avatar uploads now? Please let em know.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    DB Media on #41783

    It worked great. Thank you so much for finding a solution!

    Do you have any suggestions for moderating user profile background cover images, or adapting your profile moderation plugin to work with it too?

  • Keymaster
    (BuddyDev Team)
    Posts: 22212
    Brajesh Singh on #41791

    Hi,
    Thank you for confirming. I am glad the issue is resolved.

    I am sorry, we don’t have any option or suggestion for moderating the profile cover.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved