Got warnings from Theme-Check plugin about "Both DOS and UNIX style line endings". What does it mean!?

1081 posts
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
+1 more
Smartik says


Why ThemeCheck detects it? Do you save the CSS directly in theme? If so, then you don’t do it right because you must save any custom generated CSS in wp-uploads directory.
That’s the main CSS file for the theme, why should I put it outside theme folder?
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”.

75 posts
  • Elite Author
  • Author had a File in an Envato Bundle
  • Sold between 50 000 and 100 000 dollars
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
  • Europe
djwd says

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)

Pros:

  • 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.

Cons:

  • - ?

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");
1081 posts
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
+1 more
Smartik says

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:

Suppose that a user use your theme, he loves it so much that decided to purchase another 3 licences for other 3 sites. Now that uses is going to use your theme on 4 sites, all these 4 sites share similar content so it makes sense to use the same theme. Also all these 4 sites are from one WordPress Multisite installation. Now, you see where is the problem? No? Ok, let’s continue then.
That user want to use your theme on all these 4 sites but on each site to have a different color scheme. That means that he would adjust the settings on each site from admin. Ifthe theme will save the generated CSS in its folder, then the user will not be able to have a different color scheme for each site because every time he adjust the settings for a site it will overide the generated CSS for other sites.

That’s why you should save the generated CSS in wp-uploads folder with a unique stylesheet name for each theme and website.

Cheers.

24 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 1-2 years
bootstrapguru says

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…!

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.

75 posts
  • Elite Author
  • Author had a File in an Envato Bundle
  • Sold between 50 000 and 100 000 dollars
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
  • Europe
djwd says


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. :grin:


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

by
by
by
by
by
by