• Hi, after the update to 4.2.8 I’m getting the following error on
    https://phtn.net/corona/galerie/

    [Sun Nov 27 14:18:42.016529 2022] [php7:emerg] [pid 21985] [...] PHP Parse error: syntax error, unexpected ')' in /.../plugins/meow-gallery/classes/builders/core.php on line 87, referer: https://phtn.net/corona/

    which is this code

    if ( empty( $image_size ) || $image_size === 'srcset' ) {
                            $imgSrc = wp_get_attachment_image( $id, $this->size, false,
                                    $this->layout === 'carousel' ?
                                            [ 'class' => 'skip-lazy' ] :
                                            [ 'class' => 'wp-image-' . $id ],
                            );
                    }

    Removing the extra “,” after “$id ]” fixes the problem.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @n0ll,

    That is very weird 🙂 Yes, I know, but normally that’s totally okay in PHP, it’s even a good practice as it’s easier to add elements to an array and make diffing much easier. A little thread about it here: https://stackoverflow.com/questions/2829581/why-do-php-array-examples-leave-a-trailing-comma

    Which version of PHP are you using?

    I really had no idea this could generate an error so I will release a new version with your fix. Thanks for telling me 🙂

    Thread Starter Martin Junius

    (@n0ll)

    I’m on stone-age 7.2.24-0ubuntu0.18.04.15. Yes, this must be overhauled asap, but upgrading my virtual server to 22.04 is a time-consuming task. 😉

    But compared to 4.2.8, the new version 4.2.9 doen’t let me upgrade due to this old version. “This update does not work with your version of PHP.” 🙁

    Does it really not work on 7.2?

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @n0ll,

    You are not missing much in this new version, there is just a little fix but if you had no issues, it’s not useful.

    However, indeed, since I am testing and developing for 7.3, I prefer not to promise support for earlier versions of PHP. That said, I am pretty sure it works on 7.2 and you can safely force-upgrade.

    Thread Starter Martin Junius

    (@n0ll)

    Any way to do this in the UI or do I have to manually unpack the plugin?

    Plugin Author Jordy Meow

    (@tigroumeow)

    I think you can download it and upload it to WordPress directly (in the plugins section), that should work 🙂

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

The topic ‘Error in core.php / v4.2.8’ is closed to new replies.