WordPress.org

Making WordPress.org

Opened 5 months ago

Closed 5 months ago

#4179 closed defect (fixed)

Prevent templates from loading Dashicons library twice

Reported by: jonoaldersonwp Owned by:
Milestone: Priority: low
Component: General Keywords: speed/performance
Cc:

Description

Some templates load two versions of the dashicons library, which impacts performance.

The homepage, and some other templates (e.g., https://wordpress.org/support/), make a call to s.w.org/wp-includes/css/dashicons.min.css?20181204 in the header.

Some templates (plugins, themes) enqueue https://wordpress.org/support/wp-includes/css/dashicons.min.css?ver=5.2-alpha-44746.

Some templates load both versions, e.g., https://wordpress.org/support/

We should make this consistent, and only load one. I suggest de-enqueing the resource everywhere, and leaning on the 'hard-coded' call in the homepage/main header file.

Change History (6)

#1 @dd32
5 months ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [dotorg14827] - I've simply prevented the global header from adding dashicons when WordPress has enqueued it, same as what we do for jQuery.

Ideally I agree, we'd have leveraged the global dashicon from CDN but that wasn't as easy :)

Perhaps we should have another ticket to CDNise allwp-includes assets to the canonical CDN variant rather than having /support/wp-includes/... /plugins/wp-includes/... etc all coming from wordpress.org and $locale.wordpress.org etc.

#2 @dd32
5 months ago

In 8266:

Developer Theme: Remove the removing of dashicons.

The global header no longer enqueues dashicons if the WordPress has enqueued it.

H/t sebastienserre, daveshine.

See #4179.
Fixes #4182.

#3 @dd32
5 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#4 @coffee2code
5 months ago

In [14832-dotorg], made an identical change for Profiles as was done for Developer in [8266]:

Profiles: Reinstate native enqueuing of dashicon styles.

The now-deleted code was put into place to defer to the global header's CDN link for dashicons.css, but the approach from the below-referenced ticket is to instead rely on the site-native version.

#5 @dd32
5 months ago

Thanks @coffee2code !

Fixed in [dotorg14827] - I've simply prevented the global header from adding dashicons when WordPress has enqueued it, same as what we do for jQuery.

I reverted that change last night after finding spots where I'd missed (Profiles, and Make.w.org/core - both of which I thought i had tested :( ).

I'm not 100% sure what was affecting it on o2 so I reverted the change instead until I had some time to properly investigate it, which I'll do this afternoon.

It's expected that Profiles & developer.wordpress.org will have duplicate dashicon styles loaded temporarily.

#6 @dd32
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

[dotorg14834] should have fixed this.

  • Global header doesn't enqueue unless WordPress hasn't enqueued.
  • Make network no longer sets dashicons src to ''.

That in combination with the above commits should have fixed this :fingerscrossed:

Note: See TracTickets for help on using tickets.