[wp-trac] [WordPress Trac] #22244: jQuery should register in footer by default

WordPress Trac noreply at wordpress.org
Sat Nov 3 10:05:31 UTC 2018


#22244: jQuery should register in footer by default
-------------------------+----------------------
 Reporter:  ryanve       |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Performance  |     Version:
 Severity:  normal       |  Resolution:  wontfix
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+----------------------

Comment (by remzicavdar):

 Replying to [comment:31 Looimaster]:
 > I've just read the whole discussion and properly written themes and
 plugins use correct dependencies and they seek the best performance.
 Therefore, I suggest doing it in two steps:
 > 1) Add `jquery_in_footer` filter or `wp_modify_registered_script()`
 which would allow to set `in_footer` to `true` for all the libraries that
 don't have it set to `true` at this moment.
 > 2) Remove this filter or function in the future and make it become
 default behavior.
 >
 > Is there any situation in which a developer should not load scripts in
 the footer? If there isn't then they should learn this or don't write
 code. 95% of properly written websites should suffer lower performance
 because 5% of developers are doing it wrong?
 >
 > Another idea: add ability to add `defer` attribute to jQuery `<script>`
 tag.
 >
 > Another idea: introduce `wordpress-edge` or `wordpress-strict` (like
 JavaScript's 'use strict') option that when set to `true` by a theme (not
 by plugins) would set all things to HTML5, to strict standards and the
 newest and the best practices. When set to `false` (default) it would work
 like it used to work.


 I truly hope this will be reconsidered because loading your scripts in the
 footer is a good practice, especially for SEO

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/22244#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list