Opened 8 years ago
Closed 5 years 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 |
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)
Change History (10)
#1
@
8 years ago
- Keywords needs-patch good-first-bug added
- Owner set to iandunn
- Status changed from new to accepted
#2
@
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
#3
@
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
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
@
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.
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.