How to fully reset s2member?

I tried deactivating s2member with safeguards off - but it does not fully reset s2member as it seems to me.

I am very positive the bugs I have with Stripe subscriptions not demoting and success code not working are related to some garbage in the s2member tables.

NOTE - I do not want to reset any user meta data.
NOTE2 - the problematic data is not exported. If I export s2member settings - and put them to my testsite (testsite runs same theme, same mu-plugins, and imported s2member settings) - the problems seem to not occur. Nginx is also not at fault - because I setup the testsite at a subdomain - so same rules apply.
If I switch to the broken database (just change to via wp-options.php file and change the url beforehand) - the problems start.

So somewhere in the database there is garbage that s2member is choking on. What can I do to solve this?

Do I have to go kinda brute-force, and export wp-usermeta, wp-user wp posts and wp pages tables and import them into a clean database?
I’m 99.99% positive no other plugin settings are related (I did not duplicate all other plugin settings - as that would be a bit too much work. But disabling the plugins on the broken site, disabling the them, disabling mu-plugins - all does not help.

I’ve read this article: https://s2member.com/kb-article/where-is-the-s2member-data-stored-in-the-wordpress-database/

I’m not sure if it would be enough to delete ws_plugin__s2member_options from wp_options. I guess not because I guess on deactivation that’s exactly the table that s2member is deleting - but nothing else.

As some of the problems I have were also reported by other users - my most likely guess is some plugin that integrated into s2member - changed something on my s2member options table that is causing this mess. S2member will not export this mess - but importing the export also does not clean the wp_options table - it just overwrites (easy to see, if you have some fields with text inside, then import an s2member options export file where those fields are empty - the fields are not empty but the old text stays inside - at least for some fields).

Fully resetting s2member means dropping wp_usermeta and wp_users table. My problems are that s2member chokes on the wp_usermeta table somewhere. This is not related to any other plugin nor to any setting in wp_options or any other table. So basically if I don’t find out where s2member crashes on the wp_usermeta table (which has 160MB of data on my website) - my website is kinda defunct. I cannot import/export users because I need to keep the users passwords - and s2member does not export them/import them.

So if every something breaks in your wp_usermeta table that stops s2member from working correctly, you are pretty much lost.

Hi Felix.

So you’re saying that disabling the Deactivation Safeguards and then deactivating and removing s2Member, is not removing the s2 data from the database? When you reinstall s2Member, your old settings are still there?

Do you just deactivate it and then reactivate s2, or after deactivation you then remove the plugin? You need to remove it after deactivation, if I remember correctly.

Well I think I was wrong, I saw settings which are loaded automatically from wp user roles and wp_usermeta table.

All settings related to s2member are in wp_options. But it loads wp_user_roles from wp_optionsand wp usermetatable. Definitely query for s2member in wp_options and deleting there is better than deactivating and deleting.
My problem is that s2member has problems with the usermetatable. However I don’t know if this is related to an entry that makes S2 choke, or if it’s simply too big. It could be that upgrading my server or changing some php settings made it work on my smaller website again, but those settings are not enough for the 160MB table of my main website.

I Will try by deleting users down to 10.000 from both sides or middle only of it works then. It cannot be about the time it takes as my database is still blazing fast (stored on dedicated server with i7-8700 and modern nvme disk plus 64gv ram and nothing else running on it but the two websites if I’m not developing something/rendering)

1 Like