Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avatars are being deleted after thumbnail regenarting #31

Closed
ituk opened this issue Jun 16, 2019 · 10 comments · Fixed by #90
Closed

avatars are being deleted after thumbnail regenarting #31

ituk opened this issue Jun 16, 2019 · 10 comments · Fixed by #90
Assignees
Labels
help wanted needs:refresh This requires a refreshed PR to resolve. type:enhancement New feature or request.
Milestone

Comments

@ituk
Copy link

ituk commented Jun 16, 2019

after regenerating all thumbnails in site and wiping unnecessary images (using Regenerate Thumbnails plugin), some avatars thumbnail where deleted. so...

  1. is there a way to regenerate them? the original files are still there, only the cropped ones are gone.
  2. there must a be a way to prevent things like that from happening. maybe registering the avatars as image_size?
@jeffpaul jeffpaul added the type:enhancement New feature or request. label Jun 17, 2019
@jeffpaul jeffpaul added this to the 2.2 milestone Jun 17, 2019
@jeffpaul
Copy link
Member

@ituk I believe they should be regenerated on demand when that specific size is requested; are you seeing broken avatar images on your site or just that specific file sizes are missing in your "uploads" folder?

@ituk
Copy link
Author

ituk commented Jun 18, 2019

thanks @jeffpaul, but i only see broken avatars. i managed to restore most avatars from a backup i had, but i guess the core of the issue is still there.

@jeffpaul
Copy link
Member

@ituk thanks for the update. Mind confirming your environmental info to help us triage this and aim for a resolution in the 2.2 milestoned release?

Environment information

  • Device: [e.g. MacBook]
  • OS: [e.g. MacOS 10.14.3]
  • Browser and version: [e.g. Firefox 65.0.1, Chrome 73.0.3683.75, Safari 12.0.3]
  • Restricted Site Access version: [e.g. 7.1.0]
  • Theme and version: [e.g. Twenty Nineteen 1.3]
  • Other installed plugin(s) and version(s):

@ituk
Copy link
Author

ituk commented Jun 22, 2019

Environment information

  • Device: ISUS Laptop

  • OS: Win10

  • Browser and version: Firefox 67.0.4

  • Theme and version: a custom made theme

  • PHP version: 7.2.11

  • WP version: 5.2.2

  • Other installed plugin(s) and version(s):

  • Advanced Custom Fields: Star Rating Field - 1.0.2

  • Advanced Custom Fields PRO - 5.8.1

  • Akismet Anti-Spam - 4.1.2

  • All In One SEO Pack - 3.1.1

  • Capability Manager Enhanced -1.7.5

  • Classic Editor - 1.5

  • Co-Authors Plus - 3.4

  • Comment Attachment - 1.5.8.1

  • Contact Form 7 - 5.1.3

  • Crop Thumbnails - 1.2.4

  • Events Manage - 5.9.5

  • LearnDash LMS - 3.0.5.1

  • Mashshare - 2.4.6

  • Mashshare Share Buttons - 3.6.5

  • Minimum Featured Image Size - 2.0.1

  • One Click Accessibility - 2.0.3

  • Peter's Collaboration E-mails - 2.2.0

  • Peter's Post Notes - 1.6.5

  • plugin load filter - 3.1.0

  • Public Post Preview - 2.8.0

  • Redirection - 4.3.1

  • Search & Filter Pro - 2.4.6

  • SendinBlue Subscribe Form And WP SMTP - 2.9.5

  • Simple Local Avatars - 2.1.1

  • Subscribe to Comments Reloaded - 190529

  • Wordfence Security - 7.3.4

  • WP-Members - 3.2.8.1

  • WP-Members Email as Username - 1.8.0

  • WP-Members Expirations Extension - 0.9.2

  • WP Mail Logging - 1.9.1

  • WP Rocket - 3.3.5.2

  • WP ULike - 3.6.0

  • Yet Another Related Posts Plugin - 5.0.0

@dinhtungdu
Copy link
Contributor

I can reproduce this problem. The cropped avatars get deleted by Regenerate Thumbnails but the simple_local_avatar user meta still exists. Simple Local Avatar gets avatar data from that meta first, then if it doesn't exist SLA will generate a new avatar from the original file.

there must a be a way to prevent things like that from happening. maybe registering the avatars as image_size

This will do the trick. By registering an image size, the avatar will get regenerated like other image sizes.

Btw, we still need a way to clear the avatar cache (saved as user meta).

@dinhtungdu
Copy link
Contributor

Here is my idea about clearing the cache. The only place I can think about is under Settings > Discussion. But IMO, that's not a good UX because we go to setting to configure the plugin, not clearing cache or taking action.

cc @jeffpaul @helen

Screenshot at Jun 17 17-36-34

@jeffpaul jeffpaul mentioned this issue Jun 30, 2020
18 tasks
@jeffpaul
Copy link
Member

jeffpaul commented Sep 8, 2020

@dinhtungdu as we're still working on crafting the approach here, I'm going to move this out of the current milestone so we can move more quickly towards releasing version 2.2.0.

@jeffpaul jeffpaul modified the milestones: 2.2.0, 2.3.0 Sep 8, 2020
@sparkbold
Copy link

I'm also running into the issue of missing profile image. Try to implement a way to catch this before user start complaining. Is there some way to do this? I try to call get_avatar($user_id, 70) for both user with/without uploaded image. And the output is always returning the image from gravatar.com url not actual local image url.

something like:

string(257) "<img alt='Avatar for ' title='Gravatar for ' src='http://2.gravatar.com/avatar/?s=70&#038;d=mm&#038;r=g' srcset='http://0.gravatar.com/avatar/?s=140&#038;d=mm&#038;r=g 2x' class='avatar avatar-70 photo avatar-default' height='70' width='70' loading='lazy'/>"

@thrijith thrijith self-assigned this Oct 28, 2021
@thrijith
Copy link
Member

Hi @dinhtungdu I am starting to look into it, I am not getting where the image sizes are coming from to add it as an image size so it is generated on regenerate, also what changes is the Clear cache meant to do?

@dinhtungdu
Copy link
Contributor

@thrijith I'm sorry for this late reply! The avatars are generated on the fly so there isn't any image size to register. The cropped avatar URL is stored as the user metadata. After regenerating thumbnails, all thumbnails are deleted including ones cropped by Simple Local Avatar. But the URLs in the user meta aren't deleted, that's why we have the broken avatars.

The idea behind the Clear cache button is to delete all cropped avatar URLs in the user meta and the respective avatar files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted needs:refresh This requires a refreshed PR to resolve. type:enhancement New feature or request.
Projects
Archived in project
5 participants