Recent

Database_Command class Pro only

Database_Command

Database management commands for CRP.

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

Methods

migrate_meta()

Migrate meta data from crp_post_meta array to individual crp* keys.

OPTIONS

[—dry-run] : Show what would be migrated without making changes.

[—force] : Force migration even if already completed.

[—verbose] : Show detailed error messages.

[—batch-size=] : Number of posts to process in each batch. Default: 100.

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

[—network] : Migrate meta on all sites in the network.

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

EXAMPLES

wp crp db migrate-meta --dry-run
wp crp db migrate-meta --batch-size=50
wp crp db migrate-meta --force --verbose
wp crp db migrate-meta --network
wp crp db migrate-meta --blog-id=2
wp crp db migrate-meta --url=http://example.com/site2

Line: 70

public function migrate_meta( array $args, array $assoc_args ): void;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

rollback_meta()

Rollback migration from individual crp* keys back to crp_post_meta array.

DEPRECATED

This command is deprecated and will be removed in a future version. It rolls back to the legacy crp_post_meta array storage format.

OPTIONS

[—dry-run] : Show what would be rolled back without making changes.

[—verbose] : Show detailed error messages.

[—batch-size=] : Number of posts to process in each batch. Default: 100.

[—network] : Rollback meta on all sites in the network.

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

[—force] : Force rollback without confirmation.

EXAMPLES

wp crp db rollback-meta --dry-run
wp crp db rollback-meta --batch-size=50
wp crp db rollback-meta --network
wp crp db rollback-meta --blog-id=2
wp crp db rollback-meta --force

Line: 193

public function rollback_meta( array $args, array $assoc_args ): void;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void

status()

Show database migration status.

OPTIONS

[—format=] : Output format (table, json, csv). Default: table.

[—network] : Show status for all sites in the network.

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

EXAMPLES

wp crp db status
wp crp db status --format=json
wp crp db status --network
wp crp db status --blog-id=2

Line: 306

public function status( array $args, array $assoc_args ): void;
TypeNameDescription
array$argsCommand arguments.
array$assoc_argsCommand associative arguments.

Returns: void