WordPress plugin: Parse error: syntax error, unexpected ‘else’ (T_ELSE), expecting function (T_FUNCTION)

I messed around in the code of a plugin for woocommerce (paypal for woocommerce). After that I couldnt open the website or reach the backend to deactivate the plugin. I managed to restore my page, I had a back up. I can open the website and use the backend, except plugins. When I click plugins or move to specific pages on my website I get this error:

Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/arabst8/public_html/abaya-store/wp-content/plugins/paypal-for-woocommerce/classes/wc-gateway-paypal-express-angelleye.php on line 997

This is line 977 of that file:

if( $this->skip_final_review == 'yes' && ( get_option('woocommerce_enable_guest_checkout') === "yes" && apply_filters('woocommerce_enable_guest_checkout', get_option('woocommerce_enable_guest_checkout')) == "yes" || is_user_logged_in() )) {

I am suprised that a full restore from a backup didnt fix it? I also deleted the plugin via FTP and STILL received the message, which was even stranger.

Read more here: WordPress plugin: Parse error: syntax error, unexpected ‘else’ (T_ELSE), expecting function (T_FUNCTION)

Leave a Reply

Your email address will not be published. Required fields are marked *