Support » Plugin: File Renaming on Upload » Profile photo uploads stops working

  • Resolved hemligg

    (@hemligg)


    We are running a Buddyboss community and really needed a plugin to make sure each image got a unique names. And I was really happy to find this plugin and I thought it worked very well. BUT then it turned out that when this plugin was active no one could upload a profile photo anymore.

    I’m guess the issue is that when you upload a profile photo in Buddyboss you crop the image in the process and the file name is changed by Buddyboss. And I guess that when that happens the image is lost due to having it’s filename changed.

    So you should probably add some way to exclude profile photos from having the filenames changed because the profile photos do get their filenames changed by Buddyboss.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Pablo Pacheco

    (@karzin)

    Hello @hemligg ,

    Please contact me on wpfactory site as wp.org rules are very restrictive.
    Maybe if you could send me the Buddyboss plugin I can take a look if I can add compatibility to it

    Thread Starter hemligg

    (@hemligg)

    Sure. I will try to contact you on the wpfactory site.

    Btw Buddyboss platform is free and you can download it here:
    https://www.buddyboss.com/platform/

    Plugin Author Pablo Pacheco

    (@karzin)

    Hi @hemligg ,

    After installing the Buddyboss plugin I was able to upload profile pictures, although I noticed the renaming really gets in the way.

    Anyway, I just created a new option for you on the pro version (v1.2.5) allowing to stop profile photos from having the filenames changed 😉

    Apart from that, as I’m only stopping the plugin from renaming in this specific situation, I’m providing you the custom code I used in order to do that, if you don’t want to try the pro version.

    add_filter( 'frou_renaming_validation', function( $validation, $info ){
    	if (		
    		isset( $info['request']['action'] )
    		&& ! empty( $action = $info['request']['action'] )
    		&& ( 'bp_avatar_upload' === $action || 'bp_avatar_set' === $action )
    	) {
    		$validation = false;
    	}
    	return $validation;
    }, 10, 2 );

    Let me know your thoughts

    Thread Starter hemligg

    (@hemligg)

    Thanks Pablo! It seems to work great! Will tell my Buddyboss friends all about it. 😉

    And I also might go pro eventually. 😉

    Plugin Author Pablo Pacheco

    (@karzin)

    Great, glad to hear it!
    I hope you try the pro some day eventually 🙂

    See you

    Thread Starter hemligg

    (@hemligg)

    Well it seems the same issue is when you upload a cover photo for the profile. That doesn’t work either. So you will need to exclude that from renaming as well.

    So the code should be like this:

    add_filter( 'frou_renaming_validation', function( $validation, $info ){
    	if (		
    		isset( $info['request']['action'] )
    		&& ! empty( $action = $info['request']['action'] )
    		&& ( 'bp_avatar_upload' === $action || 'bp_avatar_set' === $action ||  'bp_cover_image_upload' === $action )
    	) {
    		$validation = false;
    	}
    	return $validation;
    }, 10, 2 );
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Profile photo uploads stops working’ is closed to new replies.