Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Improve migration #119

Merged
merged 1 commit into from Feb 24, 2017
Merged

Improve migration #119

merged 1 commit into from Feb 24, 2017

Conversation

PatelUtkarsh
Copy link
Member

change wp_update_post to update via $wpdb to skip extra hooks,
change ajax limit to 5 to avoid large snapshot migration timeouts,
improve migration verbosity.

change wp_update_post to update via $wpdb to skip extra hooks,
change ajax limit to 5 to avoid large snapshot migration timeouts,
improve migration verbosity.
@coveralls
Copy link

coveralls commented Feb 24, 2017

Coverage Status

Coverage decreased (-0.2%) to 76.769% when pulling ecfd2a5 on improve/migration into cd5a18f on develop.

\WP_CLI::success( count( $ids ) . ' ' . __( 'posts migrated:', 'customize-snapshots' ) . ' ' . implode( ',', $ids ) );
$ids = $migrate_obj->changeset_migrate( -1, true );
\WP_CLI::success( __( 'Posts migrated:', 'customize-snapshots' ) . ' ' . implode( ',', $ids ) );
\WP_CLI::success( 'Total ' . count( $ids ) . ' ' . __( 'posts migrated.', 'customize-snapshots' ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the string to something like this:

\WP_CLI::success( sprintf( __( 'Total posts migrated: %s', 'customize-snapshots' ), count( $ids ) ) );

@@ -122,6 +123,10 @@ public function changeset_migrate( $limit = -1, $dry_run = false ) {
return $query->posts;
}

if ( $is_doing_cli ) {
\WP_CLI::log( __( 'Migrating', 'customize-snapshots' ) . ' ' . count( $query->posts ) . __( ' snapshots into changeset', 'customize-snapshots' ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:

\WP_CLI::log( sprintf( __( 'Migrating %s Snapshots into Changeset', 'customize-snapshots' ), count( $query->posts ) ) );

$success = $this->migrate_post( $id );
if ( $is_doing_cli ) {
if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:

\WP_CLI::success( sprintf( __( 'Migrated post %s.', 'customize-snapshots' ), $id ) );

if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );
} else {
\WP_CLI::error( __( ' Failed to migrate', 'customize-snapshots' ) . ' ' . $id . '.' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:

\WP_CLI::error( sprintf( __( 'Failed to migrate post %s.', 'customize-snapshots' ), $id ) );

@westonruter westonruter merged commit dbee0d5 into develop Feb 24, 2017
@westonruter
Copy link
Contributor

Woops! Sorry @valendesigns. @PatelUtkarsh please follow-up with a new PR to address ☝️ feedback.

@westonruter westonruter modified the milestone: 0.6.0 Jul 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants