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.

PHP Warnings

Home Forums Community Forum PHP Warnings

Tagged: ,

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

Topic Author Topic
Posted: Monday May 13th, 2013 at 4:57 pm #49877
Ian Tasker
Username: clariner

I’m currently testing the free version before upgrading to pro and found a couple of issues.

I am running the latest version of s2member (v130510) and getting the following PHP warnings

s2member/includes/classes/cache.inc.php line 94 undefined variable $cache_needs_updating;

$cache_needs_updating is not defined in some of the if statements. I have added $cache_needs_updating = false; to the beginning of the function which resolves the issue.

I also get the following error in s2member/includes/classes/admin-notices.inc.php

Undefined index: page line 134

This line

if (!$page || “*” === $page || $pagenow === $page || $_GET[“page”] === $page)

needs to be replace with

if (!$page || “*” === $page || $pagenow === $page || ( isset( $_GET[“page”]) && $_GET[“page”] === $page))

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Monday May 13th, 2013 at 5:36 pm #49883
Ian Tasker
Username: clariner

I have also come across a number of other warnings which cause a database read error.

When i enable s2member and save a page i get the following errors.

Trying to get property of non-object in wp-includes\link-template.php on line 274

I have tracked this down to the get_page_link function, it looks like s2member is not passing the post object when getting a page link.

Posted: Monday May 13th, 2013 at 6:00 pm #49885
Ian Tasker
Username: clariner

Further to my second post, i tracked down the cause of the error to not having the follwing pages defined in the settings

Download Limited Exceeded Page
Login Welcome Page
Membership page

Posted: Monday May 13th, 2013 at 8:17 pm #49893
Ian Tasker
Username: clariner

I have come across another warning

Undefined variable: since in s2member\includes\classes\utils-time.inc.php on line 53

It looks like $since is never declared as an empty string

Posted: Monday May 13th, 2013 at 8:46 pm #49895
Ian Tasker
Username: clariner

Here is another warning i have found

Undefined index: level-1_label in s2member\includes\classes\constants.inc.php on line 286.

I believe this relates to the level given to a site guest/not logged in user of -1 and it not having a label defined under the Membership Levels / Labels section of the general s2member settings.

Is would be useful to be able to define a label for site visitors.

Its looks like all looks that refer to $GLOBALS[“WS_PLUGIN__”][“s2member”][“o”][“level”.$n.”_label”] or $GLOBALS[“WS_PLUGIN__”][“s2member”][“c”][“levels”] start at 0 and dont take -1 into account.

I am not sure where $GLOBALS[“WS_PLUGIN__”][“s2member”][“o”][“level”.$n.”_label”] isdeclared but it could be hard coded that level -1 is ‘site visitor’.

Posted: Monday May 13th, 2013 at 8:47 pm #49896
Ian Tasker
Username: clariner

I hope that i have supplied enough information for the warnings to be removed in the next version.

Posted: Tuesday May 14th, 2013 at 9:16 pm #49980

Those warnings and notices show up because you have WP_DEBUG enabled, but they don’t prevent s2Member from working. http://codex.wordpress.org/WP_DEBUG

Try disabling WP_DEBUG and you won’t have those. If you have a problem after that, then please try these: Knowledge Base » Common Troubleshooting Tips

Posted: Wednesday May 15th, 2013 at 5:44 am #50008
Ian Tasker
Username: clariner

Hi Cristian,

I am fully aware that these warnings can be hidden by turning off WP_DEBUG but that is a work around and not a fix.

I expect all plugins on our site to work correctly and without any PHP errors or warnings enevn if WP_DEBUG is turned on.
This makes the processing of debugging any plugin issues at lot easier as I won’t need to trawl through a list of non related warnings.

Posted: Friday May 17th, 2013 at 4:42 am #50106
Bruce
Username: Bruce
Staff Member

I am fully aware that these warnings can be hidden by turning off WP_DEBUG but that is a work around and not a fix.

Currently we’re not planning to fix these issues, when s2Member was first coded this was not an issue. We are planning on releasing a full rewrite/new version of s2Member which will be capable of running on WP_DEBUG mode, but currently s2Member does not support it. Sorry for the inconvenience.

Posted: Friday May 17th, 2013 at 9:46 am #50129
Ian Tasker
Username: clariner

Hi Bruce,

Thanks for the update, any ETA on when the rewrite will happen and be released?

Posted: Tuesday May 21st, 2013 at 4:28 am #50261
Bruce
Username: Bruce
Staff Member

Thanks for the update, any ETA on when the rewrite will happen and be released?

No, currently we don’t have a strict timeline for the next major version of s2Member. Sorry.

Viewing 10 replies - 1 through 10 (of 10 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.