S2member Levels have reduced to 0-4 from 0-50

Is it worth double-checking your wp-config.php level settings one last time:

define(‘MEMBERSHIP_LEVELS’, 10);

if you had quotes around ‘10’ it would not get set because there is a numeric check in the code.

If your define is ok…any chance wp-config is accidentally being cached. Are you on shared or managed hosting and with whom?

If you can push it to a staging site you can check the MEMBERSHIP_LEVELS via debugger or logfile.or debug plugin.

wp-config query had double quotes " instead of ’ but had no effect on change.

no caching is functioning on the site.

Host is WP Engine. If my site isn’t a dedicated site (it is at least managed), then they have some impressive hardware for the performance gains I have had.

I had a look at the error logs, and found a bodge I created to deal with the membership restrictions causing issues, and fixed it. Refreshed the html file delivery just in case, with no changes.

Installed Debug Plugin. It only logs events. No Errors reported as yet. I’ll check again in 12 hours or so.

without s2member pro module - you are restricted to 4 levels. You need to install pro - then maybe enter your license key. You cannot enter it before installing pro.

The issue I am having, openmtbmap is that Pro is installed. This thread contains all the troubleshooting steps taken so far with no result, including 100% deleting s2member framework and pro plugins, then reinstalling them and activating both one at a time.

You’re at the interactive debugger stage unfortunately.

You could install the https://en-au.wordpress.org/plugins/debug-this/ plugin and check that the define(‘MEMBERSHIP_LEVELS’, 10); is actually registered. If it does not appear in the global define space then there is an issue with the wp-config parsing of this information.

I installed Debug This and ran it. Took me a bit to work out how to use it, yet I don’t know where to look in the debug tools for the define() code. I saw loads of examples of the framework and pro being installed and referenced, including many errors that are unrelated (and repeated) referring to undefined/missing variables.

I used many of the options given, including running down the php list. I think my newb eyes missed it.

If the

define(‘MEMBERSHIP_LEVELS’, 10);

statement is not being executed for some reason then you would get the result of only seeing 4 S2levels even if the pro plugin is installed.

You have the statement in your wp-config.php and it appears correct when you checked it…so what if it is not getting executed! To check if it is getting executed, you should see it as a defined global via the debugger.

The absence of a ‘MEMBERSHIP_LEVELS’ global is the issue.

How To Test If The Define(MEMBERSHIP_LEVELS Statement is getting executed:

If this is not yet a public site or it is public and you do not mind a 10 second outage, remove the semi-colon at the end of the define(‘MEMBERSHIP_LEVELS statement. then refresh your website home page. If this wp-config file is getting processed and this “define” statement is processed your website should get the white screen of death (missing semi-colon is a fatal error). Put the semi-colon back and refresh your browser and your website would be fine again. This test would determine if this wp-config file is being processed or is a “shadow” file.

Thanks onepresstech. It turns out that when I added that line to my wp-config.php file to force the setting to load, I placed a * where a _ should have been. The levels now show up in the restriction list.

Such a relief. Thank you.

1 Like

All roads were leading back to that define(‘MEMBERSHIP_LEVELS statement having a typo :slight_smile:

Glad you have it working…hurrah!