Back to Reports

WooCommerce Brands CSS File Unconditionally Enqueued on All Pages

open Sep 22, 2025 PluginWoocommerce

Summary:

The WooCommerce plugin incorrectly enqueues a CSS file for its 'Brands' feature on every page of a WordPress site, regardless of whether the feature is being used. The 'brands.css' file is loaded on the frontend even when no brands are configured or displayed, leading to unnecessary HTTP requests and a slight performance impact.

This issue occurs because the stylesheet is registered and enqueued without any conditional logic to check if the brands functionality is active or needed on the current page. The bug is present in a default WordPress environment with only WooCommerce active and a default theme, confirming it is a core plugin issue.

The impact is that all sites running WooCommerce, even those not utilizing the brands feature, incur the overhead of loading this extraneous CSS file, which violates best practices for asset loading.

How to Replicate:

  1. Install and activate the WooCommerce plugin on a WordPress site.
  2. Ensure no brands are configured and the feature is not in use.
  3. Visit any page on the frontend of the site (e.g., homepage, post, product page).
  4. Open the browser's developer tools and navigate to the 'Network' tab.
  5. Reload the page and filter the loaded resources by 'brands.css'.
  6. Observe that the 'brands.css' file is present in the list of loaded resources.