• Hello, I just got a little bit fighting with Autoptimize and his “Also aggregate inline JS?” function. because no matter I tried, AO cache still growing, because of different JS for every page.

    I found the problem – some Hueman’s JS and CSS are created on the fly. – Solved by disabling this feature.

    But can you please minify this generated JS in PHP? For example in this files are some parts of non minified JS which is included in to page and webs like gtmetrix.com don’t like it 🙂
    plugins/hueman-addons/inc/sharrre-template.php
    themes/hueman/functions/init-front-php
    themes/hueman/functions/dynamic-styles.php
    themes/hueman/parts/featured.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • no, AO does not aggregate .php-files, only static .css or .js ones I’m afraid. an alternative could be to let huaman create the JS (and CSS) on the fly (as static files, I suppose) and then to exclude those that have cache-breaking code from optimization?

    frank

    Thread Starter mikrom

    (@mikrom)

    yes, but mainly I think hueman authors can chenge for example in init-front.php around line 458

    this

            <script type="text/javascript">
              jQuery( function($){
                if ( $('#flexslider-featured').length ) {
                  $('#flexslider-featured').on('featured-slider-ready', function() {
                    $( '#<?php echo $_unique_id; ?>' ).animateSvg();
                  });
                } else { $( '#<?php echo $_unique_id; ?>' ).animateSvg( { svg_opacity : 0.3, filter_opacity : 0.5 } ); }
              });
            </script>

    to that

            <script type="text/javascript">
    jQuery(function(a){a("#flexslider-featured").length?a("#flexslider-featured").on("featured-slider-ready",function(){a("#<?php echo $_unique_id; ?>").animateSvg()}):a("#<?php echo $_unique_id; ?>").animateSvg({svg_opacity:.3,filter_opacity:.5})});
            </script>

    etc in other mentioned files 🙂

    yeah, that would be a solution as well 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘minify dynamic js and css created by php’ is closed to new replies.