PHPackages                             innocode-digital/wp-critical-css-aws-lambda - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. innocode-digital/wp-critical-css-aws-lambda

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

innocode-digital/wp-critical-css-aws-lambda
===========================================

Generates critical stylesheets for templates via AWS Lambda.

3.0.0(3y ago)54.9k1GPL-2.0+PHPPHP &gt;=7.2CI failing

Since Mar 18Pushed 3y ago13 watchersCompare

[ Source](https://github.com/innocode-digital/wp-critical-css-aws-lambda)[ Packagist](https://packagist.org/packages/innocode-digital/wp-critical-css-aws-lambda)[ RSS](/packages/innocode-digital-wp-critical-css-aws-lambda/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

AWS Lambda Critical CSS
=======================

[](#aws-lambda-critical-css)

### Description

[](#description)

Generates critical stylesheets for templates via AWS Lambda. See also [AWS Lambda Critical CSS](https://github.com/innocode-digital/aws-lambda-critical-css).

### Install

[](#install)

- Preferable way is to use [Composer](https://getcomposer.org/):

    ```
    composer require innocode-digital/wp-critical-css-aws-lambda

    ```

    By default, it will be installed as [Must Use Plugin](https://codex.wordpress.org/Must_Use_Plugins). It's possible to control with `extra.installer-paths` in `composer.json`.
- Alternate way is to clone this repo to `wp-content/mu-plugins/` or `wp-content/plugins/`:

    ```
    cd wp-content/plugins/
    git clone git@github.com:innocode-digital/wp-critical-css-aws-lambda.git
    cd wp-critical-css-aws-lambda/
    composer install

    ```

If plugin was installed as regular plugin then activate **AWS Lambda Critical CSS** from Plugins page or [WP-CLI](https://make.wordpress.org/cli/handbook/): `wp plugin activate wp-critical-css-aws-lambda`.

### Usage

[](#usage)

Add the following constants to `wp-config.php`:

```
define( 'AWS_LAMBDA_CRITICAL_CSS_KEY', '' );
define( 'AWS_LAMBDA_CRITICAL_CSS_SECRET', '' );
define( 'AWS_LAMBDA_CRITICAL_CSS_REGION', '' ); // e.g. eu-west-1

define( 'AWS_LAMBDA_CRITICAL_CSS_FUNCTION', '' ); // Optional, default value is "critical-css-production-processor"

```

Create serverless function on your favorite service. Expected default name is **critical-css-production-processor**, but you may use any other. There is a prepared function [AWS Lambda Critical CSS](https://github.com/innocode-digital/aws-lambda-critical-css).

### Usage

[](#usage-1)

To generate critical CSS from enqueued styles:

```
add_filter( 'innocode_critical_css_styles', function () {
    return [
        // List of enqueued styles.
        // Specify styles which you think are needed for critical CSS.
    ];
} );

```

### Caveats

[](#caveats)

- Relative paths to custom fonts or images in stylesheets should be changed to absolute:

```
add_filter( 'innocode_critical_css_stylesheet', function ( $stylesheet ) {
    $stylesheet = str_replace(
        '../fonts/',
        get_template_directory_uri() . '/path/to/fonts/',
        $stylesheet
    );
    $stylesheet = str_replace(
        '../images/',
        get_template_directory_uri() . '/path/to/images/',
        $stylesheet
    );

    return $stylesheet;
} );

```

- This plugin is only for generating and rendering critical CSS, to defer CSS files you may use [Deferred loading](https://github.com/innocode-digital/wp-deferred-loading).
- If page caching is used then you may want to add variable value from cookie in cache key. E.g. for Batcache it's possible to do with next code before `advanced-cache.php` file is included:

```
foreach ( array_keys( $_COOKIE ) as $name ) {
    if ( strpos( $name, 'innocode_critical_css_' ) === 0 ) {
        $GLOBALS['batcache']['unique']['innocode_critical_css'] = substr( $name, strlen( 'innocode_critical_css_' ) );
    }
}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~114 days

Total

6

Last Release

1430d ago

Major Versions

2.2.1 → 3.0.02022-06-18

PHP version history (2 changes)2.0.0PHP &gt;=7.1

3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b52f801a1cdb5f6622a9e49f4359717b1808ca23e948a243eae225f55e2c7eb?d=identicon)[smfb-dinamo](/maintainers/smfb-dinamo)

---

Top Contributors

[![kuliebiakin](https://avatars.githubusercontent.com/u/6066592?v=4)](https://github.com/kuliebiakin "kuliebiakin (32 commits)")[![vitaliy-p](https://avatars.githubusercontent.com/u/9088707?v=4)](https://github.com/vitaliy-p "vitaliy-p (14 commits)")

---

Tags

aws-lambdacritical-csswordpresswordpress-plugin

### Embed Badge

![Health badge](/badges/innocode-digital-wp-critical-css-aws-lambda/health.svg)

```
[![Health](https://phpackages.com/badges/innocode-digital-wp-critical-css-aws-lambda/health.svg)](https://phpackages.com/packages/innocode-digital-wp-critical-css-aws-lambda)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[mediawiki/semantic-cite

A Semantic MediaWiki extension to manage citation resources.

2310.2k1](/packages/mediawiki-semantic-cite)[humanmade/popup

An exit intent popup block that shows when someone may be about to leave the site

144.8k](/packages/humanmade-popup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
