Title: Activation Parse error: syntax error, unexpected T_FUNCTION
Last modified: January 11, 2017

---

# Activation Parse error: syntax error, unexpected T_FUNCTION

 *  Resolved [tangobango](https://wordpress.org/support/users/tangobango/)
 * (@tangobango)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/)
 * I can’t activate the plug in. I get this error:
 * Parse error: syntax error, unexpected T_FUNCTION in /home3/tangoban/public_html/
   ourbigitalianadventure.com/wp-content/plugins/above-the-fold-optimization/includes/
   webfonts.class.php on line 368
 * Thanks.

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

 *  Plugin Author [optimalisatie](https://wordpress.org/support/users/optimalisatie/)
 * (@optimalisatie)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8647254)
 * Hi Tangobango,
 * The plugin source on WordPress should be valid (and is already in use by many
   websites). The error should not be possible.
 * The following code should be on line 368 in file /includes/webfonts.class.php:
 * `if (!empty($this->googlefonts) && isset($this->CTRL->options['gwfo_googlefonts_remove'])&&!
   empty($this->CTRL->options['gwfo_googlefonts_remove'])) {`
 * Could you please check the source of that file and post the line that is visible
   on that location?
 * Some possible explanations:
 * – a virus has malformed the source code
    – the WordPress source is invalid – 
   the download of the plugin was partially completed
 * — snip —
 *  Thread Starter [tangobango](https://wordpress.org/support/users/tangobango/)
 * (@tangobango)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8647925)
 * Hi.
 * I checked the line and it matched.
 * Then I deleted the plugin and downloaded again. I still get the same error.
 * Very puzzling.
 *  Thread Starter [tangobango](https://wordpress.org/support/users/tangobango/)
 * (@tangobango)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8647945)
 * Hi. I just tried it in a fresh install of WP 3.7 Same error.
 *  Plugin Author [optimalisatie](https://wordpress.org/support/users/optimalisatie/)
 * (@optimalisatie)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8653862)
 * Hi Tangobango,
 * The error you received should be impossible and is not related to the plugin.
 * If you want further assistance, please post your support request on Github where
   other developers will be able to review your problem.
 * [https://github.com/optimalisatie/above-the-fold-optimization/issues](https://github.com/optimalisatie/above-the-fold-optimization/issues)
 * This topic will be closed.
 * — snip —
 *  [philippknoll](https://wordpress.org/support/users/philippknoll/)
 * (@philippknoll)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8803191)
 * Hi Tangobango,
 * Did you ever find a solution to the T_FUNCTION issue? I’m having the same problem.
   Any hints would be really appreciated.
 * Thanks,
    Philipp
 *  Thread Starter [tangobango](https://wordpress.org/support/users/tangobango/)
 * (@tangobango)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8803931)
 * No. I just didn’t use the plugin.
 * The “the error should be impossible” comment turned me off on it. “Should be”
   wasn’t the issue.
 * Maybe it was another plugin, but it wasn’t worth my time to figure it out.
 * Sorry I can’t help.
 *  [philippknoll](https://wordpress.org/support/users/philippknoll/)
 * (@philippknoll)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8805046)
 * Thanks Tangobango,
 * I’ll keep working on it a bit and see what I can find. I appreciate you taking
   the time to reply.
 * Cheers.
 *  Plugin Author [optimalisatie](https://wordpress.org/support/users/optimalisatie/)
 * (@optimalisatie)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8821670)
 * Hi philippknoll and tangobango,
 * Our apologies. We discovered that the error is related to the PHP version. PHP
   <5.3 doesn’t support the `use` keyword for anonymous functions.
 * `$this->googlefonts = array_filter($this->googlefonts, function($font) use ($
   removeList) {`
 * The next plugin update may require PHP v5.3+ by default.
 * The plugin was quickly setup as a tool for professional optimization services(
   on servers where it simply works well), it was never intended as a public plugin
   for any environment.
 * For now (if you want to use the plugin) my advise is to upgrade PHP to a recent
   version.
    -  This reply was modified 9 years, 3 months ago by [optimalisatie](https://wordpress.org/support/users/optimalisatie/).
 *  Thread Starter [tangobango](https://wordpress.org/support/users/tangobango/)
 * (@tangobango)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8822263)
 * Hi, PageSpeed,
 * Thanks for the gracious response. I have upgraded php and I’ll try again.
 * Too bad about the WP spam issue, but great that you support on github.
 * Tangobango

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

The topic ‘Activation Parse error: syntax error, unexpected T_FUNCTION’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/above-the-fold-optimization_fcfbf6.
   svg)
 * [Page Speed Optimization](https://wordpress.org/plugins/above-the-fold-optimization/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/above-the-fold-optimization/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/above-the-fold-optimization/)
 * [Active Topics](https://wordpress.org/support/plugin/above-the-fold-optimization/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/above-the-fold-optimization/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/above-the-fold-optimization/reviews/)

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)

 * 9 replies
 * 3 participants
 * Last reply from: [tangobango](https://wordpress.org/support/users/tangobango/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/activation-parse-error-syntax-error-unexpected-t_function/#post-8822263)
 * Status: resolved