Easy Critical CSS

Descripción

Easy Critical CSS is a lightweight WordPress plugin that allows you to add Critical CSS to any page on your site, improving your site’s loading speed and performance.

Features:
– Easily add Critical CSS and Secondary CSS to any page
Secondary CSS removes all unused CSS rules and stylesheets, ensuring only a single optimized CSS file loads
– Supports posts, pages, archives, and taxonomy pages
– Fully compatible with caching plugins (WP Rocket, W3 Total Cache, WP Super Cache, etc.)
Customizable settings for individual pages
– Stores Critical CSS in your choice of the database or as static files
Optional API service (API key required) for automated Critical & Secondary CSS generation through CriticalCSS.net
Background processing to for smooth, non-blocking performance

Why Use Critical CSS?

Critical CSS ensures above-the-fold content loads first by reducing render-blocking styles. This helps you boost Core Web Vitals, improve page speed scores, and deliver a better experience to your visitors.

Want to try it out first? You can generate free one-off Critical CSS at CriticalCSS.net and manually apply it to your site using the plugin settings.

External services

This plugin interacts with external third-party services in order to provide its functionality. Below is a detailed breakdown of these interactions:

  1. Critical CSS API (api.criticalcss.net)
    This service generates critical and secondary CSS used to optimize your site’s CSS delivery and improve page load times.

    • Data Sent: The URL, CSS generation preferences, generation status, and HTML content of pages from your website.
    • When: Data is transmitted only if you have explicitly enabled the Auto generation mode, and occurs whenever Critical CSS or Secondary CSS needs to be generated or regenerated.
    • Links: Terms of Service, Privacy Policy.
  2. Cloudflare API (api.cloudflare.com)
    This service is used to automatically clear your Cloudflare cache after new critical CSS is generated, ensuring your visitors see updated styles immediately.

    • Data Sent: Authentication credentials (Cloudflare email, API key, and zone ID) and instructions for purging the cache.
    • When: Data is sent only if CLOUDFLARE_EMAIL, CLOUDFLARE_API_KEY, and CLOUDFLARE_ZONE_ID are defined in your site’s configuration.
    • Links: Terms of Service, Privacy Policy.
  3. Kinsta Cache Clear (localhost)
    If your site is hosted on Kinsta, this plugin can trigger a cache clear after generating new critical CSS, ensuring immediate availability of updated styles.

    • Data Sent: A cache-clear request to your site’s local server endpoint provided by Kinsta. No sensitive or identifying information is transmitted beyond the local environment.
    • When: Data is sent only when your site detects that it’s running on Kinsta infrastructure (KINSTA_CACHE_ZONE environment variable is present).
    • Links: Kinsta Terms of Service, Kinsta Privacy Policy.
  4. Freemius API (api.freemius.com and wp.freemius.com)
    Used to manage licensing, validate API keys, and handle plugin updates and account management.

    • Data Sent: Freemius sends and receives licensing information and plugin activation status, including your site’s URL, plugin version, API key, and licensing details.
    • When: Data is transmitted only after explicitly opting in through the plugin’s settings page or upon activation of a purchased API key. By default, the plugin does not send any data to Freemius.
    • Links: Freemius Terms of Service, Freemius Privacy Policy.

Instalación

Install via WordPress

  1. Visit Plugins > Add New.
  2. Search for Easy Critical CSS.
  3. Click Install Now, then Activate.

Manual installation

  1. Download the plugin ZIP file.
  2. Upload it to /wp-content/plugins/ via FTP or WordPress plugin upload.
  3. Activate it from the Plugins menu.

FAQ

Does Easy Critical CSS work with caching plugins?

Yes! It integrates smoothly with popular caching plugins and clears their cache when Critical CSS updates, ensuring your visitors always see optimized styles.

Can I exclude specific CSS files?

Yes, the plugin allows you to specify CSS files to exclude from removal.

How does the plugin generate Critical CSS?

It integrates with CriticalCSS.net, a fast and privacy-focused CSS generation service. It analyzes your page, extracts the above-the-fold styles, and returns optimized Critical and Secondary CSS automatically.

Can I use this without an API key?

Yes! You can manually enter Critical CSS that applies to your entire site, or override it on specific pages. You don’t need an API key unless you want automatic generation.

How do I generate Critical CSS for manual usage?

You can use the free generator at CriticalCSS.net to create both Critical and Secondary CSS for any page. Just copy the results into the appropriate fields in this plugin’s settings.

Where is Critical CSS stored?

By default, Critical CSS and Secondary CSS are stored in your site’s database. However, you can enable the "Serve Critical CSS from Files" option, which will save optimized CSS to static files inside /wp-content/uploads/easy-critical-css/. This can improve performance by reducing database load and serving CSS faster through your web server.
Note: This setting applies only to auto-generated Critical CSS.

Is it safe to uninstall the plugin?

Yes. If you choose the "Delete All Data" option under settings before uninstalling, all plugin settings and Critical CSS will be permanently removed from your site. If you simply deactivate or delete without using the uninstall option, your data will be preserved.

Does Easy Critical CSS work with block themes and Full Site Editing?

Yes, Easy Critical CSS is fully compatible with block-based themes and Full Site Editing (FSE) in WordPress 6.2 and above.

Reseñas

No hay reseñas para este plugin.

Colaboradores y desarrolladores

"Easy Critical CSS" es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

Traduce "Easy Critical CSS" a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

1.0.0

  • Initial release
  • FEATURE: Manual Critical CSS adding
  • FEATURE: Automated Critical CSS generation through API
  • FEATURE: Integration with popular caching plugins

1.0.1

  • FIX: Prevents feeds from auto generating Critical CSS

1.0.2

  • FIX: Fixes logic when outputting Secondary CSS
  • FIX: Prevents 404 pages from auto generating Critical CSS

1.0.3

  • FIX: Fixes issue where inline data SVGs were sometimes stripped
  • FIX: Assigns proper status on non-published pages/posts