• Resolved hades200082

    (@hades200082)


    I love this plugin but it doesn’t love my theme unfortunately.

    I’m using StartIt from https://themeforest.net/item/startit-a-fresh-startup-business-theme/13542725

    I have two main issues…

    1. When HTML Minification is enabled the hamburger menu on the right of the main menu bar drops below the menu bar. I can’t see why this would happen but checking the box to disable HTML minification seems to resolve it.

    2. The theme has a settings section in WP admin and one of the fields is for custom CSS. Many of the other fields are also used to generate CSS.

    The CSS is generated by a pair of .php files that are referenced as CSS files in the markup of the theme.

    This plugin detects them and tries to minify them but obviously fails since PHP can’t be minified like this… which means that when I have the minification of those files enabled the theme disregards all of my customisations from its settings.

    I’ve got them ignored for the time being but any help you can give would be appreciated as I’d very much like to have all of the CSS minified properly.

    Thanks in advance

    Lee

Viewing 1 replies (of 1 total)
  • Plugin Author Raul P.

    (@alignak)

    Hi,

    I wish I can do a plugin that works perfectly with all themes (also because many theme authors don’t follow good practices when coding).

    The plugin uses a well tested html minification library from mrclay and that’s the best so far I found at minifying html… so, in regard of html minification, the only thing I can say is to disable it.

    What probably happens is that your hamburger is probably not aligned properly with CSS and instead, it uses a space somewhere that get’s stripped off during the minification (or some space is added and your CSS doesn’t check for this).

    The obvious solution is to add the proper CSS rules for it to be aligned properly.
    Quick fix would be to disable html minification (which is almost irrelevant anyway if you use gzip).

    2) Dynamic generated CSS should be banned from wordpress… I mean, CSS is meant to be static code always and load as fast as possible. If you load your CSS via PHP everytime your are reducing your server efficiency into half (or even further if you have more than one dynamic css file being used).

    While a server can serve thousands of static css files, normal hosting in can only serve very few php requests simultaneously, thus this kind of theme should be avoided.

    For example, even if you cache your site, your css dynamic file becomes a vector for DDoS attacks (authors should really avoid this, there are so many other ways of doing it).

    That being said, you need a solution… and unfortunately that solution for now is to add those to the ignore list, like you did. My plugin does this automatically if the css file includes a php file with a version number.

    There would be ways of doing this with some sort of helper plugin (or your functions.php file) where you would save that dynamic css into a css file and then dequeue the dynamic file and enqueue the static file. That way my plugin would pick it up… but that also means you would need to do this every time you change something on the css code.

    Sorry if I couldn’t help you further.

    [ redacted ]

    • This reply was modified 7 years, 8 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • The topic ‘StartIt theme issues with minify’ is closed to new replies.