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.

Please fix debug notices

Home Forums Community Forum Please fix debug notices

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

Topic Author Topic
Posted: Tuesday Sep 11th, 2012 at 9:15 am #24889

Developing with debug on and getting several php notices. Could you please fix the following.

= S2member fixes =

* Notice: Undefined variable: req in /wp-content/plugins/s2member-pro/includes/classes/lock-icons-in.inc.php on line 155

public static function _return_lock_icons_description ($array = FALSE)
	{
		$dir_url = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
		/**/
		if (isset ($array["s2member_level_req"]))
			$req = 'Requires Membership Level #' . $array["s2member_level_req"];
		/**/
		else if (isset ($array["s2member_ccap_req"]))
			$req = 'Requires Custom Capabilities';
		/**/
		else if (isset ($array["s2member_sp_req"]))
			$req = 'Requires Specific Post/Page Access';
		/**/
		// more code here
	}

Add

$req = '';

below

$dir_url;

* Notice: Undefined index: level-1_label in /wp-content/plugins/s2member/includes/classes/constants.inc.php on line 287

if (!isset($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]))
	$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"] = '';

* Notice: Undefined variable: since in /wp-content/plugins/s2member/includes/classes/utils-time.inc.php on line 53

if ( !isset($since) )
	$since = '';

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Sep 11th, 2012 at 2:10 pm #24919
Bruce
Username: Bruce
Staff Member

Hi Justin,

We’ve seen similar debug errors within s2Member before. It’s because of how s2Member was originally coded, which is something we’re working on currently. The errors do not affect the way s2Member works, and is still usable code, as NULL still evaluates to FALSE.

I’m putting this in our TODO list.

Thanks!

Posted: Tuesday Sep 11th, 2012 at 3:07 pm #24926

Thanks for the response Bruce. I realize they do not affect the way s2member works. It’s just annoying having them come up when developing with debug mode on. I don’t want to deactivate s2 during development to make them go away because I want to catch any plugin conflicts during development, not after the fact.

Posted: Thursday Sep 13th, 2012 at 12:21 am #25101
Raam Dev
Username: Raam
Staff Member

Justin,

You may be interested in using the BlackBox Debug Bar WordPress plugin. It keeps those messages separate from the page content itself, making things cleaner and easier to debug.

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