connorjf
Forum Replies Created
-
I am not affiliated with this plugin and I don’t know what the developers advise is for adding this.. do so at your own risk, it just works for my setup and is temporary until they release a fix..
I opened up file public/class-memberpress-discord-public.php and added this code snippet under line 592
global $wpdb;
// Searches for all user meta keys containing '_ets_memberpress_discord'
$meta_keys = $wpdb->get_col(
$wpdb->prepare(
"SELECT meta_key FROM {$wpdb->usermeta} WHERE meta_key LIKE %s",
'%_ets_memberpress_discord%'
)
);
// Loops through the meta keys and delete them for the specific user
foreach ($meta_keys as $meta_key) {
delete_user_meta($user_id, $meta_key);
}The users meta should already be cleared in order for it to work. I use the JSM Show User Metadata plugin which shows the user meta in the edit user screen. It allows you to clear the meta data yourself.
Hopefully this helps!
When user disconnects, the plugin is meant to delete the custom user meta that it creates upon connection, however I’ve noticed this hasn’t been happening after some testing.
I’ve had to create a custom function to hook into the ets_memberpress_discord_remove_usermeta action to ensure the data is removed correctly. It has fixed my issue and users are able to reconnect again.
After some troubleshooting, it appears that the bug happens when a user disconnects their discord and then tries to reconnect. When re-connecting it redirects back to the correct page but no Discord account is connected.
@tiztou thanks for you proposed solution, I did try but was unable to get it working unfortunately. It’s ridiculous how many headaches this plugin has caused me :’D I may have to switch to a Zapier integration or something like that
I was literally testing my site yesterday, was all working great! Today out of the blue, no longer working.. It lets you click the connect button, takes you to authorise the connect and then returns to the site but with no account connected.
Scratching my head as to how a plugin can randomly stop working