My 2 cents:
I have the same problem.
In my case, my avatar is reset to the “empty” gravatar every time I delete an attachment (any image, not the avatar ofcourse) through the Media control panel.
I’ve noticed that when you add an avatar, 7 files are created on the server – the original image, and 6 square scaled images:
150, 150-2x, 96, 64, 32, 26
the 150 & 150-2x are standard (150px size & 150px with x2 pixel density if i’m not mistaking). the other 4 are not.
On deletion of an image, other than the avatar itself, the avatar’s 4 NON-standard sizes are deleted too, leaving only the 3 standard ones.
This probably means that the plugin’s code is not registering those 4 non-standard images as part of the attachment’s scaled images, so when you delete an arbitrary image from your library, the wp_delete_attachment() function probably considers those 4 images to be some sort of temporary files, and deletes them too.
I have years of experience with PHP language, but I’m not well versed in the plugin’s PHP code, nor WP code. So for now I cannot offer a solution or a bugfix.
Hope this helps.
I can confirm that if you delete any image from the media library, it deletes the custom sizes from the current users avatar only. 96, 64, 32, 26.
Such a shame as this is the best plugin except for this.
OK, it’s not just the images that get deleted, table entries for this plugin get deleted from the mysql database as well.
So here’s my workaround for now.
Edit the avatar-manager.php file.
Comment out this line of code by adding // in front of it.
add_action( 'delete_attachment', 'avatar_manager_delete_attachment' );
so it looks like this
// add_action( 'delete_attachment', 'avatar_manager_delete_attachment' );
This will stop the custom image from deleting for no reason until a fix is made.
Sorry for hacking this code.
Hello,
Thank you for reporting. This issue will be fixed in the next release.
Best regards,
Cătălin