• Resolved Little Package

    (@littlepackage)


    Hi,

    Thought I’d share this error (below) with you. Couldn’t recognize the “array function” syntax or confirm that it is correct, so I rolled it back to usual function syntax to stop the critical errors occurring (not sure when they occur but my client confirmed site was down occasionally yesterday).

    [10-Aug-2021 19:29:03 UTC] PHP Parse error: syntax error, unexpected ‘:’, expecting ‘;’ or ‘{‘ in /home/etc-etc-etc/public_html/wp-content/plugins/webp-converter-for-media/src/PluginData.php on line 42

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @littlepackage,

    Thanks for your message.

    What version of PHP are you using?

    Best,
    Mateusz

    Thread Starter Little Package

    (@littlepackage)

    7.3.29, which hasn’t reached end-of-life yet.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @littlepackage The error is related to this line:
    public function get_plugin_settings(): array {

    In order for a syntax error to occur on this line the PHP version 5.6 or earlier would have to be used. Since version 7.0, this notation is correct.

    Thread Starter Little Package

    (@littlepackage)

    7.3.29, and getting the error. Not seeing any other major plugins or themes using this syntax anywhere, or any documentation of it. Can you provide some reference for me please?

    FWIW I know what lines caused the issue and changed them for now.

    • This reply was modified 3 years, 6 months ago by Little Package. Reason: typo: "any other" not "anyone other"
    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @littlepackage Please give me the content of the line before and after your change.

    Thread Starter Little Package

    (@littlepackage)

    7.3.29, and getting the error with the code as you wrote it. I’ve upgraded to 7.4 (highest allowed on this client’s server) and will let you know if your plugin continues to crash this site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Critical errors having to do with PHP syntax’ is closed to new replies.