Support » Plugin: Autoptimize » rewrite js path

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

    (@futtta)

    you might be able to do something with rewrites in your webserver (mod_rewrite in apache) or with symlinks on your OS (if not windows)?

    autoptimize does however not support something like that natively, but it is on my (long) list of possible improvements. if you’re into development and you have time; always happy to take in patches! 🙂

    Plugin Author Frank Goossens

    (@futtta)

    Well, here I am again; I added functionality to the soon-to-be-released 1.9.2. In wp-config.php you will be able to configure something like this;

    define('AUTOPTIMIZE_CACHE_CHILD_DIR','/cachetimize/');
    define('AUTOPTIMIZE_CACHEFILE_PREFIX', 'aggregated_');

    which will change the path to a autoptimized CSS-file from /wp-content/cache/autoptimize/autoptimize_12345.css to /wp-content/cachetimize/aggregated_12345.css.

    It would be great if you could download the pre-release here, give it a spin and report back here 🙂

    thanks,
    frank

    nice, thanks Frank

    Plugin Author Frank Goossens

    (@futtta)

    You’re welcome. Have you been able to test already?

    I hope to have some people confirming all is well before releasing officially and those who ask for new features are often great testers, so … 🙂

    not yet 🙂
    will try it later, I was able to fix my above the fold too, but can not use HTML compression because it breaks my css (set to inline in head).

    Regards

    great work 🙂
    would it be possible to optimize core JS too w/ path to AO cache folder?

    /wp-includes/js/jquery/jquery.js?ver=1.11.1
    /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
    
    Regards

    Plugin Author Frank Goossens

    (@futtta)

    Those files can be aggregated (but some jquery plugins might not be that happy, esp. if you don’t “force js in head”) and minified by AO, in which case you won’t see the references to /wp-includes/ any more.

    But if those files aren’t aggregated (if you exclude them from optimization, because of the aforementioned jquery plugins), then the only approach would be to deregister the core jquery and jquery-migrate and re-register them from elsewhere. You could simply use the “use google libraries” plugin, although that would not neccesarily be the best approach performance wise as in that case those files aren’t aggregated.

    hope this helps,
    frank

    thanks, I moved them from wp-includes/… to /theme/js and de-registered jquery in /themes/functions.php … Autoptimize included the jquery files from /theme/js … looks good so far …
    Is there any security issue if using a special folder for jquery?

    everything works perfectly except the “Generate data: URIs for images” option, not sure if it’s a bug but if I enable it the css validator shows many errors:
    http://jigsaw.w3.org/css-validator/

    Plugin Author Frank Goossens

    (@futtta)

    no security issue in moving jquery no (if you’re confident in the source of the js-files, off course).

    regarding data:uri’s for images; ao aims to do that in such a way that it works in all browsers (older ie’s included), but that indeed might cause validation errors.

    happy holidays,
    frank

    if I use data: URIs is there something I could change to make it compatible with http://jigsaw.w3.org/css-validator

    happy Holidays!

    Plugin Author Frank Goossens

    (@futtta)

    hmm, based on this discussion this might be a bug in the CSS validator.

    but, again based on the info in above article, what we could try is quote the data-uri’s. if you want to experiment with that; open up wp-content/plugins/autoptimize/classes/autoptimizeStyles.php and on line 300 replace

    $headAndData=$dataurihead.$base64data;

    with

    $headAndData="\"".$dataurihead.$base64data."\"";

    and see if that appeases that pesky jigsaw?

    frank

    20 errors less from 180, I tried w/ single quote too but it returns an error 500 …
    Do you think it has a bad effect for seo ranking w/ data-uri’s enabled because of jigsaw checks?

    Plugin Author Frank Goossens

    (@futtta)

    Do you think it has a bad effect for seo ranking w/ data-uri’s enabled because of jigsaw checks?

    that would surprise me very much, really.

    yeah 🙂
    I missed to tell you that I use css inline option and the data.uris will placed into the same part … could this be the reason because it break something there?
    Ralph

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘rewrite js path’ is closed to new replies.