Support » Plugin: Subscribe2 - Form, Email Subscribers & Newsletters » syntax error, unexpected T_FUNCTION after upgrade

  • Resolved patent


    I’ve updated my WP to version 5.0.3. Then I’ve done the same for some plugins including this one (Subscribe2) and got an error on my site:

    Parse error: syntax error, unexpected T_FUNCTION in /home/virtwww/.../http/wp-content/plugins/subscribe2/classes/class-s2-block-editor.php on line 30

    I renamed ‘subscribe2’ folder via FTP and my site resumed.

    How can I solve this problem to continue working with that plugin?
    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 18 total)
  • @patent

    Where are you seeing this error? Frontend or admin? Only certain pages or everywhere?

    Also what version of PHP is your site using?

    I have not seen this myself.

    Where are you seeing this error?

    On the front page of my site. It doesn’t load normally, just showing the above error message. It happens immediately after enabling that plugin.

    PHP Version 7.3.1


    I’m going to try testing this when I get time but for now I wonder if we should rule out a corrupt file.

    If you have already renamed the plugin folder you can try re-installing from the WordPress admin menus and see if that resolves things.

    I’ve removed it via admin control panel and installed a new one from the WP catalogue.
    My website still crashes once I press ‘Activate’ link for this plugin 🙁

    I’m pressed update plugin button today. And I have that the same problem too. (PHP ver. 5.2 )

    @patent @mrsandy

    This is very strange, I’ve tested on PHP 7.3.1, 5.6.39 and 7.2.14 and I cannot reproduce this error.

    I’m wondering about a plugin conflict – could you perhaps list what other active plugins you are using?

    @patent @mrsandy This happens when your PHP is older than 5.3. Anonymous function support wasn’t available until 5.3, so PHP won’t recognize function signatures passed as parameters like that.

    Upgrade your PHP version.

    Collins Agbonghama, as I posted above my site is using PHP 7.3.1. Is this an old version? What’s the actual one?

    @mattyrob, here you are:

    Akismet Anti-Spam
    Disable XML-RPC
    Maintenance Mode
    Print, PDF & Email by PrintFriendly
    Visitor Maps Geolocation Addon
    Visitor Maps и Who’s Online
    WP Social Bookmarking
    User Photo

    I’m also using ‘Twenty Ten’ theme v. 2.7 (the last one)

    Must have missed that. Let’s see what mattyrob can find.

    I was change php version to 7.3 and error was gone. Thanks.


    I haven’t tested this yet but having looked at the code of the Antivirus plugin I wonder if it’s changing something and conflicting.
    I presume it’s this one:

    Can you try disabling that plugin and then activate Subscribe2.

    Also, could you give a link to the site you are having this issue on?

    I have snooped the decision from the neighbor thread. It’s about switching to the classic editor (via plugin). Voila: that syntax error has disappeared!

    And now… How can I revert back the list of my subscribers?

    … and all other settings like email templates etc.


    Can you link to the neighbour thread so we can see if we can apply a fix for this issue.

    Provided you only renamed the plugin folder and didn’t uninstall from the WordPress admin area all of your subscriber data and settings should be preserved. If you uninstalled then you’ll need to restore data from a backup – either your own or one from your hosting provider.

    Specifically you need to restore the wp_subscribe2 table for public subscribers, the wp_usermeta table for registered user data (but be careful here as you could over-write newer data, and you’ll need the subscribe2_options entry from the wp_options table.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘syntax error, unexpected T_FUNCTION after upgrade’ is closed to new replies.