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.

About: Stephen Carroll

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To


Topics I've Started


My Latest Replies (From Various Topics)

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
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 Aug 7th, 2012 at 10:38 pm #21453

Hello Eduan,
This problem occurs on a new installation with no other plugins. Here are the steps to re-produce the problem:

1) Install WordPress 3.4.1
2) Install s2Member plugin
3) Set WP_DEBUG to true in wp-config.php

Please fix the problem by appending:

cache_needs_updating = false;

to line 45 of cache.inc.php

Also, another warning is thrown “Undefined index” in admin-notices.inc.php.

Please fix the problem by appending:

$_GET["page"] = isset( $_GET["page"] ) ? $_GET["page"] : '';

to line 135 of admin-notices.inc.php.

Again, these problems will not affect most users that do not have WP_DEBUG set to true, as they are just warnings. But this problem will affect users doing website development that have debugging turned on. A properly coded plugin should not throw these warnings as it makes website development difficult and can invoke ‘header already sent’ errors -real errors that inhibit development. Likewise, these warnings indicate are true: variable parameters should be checked and initialized accordingly.

Lastly, I’ve submitted the fix for you above. Please simply incorporate these changes so I don’t have to each time the plugin is updated.

Thank you!

Posted: Tuesday Aug 7th, 2012 at 9:33 pm #21451

No, cache.inc.php is in the s2Member plugin folder under “includes”, “classes”

Posted: Tuesday Jul 3rd, 2012 at 3:51 pm #18219

Regarding Custom Capabilities: These are *not* WordPress capabilities.

That’s odd. Because the documentation says “offered by WordPress Roles/Capabilities”. The video also says “…WordPress Roles/Capabilities”.

It also appears to work with “WordPress Capabilities”. But there is a bug:

While s2Member generates a “WordPress Capability”. The problem is that when a user’s WordPress Role is associated with a capability and then that capability is revoked, the capability is not removed. This is because s2Member actually stores the capability in the “user capability textbox” as can be seen in the user profile page. However, it does not properly update the user meta information when his or her role is updated.

My solution, as I stated above, is to manually clear the “capabilities” textbox prior to saving the user’s profile page. To automate this, I simply created a jQuery that clears the textbox whenever a role is changed on a given user.

Please consider reviewing the documentation and video above for “WordPress Capability”.

Again, great product. Thank you!

Posted: Tuesday Jul 3rd, 2012 at 4:52 am #18146

I see the problem now. If I set up two custom capabilities and assign a user a given role, then re-assign his role, the capabilities field (that s2Member generates) simply appends the capabilities but does not clear them. This means that I must clear the s2Member capabilities field anytime I change a user’s role, otherwise the user may still have capabilities from his prior role.

Please consider fixing this and perhaps the documentation to reflect a version number that’s consistent.

Great plugin. Thank you!

Posted: Thursday Mar 15th, 2012 at 7:59 pm #8302

Never mind! I get it now. The Metabox’s comma delimited capabilities is using AND logic for access. I just assumed it was OR. The later isn’t as efficient anyways as it just makes more sense to assign users a given capability rather then append it to the page. AND logic ensures proper access levels and favors on protecting content -which is nice. Thanks! Works well.

:-)

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

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.