pollora / wp-rocket
WP Rocket for Pollora, the Laravel framework for WordPress: keeps WP Rocket from writing .htaccess and setting WP_CACHE unless the project asks for it.
Requires
- php: ^8.3
- illuminate/support: ^13.38
Requires (Dev)
- antecedent/patchwork: ^2.2
- brain/monkey: ^2.7
- illuminate/config: ^13.38
- illuminate/container: ^13.38
- laravel/pint: ^1.22.1
- mockery/mockery: ^1.6.12
- pestphp/pest: ^3.8.2
- phpstan/phpstan: ^2.1.16
- pollora/harness: ^0.1.12
- szepeviktor/phpstan-wordpress: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.1.0
- dev-chore/harness-0.1.41
- dev-chore/patchwork-fix
- dev-docs/readme-banner
- dev-chore/harness-0.1.40
- dev-chore/phpstan-level
- dev-chore/harness-0.1.35
- dev-refactor/final-classes
- dev-chore/type-coverage-floor
- dev-chore/harness-0.1.34
- dev-chore/harness-0.1.33
- dev-chore/harness-0.1.32
- dev-chore/harness-0.1.31
- dev-chore/harness-0.1.30
- dev-chore/harness-0.1.29
- dev-chore/harness-0.1.28
- dev-chore/harness-0-1-22
- dev-chore/harness-0-1-20
- dev-fix/arch-rules
- dev-chore/harness-0-1-19
- dev-chore/harness-0-1-15
This package is auto-updated.
Last update: 2026-11-27 18:56:24 UTC
README
Pollora WP Rocket
WP Rocket for Pollora, the Laravel framework for WordPress: it keeps WP Rocket from writing its rules into .htaccess and from setting WP_CACHE, unless the project asks for it.
This used to live in the framework, as
Pollora\ThirdParty\WpRocket. The old class name still resolves, to this package.
Why
In a Pollora project WordPress lives in vendor and public/cms, and the web server's rules belong to the project. WP Rocket, left alone, writes to .htaccess and edits the WP_CACHE constant on its own. This package tells it not to, and lets you opt in to either.
Installation
composer require pollora/wp-rocket
Requires PHP 8.3+ and a Pollora project (Laravel 13). The service provider is discovered by Laravel; nothing to register.
Configuration
Both settings are off by default. Set them in config/wordpress.php:
return [ 'wprocket' => [ 'generate_htaccess' => false, // let WP Rocket write its rules into .htaccess 'set_cache_constant' => false, // let WP Rocket set WP_CACHE ], ];
| Key | WP Rocket filter | Default |
|---|---|---|
generate_htaccess |
rocket_init_cache_dir_generate_htaccess |
false |
set_cache_constant |
rocket_set_wp_cache_constant |
false |
Coming from the framework
| Was | Is |
|---|---|
Pollora\ThirdParty\WpRocket\WpRocketServiceProvider |
Pollora\WpRocket\WpRocketServiceProvider |
The old name keeps working and is removed in the next major release. Install the package: a framework that no longer ships WP Rocket's integration does nothing for it, and WP Rocket goes back to writing .htaccess and setting WP_CACHE on its own. php artisan pollora:doctor warns when WP Rocket is active and this package is missing.
Development
composer install
composer qa # every gate of the Pollora harness
License
MIT, see LICENSE.