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

1291 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 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”.

110 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
  • Has been a beta tester for an Envato feature
+4 more
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");
1291 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 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.

44 posts
  • Has sold $10,000+ on Envato Market
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
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.

110 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
  • Has been a beta tester for an Envato feature
+4 more
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

2 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Had an item featured on Envato Market
+1 more
pi-themes says

The same thing for me, but i use node.js less compiler to compile main theme files. If i check it in phpstorm or notepad++ it shows that only Windows (CRLF) line endings used, but that plugin says it use both DOS and Windows(CRLF) line endings.

But no, there is no LF anywhere in my CSS.

And what futher… I had spaces instead tabs in CSS, and after i have reformated all CSS it shows no errors.

Hope that will help someone.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by