-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility with other plugins that include a class 'lessc' #82
Comments
Hm, there is a check here https://github.com/oncletom/wp-less/blob/master/lib/Plugin.class.php#L46 What was your error message? |
Sorry, maybe I wasn't very clear. As far as I am aware: I'm using WP-LESS's [However, in this project I need this other plugin...] All-in-One Event Calendar by Time.ly includes lessphp (leafo), and seems to load its version of As you pointed out, due to All-in-One Event Calendar by Time.ly also does a check to see if a class To get around this at the moment, I have created a simple |
I have had a similar issue. What seemed to be happening is that the theme was not being activated full the first time. This resulted in WP-Less trying to process the less files before my theme could specify less.php over lessc. I put an option in my theme so that it requires you to check a box to enable less processing. This way the theme is active and running before WP-Less tries to process Bootstrap. This was with no other extensions installed. Maybe it is stated somewhere else, but is there a reason that WP-Less prefers lessc? Should it hit the filter first, then check to see if the intended lib is loaded? |
Well, the compiler is required if Another safer would be to never extend lessc, and to inject the Less compiler at a constructor level. Although, I guess we could have some facades (WpLessCompiler requires WpLeafoCompiler which requires lessc etc.) to avoid requiring and extending undesired classes. |
class WPLessCompiler extends lessc
If a class
lessc
is defined in another plugin, and that plugin loads before WP-LESS, the other plugins class will be used. This can cause problems.Example:
In my project using WP-LESS I'm using the 'wp_less_compiler' filter to switch compilers to less.php (oyejorge) as we are using Bootstraps less framework, which uses syntax unsupported by lessphp (leafo).
The plugin 'all-in-one-event-calendar' includes lessphp (leafo). As the name of this plugin is alphabetically before 'wp-less' it is loaded first, and thus wp-less always uses the lessphp version of lessc. This then causes an exception as it encounters the bootstrap syntax that is unsupported.
(As a workaround, I have installed a plugin called Plugin Organizer, that lets you alter the order that plugins are loaded. Putting WP-LESS first fixes everything).
WP v4.1
WP-LESS v1.7.5
All-in-One Event Calendar by Time.ly v2.1.9
The text was updated successfully, but these errors were encountered: