WP-CLI: Check option caches
Quick links: Using | Installing | Contributing | Support
This package implements the following commands:
Check cache values for all options, excluding transients
wp option-cache diagnostic [--per-page=<per-page>] [--page=<page>] [--hide-notoptions] [--format=<format>]
Defaults to first 1000 options.
OPTIONS
[--per-page=<per-page>]
Number of options from database to list. 'notoptions' are not counted
and are always displayed. Default: 1000
[--page=<page>]
Page of results
[--hide-notoptions]
Hide notoptions output. Default: Hidden after page 2
[--format=<format>]
Format to use for the output. One of table, csv or json.
---
default: table
options:
- table
- json
- csv
- yaml
- count
---
EXAMPLES
$ wp option-cache diagnostic
# example output truncated
+-------------------+-----------+------------------+--------------------+--------------------+-----------------------------+
| option_name | autoload | db | alloptions_cache | options_cache | note |
+-------------------+-----------+------------------+--------------------+--------------------+-----------------------------+
| siteurl | yes | https://test.com | https://test.com | | OK: Cache is match |
| home | yes | https://test.com | https://test.com | | OK: Cache is match |
| blogname | yes | Test Blog | Test Blog | Cool Blog | 🚨 WRONG CACHE |
| testing_notoption | yes | bacon | bacon | | 🚨 Found in NOTOPTIONS |
| moderation_keys | no | | | | OK: Cache is unset |
| recently_edited | no | | | | OK: Cache is unset |
| testing | no | somevalue | | somedifferentvalue | 🚨 CACHE MISMATCH |
| site_logo | NOTOPTION | -- | -- | -- | |
| testing_notoption | NOTOPTION | -- | -- | -- | 🚨 NOTOPTION is real option |
+-------------------+-----------+------------------+--------------------+--------------------+-----------------------------+
Compare cache and db value for given option
wp option-cache compare <option-name> [--format=<format>]
OPTIONS
<option-name>
Option name to compare
[--format=<format>]
Format to use for the output. One of table, csv or json.
---
default: table
options:
- table
- json
- csv
- yaml
- count
---
EXAMPLES
$ wp option-cache compare home
+-----------------------------+-----------------+-----------------------------+-------------------------+---------------+--------------------------+------------------+
| database value | should autoload | alloptions cache | alloptions cache health | options cache | options cache health | notoptions cache |
+-----------------------------+-----------------+-----------------------------+-------------------------+---------------+--------------------------+------------------+
| http://local.wordpress.test | 1 | http://local.wordpress.test | ✅ match | asdf | ❓ should not be present | ✅ not present |
+-----------------------------+-----------------+-----------------------------+-------------------------+---------------+--------------------------+------------------+
Installing this package requires WP-CLI v2.1 or greater. Update to the latest stable release with wp cli update
.
Once you've done so, you can install the latest stable version of this package with:
wp package install trepmal/option-cache-cli:@stable
To install the latest development version of this package, use the following command instead:
wp package install trepmal/option-cache-cli:dev-master
We appreciate you taking the initiative to contribute to this project.
Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
For a more thorough introduction, check out WP-CLI's guide to contributing. This package follows those policy and guidelines.
Think you’ve found a bug? We’d love for you to help us get it fixed.
Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.
Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, review our bug report documentation.
Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.
Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience. See "Setting up" for details specific to working on this package locally.
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support
This README.md is generated dynamically from the project's codebase using wp scaffold package-readme
(doc). To suggest changes, please submit a pull request against the corresponding part of the codebase.