Recent

Cache_Command class Pro only

Cache_Command

Cache management commands for CRP.

Namespace: WebberZone\Contextual_Related_Posts\Pro\CLI
Since: 4.2.0
Source: includes/cli/class-cache-command.php line 26 Extends: Base_Command

Methods

clear()

Clear the CRP cache.

OPTIONS

[—post-id=] : Clear cache for specific post ID only. Multiple IDs can be comma-separated.

[—force] : Force cache clearing without confirmation.

[—verbose] : Show detailed output.

[—url=] : Specific site URL to clear cache for (multisite only).

[—network] : Clear cache on all sites in the network.

[—blog-id=] : Specific blog ID to clear cache for (multisite only).

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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

warm()

Warm up the cache for specific posts.

OPTIONS

[—post-ids=] : Comma-separated list of post IDs to warm cache for.

[—post-type=] : Specific post type to process. Default: post.

[—limit=] : Number of posts to process. Default: 100.

[—recent=] : Warm cache for the most recent N posts.

[—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=] : Batch size for processing. Default: 50.

[—url=] : Specific site URL to warm cache for (multisite only).

[—network] : Warm cache on all sites in the network.

[—blog-id=] : Specific blog ID to warm cache for (multisite only).

[—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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

enable()

Enable cache for CRP.

OPTIONS

[—type=] : Type of cache to enable. Options: posts, html, all. Default: posts.

[—url=] : Specific site URL to enable cache for (multisite only).

[—network] : Enable cache on all sites in the network.

[—blog-id=] : Specific blog ID to enable cache for (multisite only).

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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

disable()

Disable cache for CRP.

OPTIONS

[—type=] : Type of cache to disable. Options: posts, html, all. Default: all.

[—url=] : Specific site URL to disable cache for (multisite only).

[—network] : Disable cache on all sites in the network.

[—blog-id=] : Specific blog ID to disable cache for (multisite only).

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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

keys()

Show cache keys for posts.

OPTIONS

[—post-id=] : Comma-separated list of post IDs to show cache keys for.

[—url=] : Show cache keys for posts on specific site URL (multisite only).

[—blog-id=] : Specific blog ID to show cache keys for (multisite only).

[—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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

cleanup()

Clean up expired cache entries.

OPTIONS

[—url=] : Specific site URL to clean up cache for (multisite only).

[—network] : Clean up cache on all sites in the network.

[—blog-id=] : Specific blog ID to clean up cache for (multisite only).

[—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;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void