Cache_Command
Cache management commands for CRP.
Namespace: WebberZone\Contextual_Related_Posts\Pro\CLI
Since: 4.2.0
Source: includes/pro/cli/class-cache-command.php line 26
Extends: Base_Command
Methods
clear()
Clear the CRP cache.
OPTIONS
[–post-id=
[–force] : Force cache clearing without confirmation.
[–verbose] : Show detailed output.
[–url=
[–network] : Clear cache on all sites in the network.
[–blog-id=
EXAMPLES
wp crp cache clear
wp crp cache clear --post-id=123
wp crp cache clear --post-id=1,2,3
wp crp cache clear --force
wp crp cache clear --verbose
wp crp cache clear --network
wp crp cache clear --blog-id=2
wp crp cache clear --url=http://example.com/site2
Line: 75
public function clear( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void
warm()
Warm up the cache for specific posts.
OPTIONS
[–post-ids=
[–post-type=
[–limit=
[–recent=
[–all] : Warm cache for all posts.
[–popular] : Warm cache for popular posts (by comment count).
[–html] : Warm HTML cache instead of posts cache. This will call the related_posts() function.
[–batch-size=
[–url=
[–network] : Warm cache on all sites in the network.
[–blog-id=
[–force] : Force override existing lock file.
[–dry-run] : Show what would be processed without making changes.
[–verbose] : Show detailed output.
EXAMPLES
wp crp cache warm --post-ids=1,2,3
wp crp cache warm --post-type=page --limit=50
wp crp cache warm --recent=10
wp crp cache warm --all
wp crp cache warm --popular --limit=100
wp crp cache warm --all --network
wp crp cache warm --post-ids=1,2,3 --html
wp crp cache warm --all --html --network
wp crp cache warm --all --blog-id=2
wp crp cache warm --all --url=http://example.com/site2
wp crp cache warm --dry-run
Line: 199
public function warm( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void
enable()
Enable cache for CRP.
OPTIONS
[–type=
[–url=
[–network] : Enable cache on all sites in the network.
[–blog-id=
EXAMPLES
wp crp cache enable
wp crp cache enable --type=html
wp crp cache enable --type=all
wp crp cache enable --network
wp crp cache enable --url=http://example.com/site2
Line: 374
public function enable( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void
disable()
Disable cache for CRP.
OPTIONS
[–type=
[–url=
[–network] : Disable cache on all sites in the network.
[–blog-id=
EXAMPLES
wp crp cache disable
wp crp cache disable --type=html
wp crp cache disable --type=posts
wp crp cache disable --network
wp crp cache disable --url=http://example.com/site2
Line: 441
public function disable( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void
keys()
Show cache keys for posts.
OPTIONS
[–post-id=
[–url=
[–blog-id=
[–verbose] : Show detailed output including cache values.
EXAMPLES
wp crp cache keys
wp crp cache keys --post-id=123
wp crp cache keys --post-id=123,456,789
wp crp cache keys --url=http://example.com/site2
wp crp cache keys --verbose
Line: 589
public function keys( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void
cleanup()
Clean up expired cache entries.
OPTIONS
[–url=
[–network] : Clean up cache on all sites in the network.
[–blog-id=
[–dry-run] : Show what would be cleaned without making changes.
[–verbose] : Show detailed output.
EXAMPLES
wp crp cache cleanup
wp crp cache cleanup --network
wp crp cache cleanup --dry-run
Line: 712
public function cleanup( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Command arguments. |
array |
$assoc_args |
Command associative arguments. |
Returns: void