Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5517

ElasticPress plugin adds css files to all pages which aren't used

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Released
    • Icon: Should have Should have
    • 2.42.2
    • None
    • 2
    • Performance, Search
    • Sprint #147

      In the pagespeed insights report I noticed that some of the fetched files that are flagged as hurting performance are from the ElasticPress plugin. I don't think we actually use anything from these files, as we don't use everything from the ElasticPress plugin.

      Additionally these files are loaded on each page, even though they're likely only intended for the search page.

      The plugin does have some logic to only include the files if the corresponding ElasticPress features (related posts and facets) are turned on. It looks like these are turned on on most instances. Probably we can just turn them off. There might be more features that we don't use that affect performance in some way.

      https://www.greenpeace.org/international/wp-content/plugins/elasticpress/dist/css/related-posts-block-styles.min.css?ver=3.2.6

      https://www.greenpeace.org/international/wp-content/plugins/elasticpress/dist/css/facets-styles.min.css?ver=3.2.6 

      https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.greenpeace.org%2Finternational%2Fstory%2F45240%2Fwhat-you-need-to-know-about-taiwans-coral-bleaching%2F&tab=mobile

      Tasks

      • Investigate turning off these two features and test for side effects.
      • Investigate a wp cli command to amend these options and deploy to all instances.

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: