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

Improve migration#119

Merged
westonruter merged 1 commit into
developfrom
improve/migration
Feb 24, 2017
Merged

Improve migration#119
westonruter merged 1 commit into
developfrom
improve/migration

Conversation

@PatelUtkarsh

Copy link
Copy Markdown
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

coveralls commented Feb 24, 2017

Copy link
Copy Markdown

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
Copy Markdown
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 ) ) );

Comment thread php/class-migrate.php
}

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

Copy link
Copy Markdown
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 ) ) );

Comment thread php/class-migrate.php
$success = $this->migrate_post( $id );
if ( $is_doing_cli ) {
if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );

Copy link
Copy Markdown
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 ) );

Comment thread php/class-migrate.php
if ( $success ) {
\WP_CLI::success( __( 'Migrated post', 'customize-snapshots' ) . ' ' . $id . '.' );
} else {
\WP_CLI::error( __( ' Failed to migrate', 'customize-snapshots' ) . ' ' . $id . '.' );

@valendesigns valendesigns Feb 24, 2017

Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants