Thanks for the report!
BPGES ought to take care of this deletion, and in my tests it appears to be working. Briefly, BPGES hooks into the remove-from-group process; and when a user account is deleted, BuddyPress removes the user from all of its groups.
Looking over the chain of logic, I’m wondering whether there’s a Multisite vs non-Multisite issue happening here. I’m testing on Multisite, but there’s an additional check that happens on non-Multisite environments. See https://buddypress.trac.wordpress.org/browser/tags/7.0.0/src/bp-groups/bp-groups-functions.php?marks=2419,2436#L2400.
One thing to check is this: When you delete a user, are the user’s group memberships (wp_bp_groups_members) being removed from the database? If so, then your problem is with how BuddyPress is clearing user data, not with BPGES specifically. And if it turns out that BP data *is* being cleared, we can dig a bit deeper.
Hi Boone,
Thanks for your reply, I’ve taken some time to look into the functionality a bit deeper based on your feedback, but I am still a bit stumped.
When deleting a user it appears that the entry is removed from the wp_bp_groups_members table. However, something still appears to cause digest emails to be sent to empty email addresses. This particular site is not a multisite.
Here is a screenshot of our email log from the Staging site (and eventually the alert sent to admins). Reviewing the session transcript does not give much useful information: A successful authentication occurs and then nothing happens.
If helpful, I can provide access to the Staging site as well.
Thanks
Plugin Author
r-a-y
(@r-a-y)
I can confirm this behavior.
I have a potential fix here:
https://github.com/boonebgorges/buddypress-group-email-subscription/pull/213/files#diff-58f2a5cd8a1bb2e7f373afafccbca118c261c57d43ddd2870bf56a353d3883e1
Dan, if you want to test, you can add the changes from the bp-activity-subscription-digest.php
file at the link above.
Thanks @r-a-y !
I can confirm that your patch solves this issue for us.
Regards,
Dan