Compiling JS & CSS

Posted in: Newspaper
Post count: 18

Wondering if anyone has successfully been able to compile all (or most) of the JS & CSS files that appear to be loading with this team. The theme loads a lot of different CSS files and also loads a lot of specific elements into the source code.

I’m looking into some solutions to optimize so can get better load times & performance. An suggestions?

Post count: 9544

I have combined various things and also minified both CSS and JS, and you can see the tools I used to minify manually in my thread on theme optimization in tutorials > DIY > best of forums.

However, note that to “combine” certain things like lightbox, visual composer, etc., you would need to hack the plugin to NOT also enqueue the js and css calls, keep track of what you’re doing and basically “freeze” your setup for awhile for those tools.

You can also quash some things like the emoticons js and other things by disabling that via addition of code to functions.php. And of course, not using things like Jetpack, and turning *off* anything you are not using like slider plugins, etc., sure helps.

Post count: 18

Thanks for the reply Chris. We’re looking into some of the options you’ve listed. Was just wondering if there was a mode that would clean up the additional “theme specific” JS & CSS that’s entered inside the HTML in addition to the .CSS & .JS files that are loading.

I’m a fan of wordpress really… but I’m really starting to get disgusted by the way each plugin integrates it’s own CSS & JS files without an easy solution to compile data to load one single compile file vs. 20 different individual ones (sorry venting :D)

Post count: 9544

Well, the CSS and Java in the page helps it load faster by NOT having to load external sources and helps to deal with the above the fold loading, and mobile loading. Some things work better inline than external these days.

In other words, some CSS and JS “inline” loads faster for above the fold (render blocking …) vs waiting for the entire separate file to load, hence why this is now donw, which was crazy talk in olden days.

“Critical CSS” should be loaded with the page itself, then supported elements “later.”

Tricky!

I’ve stopped using some plugins due to the extra CSS crap included and no way to disable, or allow the plugin to “inherent” theme CSS (e.g., <LI> and <UL> stuff).

I also hacked one plugin to remove their CSS and just put it at bottom of the style.css and shazam.

I feel your pain; actually dealing with this right now on another project which is NOT using TagDiv themes due to a long boring story.

I really hate the form scripts which load the FORM CSS on every page and not just the actual FORM page. Requires creating custom page called “form” and then manually putting the CSS for plugin on THAT page vs having stupid if/then on every site page to NOT load it conditionally which is also dumb for resource queries.

AUGH!!!!! (damn kite eating tree!)

  • This reply was modified 10 years by simchris.
  • This reply was modified 10 years by simchris.
Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.