Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    Here is the start of the file:

    (function(){document.addEventListener('DOMContentLoaded',function(event){wpcf7_recaptcha.execute=function(action){grecaptcha.execute(wpcf7_recaptcha.sitekey,{action:action}).then(function(token){var event=new CustomEvent('wpcf7grecaptchaexecuted',{detail:{action:action,token:token,},});document.dispatchEvent(event)})};wpcf7_recaptcha.execute_on_homepage=function(){wpcf7_recaptcha.execute(wpcf7_recaptcha.actions.homepage)};wpcf7_recaptcha.execute_on_contactform=function(){wpcf7_recaptcha.execute(wpcf7_recaptcha.actions.contactform)};grecaptcha.ready(wpcf7_recaptcha.execute_on_homepage);document.addEventListener('change',wpcf7_recaptcha.execute_on_contactform);document.addEventListener('wpcf7submit',wpcf7_recaptcha.execute_on_homepage)});document.addEventListener('wpcf7grecaptchaexecuted',function(event){var fields=document.querySelectorAll("form.wpcf7-form input[name='_wpcf7_recaptcha_response']");for(var i=0;i<fields.length;i++){var field=fields[i];field.setAttribute('value',event.detail.token)}})})();var $j=jQuery.noConflict();$j(document).ready(function(){if(typeof oceanwpLocalize==='undefined'){return!1}
    var qv_modal=$j('#owp-qv-wrap'),qv_content=$j('#owp-qv-content');/**
             * Open quick view.
             */
            $j( document ).on( 'click', '.owp-quick-view', function( e ) {
                    e.preventDefault();
    
                    var $this               = $j( this ),
                            product_id  = $j( this ).data( 'product_id' );
    
                    $this.parent().addClass( 'loading' );
    Plugin Author launchinteractive

    (@launchinteractive)

    Hi, It looks like that file is now minified. Is that right?

    Thread Starter therealgilles

    (@chamois_blanc)

    Hi, not quite. I installed java on the server, so it is now using closure-compiler.jar instead of MatthiasMullie\Minify\JS.

    The minification is not happening with the latter.

    Plugin Author launchinteractive

    (@launchinteractive)

    Ahh, my guess is that MatthiasMullie Minify was failing due to something in your javascript. There would have been errors in the logs if it couldn’t complete a minify. Do you know if this was the case?

    Closure is more reliable and will do a better job so I think you are best to stick with it.

    Thread Starter therealgilles

    (@chamois_blanc)

    Sorry for the late reply. Do you mean the WP debug.log file? I did not see any errors in that log.

    Plugin Author launchinteractive

    (@launchinteractive)

    I mean in the MMR settings. You can expand each merge and it should say if the minification was successful or not.

    Thread Starter therealgilles

    (@chamois_blanc)

    If it says ‘unminified version used’, does that mean it was not able to minify it?
    If not, what does an error look like?

    Plugin Author launchinteractive

    (@launchinteractive)

    aaah, do your scripts that you want to minify have a .min.js extension? MMR doesn’t bother minifying these as it assumes they are already minified.

    Thread Starter therealgilles

    (@chamois_blanc)

    The comment suggests that if a script comes with a .js and .min.js version, it picks the .js unminified version. Right?

    Thread Starter therealgilles

    (@chamois_blanc)

    Here is an example file generated:
    https://wednesdaynighthop.com/wp-content/mmr/bb8fdbea-1605740607.min.js

    It does not look fully minified to me. For instance, it has comments:

    /*!
     * WPBakery Page Builder v6.0.0 (https://wpbakery.com)
     * Copyright 2011-2020 Michael M, WPBakery
     * License: Commercial. More details: http://go.wpbakery.com/licensing
     */

    and plenty of variable declarations that look nowhere like minified code I’ve seen before (where variables are usually abbreviated to the least number of letters possible).

    var this_element=jQuery(this),sliderTimeout=1e3*parseInt(...

    Thread Starter therealgilles

    (@chamois_blanc)

    I just tried Matthias’s public portal: https://www.minifier.org/

    And I see the same result. Which is reassuring and still odd because it claims:

    This minifier removes whitespace, strips comments, combines files, and optimizes/shortens a few common programming patterns. And it comes with a huge test suite.

    which it clearly does not in this case, at least for whitespace and comments.

    Thread Starter therealgilles

    (@chamois_blanc)

    Just read that the library does not do ‘obfuscation’ so does not change variable names, so that makes sense. Still confused as to why comments are left in the minified file though. Maybe it does not support multi-line comments?

    Thread Starter therealgilles

    (@chamois_blanc)

    I totally get now why this library runs much faster and with lower CPU usage compared to the Java Closure compiler, which parses the code as a language.

    If I find again a big chunk of clearly non-minified code, I will report the issue to Matthias’s github repo.

    Plugin Author launchinteractive

    (@launchinteractive)

    Yes, MMR will look for a .js first.

    I believe the reason the comments aren’t stripped is for legal reasons. I think when a comment has an exclamation mark then it means that the comment should stay even if its being minified.. /*!
    I think Minify and Closure both respect this.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Some css code is not getting minified’ is closed to new replies.