thom4parisot / wp-less

WordPress plugin which seemlessly compiles, caches and rebuilds your LESS stylesheets.
https://wordpress.org/plugins/wp-less/
88 stars 40 forks source link

Wp-less parse error: syntax error, unexpected 'const' (T_CONST) #121

Open andrea-1234 opened 3 years ago

andrea-1234 commented 3 years ago

Wp-less ceased to work out of the blue. I did no changes to my website, but now it displays a parse error: "Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in .../public_html/wp-content/plugins/wp-less/vendor/wikimedia/less.php/lib/Less/Version.php on line 11". My website features Wordpress and the Hygge theme.

I updated Wp-less but the situation got worse (i.e., I cannot access to the wp-admin login page). I suppose that the Wp less plugin is not compatible with the latest WordPress version, or with the current PHP version. How can I solve the problem?

pixelbart commented 3 years ago

@andrea-1234

Thank you for reporting. This is unfortunately not a WP-LESS problem but a PHP-LESS problem (which is from Wikimedia, meanwhile).

Which PHP version are you using?

WP-LESS works everywhere on our sites with PHP 7.4. PHP 8.0 has not been tested by me, because WordPress and many plugins do not yet support this version 100%.

I just looked, the class constants are allowed since PHP 7.1.0. This means that this is the minimum version for PHP.

andrea-1234 commented 3 years ago

Hello Kevin, thank you for your help and kindness. It seems that there is a minimum and a MAXIMUM version of PHP to work with, i.e., PHP 8.0.010 (and higher) is the problem. Specifically:

I must say that I have no idea of what to do... rather downgrading the PHP version of my website. Any help is much appreciated!

Cheers, Andrea

pixelbart commented 3 years ago

@andrea-1234

Doesn't seem to me like this is a problem with WP-LESS. Here the plugin JS Composer has a problem with version PHP8.0. I would generally still advise against using version PHP8.0 because most plugins are not yet ready for it.

Visual Composer support should be able to help you better: https://visualcomposer.com/support/