Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter KTS915

    (@kts915)

    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

    (@kts915)

    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

    (@potsky)

    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

    (@kts915)

    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

    (@kts915)

    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

    (@potsky)

    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

    (@kts915)

    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

    (@potsky)

    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

    (@kts915)

    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.