Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Notices on PHP7 #917

Closed
KTS915 opened this issue Mar 31, 2016 · 7 comments
Closed

PHP Notices on PHP7 #917

KTS915 opened this issue Mar 31, 2016 · 7 comments
Assignees
Labels

Comments

@KTS915
Copy link

@KTS915 KTS915 commented Mar 31, 2016

When on the admin pages of some other plugins on my localhost site running PHP7, Query Monitor reports the following PHP Notices:

Undefined index: login_welcome_page 
wp-content/plugins/s2member/includes/classes/cache.inc.php:51

Undefined index: membership_options_page
wp-content/plugins/s2member/includes/classes/cache.inc.php:52   

Undefined index: file_download_limit_exceeded_page  
wp-content/plugins/s2member/includes/classes/cache.inc.php:53
@KTS915 KTS915 changed the title PHP NOtices on PHP7 PHP Notices on PHP7 Mar 31, 2016
@KTS915
Copy link
Author

@KTS915 KTS915 commented Apr 2, 2016

Found another one when on the s2Member -> Import/Exports admin page. This says:

Undefined index: ws_plugin__s2member_pro_import_users_direct_input
wp-content/plugins/s2member-pro/includes/menu-pages/import-export.inc.php:190
@KTS915
Copy link
Author

@KTS915 KTS915 commented Apr 7, 2016

Changing lines 51, 52, and 53 of s2member/includes/classes/cache.inc.php to the following seems to fix the first set of issues:

                        $lwp_cache = isset($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]);
                        $mop_cache = isset($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]);
                        $fdlep_cache = isset($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]);
@KTS915
Copy link
Author

@KTS915 KTS915 commented Apr 7, 2016

Changing line 190 of s2member-pro/includes/menu-pages/import-export.inc.php to the following seems to fix the other issue:

echo '<textarea name="ws_plugin__s2member_pro_import_users_direct_input" id="ws-plugin--s2member-pro-import-users-direct-input" rows="10" wrap="off" spellcheck="false" style="width:99%;">'.format_to_edit(trim(stripslashes(isset($_POST["ws_plugin__s2member_pro_import_users_direct_input"])))).'</textarea><br />'."\n";
@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Apr 8, 2016

@KTS915 Thanks for the follow-ups here :-)

Those isset() calls as you have them now should eliminate the notices whenever WordPress is running in WP_DEBUG mode, but you might want to consider that it's converting what would ordinarily be a string value that is being read, into nothing more than a boolean test case; i.e., isset() returns either a true or false value now. To get rid of those notices and preserve the intended functionality, you'd want something like.

$fdlep_cache = isset($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]) ? $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"] : '';
@KTS915
Copy link
Author

@KTS915 KTS915 commented Apr 9, 2016

@jaswsinc,

Thanks for the explanation!

jaswrks pushed a commit that referenced this issue Apr 15, 2016
@jaswrks jaswrks self-assigned this Apr 15, 2016
@jaswrks jaswrks added this to the Next Release milestone Apr 15, 2016
@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Apr 15, 2016

Next Release Changelog:

  • (s2Member/s2Member Pro) Bug Fix: E_NOTICE level errors in cache handler when running in WP_DEBUG mode. Props at @KTS915 for reporting. Fixed in this release. See also: this GitHub issue.
@jaswrks jaswrks closed this Apr 15, 2016
@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Apr 23, 2016

s2Member & s2Member Pro v160423 have been released and they include changes from this GitHub Issue. See the v160423 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one. Thanks! :-)

@wpsharks wpsharks locked and limited conversation to collaborators Apr 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants