This is a bit off topic, but could you please explain, or link some source that explains why it should be considered as ‘very bad practice’? (no sarcasm, really interested) I use it to generate the main.css file on the fly from a .less source file. The main.css file only gets re-generated if the original less file is modified, otherwise no action will be taken and main.css will be enqueued normally.
One important reason: The theme should stay untouched. The user should never alter the files from a theme or plugin if is developed by somebody else.
You say that this is not a problem, because nothing is lost, but I can say the opposite. Even if you modify just a simple stylesheet, this means you’ve modified everything. Why? I tell you. To understand it better, I’ll give you an example: ....Cheers.
That’s a scenario I haven’t thought about actually, btw even though I said it’s possible, I’m not using the compiler for user customizations. In that case I’ll definitely output the file in wp-uploads as you say and still benefit of other advantages, no big deal.
Try this https://github.com/sanchothefat/wp-less I used wp less with less php and it worked fine. No errors during the theme check too.
Thanks for the heads up, I’ll check up on that
I still don’t understand how do you use the “less.inc.php”. Can you exaplain what’s the use of it? If you’re using it to pre-process the CSS , then you should use a local software that offer more options. The one I use is PrePos and it’s free.
When I say that you should save the CSS in ‘wp-uploads’ I mean custom CSS, that you don’t want to be overided on a theme update. Also, it’s a very bad practice to generate dynamic files inside of ‘themes’ folder.Please explain what’s the purpose of “less.inc.php”.
This is a bit off topic, but could you please explain, or link some source that explains why it should be considered as ‘very bad practice’? (no sarcasm, really interested)
I use it to generate the main.css file on the fly from a .less source file. The main.css file only gets re-generated if the original less file is modified, otherwise no action will be taken and main.css will be enqueued normally.
This way server php resources usage is very limited and it only takes place when needed (e.g after a theme update or if the users manually edit less files)
- You can pass user customizations as variables and output them directly to the main.css file (!)
- The development workflow is much quicker and there’s no need of any offline preprocessor
- Advanced users can directly edit well organized less files if they want to, and still get a compressed single css file on front-end automatically.
- - ?
Back in Topic, I were able to fix the issue and remove the line endings by minifying the output using the setFormatter method
$less = new lessc; $less->setFormatter("compressed");
Thanks for your answer even though that’s not exactly what I wanted to hear
Does anybody have any suggestion on how to fix this? That’s what the PHP less compiler throws out I have no idea how to affect the output in order to fix this warning…!
Bumping this up…
How about a css file that is generated from a less file and compiled through less.inc.php?
Themecheck + Themeforest Check throws out this warning but I’m not sure how to fix this, If I open and re-save the generated file with some text editor the error obviously disappear, but as soon as it regenerates same error shows up again.
Will this actually be critical in the review process?
Thanks for sharing some nice resources!
Or you can use the official plugin which Envato requires: https://github.com/envato/envato-wordpress-toolkit
It’s not required to use the official Envato toolkit
Yes. And while you’re at it, give yourself a five star rating. You deserve it!
As far as I know this isn’t allowed actually
Sales notification never worked for me on SalesDonkey app