Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-disable assets where no lightboxable images #53

Open
lkraav opened this issue Feb 22, 2019 · 2 comments
Open

Auto-disable assets where no lightboxable images #53

lkraav opened this issue Feb 22, 2019 · 2 comments

Comments

@lkraav
Copy link

lkraav commented Feb 22, 2019

Hi. Loading too much unnecessary JS is always a concern. Human-curated meta box configuration is not sustainable.

I'm thinking we could scan via the_content filter, or possibly output buffer the whole page output, for a heuristic on whether to load our JS/CSS assets at all.

Your thoughts?

@robneu
Copy link
Collaborator

robneu commented Apr 19, 2019

This is an interesting idea. I'm not sure that scanning the_content would be robust enough as many pages could be built using meta data, widgets, etc. I'm open to reviewing a PR for this, if you have something specific in mind.

@lkraav
Copy link
Author

lkraav commented Apr 19, 2019

I'm not sure that scanning the_content would be robust enough as many pages could be built using meta data, widgets, etc.

Full page output buffering might indeed be the only way. I know some plugins are doing such ob for their purposes, so it's not unheard of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants