• Resolved sumoldguy

    (@sumoldguy)


    Version 0.4.2 of this plugin doesn’t work at all with my WordPress 4.6.1.

    I just upgraded the plugin, everything seemed fine. But, anything I click on the dashboard menu or just trying to visit the site generates the following PHP error:

    syntax error, unexpected ‘[‘, expecting ‘)’ in /home/kahalcha/public_html/wp-content/plugins/multiple-featured-images/multiple-featured-images.php on line 57

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Marcus Kober

    (@marcuskober)

    Hi there,

    is it you, Cam? Are you the one who sent me mail today?

    Plugin Author Marcus Kober

    (@marcuskober)

    For all others:

    I think that’s an issue with your PHP version.
    Which PHP version are you using?

    The point is the bracket notation for the array in line 57. Bracket notation was etablished with PHP 5.4. Since WordPress itself requires at least version 5.6 I strongly reccomend to update PHP on your server!

    That’s my advice for the long run.

    Establishing backwards compatibility to PHP 5.4 is no option for the plugin!

    So to help you, we should hack the plugin together, so that it works for you.

    For a first try, please replace line 57 with the following:

    spl_autoload_register( array( ‘KdMfi’, ‘autoload’ ), true, true );

    Does that help?

    rklrkl

    (@rklrkl)

    It’s a common misconception that core WordPress requires at least PHP 5.6 – that is actually the recommended version if you read this page:

    https://www.ads-software.com/about/requirements/

    Developers just see “5.6” and don’t read further down:

    “WordPress also works with PHP 5.2.4+ and MySQL 5.0+”

    It should be noted that CentOS 6, which has 4 years of support left, ships with PHP 5.3.3 (bugs/security fixes are backported from later PHP releases, but new features aren’t). A standard WP 4.6.1 install on CentOS 6 works perfectly, but some third-party plugins are starting to ignore the 5.2.4 minimum PHP requirement and it looks like Multiple Featured Images is yet another one.

    As it stands, I’ve had to hold back updates for Multiple Featured Images so that it stays on version 0.3 (which is compatible with PHP 5.3.3 if not even older PHP releases). And, no, it’s non-trivial to upgrade PHP beyond 5.3.3 on CentOS 6 (I used the IUS repo to attempt this, but it broke a fair number of sites). It woould be nice if Multiple Featured Images could be updated to support pre-PHP 5.4 releases – after all, it did do so before version 0.4 came out!

    Thread Starter sumoldguy

    (@sumoldguy)

    I tried your suggestion, but got:

    Using $this when not in object context in /home/kahalcha/public_html/wp-content/plugins/multiple-featured-images/user_func/user_functions_deprecated.php on line 48.

    The server I’m on is running PHP 5.3.29.

    I’m talking to them to see if I can get 5.6.X.

    Any other ideas/suggestions.

    Many Thanks,

    Mitch

    Thread Starter sumoldguy

    (@sumoldguy)

    Can I just roll back to 0.3 by replacing the code or have changes been made to the database that have to be undone to run the older code?

    Thanks,

    Mitch

    Plugin Author Marcus Kober

    (@marcuskober)

    Hi there,

    compatibility to PHP 5.3 is now added in the new version 0.4.3.

    Please update and check if it works again!

    Thread Starter sumoldguy

    (@sumoldguy)

    Thanks! I’ll try to check it out this weekend.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP Syntax error in code’ is closed to new replies.