• Hello
    Can you please make a css file instead of puting the css code in page ?

    would be nice for those like me who have css parser minify agragator to reduce page size.

    thanks

    btw great plugin very nice and cool

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Anna Bansaghi

    (@annabansaghi)

    Hi, glad you like it!

    I have never seen that a plugin could generate a CSS file and store it on the server.

    I have found a solution here https://geek.hellyer.kiwi/2014/06/27/saving-css-files-uploads-folder/ , do not know if it works though.

    Do you have any ideas?

    I”m the author of the article you linked to just now. It definitely works, but the code I provided in that article will likely fail on occasional server setups. To avoid that, I think it would be a good idea to check for the presence of the static file and fallback to a PHP generated file if not present. To avoid servers messing with mime-types, I would use a PHP generated file with a .css file extension on it. To avoid performance bottle necks with checking for the presence of the static file, I’d store the information about the file being present in a transient and check that each time instead of checking for the presence of the file.

    To save some sanity, a simpler option may be to use an extension plugin which switched it to use the static file system. This way you can provide warnings and ask people to check their server setup rather than trusting your main plugin to be able to get it right.

    Storing static files is far more complicated than it should be :/

    Thread Starter bozzo23

    (@bozzo23)

    i am specialist in wordpress code … so here is what i notice on other plugin… they usual have a css for most of they option , and do write in the head (like you do) only the needed css for some special configuration.there is also some who create a css file when you save the plugin conf… i have to say i do not know how they do…and maybe it does not work soo easy at it should.but there is for exemple pluggin that agregate file to serve them after as “fast velocity minify” .. so there must be some way to do the trick.
    if it is complicated or over your competence i do understand… sometime things seems easy for user and are very complicated to do for the dev…
    still thanks a lot for taking time to look into it.

    Plugin Author Anna Bansaghi

    (@annabansaghi)

    Hi Ryan,

    that is a nice surprise! Thank you very much for your advice. Yeah, I assume it would not be a regular task.

    Perhaps can @bozzo23 clarify and add some detail to their workflow? It seems a CSS parser should be able to access the file. How does that work?

    Thread Starter bozzo23

    (@bozzo23)

    i dont know exactly here is what i guess :

    parser get all file from wordpress before it get in cache system
    the css get parsed and agregated together.
    file is create and output in wp-content/upload/ plugin name (this seems to be general way to do as all the plugin i have who write file to it there)
    link to the new file is writen in the head before the cache.

    in the end i have like 2 ou 3 css file for my website and not 20 like most people…its a litle load improvement but well its little drop of water that make sea

    Plugin Author Anna Bansaghi

    (@annabansaghi)

    Thank you for the clarification.

    Fast Velocity Minify looks pretty decent, good to know about it.

    I will take some time and figure how the config CSS can be stored in a file.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘css in css file’ is closed to new replies.