A very fast caching engine for WordPress that produces static HTML files.
This plugin generates static HTML files from your dynamic WordPress site. After a file is generated, the web server serves that file directly instead of processing WordPress PHP scripts, dramatically reducing load and response times.
For user-facing documentation, see the WordPress.org plugin page. For extended documentation, see the wiki.
wp-cache.php Main plugin entry point
wp-cache-phase1.php Early-loading caching phase (runs before WordPress)
wp-cache-phase2.php Main caching logic (runs during WordPress init)
advanced-cache.php Drop-in loaded by WordPress when WP_CACHE is enabled
ossdl-cdn.php CDN URL rewriting (OSSDL off-linker integration)
inc/ Core includes (Boost integration, admin UI helpers)
rest/ REST API endpoint classes for cache management
src/ Source modules (device detection)
plugins/ WP Super Cache's own plugin system (loaded early, before WP)
partials/ Admin settings page tab templates
tests/php/ PHPUnit tests
tests/e2e/ End-to-end tests (Docker + Jest)
scripts/ Release tooling (prepare-release, create-release, build, exclude list)
.phan/ Phan static analysis configuration and stubs
- PHP 7.4+
- Composer
- Node.js 20+ and Docker (only needed for the Makefile / wp-env workflow)
A Makefile is provided to spin up a disposable WordPress site in Docker (via @wordpress/env) with the plugin pre-mounted. Run make help to see every target.
make install # composer install + npm install
make up # start WordPress at http://localhost:8888 (admin / password)
make seed # create 100 random posts + 100 random pages for cache testing
# ... hack on the plugin; files are live-mounted into the container ...
make unseed # delete only the content created by `make seed`
make down # stop containers
make destroy # stop and wipe the databaseOther useful targets:
| Target | Purpose |
|---|---|
make cli |
Open a shell inside the wp-cli container |
make wp CMD="super-cache status" |
Run an arbitrary wp-cli command |
make logs |
Tail the WordPress container logs |
make lint / make lint-fix |
Run / auto-fix PHPCS on changed PHP files |
make lint-all |
Run PHPCS on the full codebase |
The seed script tags every item it creates with _wpsc_seed=1 post meta, so make unseed only removes content it generated — it will not touch posts or pages you created by hand.
composer install# PHP unit tests
composer test-php
# With coverage
composer test-coverage# Changed PHP files only (matches CI)
make lint
# Full-tree PHPCS (WordPress/Jetpack coding standards)
make lint-all# Phan
vendor/bin/phanE2E tests use Docker and Jest. See tests/e2e/ for setup details:
cd tests/e2e
pnpm install
docker compose up -d
pnpm testReleases use a two-phase flow: you prepare a PR locally, edit the changelog in the PR, and merging it deploys automatically. The shipped plugin is built from an allow-list: ship_paths in scripts/build-plugin.sh is the single source of truth for which files are packaged, so a newly-added dev file can never leak into the release unless it is explicitly added there.
make release VERSION=x.y.zRun from trunk. This target (scripts/prepare-release.mjs):
- Creates a
release/wp-super-cache-x.y.zbranch. - Bumps
Version:inwp-cache.phpandStable tag:inreadme.txt. - Assembles the changelog from the GitHub milestone
x.y.z— every merged PR assigned to it, pulling each PR's### Release Notessection (falling back to the PR title). - Pushes the branch and opens a PR whose body holds the changelog, editable between the two
---lines.
Create a GitHub milestone named exactly x.y.z and assign the release's PRs to it beforehand.
Edit the changelog in the PR body, review, and merge into trunk. On merge, .github/workflows/create-release.yml runs scripts/create-release.mjs, which:
- Writes the edited release notes into
readme.txt's== Changelog ==(newest 5 entries). - Tags the release and creates a GitHub release with
build/wp-super-cache.zipattached. - Deploys to the WordPress.org SVN repository via the 10up deploy action, using the
WORDPRESSORG_SVN_USERNAME/WORDPRESSORG_SVN_PASSWORDrepository secrets.
make build builds build/wp-super-cache/ and build/wp-super-cache.zip from the working tree; it runs in CI but is also useful locally to inspect the packaged plugin.
- Branch from
trunk. - Make your changes.
- Push and open a pull request against
trunk.
CI will automatically run:
- PHP tests across PHP 8.2, 8.3, 8.4, and 8.5
- PHPCS linting on changed lines
When you add a @since, @deprecated, or a WordPress _deprecated_*() call for code that will ship in the next release, tag it with the next-version placeholder token instead of guessing the version number. Run bash scripts/replace-next-version-tag.sh -h for the exact token and the recognized patterns.
At release time, make release replaces the placeholder with the version being shipped and fails if any malformed token is left behind — so you never need to know the next version number while writing a PR. (The token is deliberately not written literally here; the release step rewrites it wherever it appears in a tracked file.)
Help translate WP Super Cache on the WordPress.org translation page.
To report a security vulnerability, visit automattic.com/security or the HackerOne bug bounty program.
WP Super Cache is licensed under the GNU General Public License v2 (or later).