Making WordPress.org

Opened 8 years ago

Closed 5 years ago

#1773 closed enhancement (fixed)

Reduce Tagregator JavaScript size

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

Description

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.

Example:
https://2016.frankfurt.wordcamp.org/wp-content/plugins/tagregator/javascript/front-end.js?ver=1

Attachments (2)

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

Download all attachments as: .zip

Change History (10)

#1 @iandunn
8 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.

@xkon
7 years ago

Load css / js only on tagregator pages.

#2 @xkon
7 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,
Konstantinos

@xkon
7 years ago

Fixed Coding Standards.

#3 @xkon
7 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,
Konstantinos

#4 @iandunn
7 years ago

  • Owner iandunn deleted
  • Status changed from accepted to assigned

#5 @iandunn
7 years ago

  • Priority changed from normal to low

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


5 years ago

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


5 years ago

#8 @ryelle
5 years 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.