| 开发者 | aixeiger |
|---|---|
| 更新时间 | 2026年9月21日 00:40 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
PIGCACHE_REDIS_* constants in wp-config.php.
Features:
db.php drop-in) with per-table invalidation, so writing to one table does not discard results that never read itwp-content/plugins/pigcache, or install through the WordPress plugins screen.advanced-cache.php drop-in from the same screen and add define( 'WP_CACHE', true ); to your wp-config.php. The plugin never edits wp-config.php for you.No. A reachable Redis server is required for the object cache (and for HTML/fragment features that use Redis).
PigCache includes its own drop-in and must not be used together with the separate “Redis Object Cache” plugin.
plugins_loaded, before init, and building the cron label touched a translation function that early. WordPress logs that as a notice, but because it is the very first byte of output in the entire request, every later header() call in that request then fails with "headers already sent" — which shows up as WordPress reporting unexpected output during activation, or the plugin being silently left deactivated. Cron registration now waits for init, like it always should have.insert_id could attach new rows to the wrong record.wp_cache_decr() could return negative values instead of clamping at zero as WordPress core does.DEFAULT on a TEXT column.INSERT/REPLACE statements written without the optional INTO keyword were not attributed to their table.wp pigcache-fw report command now strips control/escape bytes before printing request data (IP, User-Agent) to the terminal, and the recorded IP is validated as a well-formed address instead of trusted verbatim from the CF-Connecting-IP header.DATETIME ... DEFAULT CURRENT_TIMESTAMP, which MySQL only allows on DATETIME columns since 5.6.5 (older versions only allowed it on TIMESTAMP). On an older server the table silently failed to create, and worse, the very next activation queried a column on a table that didn't exist, which WordPress reported as unexpected output during activation on any install with WP_DEBUG on. The two Pro-only tables with the same pattern are fixed the same way. None of the three columns had a default anyway — the code that writes to them was already setting the value itself.CREATE TABLE string was silently turned into a bogus column by dbDelta(), producing a broken ALTER TABLE ADD COLUMN on every activation after the first. Explanatory comments about column definitions now live outside the SQL string.wp-config.php; the WP_CACHE snippet is shown in the admin screen instead.WP_PLUGIN_DIR / WPMU_PLUGIN_DIR when those constants are available.