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

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

    XporterXMLWordPrintable

    Details

    • Type: Task
    • Status: CLOSED
    • Priority: Should have
    • Resolution: Released
    • Affects Version/s: None
    • Fix Version/s: 2.42.2
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      Sprint #147
    • Section:
      Performance, Search
    • P4 site:
      All sites
    • Track:
      Development
    • Repositories:
      planet4-master-theme, planet4-base

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: