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

    (@futtta)

    minify files that were excluded from optimization? no, that’s currently not possible I’m afraid.

    frank

    Thread Starter Ramanan

    (@superpoincare)

    Hi Frank,

    Thanks for your reply.

    What I meant is choosing which files to minify. Nothing really about exclusion, although implicit.

    Like

    Minify/Optimize.

    file1.css and file2.css only for CSS

    file3.js, file4.js, file5.js only for JS.

    Ignore inline and ignore other files.

    Possible by some filter?

    Plugin Author Frank Goossens

    (@futtta)

    well, since you’re asking; the development version has a filter to specify a whitelist for both JS and CSS optimization, which does just that ??

    frank

    Thread Starter Ramanan

    (@superpoincare)

    Great ??

    Can I already use it?

    Plugin Author Frank Goossens

    (@futtta)

    if you download & install the AO-zipfile from github, sure ??

    Thread Starter Ramanan

    (@superpoincare)

    Already on a development version. Don’t know which but will reinstall.

    How do I use?

    $whitelistCSS = "path/to/file1.css, path/to/file2.css";

    in (custom_)functions.php?

    Thread Starter Ramanan

    (@superpoincare)

    Or this?

    add_filter('autoptimize_filter_css_whitelist', 'my_css_whitelist',10,1);
    function my_css_whitelist($whitelistCSS) {
    	return "file1.css, file2.css";
    }
    Plugin Author Frank Goossens

    (@futtta)

    yep, the 2nd one should work ??

    Thread Starter Ramanan

    (@superpoincare)

    It’s working!!

    I have put a * in exclude. With the intention that it will exclude everything (else) and the whitelist will take care of the files.

    And it works. Just wanted to double check with you if it’s safe.

    Plugin Author Frank Goossens

    (@futtta)

    you don’t have to put that ‘*’ in the exclude-list, because as as soon as there is anything in the whitelist, the exclude-list (which is a blacklist, really) is entirely ignored.

    but yeah, that should be safe ??

    frank

    Thread Starter Ramanan

    (@superpoincare)

    Yes. Changed it to default and there’s no need for a “*”.

    Dhanyavad Frank.

    PS: I noticed the plugin saying 0 files in the cache folder. I think someone else in the forum also pointed it out for the development version.

    Plugin Author Frank Goossens

    (@futtta)

    the number of files (and filesize) are cached now to avoid the overhead of having to stat a huge number of files to calculate. you should however also see a timestamp of how old the numbers are and after 1 hour the stats should update.

    that being said, i might tweak the code a bit to only cache stats when having >100 files e.g. …

    frank

    Thread Starter Ramanan

    (@superpoincare)

    Yeah. Makes sense.

    Plugin Author Frank Goossens

    (@futtta)

    Thread Starter Ramanan

    (@superpoincare)

    Nice.

    By the way is there a correct way to upload the development zip? Do I need to deactivate and delete the previous one?

    Yesterday I uploaded the development version of the zip without deactivating or deleting the previous one and it threw some error (which I didn’t save).

    In addition, WordPress started running an hourly cron upgrader_scheduled_cleanup which I noticed in the plugin Crontrol with arguments such as 9400 or something. I let it run once and then killed it.

    Possible it’s coincidental but still thought I’ll bring it to your notice if it’s related.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Manual Mode?’ is closed to new replies.