Home>Support>Minify and combine stylesheets and js in uploads folder

Minify and combine stylesheets and js in uploads folder

So, I have a question that I’ve been trying to answer forever on my own, and it is affecting me when using Site Origin widgets and the page builder as well.

I have ZERO clue how to minify and combine css and js files that are dynamically created in the uploads folder in WP. This is not just for Site Origin, but for all WP. I have worked for quite some time building sites from scratch and having total control over where, and how, my files are setup. With WP, I use Hummingbird from WPMU Dev to save time with minifying and combining and it works well, and I manually handle the files it can’t, or that it breaks when it affects, BUT, the uploads folder is a sad abyss for me in WP. I understand that the files are generated dynamically so just moving them into my child theme manually is a no-go, but I don’t know where to look for them to change a function so they are either not created dynamically (probably don’t want because they are, well, dynamic), or they are minified and combined (and possibly placed in the footer).

The biggest issue on SO for me is the button styling. There are 3 or 4 files with a couple lines each that all manage button styling, it’s killing my scores on GTMetrix and Pingdom (and I guess Google Page Speed but whatever). If anyone has figured this out, I would massively appreciate any help you are willing to offer. Thanks!

Phil

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Phillip,

    Your minify plugin should be handling this for you. Our cached CSS files are only generated upon changing the corresponding widget or after an update so you won’t need to worry about reaching it after every page load.

    If you’re manually choosing what is and isn’t minified, you’re not going to be able to minify the files unless you manually change update your minify settings every time you make a change. Ideally, it’s best to leave minifying up to the minify plugins if you can help it.

    > it’s killing my scores on GTMetrix and Pingdom (and I guess Google Page Speed but whatever)
    The extra stylesheets won’t help but it’s not going to “kill” your score and if they are, there’s something much more serious going on that’s really affecting it.

  2. 7 years, 3 months ago phillipthiel

    Hi Alex,

    Killing may have been an overstatement, but I’m always looking for more speed. It may be because I don’t always use a page cache plugin, rather I use Hummingbird from WPMU Dev which minifies and combines CSS and JS, but I don’t think it does the dynamic files generated in the upload folders. Is there a plugin you recommend for minification and combining files generated dynamically? I try not to have too many plugins if I can avoid it, but some things you need for WP.

    Love the SO builder, generates good code and is really easy to use. I did run into one issue that I think is from combining and minifying css. I have to “refresh” my SOW buttons once in a while after changes because the styling gets removed. Have you seen that before? I’m guessing it’s likely because I switched back and forth from a CDN a couple of times and manually combined and minified the files and inlined some of the css for the buttons (the smaller files) before I decided to stop trying to manually do that with the dynamic files, so there was some chopping and changing. Just curious if you guys had ever seen that before and if there was a common fix if it continues to happen. So far so good since I moved back onto the CDN. Thanks!

    Phil

  3. 7 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Phill,

    If you’re not using a cache plugin, any old minify plugin should work. Hummingbird, might cache the results and only infrequently check.

    I personally use and recommend Better WordPress Minify but I’ve heard really good things about Autoptimize. Please note that these plugins are more complicated than Hummingbird but that complexity also comes with more power/functionality in my opinion. Please note that you’ll likely have to exclude wp-content/plugins/siteorigin-panels/css/front-flex.css.

    > I have to “refresh” my SOW buttons once in a while after changes because the styling gets removed. Have you seen that before?
    That’s due to the page referencing an older no longer existing stylesheet. You should be able to resolve this by clearing the minify data also.

  4. 7 years, 3 months ago phillipthiel

    Thanks for all the info!

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More