Support » Plugin: Autoptimize » Feature request: Some extra options

  • Would like to have the ability to:

    • Ignore head scripts or CSS in the head or body
    • Ignore inline scripts or CSS in the head or body
    • Override ‘switches’ flags to ignore processing in the HTML or scripts or CSS (e.g. <!– Autoptimize: ignore on –>Ignore this<!– Autoptimize: ignore off –>)

    Thanks for the good plugin so far!

    http://wordpress.org/extend/plugins/autoptimize/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Frank Goossens

    (@futtta)

    some interesting ideas, I’ll look into these for 1.7.0 Bison Grid.

    Hello @futtta, I second what @bison Grid has requested. Thank you kindly for such a great job you are doing with this plugin.

    Kind regards

    Plugin Author Frank Goossens

    (@futtta)

    I’m pushing a “beta”-version of 1.6.6 out (download here), which has noptimize-support.

    A simple example of JS being excluded;
    <!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->

    This can also be used to exclude CSS or HTML. Looking forward to your feedback!

    Plugin Author Frank Goossens

    (@futtta)

    excluding css is coming in 1.7.0 and I could use some testing-help there. 🙂

    Plugin Author Frank Goossens

    (@futtta)

    1.7.0 is live, hope you like it!

    Hello @futtta, thank you for the latest release. I am currently testing it and so far it is working exceptionally well ;).

    You are doing a tremendous job with this plugin. Keep up the great work.

    Kind regards

    Maurice

    (@naztiva)

    • Define costum $replaceTag(s)

    would be nice too.
    Because sometimes ignored scripts have to load after the others in footer.

    Plugin Author Frank Goossens

    (@futtta)

    not sure what you mean Maurice, can you elaborate?

    Maurice

    (@naztiva)

    Yes sure sorry, my english skills are not so great x)

    Autoptimize insert the minifyed js script just before </body> as defined in autoptimizedScript.php right? But if there is an script that have to be ignored and placed in the site after the others to work, there is no way without changing your plugin files.

    Edit:

    <!– here I want autoptimize output –>
    <script type=”my ignored special script”… />
    </body>
    </footer>

    Plugin Author Frank Goossens

    (@futtta)

    OK. The “ignored special script”, in the original HTML, is already at the bottom, or elsewhere?

    Maurice

    (@naztiva)

    In my example it is already there. This script includes tabbed widgets, some slider and other miscellaneous stuff, normally located in the head placed by the themes author. Unfortunately it only works if I add it to the ignored scripts in autoptimize settings and if the other scripts, here combined and minified by autoptimize, are loaded(?) before.

    But there could be tons of other reasons to define the place where autoptimze output its awesome job even for the css output. And in my first suggestion I didn’t consider that simple HTML comments like <!–AutoptimzeJS–> as optional alternate tags to define that output places would exactly do what I was searching for. Sorry for the wall of text.

    Plugin Author Frank Goossens

    (@futtta)

    I see. You mentioned “changing your plugin files”, did you do that already and if so, how?

    Maurice

    (@naztiva)

    I changed </body> with <!--autoptimize--> in autoptimize / classes / autoptimizeScripts.php on line 214 and my themes footer looks now

    </footer>
    <!--autoptimize--> // here comes the autoptimize output
    <script bla bla bla /> // thats the ugly ignored script
    </body>
    </html>

    But I dont know how exactly its search for the defined tag to make an <!--autoptimize--> ELSE </body> so I have to add the html comment in the theme or it will not work.

    Plugin Author Frank Goossens

    (@futtta)

    OK, think I understand what you want to achieve, I’ve added it to the wishlist (but will probably take some time before this is in a release).

    Plugin Author Frank Goossens

    (@futtta)

    Well, 1.8.0-test has just been published and it comes with an API that allows you to specify scripts that should be loaded after the optimized file. There’s example code in the included autoptimize_helper.php_example;

    add_filter('autoptimize_filter_js_movelast','my_ao_override_movelast',10,1);
    function my_ao_override_movelast($movelast) {
    	$movelast[]="console.log";
    	return $movelast;
    	}

    Looking forward to your feedback!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Feature request: Some extra options’ is closed to new replies.