|
1 | | -# super-cache |
| 1 | +# WP Super Cache |
2 | 2 |
|
3 | | -A very fast caching engine for WordPress that produces static html files. |
| 3 | +A very fast caching engine for WordPress that produces static HTML files. |
4 | 4 |
|
5 | | -## How to install super-cache |
| 5 | +[](https://wordpress.org/plugins/wp-super-cache/) |
| 6 | +[](./LICENSE.txt) |
| 7 | +[](https://www.php.net/) |
| 8 | +[](https://github.com/Automattic/wp-super-cache/actions/workflows/php-tests.yml) |
6 | 9 |
|
7 | | -### Installation From Git Repo |
| 10 | +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. |
8 | 11 |
|
9 | | -## Contribute |
| 12 | +For user-facing documentation, see the [WordPress.org plugin page](https://wordpress.org/plugins/wp-super-cache/). For extended documentation, see the [wiki](https://github.com/Automattic/wp-super-cache/wiki). |
| 13 | + |
| 14 | +## Project structure |
| 15 | + |
| 16 | +``` |
| 17 | +wp-cache.php Main plugin entry point |
| 18 | +wp-cache-phase1.php Early-loading caching phase (runs before WordPress) |
| 19 | +wp-cache-phase2.php Main caching logic (runs during WordPress init) |
| 20 | +advanced-cache.php Drop-in loaded by WordPress when WP_CACHE is enabled |
| 21 | +ossdl-cdn.php CDN URL rewriting (OSSDL off-linker integration) |
| 22 | +
|
| 23 | +inc/ Core includes (Boost integration, admin UI helpers) |
| 24 | +rest/ REST API endpoint classes for cache management |
| 25 | +src/ Source modules (device detection) |
| 26 | +plugins/ WP Super Cache's own plugin system (loaded early, before WP) |
| 27 | +partials/ Admin settings page tab templates |
| 28 | +
|
| 29 | +tests/php/ PHPUnit tests |
| 30 | +tests/e2e/ End-to-end tests (Docker + Jest) |
| 31 | +
|
| 32 | +changelog/ Individual changelog entries (Jetpack Changelogger format) |
| 33 | +.phan/ Phan static analysis configuration and stubs |
| 34 | +``` |
| 35 | + |
| 36 | +## Development setup |
| 37 | + |
| 38 | +### Prerequisites |
| 39 | + |
| 40 | +- PHP 7.4+ |
| 41 | +- [Composer](https://getcomposer.org/) |
| 42 | + |
| 43 | +### Installation |
| 44 | + |
| 45 | +```bash |
| 46 | +composer install |
| 47 | +``` |
| 48 | + |
| 49 | +### Running tests |
| 50 | + |
| 51 | +```bash |
| 52 | +# PHP unit tests |
| 53 | +composer test-php |
| 54 | + |
| 55 | +# With coverage |
| 56 | +composer test-coverage |
| 57 | +``` |
| 58 | + |
| 59 | +### Linting |
| 60 | + |
| 61 | +```bash |
| 62 | +# PHPCS (WordPress/Jetpack coding standards) |
| 63 | +vendor/bin/phpcs |
| 64 | +``` |
| 65 | + |
| 66 | +### Static analysis |
| 67 | + |
| 68 | +```bash |
| 69 | +# Phan |
| 70 | +vendor/bin/phan |
| 71 | +``` |
| 72 | + |
| 73 | +### End-to-end tests |
| 74 | + |
| 75 | +E2E tests use Docker and Jest. See `tests/e2e/` for setup details: |
| 76 | + |
| 77 | +```bash |
| 78 | +cd tests/e2e |
| 79 | +pnpm install |
| 80 | +docker compose up -d |
| 81 | +pnpm test |
| 82 | +``` |
| 83 | + |
| 84 | +## Contributing |
| 85 | + |
| 86 | +1. Branch from `trunk`. |
| 87 | +2. Make your changes. |
| 88 | +3. Add a changelog entry: |
| 89 | + ```bash |
| 90 | + vendor/bin/changelogger add |
| 91 | + ``` |
| 92 | +4. Push and open a pull request against `trunk`. |
| 93 | + |
| 94 | +CI will automatically run: |
| 95 | +- **PHP tests** across PHP 8.2, 8.3, 8.4, and 8.5 |
| 96 | +- **PHPCS linting** on changed lines |
| 97 | +- **Changelog validation** (warns if no entry is included) |
| 98 | + |
| 99 | +### Translations |
| 100 | + |
| 101 | +Help translate WP Super Cache on the [WordPress.org translation page](https://translate.wordpress.org/projects/wp-plugins/wp-super-cache). |
10 | 102 |
|
11 | | -## Get Help |
12 | | -Support is handled via the .org support forums. |
13 | 103 | ## Security |
14 | 104 |
|
15 | | -Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic). |
| 105 | +To report a security vulnerability, visit [automattic.com/security](https://automattic.com/security/) or the [HackerOne bug bounty program](https://hackerone.com/automattic). |
16 | 106 |
|
17 | 107 | ## License |
18 | 108 |
|
19 | | -super-cache is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt) |
20 | | - |
| 109 | +WP Super Cache is licensed under the [GNU General Public License v2 (or later)](./LICENSE.txt). |
0 commit comments