# Aggregator — retired

**This plugin is no longer maintained.** Version 2.2.0 is its last release; it exists only
to tell the remaining users to deactivate and delete it. The wordpress.org listing is
being closed and this repository archived.

- wordpress.org slug: `aggregator` (this repository is `ph-wp-aggregator`)
- last functional release: 2.1.2, December 2019

## What it did

Aggregated a site's local JavaScript into one header and one footer file, from the era
when the number of requests was the thing that made a page slow.

## Why it is retired

**HTTP/2 removed the reason.** Bundling worked around HTTP/1.1's one-connection-per-file.
HTTP/2 and HTTP/3 multiplex, so separate files are cheap — and they cache separately,
where one bundle is invalidated in full by a change to any part of it.

**WordPress does it better itself.** `wp_script_add_data( $handle, 'strategy', 'defer' )`
since 6.3 addresses blocking scripts directly, and script modules (6.5+) live in a
registry this plugin never touched — so on a block theme part of the JavaScript was never
aggregated anyway.

**It actively breaks pages.** Measured on WordPress 7.0.2 / PHP 8.3 against the released
2.1.2, with three probe scripts on the front end:

| | plugin off | plugin on |
|---|---|---|
| `wp_add_inline_script( …, 'before' )` | tag present | **dropped** |
| `wp_add_inline_script( …, 'after' )` | tag present | **dropped** |
| `wp_localize_script()` | `…-js-extra` | re-rendered, content kept |
| `strategy => defer` | `defer data-wp-strategy="defer"` | **attribute lost** |
| script module (core navigation) | own tag | untouched |

The aggregation itself worked — the three scripts were swallowed into
`uploads/aggregated/<hash>.js` as `aggregator-footer-js`. There is no on/off setting, so
every site with the plugin active is affected.

It also creates 13 dynamic properties per request, which PHP 8.2 deprecates and PHP 9 will
turn into a fatal error.

## What was left unfinished

The branch **`feature/respect-inline-scripts`** (five commits, April 2020) fixes exactly
the inline-script loss above — it carries `extra['before']` and `extra['after']` through
the aggregation — and adds a filter `aggregator_include_external`. It was marked as a
breaking change and never merged or released. It does not address the `defer`/`async` loss.
It is kept for the record; nothing is going to be released from it.

## Known inconsistencies, deliberately left alone

- `readme.txt` declares `License: GPLv3` while the bundled `LICENSE` file is the **GPL
  version 2** text. This contradiction has been shipping for years. A retirement release
  is the wrong place to settle a licensing question, so both are left as they are.
- `lib/minifier.php` is third-party code under the **BSD licence** (see its header), not
  Palasthotel's.

## For anyone still running it

Deactivate and delete. Nothing needs to take its place. The generated files are left
behind on purpose — by default `wp-content/uploads/aggregated/`, or the theme directory if
that was configured under **Settings → Aggregator** — and can be removed afterwards.
