WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 10 days ago

#46981 closed defect (bug)

Bundled themes should pass version to wp_enqueue_script() to ensure proper cache busting — at Version 1

Reported by: dswebsme Owned by: dswebsme
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch needs-testing
Focuses: Cc:

Description (last modified by dswebsme)

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

Change History (1)

#1 @dswebsme
4 months ago

  • Description modified (diff)
  • Owner set to dswebsme
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.