Skip to content

Commit

Permalink
Remove migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Carbis committed Oct 2, 2015
1 parent 6e91839 commit 76e809f
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 756 deletions.
32 changes: 0 additions & 32 deletions classes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class Admin {
*/
public $live_update;

/**
* @var Migrate
*/
public $migrate;

/**
* Menu page screen id
*
Expand Down Expand Up @@ -183,7 +178,6 @@ public function __construct( $plugin ) {
public function init() {
$this->network = new Network( $this->plugin );
$this->live_update = new Live_Update( $this->plugin );
$this->migrate = new Migrate( $this->plugin );
}

/**
Expand Down Expand Up @@ -394,32 +388,6 @@ public function admin_enqueue_scripts( $hook ) {
);
}

if ( $this->migrate->show_migrate_notice() ) {
$limit = absint( $this->migrate->limit );
$record_count = absint( $this->migrate->record_count );
$chunks = ceil( $record_count / $limit );
$estimated_time = ( $chunks > 1 ) ? round( ( $chunks * 5 ) / 60 ) : 0;
$migrate_time_message = ( $estimated_time > 1 ) ? sprintf( esc_html__( 'This will take about %d minutes.', 'stream' ), absint( $estimated_time ) ) : esc_html__( 'This could take a few minutes.', 'stream' );

wp_enqueue_script( 'wp-stream-migrate', $this->plugin->locations['url'] . 'ui/js/migrate.js', array( 'jquery' ), $this->plugin->get_version() );
wp_localize_script(
'wp-stream-migrate',
'wp_stream_migrate',
array(
'i18n' => array(
'migrate_process_title' => esc_html__( 'Migrating Stream Records', 'stream' ),
'ignore_migrate_title' => esc_html__( 'No Records Were Migrated', 'stream' ),
'migrate_process_message' => esc_html__( 'Please do not exit this page until the process has completed.', 'stream' ) . ' ' . esc_html( $migrate_time_message ),
'confirm_start_migrate' => ( $estimated_time > 1 ) ? sprintf( esc_html__( 'Please note: This process will take about %d minutes to complete.', 'stream' ), absint( $estimated_time ) ) : esc_html__( 'Please note: This process could take a few minutes to complete.', 'stream' ),
'confirm_migrate_reminder' => esc_html__( 'Please note: Your existing records will not appear in Stream until you have migrated them to your local database.', 'stream' ),
'confirm_ignore_migrate' => sprintf( esc_html__( 'Are you sure you want to lose all %s existing Stream records without migrating?', 'stream' ), number_format( $record_count ), ( $estimated_time > 1 && is_multisite() ) ? sprintf( esc_html__( 'about %d', 'stream' ), absint( $estimated_time ) ) : esc_html__( 'a few', 'stream' ) ),
),
'chunks' => absint( $chunks ),
'nonce' => wp_create_nonce( 'wp_stream_migrate-' . absint( get_current_blog_id() ) . absint( get_current_user_id() ) ),
)
);
}

/**
* The maximum number of items that can be updated in bulk without receiving a warning.
*
Expand Down
Loading

0 comments on commit 76e809f

Please sign in to comment.