Skip to content

Commit 1c2825d

Browse files
committed
Deploying version 1.0.5
1 parent 7597efe commit 1c2825d

File tree

12 files changed

+340
-421
lines changed

12 files changed

+340
-421
lines changed

asset/build/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/build/js/bundle-104.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

asset/build/js/bundle-104.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

asset/build/js/bundle-105.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/build/js/bundle-105.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

class/wpmdb-base.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ function __construct( $plugin_file_path ) {
9090
'error',
9191
'state_data',
9292
'is_pro',
93-
'default_profile'
93+
'default_profile',
94+
'doing_cli_migration',
9495
);
9596

9697
//Setup strings for license responses
@@ -261,7 +262,7 @@ function pro_addon_construct() {
261262
),
262263
'wp-migrate-db-pro-theme-plugin-files/wp-migrate-db-pro-theme-plugin-files.php' => array(
263264
'name' => 'Theme & Plugin Files',
264-
'required_version' => '1.0.2',
265+
'required_version' => '1.0.3',
265266
),
266267
);
267268

class/wpmdb-replace.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ function recursive_unserialize_replace( $data, $serialized = false, $parent_seri
243243
return $pre;
244244
}
245245

246+
// Some options contain serialized self-references which leads to memory exhaustion. Skip these.
247+
if ( $this->table_is( 'options' ) && 'option_value' === $this->get_column() && is_serialized( $data ) ) {
248+
if ( preg_match( '/r\:\d+/i', $data ) ) {
249+
return $data;
250+
}
251+
}
252+
246253
$is_json = false;
247254
$before_fired = false;
248255
$successive_filter = $filtered;

class/wpmdb.php

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ function __construct( $plugin_file_path ) {
5656
add_action( 'wp_ajax_wpmdb_finalize_migration', array( $this, 'ajax_finalize_migration' ) );
5757
add_action( 'wp_ajax_wpmdb_flush', array( $this, 'ajax_flush' ) );
5858
add_action( 'wp_ajax_nopriv_wpmdb_flush', array( $this, 'ajax_nopriv_flush', ) );
59-
add_action( 'wpmdb_initiate_migration', array( $this, 'log_migration_event'), 100 );
6059

6160
$this->accepted_fields = array(
6261
'action',
@@ -3987,93 +3986,4 @@ function mixed_case_table_name_warning( $migration_type ) {
39873986
return wptexturize( ob_get_clean() );
39883987
}
39893988

3990-
function log_migration_event( $state_data ) {
3991-
if ( true !== $this->settings['allow_tracking'] ) {
3992-
return false;
3993-
}
3994-
// TODO refactor into separate class so we can build free without this code
3995-
// TODO don't run while testing?
3996-
$api_url = apply_filters( 'wpmdb_logging_endpoint_url', 'https://api2.deliciousbrains.com/event' );
3997-
3998-
$log_data = array(
3999-
'local_timestamp' => time(),
4000-
'licence_key' => $this->get_licence_key(),
4001-
'cli' => $this->doing_cli_migration,
4002-
'setting-compatibility_plugin_installed' => $this->filesystem->file_exists( $this->mu_plugin_dest ),
4003-
);
4004-
4005-
foreach ( $this->parse_migration_form_data( $state_data['form_data'] ) as $key => $val ) {
4006-
if ( 'connection_info' === $key ) {
4007-
continue;
4008-
}
4009-
$log_data[ 'profile-' . $key ] = $val;
4010-
}
4011-
4012-
foreach ( $this->settings as $key => $val ) {
4013-
if ( 'profiles' === $key || 'key' === $key ) {
4014-
continue;
4015-
}
4016-
$log_data[ 'setting-' . $key ] = $val;
4017-
}
4018-
4019-
foreach ( $GLOBALS['wpmdb_meta'] as $plugin => $arr ) {
4020-
$log_data[ $plugin . '-active' ] = true;
4021-
$log_data[ $plugin . '-version' ] = $arr['version'];
4022-
}
4023-
4024-
foreach ( $state_data['site_details'] as $site => $info ) {
4025-
$log_data[ $site . '-site_url' ] = $info['site_url'];
4026-
$log_data[ $site . '-home_url' ] = $info['home_url'];
4027-
$log_data[ $site . '-prefix' ] = $info['prefix'];
4028-
4029-
$log_data[ $site . '-is_multisite' ] = $info['is_multisite'];
4030-
4031-
if ( isset( $info['subsites'] ) && is_array( $info['subsites'] ) ) {
4032-
$log_data[ $site . '-subsite_count' ] = count( $info['subsites'] );
4033-
}
4034-
4035-
$log_data[ $site . '-is_subdomain_install' ] = $info['is_subdomain_install'];
4036-
}
4037-
4038-
foreach ( $log_data as $key => $val ) {
4039-
if ( strstr( $key, 'count' ) || is_array( $val ) ) {
4040-
continue;
4041-
}
4042-
if ( '1' === $val ) {
4043-
$log_data[ $key ] = true;
4044-
continue;
4045-
}
4046-
if ( '0' === $val ) {
4047-
$log_data[ $key ] = false;
4048-
continue;
4049-
}
4050-
if ( 'true' === $val ) {
4051-
$log_data[ $key ] = true;
4052-
continue;
4053-
}
4054-
if ( 'false' === $val ) {
4055-
$log_data[ $key ] = false;
4056-
continue;
4057-
}
4058-
}
4059-
4060-
$remote_post_args = array(
4061-
'blocking' => false,
4062-
'timeout' => 60,
4063-
'method' => 'POST',
4064-
'headers' => array( 'Content-Type' => 'application/json' ),
4065-
'body' => json_encode( $log_data ),
4066-
);
4067-
$result = wp_remote_post( $api_url, $remote_post_args );
4068-
4069-
if ( is_wp_error( $result ) ) {
4070-
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
4071-
error_log( 'Error logging migration event' );
4072-
error_log( print_r( $result, 1 ) );
4073-
}
4074-
$this->log_error( 'Error logging Migration event', $result );
4075-
}
4076-
4077-
return true;
4078-
}
40793989
}

0 commit comments

Comments
 (0)