• supertrooper2

    (@supertrooper2)


    After upgrading my website to PHP 8.3 I am getting hundreds of errors on the debug log:

    PHP Deprecated: Use of “parent” in callables is deprecated in /var/www/xxx.com/wp-content/plugins/simple-lightbox/includes/class.options.php on line 501

    Can this issue be resolved?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Unfortunately, it seems like the plugin was abandoned. I fixed the PHP 8.3 errors myself. Here are the relevant fixes (diff export):

    diff --git a/includes/class.options.php b/includes/class.options.php
    index f481ab3..0a0311b 100644
    --- a/includes/class.options.php
    +++ b/includes/class.options.php
    @@ -498,7 +498,7 @@ class SLB_Options extends SLB_Field_Collection {
    function &add( $id, $properties = array(), $update = false ) {
    // Create item
    $args = func_get_args();
    - $ret = call_user_func_array( array( 'parent', 'add' ), $args );
    + $ret = call_user_func_array( array( 'SLB_Field_Collection', 'add' ), $args );
    return $ret;
    }

    diff --git a/includes/class.utilities.php b/includes/class.utilities.php
    index fe5d6ef..ae3db7c 100644
    --- a/includes/class.utilities.php
    +++ b/includes/class.utilities.php
    @@ -542,9 +542,11 @@ class SLB_Utilities {

    // Build condition
    $sep = '.';
    - $obj = trim( $obj, $sep );
    + if ($obj !== null) {
    + $obj = trim($obj, $sep);
    + }
    // Strip base object
    - if ( 0 === strpos( $obj, $base . $sep ) ) {
    + if ( $obj !== null && 0 === strpos( $obj, $base . $sep ) ) {
    $obj = substr( $obj, strlen( $base . $sep ) );
    }
    $fmt = '!!window.%1$s';
Viewing 1 replies (of 1 total)

The topic ‘Problems with PHP 8.3’ is closed to new replies.