madalinungureanu / user-profile-picture

WordPress User Profile Picture
GNU General Public License v2.0
15 stars 7 forks source link

Rest API #8

Closed alaa-alsalehi closed 6 years ago

alaa-alsalehi commented 6 years ago

add three profile picture sizes like Gravatar modify the api to add the profile picture in user in replace for new route add new route to put a media already uploaded picture as a profile picture

ronalfy commented 6 years ago

@Monter you've weighed in before. What are your thoughts on this PR?

ronalfy commented 6 years ago

@ServeMe this is a solid PR, but there are some changes I'd like to make before merging it in.

The main issue is we have to keep the current REST version v1 for backwards compatibility. I don't mind there being a v2 that implements your suggestions, or even another route that is used instead still keeping the v1 API.

I hope that makes sense!

alaa-alsalehi commented 6 years ago

check it now @ronalfy I think it is fine now

ronalfy commented 6 years ago

@ServeMe this looks good. I'll see about merging and releasing this weekend. Thanks for the contribution.

alaa-alsalehi commented 6 years ago

@ronalfy I want to add a condition for change profile picture "if the user who want to set the profile picture is the same person who upload the picture" does that make any sense?

ronalfy commented 6 years ago

Yeah, it makes sense. I'll wait for you until you say it's ready for testing.

alaa-alsalehi commented 6 years ago

all is good now check it @ronalfy

alaa-alsalehi commented 6 years ago

do you check it @ronalfy ? please do and publish I can not wait to use it on my website

ronalfy commented 6 years ago

So sorry for the delayed response. The code looks good, but I'm worried that users without the right privileges can modify profile images.

Would you be so kind as to demonstrate how someone would use this?

alaa-alsalehi commented 6 years ago

Dear @ronalfy actually that is not possible I do not take a user parameter in the request I rely on get_current_user_id so if the user is logged he can change his user profile otherwise he will kicked out with 403 http error if you need any explanation let me know

ronalfy commented 6 years ago

@ServeMe I added a capabilities check in dev. Before I push this live, can you please confirm that your REST tests are successful?

ronalfy commented 6 years ago

Assuming it works, can you show some working examples so I can add it to the docs?