thom4parisot / wp-less Goto Github PK
View Code? Open in Web Editor NEWWordPress plugin which seemlessly compiles, caches and rebuilds your LESS stylesheets.
Home Page: https://wordpress.org/plugins/wp-less/
WordPress plugin which seemlessly compiles, caches and rebuilds your LESS stylesheets.
Home Page: https://wordpress.org/plugins/wp-less/
Hi there,
You link to the github project wiki, but it does not exist.
Did you delete it?
Thank you
If no LESS file has been spotted in the enqueue mechanism and a style.less
file is present in the root directory, it should be automagically enqueued.
This behavior should be configurable through WPLessConfig
class and a config constant.
I'm using wp-less as a plugin. wp-less is not generating new stylesheets - it keeps embedding in the header the last one; I deleted the folder under uploads/wp-less and did a few edits to my .less stylesheet, but still it doesn't generate a new css file and keep an old reference in wp-header to a generated css file that no longer exists; I tried deactivating and reactivating the plugin, overwriting with files downloaded from this repo, to no avail. I did not install new plugins or updated existing ones for the problem to appear. I had made few edits to a less stylesheet yesterday night and uploaded it only this morning. That's probably when the problem occurred for the first time. I reverted back the changes, but the new stylesheet is not generated any more. I tried to make the less stylesheet empty with just a single style (like body { color: red } ) to no avail.
As i understand all css will recompiled always when using addVariable
. If so, could you consider to add some caching here too? (build a array of all variables to add and check it's change or not). After changing a theme setting in want recompile once.
In the new version of the plugin @fabrizim has set the compiler to initalize at 'init' priority 1, however the documented method for registering variables uses the functions.php file, which is executed BEFORE the 'init' action in the page life-cycle.
This results in the following error:
Fatal error: Call to a member function setVariables() on a non-object in /bedrock/web/app/plugins/wp-less/lib/Plugin.class.php on line 319
The solution was to call the variable registration with a hook after the init@1:
add_action('init', 'tws_redux_to_less_vars', 2); // The WP-LESS compiler is instantiated in 'init' priority 1.
function tws_redux_to_less_vars() {
// Pass LESS variables from reduxlessvars option to the LESS plugin class
if (class_exists('WPLessPlugin')){
$less = WPLessPlugin::getInstance();
$less->setVariables(get_option('reduxlessvars'));
}
}
I think the plugin documentation needs to be updated to reflect this. I have a feeling other plugin components (e.g. function registration) might face a similar issue.
As reported here: http://wordpress.org/support/topic/plugin-wp-less-issues-with-wp-network-site-and-domain-mapping
Hello, I´ve got an issue when enabling the bootstrap version for theme include, and WordPress Network Site(MU) with Domain Mapping(Free version).
It works fine before the Domain is changed(Less is compiled and css is stored), then i got error in line 96, in stylesheet.class.php, and i think the error is because of$this->source_path = WP_CONTENT_DIR.preg_replace('#^'.WP_CONTENT_URL.'#U', '', $this->stylesheet->src);
- when the new domain is mapped.
Hi there!
Plugin .zip on WordPress repo contains .gitignore and .svnignore files in its root.
This can lead to some problems with pushing whole site repositories to production. Like this:
PHP Fatal error: require(): Failed opening required
'/app-root/data/plugins/wp-less/lib/../vendor/leafo/lessphp/lessc.inc.php'
... in /app-root/data/plugins/wp-less/lib/Plugin.class.php on line 48
It might be a good idea to remove them, if that is possible, to skip rare but unnecessary problems.
Cheers!
As detailed in this commit: b13596f
Some changes were made to configurePath()
in lib/Stylesheet.class.php
that breaks the previous caching convention. The cached css files were previously stored under wp-content/uploads/wp-less/[theme]/
(where [theme] is equivalent to the theme folder name in use). However, since the aforementioned commit, the addition of basename()
is causing the [theme] path portion to be stripped, since basename()
returns nothing if the file doesn't already exist. Cached stylesheets are now being placed under wp-content/uploads/wp-less/
, instead.
Anyone who was depending on that convention for relative paths from the cached stylesheet to other things, such as FontAwesome, will find that those components now quietly break.
Hi,
it seams to me that the plugin is not working in the admin area, or I'am doing something very wrong.
The problem is that the Plugin does use the "wp_enqueue_scripts" Action what is ok for the non-admin part. But in the admin area the hook should be "admin_enqueue_scripts".
I have tried some stuff and ended up doing this:
$less = WPLessPlugin::getInstance();
add_action('admin_enqueue_scripts', array($less, 'processStylesheets'), 999, 0);
in a function due to the init action. That works but is kind of ugly.
Is there a more easy solution to get wp-less working in the admin area?
wpless is in deep mode.... but caching keeps creating new files... even when no changes are detected... any idea why?
Ran into this one today and it appears to be fixed in the latest release 0.5.0
I don't know why, but for me, those two options are not working. Maybe you could give me a tip on how to find out why.
I have added WP Less to my theme functions.php:
$less = WPLessPlugin::getInstance();
$less->dispatch();
$less->install();
Is there a way to compile LESS files via add_editor_style? I need it to compile LESS for me to improve the visual editor style easier.
Same as #1 but from the admin side, not code side.
After updating Bootstrap I had an error thrown by wp-less/lessphp similar to that experienced in this ticket leafo/lessphp#376
this commit fixes the issue leafo/lessphp@ee5b675
however I think that is not yet updated inside wp-less
I fixed the problem by manually upgrading the old phpless with the newest build from the github repo
Hi there. I am really enjoying using wp-less. However, there is a niggle:
I am trying to make individually styled pages through use of custom categories, meta fields, what have you.
The way I've done this in the past is to basically generate in-line CSS with PHP, based on what the $vars of the page are set to.
I have been trying to pass vars to wp-less for quite some time now, from header.php to functions.php, but have had no luck. Using my_less_vars(), add_var(), the $less->addVariable() method, etc have yielded no luck.
Manually changing the variables.less file to change colour values results in immediate change. But I want to do it as the page renders.
I am using the twitter bootstrap less framework, and enqueuing only bootstrap.less, which as you probably know @imports a whole bunch of .less files, one of which contains the relevant values: variables.less
Am I getting this ass backwards, or is something wrong? I am on a fresh install of WP 3.7.1 on Dreamhost. WP-less is the only plug-in installed.
so after I moved over my WP, via a cloner.. the less files started spitting out this error..
lessphp fatal error: load error: failed to find D:\Hosting\4926382\html\cdpinew/wp-content/themes/theme2126/bootstrap/less/bootstrap.lesslessphp
fatal error: load error: failed to find D:\Hosting\4926382\html\cdpinew/wp-content/themes/theme2126/style.less
this theme uses less built into it.. its trying to access the files via the old location on the previoius server.. how do i clean this up??
How would I use less stylesheets for backend styling? I have wp_enqueue_stlye() in an 'admin_enqueue_scripts' action, which doesn't seem to work. Any advice much appreciated. Thanks!
Hi oncletom! Nice job with this wp plugin, it's pretty funny to develop in this way-
Neverthless i couldn't get work unit() function. There is what i'm trying to do:
.fontsize( @size ) {
font-size: unit( @size, px );
font-size: unit( @size / @rembase, rem );
}
@rembase is previously defined. When i use this mixin .fontsize(14)
i get this output:
font-size: unit( 14, px );
font-size: unit( 1, rem );
According to Less Function Reference the output it's supossed to be
font-size: 14px;
font-size: 1rem;
I'm not sure if that is a bug or unit() function is not supported yet in wpless.
Thanks you so much!
All regular .css files are being removed in the mce_css filter. I am adding this issue for posterity, as I just resolved it with this commit: e56b037
I think this patch may warrant an updated package for public consumption.
Today I wrote a little issue in less saved the file and then I got a blank wordpress page.
There was no error and no hint.
Please fix that.
Thank you
There's not much more I can say, I don't know what's broken but it's not working on 3.6
Because it is unnecessary and cause troubles on some hosting install.
Most important thing to do, it's slowing contribution and plugin evolution.
I should probably open a pull request for this but I'm not sure how many others want/need it. In Plugin.class.php around line 43 I added this to the construct...
$this->compiler->setFormatter('compressed');
It ecentially minifies the css output. It didn't make a huge difference on file size for me but I figure every k counts!
So, to recap, line 43....
$this->compiler = new WPLessCompiler;
$this->compiler->setFormatter('compressed');
$this->compiler->setVariable('stylesheet_directory_uri', "'" . get_stylesheet_directory_uri() . "'");
$this->compiler->setVariable('template_directory_uri', "'" . get_template_directory_uri() . "'");
It's easy to read the output css file without this obviously but better to have this for mobile reasons.
I'd like to use the compressed
formatter in lessphp to get a minified output, but there seems to be no way to access the WPLessCompiler
instance to call setFormatter
.
IE seems not to like ../
notation in URL paths.
When having a folder called /less/ and another called /img/ the CSS for a background image becomes /default-theme/less/../img/my-image.png. Internet Explorer don't like the /../. Maybe replace it with the folder name instead? Else the less-file must be in the theme root.
Part 1:
I have version 1.6.0 running just fine on production at betterplace.org/c/.
Whenever I update to the latest (current 1.7.5) I get this error on production:
Warning: require(/www/static.asdf.com/releases/20141124155319/wp-content/plugins/wp-less/lib/../vendor/leafo/lessphp/lessc.inc.php): failed to open stream: No such file or directory in /www/static.asdf.com/releases/20141124155319/wp-content/plugins/wp-less/lib/Plugin.class.php on line 48
Fatal error: require(): Failed opening required '/www/static.asdf.com/releases/20141124155319/wp-content/plugins/wp-less/lib/../vendor/leafo/lessphp/lessc.inc.php' (include_path='.:/usr/local/lib/php') in /www/static.asdf.com/releases/20141124155319/wp-content/plugins/wp-less/lib/Plugin.class.php on line 48
I get this error regardless of the .gitignore files from part 2, below.
Part 2:
Also, I have issues with the .gitignore files
that the plugin downloads automatically.
(I have all my WP Code in a private repo and deploy via capistrano.)
There is a difference between what I check in when I keep the .gitignore files in the plugin folder to the version when I ignore the .gitignore-plugin files.
Version with plugin-gitingore-files:
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: wp-content/plugins/wp-less/.svnignore
modified: wp-content/plugins/wp-less/bootstrap.php
modified: wp-content/plugins/wp-less/lib/Compiler.class.php
modified: wp-content/plugins/wp-less/lib/Configuration.class.php
modified: wp-content/plugins/wp-less/lib/Garbagecollector.class.php
modified: wp-content/plugins/wp-less/lib/Plugin.class.php
modified: wp-content/plugins/wp-less/lib/Stylesheet.class.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/.gitignore
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/.travis.yml
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/LICENSE
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/Makefile
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/README.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/composer.json
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/docs/docs.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessc.inc.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessify
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessify.inc.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/package.sh
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/plessc
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/ApiTest.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/InputTest.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/README.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/bootstrap.sh
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/accessors.less.disable
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/arity.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/attributes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/builtins.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/colors.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/compile_on_mixin.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/directives.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/escape.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/font_family.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/guards.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/hacks.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/hi.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/ie.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/import.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/interpolation.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/keyframes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/math.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/media.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/misc.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixin_functions.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixin_merging.less.disable
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixins.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/nested.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/pattern_matching.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/scopes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/selector_expressions.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/site_demos.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/a.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/b.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file1.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file2.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file3.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/inner/file1.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/inner/file2.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/variables.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/accessors.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/arity.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/attributes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/builtins.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/colors.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/compile_on_mixin.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/directives.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/escape.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/font_family.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/guards.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/hacks.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/hi.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/ie.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/import.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/interpolation.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/keyframes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/math.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/media.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/misc.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixin_functions.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixin_merging.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixins.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/nested.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/nesting.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/pattern_matching.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/scopes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/selector_expressions.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/site_demos.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/variables.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/sort.php
modified: wp-content/plugins/wp-less/lib/vendor/plugin-toolkit/BaseConfiguration.class.php
modified: wp-content/plugins/wp-less/readme.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
wp-content/plugins/wp-less/.gitignore
wp-content/plugins/wp-less/composer.json
wp-content/plugins/wp-less/doc/
no changes added to commit (use "git add" and/or "git commit -a")
Version without those files:
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
modified: wp-content/plugins/wp-less/.svnignore
modified: wp-content/plugins/wp-less/bootstrap.php
modified: wp-content/plugins/wp-less/lib/Compiler.class.php
modified: wp-content/plugins/wp-less/lib/Configuration.class.php
modified: wp-content/plugins/wp-less/lib/Garbagecollector.class.php
modified: wp-content/plugins/wp-less/lib/Plugin.class.php
modified: wp-content/plugins/wp-less/lib/Stylesheet.class.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/.gitignore
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/.travis.yml
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/LICENSE
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/Makefile
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/README.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/composer.json
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/docs/docs.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessc.inc.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessify
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/lessify.inc.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/package.sh
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/plessc
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/ApiTest.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/InputTest.php
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/README.md
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/bootstrap.sh
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/accessors.less.disable
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/arity.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/attributes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/builtins.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/colors.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/compile_on_mixin.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/directives.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/escape.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/font_family.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/guards.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/hacks.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/hi.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/ie.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/import.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/interpolation.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/keyframes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/math.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/media.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/misc.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixin_functions.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixin_merging.less.disable
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/mixins.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/nested.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/pattern_matching.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/scopes.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/selector_expressions.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/site_demos.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/a.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/b.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file1.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file2.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/file3.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/inner/file1.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/test-imports/inner/file2.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/inputs/variables.less
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/accessors.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/arity.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/attributes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/builtins.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/colors.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/compile_on_mixin.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/directives.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/escape.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/font_family.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/guards.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/hacks.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/hi.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/ie.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/import.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/interpolation.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/keyframes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/math.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/media.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/misc.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixin_functions.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixin_merging.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/mixins.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/nested.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/nesting.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/pattern_matching.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/scopes.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/selector_expressions.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/site_demos.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/outputs/variables.css
deleted: wp-content/plugins/wp-less/lib/vendor/lessphp/tests/sort.php
modified: wp-content/plugins/wp-less/lib/vendor/plugin-toolkit/BaseConfiguration.class.php
modified: wp-content/plugins/wp-less/readme.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
wp-content/plugins/wp-less/composer.json
wp-content/plugins/wp-less/doc/
no changes added to commit (use "git add" and/or "git commit -a")
As received from email feedback, an admin panel could be nice.
Features are detailed in other issues.
I am using WP Engine as my host, and I've been having trouble getting WP-LESS to work since upgrading to 1.5.1.
According to the WP Engine engineer I've consulted, their server configuration won't allow the chmod() operation WP-LESS implements when writing the generated CSS files to the assigned upload directory.
But prior to the 1.5.1 release WP-LESS was working fine with WP Engine, and it looks to me like chmod() was used at least as far back as 1.4.2.
So, I'm not sure we've pinpointed what changed in 1.5.1 that's causing the issue. Anyone else out there having the same problem? Any ideas?
I try to add https://github.com/oyejorge/less.php to compile, see also https://github.com/bassjobsen/wp-lesscss
in my functions.php i define:
if (class_exists('WPLessPlugin'))
{
$less = WPLessPlugin::getInstance();
$less->addVariable('myColor', 'purple');
}
with addVariable in WPLessPlugin:
public function addVariable($name, $value)
{
$this->compiler->parse('@'.$name.': '.$value.';');
}
and
class WPLessCompiler extends Less_Parser
{
}
$this->compiler->parse seems to set Less_Parser->rules but will be reset after every call to addVariable();
Calling $this->parse()
inside Less_Parser->getCss() works as expected.
For me it seems addVariable creates a new instance of WPLessCompiler every time and i don't understand why.
Hope you can help.
If I am not wrong the Second Line in the Compiler.class.php is useless.
<?php
$compiler = 'lessphp';
if( defined('WP_LESS_COMPILER') ){
The $compiler variable is never used again, is it?
Secondly, would it not been better to register a filter hook to let programmers change the folder with the compiler class base, instead of using globals?
Also would it not been better to encapsulate the checksequence for the includepath inside some other class? This plugin is nicely done in OOP but that look outside the norm.
I just used to switch from lessphp to less.php 'cause lessphp does not compile the "Semantic Grid System" less files right.
Was nicely surprised that switching the compiler class was soo easy! :)
Many thank!
Have to think if we deal with symlinks (won't work for Windows) or if we create another copy of the file.
Hi there,
There is an issue I keep hitting where the cron
value in wp_options
get's so big that the site no longer operates.
I believe this could be due to an issue mentioned at https://codex.wordpress.org/Function_Reference/wp_schedule_event
'For some reason there seems to be a problem on some systems where the hook must not contain underscores or uppercase characters.'
The issue causes the hook to be repeatedly added to the serialised array,
Hi,
I'm getting errors when I'm using WP-LESS with WP multisite. I've created a fix for it:
Replace line 87 in "Stylesheet.class.php" from:
$this->source_path = WP_CONTENT_DIR.preg_replace('#^'.content_url().'#U', '', $this->stylesheet->src);
To:
$this->source_path = WP_CONTENT_DIR.str_replace('/wp-content','',parse_url($this->stylesheet->src,PHP_URL_PATH));
It would be nice if you change this in a feature version.
And bump the plugin version to 1.6.0 as it's possibly breaking things.
Button to invalidate global LESS cache.
For problem description see: leafo/lessphp#208
I upgraded phpless to the latest version (0.3.5) and that fixed the issue.
As received feedback, using WP_DEBUG
is not a good strategy on live servers, as we may need an always rebuild cache without being in debug.
These rules are interesting:
Either to choose that from a constant + bitmask, or many constants.
i run wordpress in my computer (using EasyPHP), and i download themes that include less files.
in the documetation, everything just click and will be done. but when i finished install the themes, not single one of css in the less folder that compiled.
i try to upload it on server, web hosting i mean. It's ok, nothing error, all less files compiled well.
i think it was my EasyPHP that error, but it's not. i try to download EasyPHP again, but it's still not compiled.
maybe it's because i run it in localhost?
(ALREADY SOLVED) NOT WP LESS BUG, THE PROBLEM IS IN EASYPHP
When attempting to enqueue a LESS stylesheet with the wp_enqueue_style('foo', get_stylesheet_directory().'bar.less')
method, I'm getting a PHP error as follows:
PHP Warning: filemtime(): stat failed for /Applications/MAMP/htdocs/mysite.com/content/Applications/MAMP/htdocs/mysite.com/content/themes/my_theme/assets/less/bar.less
I'm pretty sure there is a conflict between some folder / WordPress structural re-writes that I'm doing and the expected schema of the plugin - notice how (the above error is being thrown from local development in MAMP) the filepath is duplicated above: /Applications/MAMP/htdocs/mysite.com/content/Applications/MAMP/htdocs/mysite.com...
Any idea how to make that filepath for wp_enqueue_style()
absolute? Note that my other enqueue style calls are working fine for other CSS and JS, only the one for the .less file as directed through this plugin is causing a problem.
I had the issue that only the "stylesheet_dir"-part of a converted "url()"-path was displayed, not the filename or any parts put into the parantheses.
Solution was in function _filterStylesheetUri() (Plugin.class.php)
$matches wasn't associative, but rather numerical array. so, $matches['url'] etc returned nothing; replacing by $matches[2] works now.
Maybe this is actually just an issue of that hosting provider, but just for the record...
PHP Version 5.2.6-1+lenny6
wp_enqueue_style('theme-main', get_stylesheet_directory_uri().'/stylesheets/theme-main.less');
wp_enqueue_style('theme-extra', get_stylesheet_directory_uri().'/stylesheets/theme-extra.less');
---> combine-main-extra.css
That sound quite good, but how could I get my options from options-tree to wp-less?
This works just fine:
<?php
if (class_exists('WPLessPlugin')){
$less = WPLessPlugin::getInstance();
$less->setVariables(array(
'fontcolor' => 'red'
));
}
?>
Now, Option-tree's docs says:
If you've integrated OptionTree directly into your themes root directory, you will not need to wrap your code with function_exists, as you're guaranteed to have the ot_get_option() function available.
So, I'm trying this:
<?php
if (class_exists('WPLessPlugin')){
$less = WPLessPlugin::getInstance();
$less->setVariables(array(
'fontcolor' => ot_get_option( 'fontcolor' )
));
}
?>
And getting Fatal error: Call to undefined function ot_get_option()
I'm using Option Tree Plugin in Theme Mode.
The grid would present the state of each file cache, and if a theme LESS file is newer.
It could hint a manual refresh.
Hey,
I'm using wp-less, and all comments in generated css's are eliminated, how can i set it to output comments?
Hi,
In the later versions the install procedure have changed noticeable. Can anyone write a documentation how to install this Plugin via git and composer?
Also how to update guide the plugin when installed via git and composer would be nice. I find myself in a position needing something like that...
Thanks a lot!
Hi there great work and great to see 1.5 coming along... I have the framework bootstraped within my theme... is there any hooks I can get into to do a proper registrer function call to add my own lessphp functions?
Thanks so much (see lessphp example below)
<?php
include "lessc.inc.php";
function lessphp_double($arg) {
list($type, $value) = $arg;
return array($type, $value*2);
}
$less = new lessc;
$less->registerFunction("double", "lessphp_double");
// gives us a width of 800px
echo $less->compile("div { width: double(400px); }");
We are using wp-less as a part of our theme (not installed as a plugin) and we noticed that Apache error log has thousands of errors like:
PHP Warning: unlink( [path here]): Is a directory in [path here]/plugins/wp-less/lib/Garbagecollector.class.php on line 118
Although the plugin works - our error log contains literally thousands of these warnings. Can you point us to the solution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.