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

[feature] Avoid versioning remote libraries #15

Open
cristianuibar opened this issue Jun 14, 2018 · 0 comments
Open

[feature] Avoid versioning remote libraries #15

cristianuibar opened this issue Jun 14, 2018 · 0 comments

Comments

@cristianuibar
Copy link
Contributor

As requested on https://wordpress.org/support/topic/feature-idea-avoid-versioning-remote-libraries/

Quote:

I’ve noticed that the plugin doesn’t remove the (wordpress default?) ?ver=4.9.6 from remote urls, like Google Fonts, jQuery, and so on.

I think that’s because it doesn’t find anything local to get filemtime for, so it throws up hands and returns without changing the src.

It’s possible that without this ?ver= param, loading from a canonical source, a viewer browser could have some libraries already in cache from another site. a mild perf boost.

Adding the following line to the top of the autover_version_filter function fixes this behavior, so that if it can’t find the file locally, it gets no ?ver= param at all.


	$src = remove_query_arg( 'ver', $src );
Arguably a defect in wp core, not autover, but seems like a nice opportunity to make this plugin even better…

Thanks,
Chris
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

1 participant