Opened 2 years ago
Last modified 5 months ago
#16020 reviewing feature request
Upload custom avatar for user in Dashboard
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Users | Version: | |
| Severity: | minor | Keywords: | ux-feedback has-patch 2nd-opinion |
| Cc: | sabreuse@…, catalin.dogaru@…, xoodrew@…, beau@… |
Description
It would be nice to be able to upload a custom avatar for a user in the WordPress Dashboard rather than making each user sign up for a Gravatar account and upload the image to that account.
Attachments (11)
Change History (53)
comment:1
computerwiz908
— 2 years ago
- Keywords avatar custom upload removed
comment:3
SergeyBiryukov
— 12 months ago
Duplicate: #21049
comment:8
helenyhou
— 9 months ago
Relevant plugin: http://wordpress.org/extend/plugins/simple-local-avatars/
comment:10
cdog
— 9 months ago
attachment:16020.diff adds support for self-hosted custom avatars. Users are able to:
- upload a new avatar image;
- choose a rating for their custom avatar;
- remove their current avatar image.
Users can switch between their custom avatar or their Gravatar by choosing back the Default option from the Profile page.
This patch works properly with JavaScript disabled too. The output can be previewed here: attachment:16020-profile-avatar-default.jpg, attachment:16020-profile-avatar-custom.jpg, attachment:16020-options-discussion-avatars.jpg.
comment:11
follow-up:
↓ 12
scribu
— 9 months ago
The patch also seems to allow custom avatar sizes.
I think the "Default" label is kind of confusing. Instead of this:
[ ] Default [ ] Custom Use Default to display your Gravatar. <a href="...">More Information</a>
we could have this:
[ ] Gravatar <a href="...">More Information</a> [ ] Custom
Otherwise, the patch looks good. There's not much point using Thickbox instead of a simple file input here.
comment:12
in reply to:
↑ 11
cdog
— 9 months ago
Replying to scribu:
I think the "Default" label is kind of confusing.
Agreed. I have updated the patch as you suggested.
comment:13
follow-up:
↓ 14
scribu
— 9 months ago
There are some inconsistencies here:
153 $user->avatar_type = 'gravatar'; 154 $user->custom_avatar = array(); 155 $user->custom_avatar_rating = 'G';
First, you allow the user to upload multiple custom avatars, but he can only set one custom_avatar_rating. I think it's best to only allow a single custom avatar.
Also, why is $user->has_custom_avatar = 'false'; set to the string 'false' rather than to the boolean false.
comment:14
in reply to:
↑ 13
cdog
— 9 months ago
Replying to scribu:
First, you allow the user to upload multiple custom avatars, but he can only set one custom_avatar_rating. I think it's best to only allow a single custom avatar.
The user can upload only one custom avatar. Uploading another will replace the current one. The custom_avatar array contains the same avatar, but different sizes.
Also, why is $user->has_custom_avatar = 'false'; set to the string 'false' rather than to the boolean false.
Sorry for that. Fixed it.
comment:15
follow-up:
↓ 16
scribu
— 9 months ago
The custom_avatar array contains the same avatar, but different sizes.
Oh, I see.
Ideally, you should only need to store an attachment id, which could contain arbitrary sizes. See #15311
comment:16
in reply to:
↑ 15
cdog
— 9 months ago
Replying to scribu:
Ideally, you should only need to store an attachment id, which could contain arbitrary sizes. See #15311
To use the suggested method an avatar should be inserted as an attachment which is not the case. Making the avatars visible in Media Library would let other users to alter not only their avatar.
comment:17
follow-up:
↓ 18
scribu
— 9 months ago
Please don't overwrite patches that have been reviewed.
Making the avatars visible in Media Library would let other users to alter not only their avatar.
Non-administrators can only edit their own attachments.
comment:18
in reply to:
↑ 17
cdog
— 9 months ago
Replying to scribu:
Non-administrators can only edit their own attachments.
And users without the capability to upload files to Media Library (like Subscribers) wouldn't be able to upload an avatar image then. Should the subscribers be limited on using Gravatar only?
comment:19
follow-up:
↓ 21
scribu
— 9 months ago
I think that's acceptable, as a first pass of this feature.
comment:20
DrewAPicture
— 9 months ago
- Cc xoodrew@… added
comment:21
in reply to:
↑ 19
cdog
— 9 months ago
Replying to scribu:
I think that's acceptable, as a first pass of this feature.
I've made some updates based on your feedback. Please check: attachment:16020.2.diff.
comment:22
follow-up:
↓ 23
scribu
— 9 months ago
The avatar cleanup code is repeated in 3 places. Should make a helper function.
comment:23
in reply to:
↑ 22
cdog
— 9 months ago
Replying to scribu:
The avatar cleanup code is repeated in 3 places. Should make a helper function.
Cleaned up the previous submission. Please check: attachment:16020.3.diff.
With the current patch users have only one option: to upload a new avatar image. What do you think about adding support for choosing an existing image from Media Library?
comment:24
scribu
— 9 months ago
I don't think it's a good idea to try something like that right now, given #21390.
16020.3.diff looks good, and works too.
Regarding UX, if a user makes some other changes to their profile, when they press the Upload button they'll loose their changes, right?
comment:25
scribu
— 9 months ago
Nevermind, they won't.
The "Remove Image" button should be to the right of the Custom option, not below the rating and should probably be red and say "Delete".
comment:26
follow-up:
↓ 27
scribu
— 9 months ago
Oh, if you have a custom avatar and you go to /author/your-user/ in the front-end, using the Twentyeleven theme, you'll see the gravatar instead.
comment:27
in reply to:
↑ 26
cdog
— 9 months ago
Replying to scribu:
The "Remove Image" button should be to the right of the Custom option, not below the rating and should probably be red and say "Delete".
Tried to keep the interface consistent (take a look at Appearance > Header / Background). If it's not the case, I'll follow your suggestion.
Oh, if you have a custom avatar and you go to /author/your-user/ in the front-end, using the Twentyeleven theme, you'll see the gravatar instead.
Sorry for that. Fixed it in: attachment:16020.4.diff.
Thank you for your help!
comment:28
follow-up:
↓ 29
scribu
— 9 months ago
Tried to keep the interface consistent (take a look at Appearance > Header / Background).
It's not the same. The header takes up the whole width.
Also, that whole page is dedicated to the header, whereas on the profile page you have all sort of other things going on, so compactness is more important.
comment:29
in reply to:
↑ 28
cdog
— 9 months ago
I've updated the "Delete" link. Please check: attachment:16020.5.diff and attachment:16020.5-profile-avatar-custom.jpg for preview.
comment:30
scribu
— 9 months ago
Looks good to me. Let's see what some of the UX/UI people think.
comment:31
follow-up:
↓ 32
johnbillion
— 9 months ago
To me, this interface is confusing.
- What is the 'Select Image' field for? Is this my avatar? Is this a fallback avatar for users without avatars? Is it a global avatar for all users?
- If I switch between Gravatar and Custom (and vice versa), the explanatory text for Avatar Rating is no longer accurate.
- It's not clear that the Remove Avatar Image button applies only to your custom avatar.
I think this whole section needs to have a clear separation between functionality for the custom avatar and the functionality for Gravatars.
comment:32
in reply to:
↑ 31
cdog
— 9 months ago
Replying to johnbillion:
I still think it's a little unclear that the Avatar Rating and Remove Image controls only apply to your custom avatar. This needs to be made clearer.
The "Avatar Rating" controls becomes visible only when the user have a custom avatar uploaded. Also, the "Remove Image" section is not anymore there. It was replaced with the "Delete" link in the latest version of the patch (attachment:16020.5.diff) as you can see in: attachment:16020.5-profile-avatar-custom.jpg.
Thank you for your feedback and for testing the patch.
comment:33
cdog
— 6 months ago
attachment:16020.6.diff updates the previous submission making the patch ready to test against the latest revision (23184). Going to use the new wp_get_image_editor() instead of the deprecated image_resize() to get rid of the notices.
I want to add support for the new media manager but I think it would be better to wait until the ticket gets closed. Because the code is getting pretty big for a single patch I suggest to continue it separately. It would be easier to write (and review) and to avoid creating new bugs.
comment:34
nacin
— 6 months ago
- Keywords close added
- Owner set to nacin
- Status changed from new to reviewing
I don't think this is core material. Gravatar, despite it being "a private, hosted third-party service," is the industry standard. Suggesting close as maybelater, or wontfix.
comment:35
follow-up:
↓ 38
scribu
— 6 months ago
Erm, no; the industry standard is for each site to have their own user avatars. See twitter, facebook, etc. etc.
comment:36
scribu
— 6 months ago
- Keywords 2nd-opinion added; close removed
comment:37
cdog
— 6 months ago
I agree with jane and scribu. Even if it's not an important feature it's requested by users (Add Local Avatar has reached more than 250K downloads and it's just one of the available plugins). Gravatar will be still the default option even if support for self-hosted avatars is added. I think it's better to have this option rather than making users to register an alternate email address on Gravatar or install an additional plugin.
comment:38
in reply to:
↑ 35
;
follow-up:
↓ 39
rmccue
— 6 months ago
Replying to scribu:
Erm, no; the industry standard is for each site to have their own user avatars. See twitter, facebook, etc. etc.
-1, I agree with nacin. I personally think this is firmly plugin territory.
The examples you noted are social networks, so they have their own avatars, whereas most other sites don't. See GitHub (which is basically a social network), StackOverflow (ditto), etc. (Note that these are technology-focussed sites, so that's slightly biased.)
comment:39
in reply to:
↑ 38
cdog
— 6 months ago
Replying to rmccue:
The examples you noted are social networks, so they have their own avatars, whereas most other sites don't. See GitHub (which is basically a social network), StackOverflow (ditto), etc. (Note that these are technology-focussed sites, so that's slightly biased.)
The Envato marketplaces (ThemeForest, CodeCanyon etc.) are technology-focused sites too and they don't have support for Gravatar.
Thinking again the situation. Mixing both options (Gravatar and self-hosted avatars) doesn't seem right for core. Obviously, replacing Gravatar is not a good choice either. Perhaps moving it into a separate plugin would be the most appropriate solution.
Closing it as wontfix would be fine for me. But let's wait for nacin and scribu to confirm and take a decision.
comment:40
follow-up:
↓ 41
scribu
— 6 months ago
Maybe a better course of action would be to lobby the Gravatar developers (i.e. Automattic?) to release some sort of API which opens an iframe/lightbox/whatever for users to create/change their image, instead of having to go to Gravatar.com to do it, which is quite a confusing workflow.
comment:41
in reply to:
↑ 40
;
follow-up:
↓ 42
beaulebens
— 6 months ago
- Cc beau@… added
Replying to scribu:
Maybe a better course of action would be to lobby the Gravatar developers (i.e. Automattic?) to release some sort of API which opens an iframe/lightbox/whatever for users to create/change their image, instead of having to go to Gravatar.com to do it, which is quite a confusing workflow.
You could load gravatar.com in a thickboxed iframe right now, we actually do something like that on WordPress.com. Signup would still be an issue though (and there are no plans to provide a signup API). Because we need to verify ownership of an email address before we can assign it to an account, there needs to be some involvement with Gravatar.com there.
We've talked about possibly making the signup flow easier to integrate with other (non-Gravatar) sites, but haven't come up with a good solution to that yet that still includes the verification step.
As a sidenote, you can link here to slightly improve the signup process: https://gravatar.com/site/signup/email%40domain.com
And check if a user has an existing Gravatar by requesting this, with the 0's replaced with the user's email hash: http://www.gravatar.com/avatar/00000000000000000000000000000000?d=404 (default = 404 response)
There is also an XMLRPC API for working with Gravatar, although to be honest it doesn't get much attention since I don't believe many folks use it. Obviously that would change if WP core started using it. http://en.gravatar.com/site/implement/xmlrpc/
comment:42
in reply to:
↑ 41
cdog
— 5 months ago
Replying to beaulebens:
There is also an XMLRPC API for working with Gravatar, although to be honest it doesn't get much attention since I don't believe many folks use it. Obviously that would change if WP core started using it. http://en.gravatar.com/site/implement/xmlrpc/
Thank you for the information. I think it's a good approach to let users manage their Gravatar right from the profile screen. It would improve the workflow making it less confusing. Going to take a more in-depth look at the XMLRPC API to see what it can be done.
I've moved the current patch into a plugin, cleaned it up and documented the code. It's available on GitHub and WordPress Plugin Directory if anyone is interested in giving some help or just prefers a plugin to work with than hacking directly the core.
Agreed. Requiring dependence on a private, hosted third-party service doesn't seem right.