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

Added assets cleanup optimization script #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aritzolaba
Copy link

  • Removes unused jQuery migrate
  • Removes unused sitepress.js when WPML is enabled
  • Removes language selector css when WPML is enabled

@benatespina
Copy link
Contributor

@aritzolaba Why would we want to remove this scripts?? They are never necessary?

@aritzolaba
Copy link
Author

Firstly, let's see what jQuery Migrate does:
"Migrate plugin is created to simplify the transition from older versions of jQuery to newer ones. The plugin restores deprecated features and behaviors so that older code will still run properly on the current jQuery version and later."

So we can assume it is safe not to include it if your project additional libs and jQuery related tools work ok with the jQuery version you are using. It's one request less.

For sitepress.js and the language-selector.css, they can be removed if you are including a custom language selector where you have already coded the selector itself and applied styles.

If those 2 scenarios are met (90% of the projects I believe) we can apply these optimizations that lead to 3 http requests less to make and a lighter website.

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

Successfully merging this pull request may close these issues.

2 participants