Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

use of standards WP hooks rather than output buffering #77

Closed
drzraf opened this Issue Jan 24, 2017 · 5 comments

Comments

Projects
None yet
3 participants

drzraf commented Jan 24, 2017

I looked at the code and found that most of it is executed inside an output buffering handler.

I would like to know:

  • why was it done like this?
  • don't recent WP version help streamlining the process?
  • why not simply use WP hooks in order to fetch every queued js/css rather than regexp over the final HTML?
  • do you know of similar caching plugins hooks standard hooks to achieve the same result? What are their drawback w.r.t to this?
Owner

futtta commented Jan 24, 2017

for the simple reason that using the OB every little bit if JS/ CSS will be captured, extracted and optimized, even if it was not enqueued properly (which happens all too often) :-)

@futtta futtta added the question label Jan 24, 2017

drzraf commented Jan 25, 2017

Thank you for making the initial assumption clear (modules/themes authors do not write good code).
Don't you think that the far cleaner WP-integration of autoptimize in case of processing only properly declared assets would be worth the change?
Do you know of any module similar to autoptimze (in quality) that applies in a less intrusive way (more WP-compliant)?

Personally, I think that there should be no intent in processing assets of "bad" module/themes that would rather need fixing, but that's just my opinion.

Owner

futtta commented Jan 26, 2017

Do you know of any module similar to autoptimze (in quality) that applies in a less intrusive way (more WP-compliant)?

bwp-minify maybe?

Contributor

zytzagoo commented Jan 26, 2017

For properly enqueued assets minification, you should consider https://github.com/kasparsd/minit + various https://github.com/kasparsd/minit/wiki/Minit-Extensions

Owner

futtta commented Jan 28, 2017

closing time ;-)

@futtta futtta closed this Jan 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment