Error "Cannot redeclare class lessc_parser" after install


Hi support,

I hope you can help me the following error:

Fatal error: Cannot redeclare class lessc_parser in /home/myuseracc/tst/wp-content/themes/tm-beans/lib/api/compiler/vendors/lessc.php on line 2192

Today i made a copy of my production site because i like to test the Beans (and child) theme with real data. It all went well. But after installing the the theme (beans-1.4.0) i got this error.

Before this i installed the Beans theme on an complete other website (on the same host) and anything was working great.

Do you have any ideas?

Grtz, Martijn


Hi support,

I think i have found the solution. It looks like that one of my plugins (All in one event calendar) have a conflict with the theme. Lucky for me i'am switching to another calendar plugin πŸ˜‰

Grtz, Martijn


Hi all,

I'm having this problem too, with the lessc_parser class, on a client's site, except in this case I can't just replace the plug-in. For the moment I put the site back on the old version of Beans, but of course we want to be able to update the parent theme. I'm not using LESS in the child theme, just CSS, so I wonder if there is some way to ask the child theme to skip some chunk of the compiler and do something else instead? Or is this the wrong way of thinking about this? I'm a designer, not a developer (which is why Beans has been so great for me) so I am probably missing something basic!

Thank you!


Hello Abigail, Hello Martijn,

Thank you for reporting this issue. Looks like we will have this fixed in the next release.


Hi Christoph,

Can you confirm that beans 1.5.1still does not solved this issue?

Today i try to launch our new website (build using Beans, yeah!) but i got stuks with the following error:

PHP Fatal error: Cannot declare class lessc_formatter_compressed, because the name is already in use in /my/path/wp-content/themes/tm-beans/lib/api/compiler/vendors/lessc.php on line 3684

The intention was to switch to anoter calendaring plugin but for now i'm stuck on the All in One Event Calendar πŸ™

My problem is that i can not launch our new website because of this plugin conflict.

Can you please tell me if and what is the roadmap for this issue?

As a workaround is it possible to change the class name?

Like: vi wp-content/themes/tm-beans/lib/api/compiler/vendors/lessc.php

Change the class name. For example add 'tmp':

class lessc_formatter_compressed_tmp extends lessc_formatter_classic {

Best regards, Martijn


I solved the conflict between the Beans theme and the All in One Event Calendar (AI1EC) plugin after making the following changes to the following file:

./wp-content/themes/tm-beans/lib/api/compiler/vendors/lessc.php


Line 3673 changed from::

class lessc_formatter_compressed extends lessc_formatter_classic {

to:

class lessc_formatter_compressed_tmp extends lessc_formatter_classic {


Line 3689 changed from:

class lessc_formatter_lessjs extends lessc_formatter_classic {

to:

class lessc_formatter_lessjs_tmp extends lessc_formatter_classic {


Line 1775 changed from:

$parser = new lessc_parser($this, __METHOD__);

to:

$parser = new lessc_parser_tmp($this, __METHOD__);

and

Line 1775 changed from:

$parser = new lessc_parser($this, $name);

to:

$parser = new lessc_parser_tmp($this, $name);

and

Line 2192 changed from:

class lessc_parser {

to:

class lessc_parser_tmp {


Line 3575 changed from:

class lessc_formatter_classic {

to:

class lessc_formatter_classic_tmp {

and

Line 3673 changed from:

class lessc_formatter_compressed_tmp extends lessc_formatter_classic {

to:

class lessc_formatter_compressed_tmp extends lessc_formatter_classic_tmp {

and

Line 3689 changed from:

class lessc_formatter_lessjs_tmp extends lessc_formatter_classic {

to:

class lessc_formatter_lessjs_tmp extends lessc_formatter_classic_tmp {


I hope you can change in the next version of Beans the class names to something like: beans_class_name. This is such a unique name that it would not conflict with any plugin.

By the way, i love Beans! Thanx for all the great work!

Grtz, Martijn



Hi Christoph,

That's great news! Thanks a lot for helping me (and others!)

I love Beans!

Grtz, martijn

Write a reply

Login or register to write a reply, it's free!