[wp-trac] [WordPress Trac] #46981: Bundled themes should pass version to wp_enqueue_script() to ensure proper cache busting

WordPress Trac noreply at wordpress.org
Thu Apr 18 17:49:21 UTC 2019


#46981: Bundled themes should pass version to wp_enqueue_script() to ensure proper
cache busting
--------------------------+-----------------------
 Reporter:  dswebsme      |       Owner:  dswebsme
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.2.1
Component:  Themes        |     Version:  5.1.1
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------
Changes (by dswebsme):

 * owner:  (none) => dswebsme
 * status:  new => assigned


Old description:

> Bundled themes should pass the current theme version (`$ver` parameter)
> to wp_enqueue_script() to ensure theme stylesheets properly bypass cache
> after being updated.
>
> Original DEV discussion (related to stylesheets) took place here: #39997
>
> In this discussion script enqueues were mentioned briefly but could
> definitely benefit from cache busting as well.
>
> This affects themes `twentyten` - `twentyseventeen`. Bundled theme
> `twentynineteen` already passes a dynamic `$ver` parameter.

New description:

 Bundled themes should pass the current theme version (`$ver` parameter) to
 wp_enqueue_script() to ensure theme stylesheets properly bypass cache
 after being updated.

 Original DEV discussion (related to stylesheets) took place here: #39997

 In this discussion script enqueues were mentioned briefly but could
 definitely benefit from cache busting as well.

 This affects themes `twentyten` - `twentyseventeen`. Bundled theme
 `twentynineteen` already passes a dynamic `$ver` parameter.

 Key details provided by @desrosj

 I audited the stylesheet last edit dates and the version specified in the
 `wp_enqueue_style()` call. Let's leave Twenty Nineteen alone (that was
 already calling `wp_get_theme()->get( 'Version' )`, and make sure the
 dates are correct (and actually present) for each stylesheet. Results
 (dates in YYYY-MM-DD):

 || ||= **Last Modified** =||= **Current Specified Version** =||
 ||= **Twenty Ten** =|| || ||
 ||= `blocks.css` =||  `2018-12-18`  || `20181018`* ||
 ||= `editor-blocks.css` =||  `2018-12-18`  || none ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= **Twenty Eleven** =|| || ||
 ||= `blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `style.css` =||  `2019-04-04`  || none ||
 ||= `/inc/theme-options.css` =||  `2011-06-02`  || `2011-04-28`* ||
 ||= `/colors/dark.css` =||  `2019-04-04`  || `null`** ||
 ||= **Twenty Twelve** =|| || ||
 ||= `style.css` =||  `2019-04-06`  || none ||
 ||= `/css/blocks.css` =||  `2019-04-06`  || `20181230`* ||
 ||= `/css/ie.css` =||  `2015-02-14`  || `20121010`* ||
 ||= `/css/editor-blocks.css` =||  `2019-04-06`  || `20181230`* ||
 ||= **Twenty Thirteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || `2013-07-18`* ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
 ||= `/css/ie.css` =||  `2015-02-14`  || `2013-07-18`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `2018-12-30`* ||
 ||= **Twenty Fourteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie/css` =||  `2014-07-01`  || `20131205`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Fifteen** =|| || ||
 ||= `style.css` =||  `2019-04-02`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie.css` =||  `2017-09-16`  || `20141010`* ||
 ||= `/css/ie7.css` =||  `2014-12-10`  || `20141010`* ||
 ||= `css/edtior-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Sixteen** =|| || ||
 ||= `style.css` =||  `2019-02-07`  || none ||
 ||= `/css/blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= `/css/ie8.css` =||  `2017-05-30`  || `20160816`* ||
 ||= `/css/ie7.css` =||  `2017-05-30`  || `20160816`* ||
 ||= `/css/editor-blocks.css` =||  `2019-01-02`  || `20181230`* ||
 ||= **Twenty Seventeen** =|| || ||
 ||= `style.css` =||  `2019-04-08`  || none ||
 ||= `/assets/css/blocks.css` =||  `2019-01-05`  || `1.1` ||
 ||= `/assets/css/colors-dark.css` =||  `2019-04-08`  || `1.0` ||
 ||= `/assets/css/ie9.css` =||  `2016-12-02`  || `1.0` ||
 ||= `/assets/css/ie8.css` =||  `2016-12-02`  || `1.0` ||
 ||= `/assets/css/editor-blocks.css` =||  `2019-03-28`  || `1.1` ||

--

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


More information about the wp-trac mailing list