I have something strange. users can not upload my avatar

Hey,

I have something strange. users can not upload my avatar anymore. Only the admin can. yesterday it was possible, nothing has changed, except for an update of the WPMU chat plugin, and today it can not. i get a error, that there’s a error please try again later

Anyone know how this is possible?

thank you for the assistance

  • Nastia
    • Ex Staff

    Hello @bert, I hope you are well today!

    I tested this on my site and could not recreate the same issue.

    Would you please run a quick check for a conflict with a plugin and theme? Deactivate all other plugins and test again. If the issue is gone please activate one plugin at the time to find out which one is causing this issue. Do the same for a conflict with a theme and switch to a WordPress default theme.

    Please follow the flowchart from our manual:

    https://wpmudev.com/manuals/using-wpmu-dev/getting-support/

    Let us know how it went!

    Kind Regards,

    Nastia

  • bert
    • Site Builder, Child of Zeus

    Hi Nastia,

    i maked sure that all themes and plugins are updated and after that i changed theme and deactivated al plugins. the error is still there. I have try debug but i dont understand the things i see :slight_frown:

    its a strange error because it happend without a reason. Only when i make a user admin he or she can upload a avatar. All other roles cant. It keep telling them that there is a error and that they have to try later.

    everything on the site is working fine. Upload media dont have problems and all the functions works normal. Only the avatar is a problem

    i have grant support acces on my site http://www.letsdobusiness-netwerk.nl

    I really hope you can help me

    thnx

  • bert
    • Site Builder, Child of Zeus

    Hi Kasia,

    Its a little difficult because when im loged in as admin i can use debug, but i also can upload the avatar. so i cant see the error thats related to the problem. When i login as a user i dont see the debug errors.

    I have found the error log on my server, because its a big one included old errors i attach it by this post.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bert,

    Hope you are doing good today :slight_smile:

    Thanks for attaching the error log with your post. I can see that there is permission error at the end of file stating that there is no file or directory profile/change-avatar.

    Make sure you have not changed the permissions to these folders.

    Also, if you can grant support staff access then I can take a closer look. To grant support staff access go to WPMUDEV > Support > Support Access > Grant Access or see this manual.

    Take care and have a nice day :slight_smile:

    Kind Regards,

    Sajid J

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bert,

    Hope you are doing good today :slight_smile:

    I am unable to access your site with support staff access. I am being redirected to authorization page as seen in attached screenshot.

    You mean its started happening after making changes by Rupok ? If yes then I will flag Rupok here for his invaluable feedback on this matter.

    If you can send in login credentials along with FTP details that would help us diagnose the issue quickly using our private contact form in following format.

    Subject: "Attn: Sajid Javed"

    -WordPress admin username

    -WordPress admin password

    -login url

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant urls

    Select "I have a different question" for your topic – this and the subject line ensure that it gets assigned to me :slight_smile:

    https://wpmudev.com/contact/

    Take care and have a nice day :slight_smile:

    Kind Regards,

    Sajid J

    [attachments are only viewable by logged-in members]

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bert,

    Hope you are doing good today :slight_smile:

    Thanks for explaining the issue and providing direct credentials. You sent me super admin details with my name ? I think yes because I was able to change the avatar from extended profiles section of BuddyPress.

    Do we on same page ? The issue is with BuddyPress profile avatar ?

    Take care and happy new year :slight_smile:

    Kind Regards,

    Sajid J

  • bert
    • Site Builder, Child of Zeus

    Hi Sajid,

    Yes the problem is that a user cant upload or change the avatar on his profile. Only the admin or super admin can. All the others Rolls cant. They are able to add a profile cover but no avatar

    I wish you the best Year ever????

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bert,

    Hope you are doing good today :slight_smile:

    Thanks for providing more details. I created a test user with subscriber role and tried to change the avatar but get following error. That does not tell more about the issue unfortunately.

    An error occurred. Please try again later.

    I found similar issue on official BuddyPress forum with no answer from the community or contributor at all. It appears to be an untraceable issue that is still not fixed yet.

    https://buddypress.org/support/topic/only-admin-can-upload-new-profile-pic-avatar/

    To make sure its not a bug with BuddyPress I conducted a test on my own test site with latest BuddyPress, WordPress and TwentySixteen theme. I could successfully change the profile picture as a subscriber. It appears to be issue with your site or server configurations.

    Try to change the uploads folder permissions from 755 to 777 (temporarily) and then check again. Make this change on all subfolders.

    Wish you a happy and successful 2016 :slight_smile:

    Kind Regards,

    Sajid J

  • bert
    • Site Builder, Child of Zeus

    Hi Sajid,

    I going to run a couple of test to see of it is a problem in the frontend only or maybe also in de backend. Im a little afraid to change permissions because Rupok set everything right after i had a lot of problems. I really saved me.

    Ik have test it with other themes And disable the plugins but that dont work.

    Is it possible that iTS a permission problem? Because the admin rol can change or upload a avatar without problems.

    Can it be that for Some reason the wp permissions for the other rols changed? Is there any way i can check that?

  • bert
    • Site Builder, Child of Zeus

    hi Sajid and Nastia,

    I tested a few things and I was able to solve my problem. The problem was that only the admin can change an avatar and a user does not. Because Rupok had set all permissions well it had to be something else.

    Because I, like many others, do not want a user visits the admin dashboard, I use a snippet which the admin blocked for users. Because I wanted to test whether a user from the admin be able to upload an avatar, I had to remove this code. I found out that a user was be able to upload the avatar from the admin. And that without this code, the avatar could be adjusted in the frontend.

    So it had to be the code.

    This was the code I used:

    add_action (‘init’, ‘blockusers_wps_init’:wink:; blockusers_wps_init function () {if (is_admin () && current_user_can (‘administrator’:wink:) {wp_redirect (home_url ()); exit; }}

    I changed:

    add_action( ‘init’, ‘blockusers_init’ );

    function blockusers_init() {

    if ( is_admin() && ! current_user_can( ‘administrator’ ) &&

    ! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {

    wp_redirect( home_url() );

    exit;

    }

    }

    I found this code on your forum:

    https://wpmudev.com/blog/limit-access-to-your-wordpress-dashboard/

    now everything is working as it should and WPMU has again proven to be a very valuable source of information with great support and assistance.

    My thanks to you again is very high.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bert,

    Hope you are doing good today :slight_smile:

    I am glad to know you have figured it out and found the culprit. Also many thanks for sharing the solution, much appreciated.

    I am marking it as resolved for now, if you need any further assistance don’t hesitate to start new thread, happy help :slight_smile:

    Cheers, Sajid