🌐 US-Proxy
class="wp-singular plugin-template-default single single-plugin postid-86451 wp-embed-responsive wp-theme-wporg-parent-2021 wp-child-theme-pubwporg-plugins-2024 no-js">

OPcache Reset

Beskrivning

This plugin clears OPcache after updating WordPress core, themes, and files.
Unlike other plugins, it is also compatible with WordPress updates made by Linux cron.

Features

  • Automatic OPcache reset after plugin/theme/core updates
  • Clears both memory-based and file-based OPcache
  • Works with cron-based WordPress updates (CLI context)
  • WP-CLI commands for manual OPcache management
  • Zero external dependencies and no shell commands

Configuration

The plugin works automatically for web-based updates. For CLI-based updates (cron, WP-CLI), configure your PHP-FPM socket:

Create a CacheTool-compatible .cachetool.yml in your WordPress root:

adapter: fastcgi
fastcgi: /run/php-fpm/www.sock

WP-CLI Commands

Reset OPcache from the command line:

wp opcache reset

Show OPcache status and statistics:

wp opcache status

Output status as JSON:

wp opcache status --format=json

Recensioner

27 maj 2019
This almost what I have been looking for. The OPCache is also reset when installing new plugins, but not when deinstalling.
Läs 1 betyg

Bidragsgivare och utvecklare

”OPcache Reset” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”OPcache Reset” har översatts till 1 språk. Tack till översättarna för deras bidrag.

Översätt ”OPcache Reset” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.

Ändringslogg

2.4.1

  • Reset PHP-FPM OPcache from cron and WP-CLI without shell_exec or a CacheTool binary
  • Replace shell-based file cache cleanup with native PHP filesystem operations
  • Improve FastCGI configuration, response validation, and error handling
  • Add direct-access protection and prefix internal functions and constants
  • Exclude development-only hidden files from release packages
  • Add disabled-shell_exec regression coverage

2.4.0

  • Added WP-CLI commands: wp opcache reset and wp opcache status
  • Added direct FastCGI communication (no cachetool dependency required)
  • Added support for cachetool.yml configuration format
  • Added end-to-end FastCGI testing
  • Improved test coverage (34 tests)

2.3.0

  • Added comprehensive Docker-based integration test suite (27 tests)
  • Added GitHub Actions CI for linting and testing
  • Added PHPStan and PHPCS for code quality
  • Improved OPcache reset verification with validate_timestamps=0 testing
  • Added pre-commit hooks for automated code checks
  • Updated plugin assets (icons, banners)

2.2.0

  • Added support for file-based OPcache clearing with race condition handling
  • Improved cachetool invocation with proper PATH handling

2.1.2

  • No calling cachetool opcache:reset for setups with only file cache

2.1.0

  • Handle file OPcaches in a consistent fashion

2.0.0

  • Handle file OPCaches

1.0.0

  • Initial release.