Welcome to the W3 Total Cache repository on GitHub. Here you can browse the source, look at open issues and keep track of development.
If you are not a developer, please use the W3 Total Cache plugin page on WordPress.org.
This repository is not suitable for support. Please don't use our issue tracker for support requests. Support can take place through the appropriate channels:
- The support form can be found in Performance -> Support page of your wp-admin.
- Our community forum on wp.org.
Support requests in issues on this repository will be closed on sight.
If you have a patch or have stumbled upon an issue with W3 Total Cache, you can contribute this back to the code. Please read our contributor guidelines for more information how you can do this.
The plugin's automated tests run on PHPUnit ^8.5 paired with Yoast PHPUnit Polyfills ^3.0, which adapts PHPUnit 8.5's assertion surface to the full PHP 7.4 → 8.5 range supported by the plugin. The suite is configured in phpunit.xml and lives under tests/, with tests/bootstrap.php loading the plugin into the WordPress test environment.
Most tests boot the WordPress test scaffolding, which is downloaded into WP_TESTS_DIR by bin/install-wp-tests.sh. A handful of standalone tests (e.g. tests/test-cache-unserialize.php) can be invoked with php tests/<file> directly, without the WordPress bootstrap.
To run the suite locally:
yarn run install:deps
bash bin/install-wp-tests.sh wordpress_test root '' localhost
./vendor/bin/phpunitA single test file can be targeted by passing its path, e.g. ./vendor/bin/phpunit tests/test-generic-plugin.php. Code-coverage output is written to coverage.xml in Clover format and is what the CI job below feeds to Codecov.
Travis CI runs the PHPUnit suite on every push and pull request. The job matrix lives in .travis.yml and exercises both ends of the supported PHP version range:
- PHP 7.4 on Ubuntu 20.04 (Focal) — the lower bound of supported PHP. This job also uploads the PHPUnit coverage report to Codecov and, on tag pushes, builds the release zip via
bin/release.shand publishes it to the GitHub Releases page. - PHP 8.5 on Ubuntu 22.04 (Jammy) — the upper bound of supported PHP. PHP 8.5 is installed from the Ondřej Surý PPA because Travis's
phpenvdoes not yet ship a prebuilt 8.5 archive.
Each job installs Composer dependencies, downloads the WordPress test scaffolding via bin/install-wp-tests.sh, runs the PHPUnit suite described above, and PHP-lints every plugin source file. The live build status is shown by the badge at the top of this README.