Title: Uncaught Error: syntax error, unexpected &#8216;)&#8217;
Last modified: June 18, 2021

---

# Uncaught Error: syntax error, unexpected ‘)’

 *  Resolved [Gabriel](https://wordpress.org/support/users/mrgkanev/)
 * (@mrgkanev)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/)
 * Hi, after update to the newest version of the plugin I got this error:
 *     ```
       Fatal error: Uncaught Error: syntax error, unexpected ')'
       in ../plugins/ewww-image-optimizer/bulk.php on line 343
   
       Call stack:
   
       ewww_image_optimizer_admin_init()
       wp-includes/class-wp-hook.php:292
       WP_Hook::apply_filters()
       wp-includes/class-wp-hook.php:316
       WP_Hook::do_action()
       wp-includes/plugin.php:484
       do_action()
       wp-admin/admin.php:175
       require_once()
       wp-admin/plugins.php:10
       ```
   
 * It causes the Admin panel to stop working.

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

 *  [wpblogwriter](https://wordpress.org/support/users/wpblogwriter/)
 * (@wpblogwriter)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14569937)
 * I’ve got the same error updating via WP CLI…
 *  [pierreripka](https://wordpress.org/support/users/pierreripka/)
 * (@pierreripka)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570178)
 * Same issue on multiple sites.
 *  [Seagull87](https://wordpress.org/support/users/flagship890/)
 * (@flagship890)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570224)
 * Also seeing this… Potentially a stray comma on line 342 and 349 of bulk.php?
    -  This reply was modified 4 years, 11 months ago by [Seagull87](https://wordpress.org/support/users/flagship890/).
 *  [deswegen](https://wordpress.org/support/users/deswegen/)
 * (@deswegen)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570242)
 * Same here…
 *  [makkabi](https://wordpress.org/support/users/makkabi/)
 * (@makkabi)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570396)
 * There are two trailing commas on line 342 and 349, but this syntax is only allowed
   from PHP 7.3 on. So a quick fix is updating PHP (a good idea anyway!), or deleting
   the comma on the end of these two lines.
    -  This reply was modified 4 years, 11 months ago by [makkabi](https://wordpress.org/support/users/makkabi/).
 *  [pierreripka](https://wordpress.org/support/users/pierreripka/)
 * (@pierreripka)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570493)
 * I can confirm, the sites with a PHP version older than 7.3 are the only ones 
   affected.
 *  [wpblogwriter](https://wordpress.org/support/users/wpblogwriter/)
 * (@wpblogwriter)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570574)
 * [@makkabi](https://wordpress.org/support/users/makkabi/): my sites affected are
   running with PHP 7.4. So it is probably not a syntax issue due to too old PHP
   version..
 *  [makkabi](https://wordpress.org/support/users/makkabi/)
 * (@makkabi)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570660)
 * [@wpblogwriter](https://wordpress.org/support/users/wpblogwriter/) Maybe you 
   have another issue or some weird PHP settings, maybe double check if PHP 7.3+
   is running, because this error is definitely as described.
 *  [Dimitris Pantazis](https://wordpress.org/support/users/dpantazis/)
 * (@dpantazis)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14570749)
 * A `Requires PHP` in the plugin’s header would have prevented this. Could the 
   developers add it please ?
 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14571083)
 * Checking on this, we don’t intend to require PHP 7.3+ yet, but I use 7.4 for 
   development, so the stray commas don’t always pop up in my testing.
    Will have
   a bugfix out ASAP.
 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14571463)
 * As others have noted, the issue could be fixed by upgrading to PHP 7.3+. That’s
   a good idea in any case, because all other versions of PHP are EOL (end of life).
 * However, I do not intend to drop support for PHP 7.1 and 7.2 at this time, so
   a fix has been released as version 6.1.7.
 * In addition, I found that the error bypassed our automated tests because bulk.
   php is only included by the admin_init hook, which is not triggered by PHPUnit.
   I added a unit test to specifically call our admin_init function, so that such
   errors will be automatically detected pre-release in the future 🙂
 * P.S. Note that EOL does not mean 7.1 & 7.2 are completely unsupported, as they
   may receive security updates from vendors. But it does mean the PHP team will
   not issue any security updates for those versions, and that your site is running
   slower than it could be: [https://kinsta.com/blog/php-benchmarks/](https://kinsta.com/blog/php-benchmarks/)

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

The topic ‘Uncaught Error: syntax error, unexpected ‘)’’ is closed to new replies.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

 * 11 replies
 * 8 participants
 * Last reply from: [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/uncaught-error-syntax-error-unexpected/#post-14571463)
 * Status: resolved