latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

How to enable WP_DEBUG ?

Home Forums Community Forum How to enable WP_DEBUG ?

Tagged: ,

This topic contains 7 replies, has 3 voices. Last updated by  Eduan 4 years, 3 months ago.

Topic Author Topic
Posted: Saturday May 5th, 2012 at 7:36 pm #12736

Hey guys, nice job with s2Member. It works great!

I have a problem: I’m developing a website and need to turn on WP_DEBUG, but when I do I get dozens of errors from s2Member (please see http://postmy.info/misc/s2Member-errors.png).

I’ve tried the define(“LOCALHOST”, true); trick, and while that clears up a few, s2Member throws many, many more. I know this is claimed to be fixed and I am running Apache > 2.2. But yet this still throws errors on my localhost and on live servers. To replicate the problem is easy:

1) Installl WordPress
2) Download and install s2Member (latest version 120309)
3) set WP_DEBUG to true

A google search for “wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97” takes me to this forum where it claims to have been fixed but that clearly isn’t the case :-(

Is website development debugging just not supported?

Regards,
Steve

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Tuesday Sep 11th, 2012 at 7:54 am #24876
2046
Username: 2046

hello
I have the “same problem”
WordPress 3.4.2.
WP_DEBUG : true

Notice: Undefined variable: cache_needs_updating in ....../wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97

and also

Notice: Undefined index: page in ......wp-content/plugins/s2member/includes/classes/admin-notices.inc.php on line 136

I’m developing on real server, with Apache 2+
I turned all other plugins off, but still. I do not know if it causes any real problems, because I haven’t chance to test the site fully (it is not ready yet).

  • This reply was modified 4 years, 3 months ago by  2046.
Posted: Tuesday Sep 11th, 2012 at 9:24 am #24890
Eduan
Username: Eduan
Moderator

Hello Stephen, 2046,

What happens if you update Apache to version 3+?

EDIT: Oops, didn’t notice the original date of this. :P

Posted: Tuesday Sep 11th, 2012 at 9:32 am #24896
2046
Username: 2046

hello, Don’t know what happens on Apache 3+
And I’m not gonna try it. There are many websites running on the server and I do not want to brake any of them.

Posted: Tuesday Sep 11th, 2012 at 7:36 pm #24940

Unfortunately it looks like s2Member developers created the plugin with a complete disregard for WP_DEBUG. It doesn’t appear that they have ever turned it on themselves or have chosen to ignore the output assuming the average user of their product wouldn’t be doing such development (highly unlikely, if you are using s2Member then you are probably a developer).

The number of warnings that I’m seeing are because of ambiguous references to (possibly) global variables or items that are just un-initialized. I’ve written the authors about this:

“Undefined variable: cache_needs_updating in cache.inc.php on line 97. Please initialize the variable with a default value at the top of the function block (probably cache_needs_updating = false) or define it as global (which it probably is not).

We’ve got lots of debugging of our own stuff to do and these unnecessary notices are interfering with header transmissions, etc. Please fix in next release please.”

Unfortunately for every one I fix, more and more keep popping up. This makes using WP_DEBUG virtually impossible without first deactivating s2Member, which isn’t a great option if you are trying to create a website.

  • This reply was modified 4 years, 3 months ago by  Stephen Carroll. Reason: 'nicer' explanation
Posted: Tuesday Sep 11th, 2012 at 8:16 pm #24949
Eduan
Username: Eduan
Moderator

Hello Stephen,

Yes I understand, I already told Jason and he answered me that the next generation of s2Member is gonna fix all of this, in general it’s gonna be much better coded. :)

Posted: Wednesday Sep 12th, 2012 at 3:58 am #24972
2046
Username: 2046

in other words.. it is not any crucial problem. it just messes up debugging, right?
If that is the case, then I can live with that for now :)

Posted: Wednesday Sep 12th, 2012 at 9:40 am #25016
Eduan
Username: Eduan
Moderator

That is correct 2046. :)

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.