Support » Plugin: Download Monitor » Fatal error: Parse error: syntax error, unexpected ‘)’ in src/Gutenberg.php

  • Resolved KZeni

    (@kzeni)


    src/Gutenberg.php currently has (as of version 4.4.12 just now):

    
    		wp_register_script(
    			'dlm_gutenberg_blocks',
    			plugins_url( '/assets/blocks/dist/blocks.js', download_monitor()->get_plugin_file() ),
    			$asset_file['dependencies'],
    			$asset_file['version'],
    		);
    

    and it appears the last comma is unnecessary while also then causing a site-wide fatal server error for some sites (might be PHP 7.2 related or something similar.)

    The error that’s returned is the following:

    
    Parse error: syntax error, unexpected ')' in /wp-content/plugins/download-monitor/src/Gutenberg.php on line 30
    

    Simply removing that already unnecessary comma fixes this error for those setups.

    
    		wp_register_script(
    			'dlm_gutenberg_blocks',
    			plugins_url( '/assets/blocks/dist/blocks.js', download_monitor()->get_plugin_file() ),
    			$asset_file['dependencies'],
    			$asset_file['version']
    		);
    

    Might need to be a hotfix as sites that auto-update to this are going down because of it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter KZeni

    (@kzeni)

    I know this might be dismissed as supporting an older PHP version, but 7.2 wasn’t that long ago so some sites might still be on it and this really is a quick & easy fix to help avoid the issue.

    Hello @kzeni,

    Thank you for this, we will make another update in minutes.

    Thank you again,
    George.

    Hello @kzeni,

    Please update to 4.4.13 and everything should be ok.

    Thank you,
    George.

    Thread Starter KZeni

    (@kzeni)

    I can confirm that version 4.4.13 doesn’t experience this issue anymore.

    Thanks for the quick response & distributed fix!

    Dear @kzeni

    Is the version 4.4.13 released?

    Cause our website haven’t been updated to version 4.4.13.

    https://www.technica.com.tw/product/mf-h410g/

    Could you please help us? Thank you very much.

    Dear @kzeni @giucu91

    Thank you very much for your support.

    I removed the “,” comma, and now our website is working!! 🙂

    Sincerely appreciated.

    Hello @wilberlin88 ,

    The update is live, you can update to 4.4.13.

    Thank you,
    George.

    Hello @giucu91

    Our website haven’t been update to 4.4.13.

    Could you please tell me the reason?

    Thread Starter KZeni

    (@kzeni)

    @wilberlin88

    Could be any number of reasons, potentially, when it comes to a specific site. I can say that I have a rather large set of sites that use this plugin, and they all saw the new version was available within the hour (or whenever the given site checked WP.org’s plugin details to see there’s a new version.)

    It really doesn’t appear to be something specific to this plugin or anything within the plugin developer’s control here (it should just be using the normal WP.org plugin listing’s plugin version to compare & see it’s a higher version number that’s currently available, as with any WP.org-based plugin.)

    Nonetheless, you should be able to see the latest version on https://wordpress.org/plugins/download-monitor/ (that’s usually the very first place to notice & offer up the new version release). That’s where I saw it available when I posted about it 2 days ago (I didn’t have any access access or anything.)

    If you site still isn’t updating, you might want to try the manual “Check again” link on the Dashboard => Updates section of your site admin. If it still isn’t showing, you should be able to download the zip from WP.org and then use the plugin installer the site admin offers (using the Upload Plugin option at the top of the Add Plugin screen to give it the zip.) It should notice it’s already installed & offer to replace it with the version you’re uploading where you should be able to replace it (forcing that specific version of the plugin to be implemented.)

    Again, there could be many other reasons a site might not be seeing a new version is available (cron isn’t running properly, site’s unable to access the plugin directory endpoint, update notifications being disabled, etc. with some getting less & less likely/common), but those should help clear it up at least when it comes to getting this plugin updated now.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Fatal error: Parse error: syntax error, unexpected ‘)’ in src/Gutenberg.php’ is closed to new replies.