Making WordPress.org

Opened 4 years ago

Closed 6 weeks ago

#1773 closed enhancement (fixed)

Reduce Tagregator JavaScript size

Reported by: walterebert Owned by:
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch


The Tagregator plugin is active by default on WordCamp sites. It currently loads an 1.5 MB JavaScript file, even if the functionality is not used. This seems excessive.


Attachments (2)

1773.diff (539 bytes) - added by xkon 3 years ago.
Load css / js only on tagregator pages.
1773.2.diff (520 bytes) - added by xkon 3 years ago.
Fixed Coding Standards.

Download all attachments as: .zip

Change History (10)

#1 @iandunn
4 years ago

  • Keywords needs-patch good-first-bug added
  • Owner set to iandunn
  • Status changed from new to accepted

Doh, I accidentally committed the development version instead of the build version :|

I fixed that in [plugins 1438841], and it now comes out as 131k gzipped, or 556k uncompressed.

It'd still be good to make sure the script is only enqueued on pages where the shortcode it used, though.

3 years ago

Load css / js only on tagregator pages.

#2 @xkon
3 years ago

  • Keywords has-patch added; needs-patch removed

1773.diff addresses the issue. The css & js files will only be loaded if Tagregator is present in the page.

Best regards,

3 years ago

Fixed Coding Standards.

#3 @xkon
3 years ago

There was an issue with my editor so I've updated the diff ( 1773.2.diff ) to meet the coding standards.

Sorry for the inconvenience.

Best regards,

#4 @iandunn
2 years ago

  • Owner iandunn deleted
  • Status changed from accepted to assigned

#5 @iandunn
2 years ago

  • Priority changed from normal to low

This ticket was mentioned in Slack in #meta-wordcamp by iandunn. View the logs.

6 months ago

This ticket was mentioned in Slack in #meta-wordcamp by iandunn. View the logs.

8 weeks ago

#8 @ryelle
6 weeks ago

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

In https://plugins.trac.wordpress.org/changeset/2245877/, the JS file was properly minified and updated so that it's now only 205KB. We can't necessarily rely on checking $post for the shortcode (or body_class), since this shortcode could be used on any post on the site, and will return incorrectly for archive pages. Now that the file size is more reasonable, I think it's OK that we load this on all pages, since the browser should cache it anyway.

Note: See TracTickets for help on using tickets.