Title: PHP Notice
Last modified: August 31, 2016

---

# PHP Notice

 *  Resolved [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/)
 * Thanks for the plugin!
 * Running the Query Monitor plugin, I am getting the following message when I am
   on the admin pages:
 *     ```
       Notice
       Undefined offset: 1
       wp-content/plugins/s2member-secure-file-browser/class/psk_s2msfb.admin.class.php:84
       ```
   
 * In case it matters, I am running PHP 7.0.
 * [https://wordpress.org/plugins/s2member-secure-file-browser/](https://wordpress.org/plugins/s2member-secure-file-browser/)

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

 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7212960)
 * I think this is indeed connected to PHP 7. If I turn off Query Monitor, I get
   the following PHP7 warning:
 *     ```
       Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PSK_S2MSFB_wdgt_download has a deprecated constructor in ~/wp-content/plugins/s2member-secure-file-browser/class/psk_s2msfb.widgets.class.php on line 34
   
       Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PSK_S2MSFB_wdgt_files has a deprecated constructor in ~/wp-content/plugins/s2member-secure-file-browser/class/psk_s2msfb.widgets.class.php on line 670
       ```
   
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213163)
 * To fix the deprecated warnings, make the following changes in this file: `~/wp-
   content/plugins/s2member-secure-file-browser/class/psk_s2msfb.widgets.class.php`
 * On line 42, change
    `function PSK_S2MSFB_wdgt_download() {` to `function __construct(){`
 * On line 676, change
    `function PSK_S2MSFB_wdgt_files() {` to `function __construct(){`
 *  Plugin Author [Potsky](https://wordpress.org/support/users/potsky/)
 * (@potsky)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213174)
 * Hi !
 * Sorry I am a little bit swamped these days, I will release a new version as soon
   as possible with this fix.
 * And… thank you for reporting and for the fix !
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213175)
 * I understand. It’s good that you’re so busy!
 * Unfortunately, my fix only address the deprecated warnings and not the original
   notice about an “undefined offset”
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213179)
 * It turns out that there are several PHP notices being thrown. I think I have 
   now found and fixed all the others besides the deprecated notices fix I already
   posted. The remaining fixes are as follows:
 * In `s2member-secure-file-browser/class/psk_s2msfb.admin.class.php` on line 84,
   change
 * `@list( $parent , $child ) = @explode( '_' , $page );`
 * to
 * `list( $parent , $child ) = array_pad( explode( '_' , $page, 2 ), 2, null );`
 * On line 67, change
 * `@list( $psk , $admin , $screen , $parent , $child ) = @explode( '_' , $method);`
 * to
 * `list( $psk , $admin , $screen , $parent , $child ) = array_pad( explode( '_',
   $method, 5 ), 5, null);`
 * On line 68, change
 * `$parent = ( isset( self::$admin_menu[ 'left' ][ $parent ] ) ) ? self::$admin_menu['
   left' ][ $parent ] : @self::$admin_menu[ 'right' ][ $parent ];`
 * to
 * `$parent = ( isset( self::$admin_menu[ 'left' ][ $parent ] ) ) ? self::$admin_menu['
   left' ][ $parent ] : isset( self::$admin_menu[ 'right' ][ $parent ] );`
 * In `s2member-secure-file-browser/class/psk_s2msfb.admin.stats.class.php` on lines
   141, 283, and 406, change
 * `switch ( @$_GET[ 't' ] ) {`
 * to
 * `switch ( isset( $_GET[ 't' ] ) ) {`
 * On line 437, change
 * `$user = $row[ 'useremail' ] . ' - #' . $row[ 'userid' ];`
 * to
 * `$user = isset( $row[ 'useremail' ] ) . ' - #' . $row[ 'userid' ];`
 * In `s2member-secure-file-browser/class/psk_s2msfb.class.php` on line 1294, change
 * `if ( @$atts[ 'displaydownloaded' ] == '1' ) {`
 * to
 * `if ( isset( $atts[ 'displaydownloaded' ] ) == '1' ) {`
 * On line 1302, change
 * `if ( @$atts[ 's2alertbox' ] == '1' ) {`
 * to
 * `if ( isset( $atts[ 's2alertbox' ] ) == '1' ) {`
 * On line 1323, change
 * `if ( @$atts[ 'displaydownloaded' ] == '2' ) {`
 * to
 * `if ( isset( $atts[ 'displaydownloaded' ] ) == '2' ) {`
 * On line 1327, change
 * `} else if ( @$atts[ 'displaydownloaded' ] == '1' ) {`
 * to
 * `} else if ( isset( $atts[ 'displaydownloaded' ] ) == '1' ) {`
 *  Plugin Author [Potsky](https://wordpress.org/support/users/potsky/)
 * (@potsky)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213182)
 * I have changes these block of codes but in a different way.
 * I don’t figure out how `if ( isset( $atts[ 'displaydownloaded' ] ) == '2' )` 
   can be true given that `isset` returns a boolean.
 * There still are a lot of `@`. Is it the problem with PHP7 ?
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213183)
 * I haven’t addressed all the `@` — only where Query Monitor was flagging a problem.
   I think part of the issue (for me, at least) is PHP7, and part is that Query 
   Monitor was recently updated to detect more of these things. Since my testing
   site is already on PHP7, I don’t know if they would show up on PHP5.5 or whatever.
 * Surely `if ( isset( $atts[ 'displaydownloaded' ] ) == '2' )` can be true if it
   is true that 2 is returned?
 *  Plugin Author [Potsky](https://wordpress.org/support/users/potsky/)
 * (@potsky)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213184)
 * Ok version 0.4.19 is being transmitted. As soon as you will upgrade, tell me 
   if it is ok for you!
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213185)
 * Yes, it’s looking great now! Thanks very much!

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

 The topic ‘PHP Notice’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/s2member-secure-file-browser_a19d9c.
   svg)
 * [s2member Secure File Browser](https://wordpress.org/plugins/s2member-secure-file-browser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/s2member-secure-file-browser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/s2member-secure-file-browser/)
 * [Active Topics](https://wordpress.org/support/plugin/s2member-secure-file-browser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/s2member-secure-file-browser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/s2member-secure-file-browser/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [KTS915](https://wordpress.org/support/users/kts915/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/php-notice-73/#post-7213185)
 * Status: resolved