Title: Topic For Discussion: jQuery
Author: Chip Bennett
Published: March 1, 2011
Last modified: March 16, 2012

---

 [  ](https://profiles.wordpress.org/chipbennett/) [Chip Bennett](https://profiles.wordpress.org/chipbennett/)
8:37 pm _on_ March 1, 2011      

# Topic For Discussion: jQuery

The Theme Review Team is considering guidelines regarding handling of jQuery (and
any other scripts bundled with and registered by WordPress coreCore Core is the 
set of software required to run WordPress. The Core Development Team builds WordPress.)
by Repository-hosted Themes. We would like to gather input and feedback on the following
discussion points:

 1. The first point for discussion is that **Themes should always use the current version
    of jQuery as bundled with WordPress**, so as to avoid core/PluginPlugin A plugin
    is a piece of software containing a group of functions that can be added to a WordPress
    website. They can extend functionality or add new features to your WordPress websites.
    WordPress plugins are written in the PHP programming language and integrate seamlessly
    with WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
    or can be cost-based plugin from a third-party. breakage due to an unexpected version(
    whether older or newer than the WordPress-bundled version).
 2. The second point for consideration is that, if Themes should always use the current
    version of jQuery as bundled with WordPress, then **Themes should not bundle their
    own version of jQuery**, and should instead enqueue the core-bundled version, via
    wp_enqueue_script( ‘jquery’ ).
 3. The third – and likely, most controversial – point for discussion is that **Themes
    should not deregister the core-bundled jQuery, in order to register a CDN-hosted,
    minified version of jQuery**, as such functionality is better-left to the end user,
    via Plugin.

Note that Themes are currently already required to enqueue any custom scripts via
wp_enqueue_script(), and to hook such scripts in wherever appropriate (primarily,
either wp_head or wp_footer).

So, what are you thoughts on the above discussion points? What else do we need to
consider, regarding handling of jQuery and other WordPress core-bundled scripts?

### Share this:

 * [  Threads ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=bluesky)
 * [  Facebook ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=facebook)
 * [  X ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=x)
 * [  LinkedIn ](https://make.wordpress.org/themes/2011/03/01/topic-for-discussion-jquery/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/a2293936b68aa6f07397754f9d1ae2b771b12ad56f868a980206b8d96f1bad31?
     s=32&d=mm&r=g)
 2.   [Michael Fields](https://profiles.wordpress.org/mfields/)  8:47 pm _on_ March
     1, 2011
 3.  I completely agree with all three points and honestly, there is nothing that I
     would add or remove.
 4.  ![](https://secure.gravatar.com/avatar/250257111d1248c34046552bbcdf6999949ef56b2f992dd5eb39bf45cabeb18a?
     s=32&d=mm&r=g)
 5.   [Otto](https://profiles.wordpress.org/otto42/)  8:49 pm _on_ March 1, 2011
 6.  Absolute yes to all three.
 7.  If a user wants to use a CDN version of jQuery, that’s absolutely pluginPlugin
     A plugin is a piece of software containing a group of functions that can be added
     to a WordPress website. They can extend functionality or add new features to your
     WordPress websites. WordPress plugins are written in the PHP programming language
     and integrate seamlessly with WordPress. These can be free in the WordPress.org
     Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. territory. Use-Google-Libraries
     is my choice there.
 8.  Also, I would expand that to include *any* WP-included JS library. WordPress tries
     to avoid “breaking” changes, which is why jQuery 1.5 was not included in 3.1 (
     also, timing was bad).
 9.  I would also like it if it was a recommendation that themes enqueue-ing their 
     JS files would do it in the proper place, namely on the wp_enqueue_scripts or 
     admin_enqueue_scripts action hooksHooks In WordPress theme and development, hooks
     are functions that can be applied to an action or a Filter in WordPress. Actions
     are functions performed when a certain event occurs in WordPress. Filters allow
     you to modify certain functions. Arguments used to hook both filters and actions
     look the same.. It does work on init and in several different hooks, but the wp_enqueue_scripts
     hook is really the better place to do it. For admin page-specific JS enqueues,
     there are also page-specific hooks that can be used as well.
 10.  * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  9:08 pm _on_ 
        March 1, 2011
      * We would definitely want to extrapolate such guidelines to *any* WordPress 
        coreCore Core is the set of software required to run WordPress. The Core Development
        Team builds WordPress.-bundled scripts. jQuery is merely the most frequently
        encountered.
      * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  9:54 pm _on_ 
        March 1, 2011
      * I’ll be sure to start using those as the recommended/required hooksHooks In
        WordPress theme and development, hooks are functions that can be applied to
        an action or a Filter in WordPress. Actions are functions performed when a 
        certain event occurs in WordPress. Filters allow you to modify certain functions.
        Arguments used to hook both filters and actions look the same. into which to
        hook enqueued scripts. I think that easily fits into proper support/implementation
        of coreCore Core is the set of software required to run WordPress. The Core
        Development Team builds WordPress. WordPress functionality.
      * ![](https://secure.gravatar.com/avatar/250257111d1248c34046552bbcdf6999949ef56b2f992dd5eb39bf45cabeb18a?
        s=32&d=mm&r=g)
      *  [Otto](https://profiles.wordpress.org/otto42/)  7:49 pm _on_ March 3, 2011
      * Since somebody asked, the admin_enqueue_scripts action actually gets the $hook_suffix
        parameter passed to it. You can use that to determine which admin page you’re
        on and act accordingly. Like so:
      * add_action(‘admin_enqueue_scripts’,’example’);
         function example($hook_suffix){//
        $hook_suffix will be the page name or other hook information.. examine it to
        see what it contains where and you’ll figure it out soon enough }
 11. ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
     s=32&d=mm&r=g)
 12.  [Emil](http://themeid.com)  9:12 pm _on_ March 1, 2011
 13. Definitely in agreement to all 3 here as well.
 14. Another suggestion is when you use custom JS library please don’t minify and/or
     pack the source and don’t remove headerHeader The header of your site is typically
     the first thing people will experience. The masthead or header art located across
     the top of your page is part of the look and feel of your website. It can influence
     a visitor’s opinion about your content and you/ your organization’s brand. It 
     may also look different on different screen sizes. notes, original author, copyright
     etc. I have seen JS files that are not GPLGPL GPL is an acronym for GNU Public
     License. It is the standard license WordPress uses for Open Source licensing [https://wordpress.org/about/license/](https://wordpress.org/about/license/).
     The GPL is a ‘copyleft’ license [https://www.gnu.org/licenses/copyleft.en.html](https://www.gnu.org/licenses/copyleft.en.html).
     This means that derivative work can only be distributed under the same license
     terms. This is in distinction to permissive free software licenses, of which the
     BSD license and the MIT License are widely used examples. compatible (and yes 
     most of them usually are) and also JS authors who strictly forbids the distribution
     via Themes/Templates.
 15. This would be an example: (picked randomly)
      [http://themeforest.net/item/javascript-showcase/74131](http://themeforest.net/item/javascript-showcase/74131)
 16. If you take a look you will see two types of license, personal and extended and
     only the extended allows you to use the codes in projects such as Themes. Personal
     version does not.
 17. This is probably bit beyond the jQuery, but it’s connected with, so…
 18. ![](https://secure.gravatar.com/avatar/5e52265402626dacf1e982ee9b7c2f0c7cbfc58f6fe8620d44cbb842cd83ddc6?
     s=32&d=mm&r=g)
 19.  [esmi](https://profiles.wordpress.org/esmi/)  9:14 pm _on_ March 1, 2011
 20. No arguments about any of the above from me.
 21. ![](https://secure.gravatar.com/avatar/8013a62d7397c006bae48b96d6832a573ea71a7d5d3597fe584210567b508c05?
     s=32&d=mm&r=g)
 22.  [Greenshady](https://profiles.wordpress.org/greenshady/)  9:14 pm _on_ March 
     1, 2011
 23. Themes should always use any script that’s included with WordPress. They should
     not be bundling their own versions of these scripts or linking up to a CDN. This
     breaks plugins if there’s a conflict between versions.
 24. WordPress is the framework we’re all building on top of. Not using the WP-bundled
     scripts is a prime example of not playing nice with others.
 25. Now, if a *user* wants whatever extra optimization from registering their own 
     version of the script, that’s pluginPlugin A plugin is a piece of software containing
     a group of functions that can be added to a WordPress website. They can extend
     functionality or add new features to your WordPress websites. WordPress plugins
     are written in the PHP programming language and integrate seamlessly with WordPress.
     These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. territory.
 26. ![](https://secure.gravatar.com/avatar/ca20d16a7871a44d060a80ad572c90be25dd5b73212b0a839fb0474e623ee357?
     s=32&d=mm&r=g)
 27.  [Joachim Kudish](http://jkudish.com)  9:18 pm _on_ March 1, 2011
 28. Likewise, going to agree with all of the above.
 29. ![](https://secure.gravatar.com/avatar/a90af2189928f5d56869d4ebe8daa7626f88b73a154d8eb4fe858f42075c4bb2?
     s=32&d=mm&r=g)
 30.  [Satish Gandham](https://profiles.wordpress.org/gandham/)  9:19 pm _on_ March
     1, 2011
 31. agree with all three.
 32. ![](https://secure.gravatar.com/avatar/44567cb8c05873e8974341ab91a7aab4473707a8b77edf055314366e13836fec?
     s=32&d=mm&r=g)
 33.  [curtismchale](http://curtismchale.ca)  9:21 pm _on_ March 1, 2011
 34. All good items for themes on the repository. Regarding minified versions of scripts,
     I don’t think that there should be a prohibition on using the minified versions
     but maybe a requirement that you also include the non-minified version with the
     license intact for reference.
 35.  * ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
        s=32&d=mm&r=g)
      *  [Emil](http://themeid.com)  9:47 pm _on_ March 1, 2011
      * well no, because we need to unpack to see what’s behind the source, not many
        will include dev version for that and if i.e. we use [http://dean.edwards.name/packer/](http://dean.edwards.name/packer/)
        who can tell what’s what 😉
      * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  9:50 pm _on_ 
        March 1, 2011
      * Our thinking is that swapping out the WordPress coreCore Core is the set of
        software required to run WordPress. The Core Development Team builds WordPress.-
        bundled jQuery for a minified version is PluginPlugin A plugin is a piece of
        software containing a group of functions that can be added to a WordPress website.
        They can extend functionality or add new features to your WordPress websites.
        WordPress plugins are written in the PHP programming language and integrate
        seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory
        [https://wordpress.org/plugins/](https://wordpress.org/plugins/) or can be 
        cost-based plugin from a third-party. territory, because the user should be
        considering the impact not only to the Theme, but also to core, and to any 
        installed Plugins. Besides, Plugins can handle such functionality much better(
        consider the minification functionality of the various caching Plugins).
         - ![](https://secure.gravatar.com/avatar/44567cb8c05873e8974341ab91a7aab4473707a8b77edf055314366e13836fec?
           s=32&d=mm&r=g)
         -  [curtismchale](http://curtismchale.ca)  10:11 pm _on_ March 1, 2011
         - Yes I agree that they shouldn’t be swaping out the bundled jQuery for a 
           minified one but if there is a slideshow pluginPlugin A plugin is a piece
           of software containing a group of functions that can be added to a WordPress
           website. They can extend functionality or add new features to your WordPress
           websites. WordPress plugins are written in the PHP programming language 
           and integrate seamlessly with WordPress. These can be free in the WordPress.
           org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
           or can be cost-based plugin from a third-party. I don’t see an issue with
           using the minified one and including a non-minified one.
         - @Emil just require with theme check or the approval process that they include
           the non-minified version.
            * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
              s=32&d=mm&r=g)
            *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:14 pm
              _on_ March 1, 2011
            * I think the most ideal approach there would be to register a CDN-version(
              i.e. from Google) for the required script.
            * I think that actually bundling a common JS script with the Theme itself
              should be a last-resort measure.
            * ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
              s=32&d=mm&r=g)
            *  [Emil](http://themeid.com)  10:49 pm _on_ March 1, 2011
            * That would be good idea.
            * ![](https://secure.gravatar.com/avatar/44567cb8c05873e8974341ab91a7aab4473707a8b77edf055314366e13836fec?
              s=32&d=mm&r=g)
            *  [curtismchale](http://curtismchale.ca)  6:15 am _on_ March 2, 2011
            * Fair enough
         - ![](https://secure.gravatar.com/avatar/1efc344036f54cbe066a5bf3883426a2ef7c7e457757b38e24465b7be626b1e0?
           s=32&d=mm&r=g)
         -  [scribu](https://profiles.wordpress.org/scribu/)  10:21 pm _on_ March 1,
           2011
         - I would just like to point out that the bundled version of jQuery is _already_
           minified:
         - [https://core.trac.wordpress.org/browser/branches/3.1/wp-includes/js/jquery/jquery.js](https://core.trac.wordpress.org/browser/branches/3.1/wp-includes/js/jquery/jquery.js)
            * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
              s=32&d=mm&r=g)
            *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:26 pm
              _on_ March 1, 2011
            * Well that rather settles that particular debate. 🙂
            * ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
              s=32&d=mm&r=g)
            *  [Emil](http://themeid.com)  1:29 am _on_ March 3, 2011
            * Correct minified, but not packed there’s a huge difference in that 😉
      * ![](https://secure.gravatar.com/avatar/250257111d1248c34046552bbcdf6999949ef56b2f992dd5eb39bf45cabeb18a?
        s=32&d=mm&r=g)
      *  [Otto](https://profiles.wordpress.org/otto42/)  11:01 pm _on_ March 1, 2011
      * To clarify Emil’s point, if somebody includes a packed script named script.
        js and an unpacked one named script.dev.js, what evidence do you have that 
        the packed script doesn’t have one extra line of code in it somewhere that 
        allows a backdoor access to the site in some manner?
      * I’d be pro-banning minified/obfuscated code of any sort in the themes directory.
        If a user wants to minify, they can after the fact.
         - ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
           s=32&d=mm&r=g)
         -  [Emil](http://themeid.com)  1:30 am _on_ March 3, 2011
         - thank you Otto
 36. ![](https://secure.gravatar.com/avatar/66100363deaf502bcb6a7200150bf4f3405f16f76c250b814c7d31714c1ae125?
     s=32&d=mm&r=g)
 37.  [sabreuse](https://profiles.wordpress.org/sabreuse/)  9:30 pm _on_ March 1, 2011
 38. Agreed on all 3 points.
 39. ![](https://secure.gravatar.com/avatar/93286b726ea8fa2c3cc76622cf9c45ff477acf69d2c44679c77a3545477b7ae4?
     s=32&d=mm&r=g)
 40.  [Jacob](http://jacobdubail.com)  9:45 pm _on_ March 1, 2011
 41. I would like to add a point about where scripts are loaded; head vs footer. At
     the very least, pluginPlugin A plugin is a piece of software containing a group
     of functions that can be added to a WordPress website. They can extend functionality
     or add new features to your WordPress websites. WordPress plugins are written 
     in the PHP programming language and integrate seamlessly with WordPress. These
     can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. authors should use a standard 
     way to change where scripts are hooked.
 42. ![](https://secure.gravatar.com/avatar/db998bdb0f76240cd86cf6bd8f64bd619bda0314bcead1d8ef5c9c3ba839ed71?
     s=32&d=mm&r=g)
 43.  Daniel  9:51 pm _on_ March 1, 2011
 44. The correct hook to enqueue scripts is wp_print_scripts. This fires before wp_head
     and after wp_print_styles and is hooked itself to wp_head. From a point of view
     of correctly loading dependensies and priorities, this is the correct hook, not
     crowding them in wp_head
 45.  * ![](https://secure.gravatar.com/avatar/250257111d1248c34046552bbcdf6999949ef56b2f992dd5eb39bf45cabeb18a?
        s=32&d=mm&r=g)
      *  [Otto](https://profiles.wordpress.org/otto42/)  11:05 pm _on_ March 1, 2011
      * wp_enqueue_scripts is the correct hook, actually. There’s a whole function 
        for it, hooked to wp_head with a priority of 1. Hooking them here ensures they’re
        enqueued first. Hooking to wp_print_scripts works, but really makes little 
        sense, as that is enqueueing them at the last possible minute and making order
        matter for cases where scripts might need to be dequeued.
      * Enqueue in wp_enqueue_scripts.
      * If you have to dequeue, do it in wp_print_scripts.
 46. ![](https://secure.gravatar.com/avatar/ed3deaa23673bd678db4b20b67bbdfc529a1454adfcf79e805310fac6be40460?
     s=32&d=mm&r=g)
 47.  [Seth Merrick](http://strangewindstudio.com)  9:53 pm _on_ March 1, 2011
 48. While I agree with all 3 points in principle, I’d like to point out the other 
     side of the coin:
 49. Every major WordPress Release ( 3.x vs. 3.x.x ) should come bundled with the latest
     stable version of jQuery & jQuery UIUI UI is an acronym for User Interface - the
     layout of the page the user interacts with. Think ‘how are they doing that’ and
     less about what they are doing.! It’s absurd that it took until 3.1 to get past
     jQuery 1.4
 50. Though I would have preferred not to, I once had to deregister coreCore Core is
     the set of software required to run WordPress. The Core Development Team builds
     WordPress. jQuery and enqueue the latest version in a theme in order to implement
     a feature that was dependent on the latest jQuery UI which, at the time, was only
     compatible with jQuery 1.4 or later.
 51.  * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:12 pm _on_
        March 1, 2011
      * From what I understand, jQuery 1.5 was causing breakage issues in WordPress
        3.1, which is why jQuery 1.4.4 was included.
      * Downstream projects almost always have such version-delay issues, because new
        versions of upstream projects have to be tested thoroughly before being bundled.
        So, if Themes were to start bundling jQuery 1.5, and deregistering version 
        1.4.4, currently we *know* that it would result in certain breakage.
         - ![](https://secure.gravatar.com/avatar/ed3deaa23673bd678db4b20b67bbdfc529a1454adfcf79e805310fac6be40460?
           s=32&d=mm&r=g)
         -  [Seth Merrick](http://strangewindstudio.com)  10:20 pm _on_ March 1, 2011
         - I’m satisfied with the upgrade to 1.4.4 instead of 1.5. In fact, I’m pretty
           sure 1.5 hadn’t dropped until after the 3.1 code had been frozen.
         - I would say it comes down to a matter of prioritization. As it stands now,
           this issue seems to be of a lower priority than I’d prefer. Of course, every
           developer would like to see their own ‘pet issue’ at the top of the list,
           and I understand there may be more pressing matters at hand.
         - Saying “the latest version of jQuery causes breakage” is really saying “
           fixing the breakage caused by the latest version of jQuery was not of sufficient
           priority to make the cut.”
         - I think that as WordPress Themes and Plugins continue to increase in complexity,
           and interfaces become more robust and reliant on jQuery, this issue will
           garner more attention in the community, hopefully becoming more visible 
           as the team sets milestones for future releases.
            * ![](https://secure.gravatar.com/avatar/1a7df76f4f6519a5618c32428b277a5c7a89798394965b67e50528ca57c1b5a8?
              s=32&d=mm&r=g)
            *  [Andrew Nacin](https://profiles.wordpress.org/nacin/)  10:20 am _on_
              March 3, 2011
            * Yes, that’s accurate — 1.5 hadn’t dropped until 3.1 was frozen.
            * > Saying “the latest version of jQuery causes breakage” is really saying“
              > fixing the breakage caused by the latest version of jQuery was not 
              > of sufficient priority to make the cut.”
            * Potentially, yes, that would be our reasoning. At the same time, it’s
              not just breakage, it’s testing. There are quite a bit of jQuery bits
              to test, and if a major jQuery release isn’t in trunk long enough, we’ll
              miss something. Just one issue with the widgets panel could affect hundreds
              of thousands of users. That’s no fun.
            * That said, that _wasn’t_ our reasoning here. While our code was indeed
              already frozen, it’s not that 1.5 broke any of our JavaScriptJavaScript
              JavaScript or JS is an object-oriented computer programming language 
              commonly used to create interactive effects within web browsers. WordPress
              makes extensive use of JS for a better user experience. While PHP is 
              executed on the server, JS executes within a user’s browser.
               [https://www.javascript.com](https://www.javascript.com/).
              It’s that 1.5 majorly broke jQuery UIUI UI is an acronym for User Interface-
              the layout of the page the user interacts with. Think ‘how are they doing
              that’ and less about what they are doing. (oops!).
            * Had it been a minor 1.4.x release, we probably would have updated it 
              after a thorough review of the changes.
            * You have a point that it comes down to prioritization, but we’ve discussed
              this and we made it a much higher priority during the 3.1 cycle. At one
              point we were running jQuery trunk in WordPress trunk. We’ll be putting
              1.5.2-dev in coreCore Core is the set of software required to run WordPress.
              The Core Development Team builds WordPress. the moment we start 3.2 development.
 52. ![](https://secure.gravatar.com/avatar/cafa882d26933e7c0d5bc9d498a593fbf9bb1765e9b9e1356082646a41e69de1?
     s=32&d=mm&r=g)
 53.  [Emil](http://themeid.com)  9:57 pm _on_ March 1, 2011
 54. @Chip agreed, sorry could not reply directly, there’s a some kind of error when
     I press the “Reply” button.
 55. ![](https://secure.gravatar.com/avatar/c19faa88a7f1be85e5eeae5f80376e186a8370eb500e0d3ba77f6d25584a720c?
     s=32&d=mm&r=g)
 56.  [Brian Krogsgard](http://krogsgard.com)  9:59 pm _on_ March 1, 2011
 57. Well, I’ll play devil’s advocate.
 58. I have a hard time thinking of any reason #1 and #2 are bad ideas. It might be
     fun to use 1.5, but I totally understand that is probably a limited use case and
     can be handled by advanced users that would likely want to use it.
 59. As far as #3, it’s well and good to say it’s pluginPlugin A plugin is a piece 
     of software containing a group of functions that can be added to a WordPress website.
     They can extend functionality or add new features to your WordPress websites. 
     WordPress plugins are written in the PHP programming language and integrate seamlessly
     with WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. territory, but is it really? I
     mean, it can be, but a lot of users will never know they can speed their site 
     using such a plugin, and won’t do so. Whereas, if a theme author can deregister,
     and register from Google, and it helps optimize the theme, what’s the harm in 
     that if it’s done properly?
 60. I’d rather just see a recommendation for a standard method of doing so, rather
     than not allowing it. It just feels a bit too restricting.
 61.  * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:10 pm _on_
        March 1, 2011
      * That’s why we’re having the discussion: to make sure that we hear, and try 
        to understand, all points of view.
      * I’m curious: what is the actual performance gain from using a cached, minified,
        CDN version of jQuery, rather than the WordPress coreCore Core is the set of
        software required to run WordPress. The Core Development Team builds WordPress.-
        bundled jQuery?
      * There is another problem with handling this sort of thing in the Theme: WordPress
        updates – specifically, when WordPress updates, and the Theme doesn’t. Suddenly,
        the Theme is introducing breakage issues, due to core or Plugins expecting 
        one version of jQuery, and the Theme registering a different version.
      * With respect to Repository-hosted Themes, we have to balance what is best, 
        and most appropriate, for the widest public audience. This sort of discussion
        helps us better understand what meets those criteria.
         - ![](https://secure.gravatar.com/avatar/c19faa88a7f1be85e5eeae5f80376e186a8370eb500e0d3ba77f6d25584a720c?
           s=32&d=mm&r=g)
         -  [Brian Krogsgard](http://krogsgard.com)  10:20 pm _on_ March 1, 2011
         - Basically, the way it was put to me, was in the form of a question:
            “Are
           your servers faster than Google’s?” I’m not the smartest developer, but 
           that seemed logical enough to me.
         - As far as preventing old versions of jQuery in older themes, that could 
           be part of the recommended way of implementing it , include a check that
           makes sure the jQuery version is at least as up-to-date as the WordPress
           bundled one.
            * ![](https://secure.gravatar.com/avatar/ed3deaa23673bd678db4b20b67bbdfc529a1454adfcf79e805310fac6be40460?
              s=32&d=mm&r=g)
            *  [Seth Merrick](http://strangewindstudio.com)  10:22 pm _on_ March 1,
              2011
            * I think an even better question along the same lines is “Is your browser’s
              cached version of the Google CDN jQuery faster to load than making another
              request to your private server?”
            * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
              s=32&d=mm&r=g)
            *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:28 pm
              _on_ March 1, 2011
            * The issue isn’t that the Theme registers the same version of jQuery as
              WordPress _at the time the Theme is approved_, but rather, what happens
              when _WordPress is updated, but the Theme isn’t_.
            * (A quick look around the Repository should give a good indication of 
              how _in_frequently the vast majority of Repository-hosted Themes are 
              updated.)
               - ![](https://secure.gravatar.com/avatar/c19faa88a7f1be85e5eeae5f80376e186a8370eb500e0d3ba77f6d25584a720c?
                 s=32&d=mm&r=g)
               -  [Brian Krogsgard](http://krogsgard.com)  10:33 pm _on_ March 1, 2011
               - That’s why I said to do the check. If the version isn’t at least the
                 latest version bundled with WordPress, then use the WordPress version.
               - ![](https://secure.gravatar.com/avatar/c19faa88a7f1be85e5eeae5f80376e186a8370eb500e0d3ba77f6d25584a720c?
                 s=32&d=mm&r=g)
               -  [Brian Krogsgard](http://krogsgard.com)  10:34 pm _on_ March 1, 2011
               - Sorry, misread your comment…
         - ![](https://secure.gravatar.com/avatar/db484950b36ac81cb385b169de8c7caebc302978cd0b3f6f9fe7de54a2d7bd05?
           s=32&d=mm&r=g)
         -  [robertjakobson](https://profiles.wordpress.org/robertjakobson/)  12:32
           pm _on_ March 7, 2011
         - The best way is to call Google libraries by default and if they are not 
           available then use the scripts bundled with WordPress.
      * ![](https://secure.gravatar.com/avatar/250257111d1248c34046552bbcdf6999949ef56b2f992dd5eb39bf45cabeb18a?
        s=32&d=mm&r=g)
      *  [Otto](https://profiles.wordpress.org/otto42/)  9:39 pm _on_ March 2, 2011
      * “As far as #3, it’s well and good to say it’s pluginPlugin A plugin is a piece
        of software containing a group of functions that can be added to a WordPress
        website. They can extend functionality or add new features to your WordPress
        websites. WordPress plugins are written in the PHP programming language and
        integrate seamlessly with WordPress. These can be free in the WordPress.org
        Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. territory, but is it really?”
      * Yes, absolutely.
      * Consider the case where somebody is using WP for an internal site in a company,
        and the viewers of the site don’t have general internet access. It would kinda
        suck if somebody installed a theme and now the thing was broken because the
        theme tried to use links to Google’s jQuery, which nobody in the company can
        access.
      * Themes should be themes, period. They should be about the design and layout
        of the site. When themes start trying to provide functionality, things get 
        weird and start breaking.
      * Let the users decide what functionality they want. Don’t let theme designers
        try to decide it for them.
         - ![](https://secure.gravatar.com/avatar/db484950b36ac81cb385b169de8c7caebc302978cd0b3f6f9fe7de54a2d7bd05?
           s=32&d=mm&r=g)
         -  [robertjakobson](https://profiles.wordpress.org/robertjakobson/)  12:31
           pm _on_ March 7, 2011
         - Obviously one uses a fallback – if google libraries are available then use
           them, if not then use the WP bundle. A moot point!
 62. ![](https://secure.gravatar.com/avatar/db998bdb0f76240cd86cf6bd8f64bd619bda0314bcead1d8ef5c9c3ba839ed71?
     s=32&d=mm&r=g)
 63.  [Daniel](https://profiles.wordpress.org/pseudoxiah/)  10:12 pm _on_ March 1, 
     2011
 64. If for whatever reason themes do change the provided jQuery version, it should
     do it in an if( ! is_admin() ) conditional, or else the sections of the heavily
     jQuery powered backend, like the file uploader, may collapse.
 65.  * ![](https://secure.gravatar.com/avatar/ed3deaa23673bd678db4b20b67bbdfc529a1454adfcf79e805310fac6be40460?
        s=32&d=mm&r=g)
      *  [Seth Merrick](http://strangewindstudio.com)  10:25 pm _on_ March 1, 2011
      * This raises a major pet peeve of mine: When pluginPlugin A plugin is a piece
        of software containing a group of functions that can be added to a WordPress
        website. They can extend functionality or add new features to your WordPress
        websites. WordPress plugins are written in the PHP programming language and
        integrate seamlessly with WordPress. These can be free in the WordPress.org
        Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. & theme developers load their
        scripts and styles willy-nilly on ALL admin pages and/or the ENTIRE front end
        instead of only loading them in the appropriate contexts.
      * Nothing makes me nuttier than providing support to a user who is having problems
        with my plugin or theme because another developer loaded their junk into my
        admin page!
         - ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
           s=32&d=mm&r=g)
         -  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  10:36 pm _on_
           March 1, 2011
         - Yep; this is part of what we’re trying to make sure we handle properly, 
           also, by pointing developers to the correct way to enqueue scripts, and 
           the correct hooksHooks In WordPress theme and development, hooks are functions
           that can be applied to an action or a Filter in WordPress. Actions are functions
           performed when a certain event occurs in WordPress. Filters allow you to
           modify certain functions. Arguments used to hook both filters and actions
           look the same. into which to hook them.
 66. ![](https://secure.gravatar.com/avatar/99ac6675ed857de8d430540da76a7eb2da6606d034dcdfd38e6b0e05e4b5c98e?
     s=32&d=mm&r=g)
 67.  [Devin](http://wptheming.com)  10:45 pm _on_ March 1, 2011
 68. Agreed on all three points.
 69. ![](https://secure.gravatar.com/avatar/97f7d486b28480753bac40f575e711069c818980da87c5816882d8a060670f20?
     s=32&d=mm&r=g)
 70.  [StandardSpace](http://www.standardspace.com)  11:57 pm _on_ March 1, 2011
 71. Agree with all three. It’s a pain removing duplicate copies of wordpress churned
     out by themes and plugins. I just want to CDN and fallback to local using functions.
     php
 72.  * ![](https://secure.gravatar.com/avatar/97f7d486b28480753bac40f575e711069c818980da87c5816882d8a060670f20?
        s=32&d=mm&r=g)
      *  [StandardSpace](http://www.standardspace.com)  11:58 pm _on_ March 1, 2011
      * Should have read “duplicate copies of jQuery”
 73. ![](https://secure.gravatar.com/avatar/f5fa0f6001c40e69997547b831f76483e2219e508ab328da5b8e571c6ecb3ec0?
     s=32&d=mm&r=g)
 74.  visaap  7:19 am _on_ March 2, 2011
 75. Three thumbs up!
 76. ![](https://secure.gravatar.com/avatar/39bfb8ebf8c99856f07d90c116ff2d861e4bfe516906beb5fbcc968d6c1f0839?
     s=32&d=mm&r=g)
 77.  [Ben Huson](http://www.benhuson.co.uk)  12:05 pm _on_ March 2, 2011
 78. Definitely agree with all 3 points.
 79. ![](https://secure.gravatar.com/avatar/1a7df76f4f6519a5618c32428b277a5c7a89798394965b67e50528ca57c1b5a8?
     s=32&d=mm&r=g)
 80.  [Andrew Nacin](https://profiles.wordpress.org/nacin/)  10:21 am _on_ March 3,
     2011
 81. +1 from me.
 82. ![](https://secure.gravatar.com/avatar/8278fce69b1c6030d4a554e47aac6931690543f6d9961841960b45050e474bce?
     s=32&d=mm&r=g)
 83.  Paul  3:06 am _on_ April 29, 2011
 84. /**
      * Be smart now. * Tell the theme to load latest jquery from google’s cdn *
     which is faster than loading from your shared host * and yes it’s free bandwidth.*/
     add_theme_support(‘use-google-super-faster-jquery-cdn’);
 85.  * ![](https://secure.gravatar.com/avatar/7d256f7b605361e4dc402138e2896ff727d2a13d669f1420a8644d12a90bb7af?
        s=32&d=mm&r=g)
      *  [Chip Bennett](https://profiles.wordpress.org/chipbennett/)  3:07 pm _on_ 
        April 29, 2011
      * None of us disagrees with the advantages of using Google’s CDN for such resources;
        however, the consensus appears to be that the decision to replace coreCore 
        Core is the set of software required to run WordPress. The Core Development
        Team builds WordPress. scripts with CDN is an individual user decision, and
        thus “PluginPlugin A plugin is a piece of software containing a group of functions
        that can be added to a WordPress website. They can extend functionality or 
        add new features to your WordPress websites. WordPress plugins are written 
        in the PHP programming language and integrate seamlessly with WordPress. These
        can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party.” Territory.

Comments are closed.

# Post navigation

[← Sorry about all the issues many of you…](https://make.wordpress.org/themes/2011/02/18/sorry-about-all-the-issues-many-of-you/)

[I thought we already allowed child theme… →](https://make.wordpress.org/themes/2011/03/11/i-thought-we-already-allowed-child-theme/)