Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    AO does not minify inline JS, I have a code snippet that attempts to do just that, but it’s on another computer. I’ll try to find it Friday (ping me here if I forget).

    Regarding cookie-free domains; you’ll have to move your static resources, including the autoptimized JS, to a separate domain (typically a CDN) for that.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    so that code snippet;

    function minify_inline_code($htmlIn) {
      	preg_match_all('#<(style|script).*>(.*)</(style|script)>#Usmi',$htmlIn,$code);
      	foreach ($code[0] as $codeIn) {
    		$repl["in"] = $codeIn;
    	  	$repl["out"] = str_replace(array("\r\n", "\n", "\r", "\t"),"",$codeIn);
    	  	$replArr[] = $repl;
    	}
      	foreach ($replArr as $replNow) {
    	  	$htmlIn = str_replace($replNow["in"],$replNow["out"],$htmlIn);
    	}
      	return $htmlIn;
    }
    add_filter("autoptimize_html_after_minify","minify_inline_code");

    will close the topic as resolved, but don’t hesitate to follow up here if you have additional questions! 🙂

    frank

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hide my wp can be … difficult, see https://blog.futtta.be/2018/08/28/hide-my-wordpress-autoptimize-compatibility-glue/ for a potential solution 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    given hide my wp is a premium plugin, you should ask them really 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Minify And Cookie Free Domains’ is closed to new replies.