Added dependency plugins

This commit is contained in:
Moris Zen
2018-06-25 00:00:37 +02:00
parent 720a1c31a4
commit f069f6782f
698 changed files with 289637 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
<?php
$licence = $this->get_licence_key();
?>
<div class="addons-tab content-tab">
<div class="addons-content">
<?php if ( ! empty( $licence ) && $this->is_pro ) : ?>
<p><?php _e( 'Fetching addon details, please wait...', 'wp-migrate-db' ); ?></p>
<?php else : ?>
<?php if ( $this->is_pro ) : ?>
<p class="inline-message warning">
<strong><?php _ex( 'Activate Your License', 'License must be activated to use addons', 'wp-migrate-db' ); ?></strong> &ndash; <?php _e( 'Please switch to the Settings tab and activate your license. If your license includes the addons below, you will be able to install them from here with one-click.', 'wp-migrate-db' ); ?>
</p>
<?php else: ?>
<p class="inline-message warning">
<strong><?php _ex( 'Get Addons', 'Addons are available with a developer license and better', 'wp-migrate-db' ); ?></strong> &ndash; <?php printf( __( 'The following addons are available with the WP Migrate DB Pro Developer license and better. Visit <a href="%s" target="_blank">deliciousbrains.com</a> to purchase in just a few clicks.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_content=addons-tab&utm_campaign=freeplugin' ); ?>
</p>
<?php endif; ?>
<article class="addon wp-migrate-db-pro-media-files">
<div class="desc">
<h1><?php _e( 'Media Files', 'wp-migrate-db' ); ?></h1>
<p><?php printf( __( 'Allows you to push and pull your files in the Media Library between two WordPress installs. It can compare both libraries and only migrate those missing or updated, or it can do a complete copy of one site\'s library to another. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/' ); ?></p>
</div>
</article>
<article class="addon wp-migrate-db-pro-cli">
<div class="desc">
<h1><?php _e( 'CLI', 'wp-migrate-db' ); ?></h1>
<p><?php printf( __( 'Integrates WP Migrate DB Pro with WP-CLI allowing you to run migrations from the command line: %s <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), '<code>wp migratedb &lt;push|pull&gt; &lt;url&gt; &lt;secret-key&gt;</code> <code>[--find=&lt;strings&gt;] [--replace=&lt;strings&gt;] ...</code>', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/' ); ?></p>
</div>
</article>
<article class="addon wp-migrate-db-pro-multisite-tools">
<div class="desc">
<h1><?php _e( 'Multisite Tools', 'wp-migrate-db' ); ?></h1>
<p><?php printf( __( 'Export a subsite as an SQL file that can then be imported as a single site install. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/' ); ?></p>
</div>
</article>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,17 @@
<?php
if ( count( $this->settings['profiles'] ) > 0 ) :
$profile_name = $is_default_profile ? _x( 'New Profile', 'Default profile loaded', 'wp-migrate-db' ) : $loaded_profile['name'];
?>
<div class="crumbs">
<a class="crumb" href="<?php echo $this->plugin_base; ?>" class="return-to-profile-selection clearfix">
<?php _e( 'Saved Profiles', 'wp-migrate-db' ); ?>
</a>
<span class="crumb"><?php echo esc_html( $profile_name ); ?></span>
</div>
<?php
endif;

View File

@@ -0,0 +1,11 @@
<?php
$value = ( isset( $value ) ) ? $value : $this->settings[$key];
$class = ( isset( $class ) ) ? 'class="' . $class . '"' : '';
$disabled = ( isset( $disabled ) && $disabled ) ? ' disabled' : '';
?>
<div id="<?php echo $key; ?>-wrap" data-checkbox="<?php echo $key; ?>" class="wpmdb-switch<?php echo $disabled . $value ? ' on' : ''; ?>">
<span class="on <?php echo $value ? 'checked' : ''; ?>">ON</span>
<span class="off <?php echo ! $value ? 'checked' : ''; ?>">OFF</span>
<input type="hidden" name="<?php echo $key; ?>" value="0" />
<input type="checkbox" name="<?php echo $key; ?>" value="1" id="<?php echo $key; ?>" <?php checked( $value ); ?> <?php echo $class ?>/>
</div>

View File

@@ -0,0 +1,46 @@
<tr class="wpmdb-setting-title">
<td colspan="2"><h3><?php _e( 'Compatibility', 'wp-migrate-db' ); ?></h3></td>
</tr>
<tr>
<td><?php $this->template( 'checkbox', 'common', array( 'key' => 'plugin-compatibility', 'value' => $plugin_compatibility_checked ) ); ?></td>
<td>
<h4>
<?php _e( 'Plugin Compatibility Mode', 'wp-migrate-db' ); ?> <a href="#" class="general-helper plugin-compatibility-helper js-action-link"></a>
<div class="plugin-compatibility-message helper-message bottom">
<?php _e( 'Some plugins add a lot of overhead to each request, requiring extra memory and CPU. And some plugins even interfere with migrations and cause them to fail. We recommend only loading plugins that affect migration requests, for example a plugin that hooks into WP Migrate DB.', 'wp-migrate-db' ); ?></br>
</div>
<span class="setting-status"></span>
</h4>
<p><?php _e( 'Avoid plugin conflicts and improve performance by not loading plugins for migration requests.', 'wp-migrate-db' ); ?></p>
</td>
</tr>
<tr class="plugin-compatibility-section">
<td colspan="2">
<div class="indent-wrap expandable-content plugin-compatibility-wrap select-wrap">
<select autocomplete="off" class="multiselect" id="selected-plugins" name="selected_plugins[]" multiple="multiple">
<?php
$blacklist = array_flip( (array) $this->settings['blacklist_plugins'] );
foreach ( get_plugins() as $key => $plugin ) {
if ( 0 === strpos( $key, 'wp-migrate-db' ) ) {
continue;
}
$selected = ( isset( $blacklist[ $key ] ) ) ? ' selected' : '';
printf( '<option value="%s"%s>%s</option>', $key, $selected, $plugin['Name'] );
}
?>
</select>
<br>
<a class="multiselect-select-all js-action-link" href="#"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a class="multiselect-deselect-all js-action-link" href="#"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a class="multiselect-invert-selection js-action-link" href="#"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
<p>
<span class="button plugin-compatibility-save"><?php _e( 'Save Changes', 'wp-migrate-db' ); ?></span>
</p>
</div>
</td>
</tr>

View File

@@ -0,0 +1,6 @@
<div class="debug">
<h3><?php _e( 'Diagnostic Info &amp; Error Log', 'wp-migrate-db' ); ?></h3>
<textarea class="debug-log-textarea" autocomplete="off" readonly></textarea>
<a href="<?php echo network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-download-log' ) . '&wpmdb-download-log=1' ); ?>" class="button"><?php _ex( 'Download', 'Download to your computer', 'wp-migrate-db' ); ?></a>
<a class="button clear-log js-action-link"><?php _e( 'Clear Error Log', 'wp-migrate-db' ); ?></a>
</div>

View File

@@ -0,0 +1,17 @@
<?php if ( $this->is_pro ) return; ?>
<tr class="option-section slider-outer-wrapper max-request-size">
<td colspan="2">
<div class="clearfix slider-label-wrapper">
<div class="slider-label"><span><?php _e( 'Maximum Request Size', 'wp-migrate-db' ); ?></span>
<a class="general-helper slider-helper js-action-link" href="#"></a>
<div class="slider-message helper-message">
<?php printf( __( 'We\'ve detected that your server supports requests up to %s, but it\'s possible that your server has limitations that we could not detect. To be on the safe side, we set the default to 1 MB, but you can try throttling it up to get better performance. If you\'re getting a 413 error or having trouble with time outs, try throttling this setting down.', 'wp-migrate-db' ), size_format( $this->get_bottleneck( 'max' ) ) ); ?>
</div>
</div>
<div class="amount"></div>
</div>
<div class="slider"></div>
</td>
</tr>

View File

@@ -0,0 +1,3 @@
<div class="help-tab content-tab">
<?php $this->template_part( array( 'wordpress_org_support', 'licence_info', 'debug_info', 'videos' ) ); ?>
</div> <!-- end .help-tab -->

View File

@@ -0,0 +1,26 @@
<div class="progress-content progress-overlay-container">
<span class="close-progress-content close-progress-content-button">&times;</span>
<div class="progress-wrapper-primary">
<div class="progress-info-wrapper clearfix">
<h2 class="progress-title"><?php _e( 'Please wait while migration is running…', 'wp-migrate-db' ); ?></h2>
<div class="progress-text"><?php _e( 'Establishing Connection', 'wp-migrate-db' ); ?></div>
<span class="timer">00:00:00</span>
</div>
</div>
<div class="stage-tabs"></div>
<div class="migration-progress-stages"></div>
<div class="migration-controls">
<span class="pause-resume button"><?php _ex( 'Pause', 'Temporarily stop migrating', 'wp-migrate-db' ); ?></span>
<span class="cancel button"><?php _ex( 'Cancel', 'Stop the migration', 'wp-migrate-db' ); ?></span>
<span class="pause-before-finalize">
<input id="pause-before-finalize" type="checkbox" name="pause_before_finalize" value="1" />
<label id="pause-before-finalize-label" for="pause-before-finalize">
<?php _e( 'Pause before replacing migrated tables', 'wp-migrate-db' ); ?>
</label>
</span>
</div>
</div> <!-- end .progress-content -->

View File

@@ -0,0 +1,379 @@
<?php
global $wpdb;
global $loaded_profile;
if ( isset( $_GET['wpmdb-profile'] ) ) {
$loaded_profile = $this->get_profile( $_GET['wpmdb-profile'] );
} else {
$loaded_profile = $this->default_profile;
}
$is_default_profile = isset( $loaded_profile['default_profile'] );
$convert_exclude_revisions = false;
$convert_post_type_selection = false;
if ( ! $is_default_profile ) {
if ( isset( $loaded_profile['exclude_revisions'] ) ) {
$convert_exclude_revisions = true;
}
/* We used to provide users the option of selecting which post types they'd like to migrate.
* We found that our wording for this functionality was a little confusing so we switched it to instead read "Exclude Post Types"
* Once we made the switch we needed a way of inverting their saved post type selection to instead exclude the select post types.
* This was required to make their select compatible with the new "exclude" wording.
* This is easy enough for "push" and "export" saved profile as we know which post types exist on the local system and
* can easily invert the selection. Pull saved profiles is a little trickier.
* $this->maybe_update_profile() is used to update deprecated profile options to their new values.
* At the time of page request $this->maybe_update_profile() cannot be used to update a pull profile as we don't know which
* post types exist on the remote machine. As such we invert this selection later using the $convert_post_type_selection flag below.
*/
if ( isset( $loaded_profile['post_type_migrate_option'] ) && 'migrate_select_post_types' == $loaded_profile['post_type_migrate_option'] && 'pull' == $loaded_profile['action'] ) {
$convert_post_type_selection = true;
}
$loaded_profile = $this->maybe_update_profile( $loaded_profile, $_GET['wpmdb-profile'] );
}
if ( false == $is_default_profile ) {
$loaded_profile = wp_parse_args( $loaded_profile, $this->default_profile );
}
$loaded_profile = wp_parse_args( $loaded_profile, $this->checkbox_options );
$breadcrumbs_params = array(
'loaded_profile' => $loaded_profile,
'is_default_profile' => $is_default_profile,
);
?>
<script type='text/javascript'>
var wpmdb_default_profile = <?php echo ( $is_default_profile ? 'true' : 'false' ); ?>;
<?php if ( isset( $loaded_profile['select_tables'] ) && ! empty( $loaded_profile['select_tables'] ) ) : ?>
var wpmdb_loaded_tables = <?php echo json_encode( $loaded_profile['select_tables'] ); ?>;
<?php endif; ?>
<?php if ( isset( $loaded_profile['select_post_types'] ) ) : ?>
var wpmdb_loaded_post_types = <?php echo json_encode( $loaded_profile['select_post_types'] ); ?>;
<?php endif; ?>
<?php if ( isset( $loaded_profile['select_backup'] ) && ! empty( $loaded_profile['select_backup'] ) ) : ?>
var wpmdb_loaded_tables_backup = <?php echo json_encode( $loaded_profile['select_backup'] ); ?>;
<?php endif; ?>
var wpmdb_convert_exclude_revisions = <?php echo ( $convert_exclude_revisions ? 'true' : 'false' ); ?>;
var wpmdb_convert_post_type_selection = <?php echo ( $convert_post_type_selection ? '1' : '0' ); ?>;
</script>
<div class="migrate-tab content-tab">
<form method="post" id="migrate-form" action="#migrate" enctype="multipart/form-data">
<?php $this->template( 'breadcrumbs', 'common', $breadcrumbs_params ); ?>
<div class="option-section">
<ul class="option-group migrate-selection">
<li>
<label for="savefile">
<input id="savefile" type="radio" value="savefile" name="action"<?php echo ( $loaded_profile['action'] == 'savefile' || ! $this->is_pro ) ? ' checked="checked"' : ''; ?> />
<?php _e( 'Export File', 'wp-migrate-db' ); ?>
</label>
<ul>
<li>
<label for="save_computer">
<input id="save_computer" type="checkbox" value="1" name="save_computer"<?php $this->maybe_checked( $loaded_profile['save_computer'] ); ?> />
<?php _e( 'Save as file to your computer', 'wp-migrate-db' ); ?>
</label>
</li>
<?php if ( $this->gzip() ) : ?>
<li>
<label for="gzip_file">
<input id="gzip_file" type="checkbox" value="1" name="gzip_file"<?php $this->maybe_checked( $loaded_profile['gzip_file'] ); ?> />
<?php _e( 'Compress file with gzip', 'wp-migrate-db' ); ?>
</label>
</li>
<?php endif; ?>
</ul>
</li>
<?php $this->template_part( array( 'pull_push_radio_buttons' ), $loaded_profile ); ?>
<li>
<label for="find_replace">
<input id="find_replace" type="radio" value="find_replace" name="action"<?php echo ( 'find_replace' === $loaded_profile['action'] ) ? ' checked="checked"' : ''; ?> />
<?php _e( 'Find & Replace', 'wp-migrate-db' ); ?><span class="option-description"><?php _e( 'Run a find & replace on this site\'s db', 'wp-migrate-db' ); ?></span>
</label>
</li>
</ul>
<div class="connection-info-wrapper clearfix">
<textarea class="pull-push-connection-info" name="connection_info" placeholder="<?php _e( 'Connection Info - Site URL &amp; Secret Key', 'wp-migrate-db' ); ?>"><?php echo esc_html( isset( $loaded_profile['connection_info'] ) ? $loaded_profile['connection_info'] : '' ); ?></textarea>
<br/>
<div class="basic-access-auth-wrapper clearfix">
<input type="text" name="auth_username" class="auth-username auth-credentials" placeholder="Username" autocomplete="off"/>
<input type="password" name="auth_password" class="auth-password auth-credentials" placeholder="Password" autocomplete="off"/>
</div>
<input class="button connect-button" type="submit" value="Connect" name="Connect" autocomplete="off"/>
</div>
<div class="notification-message warning-notice ssl-notice inline-message">
<strong><?php _e( 'SSL Disabled', 'wp-migrate-db' ); ?></strong> &mdash; <?php _e( 'We couldn\'t connect over SSL but regular http (no SSL) appears to be working so we\'ve switched to that. If you run a push or pull, your data will be transmitted unencrypted. Most people are fine with this, but just a heads up.', 'wp-migrate-db' ); ?>
</div>
<?php $this->template_part( array( 'invalid_licence_warning' ) ); ?>
</div>
<p class="connection-status"><?php _e( 'Please enter the connection information above to continue.', 'wp-migrate-db' ); ?></p>
<div class="notification-message error-notice directory-permission-notice inline-message" style="display: none;">
<strong><?php _e( 'Cannot Access Uploads Directory', 'wp-migrate-db' ); ?></strong> &mdash;
<?php
_e( 'We require write permissions to the standard WordPress uploads directory. Without this permission exports are unavailable. Please grant 755 permissions on the following directory:', 'wp-migrate-db' );
echo esc_html( $this->get_upload_info( 'path' ) );
?>
</div>
<div class="step-two">
<?php do_action( 'wpmdb_before_migration_options' ); ?>
<div class="option-section">
<div class="header-wrapper clearfix">
<div class="option-heading find-heading"><?php _ex( 'Find', 'Source text to be replaced', 'wp-migrate-db' ); ?></div>
<div class="option-heading replace-heading"><?php _ex( 'Replace', 'Text to replace in source', 'wp-migrate-db' ); ?></div>
</div>
<table id="find-and-replace-sort" class="clearfix replace-fields">
<tbody>
<tr class="replace-row original-repeatable-field">
<td class="sort-handle-col">
<span class="sort-handle"></span>
</td>
<td class="old-replace-col">
<input type="text" size="40" name="replace_old[]" class="code" placeholder="Old value" autocomplete="off" />
</td>
<td class="arrow-col" title="Copy Find to Replace">
<span class="right-arrow">&rarr;</span>
</td>
<td class="replace-right-col">
<input type="text" size="40" name="replace_new[]" class="code" placeholder="New value" autocomplete="off" />
</td>
<td class="row-action-buttons">
<span class="replace-remove-row" data-profile-id="0"></span>
</td>
</tr>
<?php if ( $is_default_profile ) : ?>
<tr class="replace-row<?php echo ( $this->lock_url_find_replace_row ) ? ' pin' : ''; ?>">
<td class="sort-handle-col">
<span class="sort-handle"></span>
</td>
<td class="old-replace-col">
<input type="text" size="40" name="replace_old[]" class="code" id="old-url" placeholder="Old URL" value="<?php echo esc_url( preg_replace( '#^https?:#', '', home_url() ) ); ?>" autocomplete="off"<?php echo ( $this->lock_url_find_replace_row ) ? ' readonly' : ''; ?> />
</td>
<td class="arrow-col" title="Copy Find to Replace">
<span class="right-arrow">&rarr;</span>
</td>
<td class="replace-right-col">
<input type="text" size="40" name="replace_new[]" class="code" id="new-url" placeholder="New URL" autocomplete="off" />
</td>
<td class="row-action-buttons">
<?php $style = $this->lock_url_find_replace_row ? 'display: none;' : ''; ?>
<span class="replace-remove-row" data-profile-id="0" style="<?php echo $style; ?>"></span>
<a href="#" class="general-helper domain-replace-helper js-action-link"></a>
<div class="domain-replace-info helper-message bottom">
<?php printf( __( 'This find & replace will find the domain name of your remote site and replace it with the domain name of this site. We\'ve left out the protocol so that both http:// and https:// will be found and replaced. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?>
</div>
</td>
</tr>
<tr class="replace-row">
<td class="sort-handle-col">
<span class="sort-handle"></span>
</td>
<td class="old-replace-col">
<input type="text" size="40" name="replace_old[]" class="code" id="old-path" placeholder="Old file path" value="<?php echo esc_attr( $this->get_absolute_root_file_path() ); ?>" autocomplete="off" />
</td>
<td class="arrow-col" title="Copy Find to Replace">
<span class="right-arrow">&rarr;</span>
</td>
<td class="replace-right-col">
<input type="text" size="40" name="replace_new[]" class="code" id="new-path" placeholder="New file path" autocomplete="off" />
</td>
<td class="row-action-buttons">
<span class="replace-remove-row" data-profile-id="0"></span>
<a href="#" class="general-helper path-replace-helper js-action-link"></a>
<div class="path-replace-info helper-message bottom">
<?php printf( __( 'This find and replace is mostly for 3rd party plugins that store the websites root file path in the database. This set of fields will ensure that these values are updated to the correct root file path during the migration. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?>
</div>
</td>
</tr>
<?php else :
$i = 1;
foreach ( $loaded_profile['replace_old'] as $replace_old ) : ?>
<tr class="replace-row<?php echo ( 1 == $i && $this->lock_url_find_replace_row ) ? ' pin' : ''; ?>">
<?php
$replace_new = ( ! empty( $loaded_profile['replace_new'][ $i ] ) ) ? $loaded_profile['replace_new'][ $i ] : '';
?>
<td class="sort-handle-col">
<span class="sort-handle"></span>
</td>
<td class="old-replace-col">
<input type="text" size="40" name="replace_old[]" class="code" placeholder="Old value" value="<?php echo esc_attr( $replace_old ); ?>" autocomplete="off"<?php echo ( 1 == $i && $this->lock_url_find_replace_row ) ? ' readonly' : ''; ?> />
</td>
<td class="arrow-col" title="Copy Find to Replace">
<span class="right-arrow">&rarr;</span>
</td>
<td class="replace-right-col">
<input type="text" size="40" name="replace_new[]" class="code" placeholder="New value" value="<?php echo esc_attr( $replace_new ); ?>" autocomplete="off" />
</td>
<td class="row-action-buttons">
<?php if ( ! $this->lock_url_find_replace_row || ( $this->lock_url_find_replace_row && $i != 1 ) ) : ?>
<span class="replace-remove-row" data-profile-id="0"></span>
<?php endif; ?>
</td>
</tr>
<?php
++$i;
endforeach; ?>
<?php endif; ?>
<tr class="pin">
<td colspan="4"><a class="button add-row">Add Row</a></td>
</tr>
</tbody>
</table>
<?php
$new_url_missing_warning = __( '<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative URL of the remote website in the "New URL" field or remove the whole row entirely. If you are unsure of what this URL should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' );
if ( $is_default_profile && $this->lock_url_find_replace_row ) {
$new_url_missing_warning = __( '<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative URL of the remote website in the "New URL" field. If you are unsure of what this URL should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' );
}
?>
<div id="new-url-missing-warning" class="warning inline-message missing-replace"><?php printf( $new_url_missing_warning, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?></div>
<div id="new-path-missing-warning" class="warning inline-message missing-replace"><?php printf( __( '<strong>New File Path Missing</strong> &mdash; Please enter the root file path of the remote website in the "New file path" field or remove the whole row entirely. If you are unsure of what the file path should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?></div>
</div>
<?php $this->template_part( array( 'select_tables', 'exclude_post_types' ), $loaded_profile ); ?>
<div class="option-section">
<div class="header-expand-collapse clearfix">
<div class="expand-collapse-arrow collapsed">&#x25BC;</div>
<div class="option-heading tables-header"><?php _e( 'Advanced Options', 'wp-migrate-db' ); ?></div>
</div>
<div class="indent-wrap expandable-content">
<ul>
<li>
<label for="replace-guids">
<input id="replace-guids" type="checkbox" value="1" name="replace_guids"<?php $this->maybe_checked( $loaded_profile['replace_guids'] ); ?> />
<?php _e( 'Replace GUIDs', 'wp-migrate-db' ); ?>
</label>
<a href="#" class="general-helper replace-guid-helper js-action-link"></a>
<div class="replace-guids-info helper-message">
<?php printf( __( 'Although the <a href="%s" target="_blank">WordPress Codex emphasizes</a> that GUIDs should not be changed, this is limited to sites that are already live. If the site has never been live, we recommend replacing the GUIDs. For example, you may be developing a new site locally at dev.somedomain.com and want to migrate the site live to somedomain.com.', 'wp-migrate-db' ), 'http://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note' ); ?>
</div>
</li>
<li>
<label for="exclude-spam">
<input id="exclude-spam" type="checkbox" autocomplete="off" value="1" name="exclude_spam"<?php $this->maybe_checked( $loaded_profile['exclude_spam'] ); ?> />
<?php _e( 'Exclude spam comments', 'wp-migrate-db' ); ?>
</label>
</li>
<li class="keep-active-plugins">
<label for="keep-active-plugins">
<input id="keep-active-plugins" type="checkbox" value="1" autocomplete="off" name="keep_active_plugins"<?php $this->maybe_checked( $loaded_profile['keep_active_plugins'] ); ?> />
<?php _e( 'Do not migrate the \'active_plugins\' setting (i.e. which plugins are activated/deactivated)', 'wp-migrate-db' ); ?>
</label>
</li>
<li>
<label for="exclude-transients">
<input id="exclude-transients" type="checkbox" value="1" autocomplete="off" name="exclude_transients"<?php $this->maybe_checked( $loaded_profile['exclude_transients'] ); ?> />
Exclude <a href="https://codex.wordpress.org/Transients_API" target="_blank">transients</a> (temporary cached data)
</label>
</li>
<li class="compatibility-older-mysql">
<label for="compatibility-older-mysql">
<input id="compatibility-older-mysql" type="checkbox" value="1" autocomplete="off" name="compatibility_older_mysql"<?php $this->maybe_checked( $loaded_profile['compatibility_older_mysql'] ); ?> />
<?php _e( 'Compatible with older versions of MySQL (pre-5.5)', 'wp-migrate-db' ); ?>
</label>
</li>
<?php $this->template_part( array( 'exclude_post_revisions' ), $loaded_profile ); ?>
</ul>
</div>
</div>
<?php $this->template_part( array( 'backup' ), $loaded_profile ); ?>
<?php do_action( 'wpmdb_after_advanced_options' ); ?>
<div class="option-section save-migration-profile-wrap">
<label for="save-migration-profile" class="save-migration-profile checkbox-label">
<input id="save-migration-profile" type="checkbox" value="1" name="save_migration_profile"<?php echo( ! $is_default_profile ? ' checked="checked"' : '' ); ?> />
<?php _e( 'Save Migration Profile', 'wp-migrate-db' ); ?><span class="option-description"><?php _e( 'Save the above settings for the next time you do a similiar migration', 'wp-migrate-db' ); ?></span>
</label>
<div class="indent-wrap expandable-content">
<ul class="option-group">
<?php
foreach ( $this->settings['profiles'] as $profile_id => $profile ) {
++ $profile_id;
?>
<li>
<span class="delete-profile" data-profile-id="<?php echo esc_attr( $profile_id ); ?>"></span>
<label for="profile-<?php echo esc_attr( $profile_id ); ?>">
<input id="profile-<?php echo esc_attr( $profile_id ); ?>" type="radio" value="<?php echo esc_attr( -- $profile_id ); ?>" name="save_migration_profile_option"<?php echo ( $loaded_profile['name'] == $profile['name'] ) ? ' checked="checked"' : ''; ?> />
<?php echo esc_html( $profile['name'] ); ?>
</label>
</li>
<?php
}
?>
<li>
<label for="create_new" class="create-new-label">
<input id="create_new" type="radio" value="new" name="save_migration_profile_option"<?php echo( $is_default_profile ? ' checked="checked"' : '' ); ?> />
<?php _e( 'Create new profile', 'wp-migrate-db' ); ?>
</label>
<input type="text" placeholder="e.g. Live Site" name="create_new_profile" class="create-new-profile"/>
</li>
</ul>
</div>
</div>
<div class="notification-message warning-notice prefix-notice pull">
<h4><?php _e( 'Warning: Different Table Prefixes', 'wp-migrate-db' ); ?></h4>
<p><?php _e( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in your local database with prefix "<span class="remote-prefix"></span>".', 'wp-migrate-db' ); ?></p>
<p><?php printf( __( 'However, your local install is configured to use table prefix "%1$s" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your local install\'s wp-config.php and change the "%1$s" variable to "<span class="remote-prefix"></span>".', 'wp-migrate-db' ), $wpdb->base_prefix, $wpdb->base_prefix ); ?></p>
<p><?php _e( 'This will allow your local install the use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
</div>
<div class="notification-message warning-notice prefix-notice push">
<h4><?php _e( 'Warning: Different Table Prefixes', 'wp-migrate-db' ); ?></h4>
<p><?php printf( __( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in the remote database with prefix "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
<p><?php printf( __( 'However, your remote install is configured to use table prefix "<span class="remote-prefix"></span>" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your remote install\'s wp-config.php and change the "<span class="remote-prefix"></span>" variable to "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
<p><?php _e( 'This will allow your remote install the use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
</div>
<div class="notification-message warning-notice mixed-case-table-name-notice pull">
<?php echo $this->mixed_case_table_name_warning( 'pull' ); ?>
</div>
<div class="notification-message warning-notice mixed-case-table-name-notice push">
<?php echo $this->mixed_case_table_name_warning( 'push' ); ?>
</div>
<p class="migrate-db">
<input type="hidden" class="remote-json-data" name="remote_json_data" autocomplete="off"/>
<input class="button-primary migrate-db-button" type="submit" value="<?php echo esc_attr_x( 'Export', 'Download a copy of the database', 'wp-migrate-db' ); ?>" name="Submit" autocomplete="off"/>
<input class="button save-settings-button" type="submit" value="<?php echo esc_attr_x( 'Save Profile', 'Save current migration settings', 'wp-migrate-db' ); ?>" name="submit_save_profile" autocomplete="off"/>
</p>
</div>
</form>
<?php $this->template( 'migrate-progress' ); ?>
<?php $this->template_part( array( 'progress_upgrade' ) ); ?>
</div> <!-- end .migrate-tab -->

View File

@@ -0,0 +1,9 @@
<div class="wrap wpmdb">
<?php /* This is a hack to get sitewide notices to appear above the visible title. https://github.com/deliciousbrains/wp-migrate-db-pro/issues/1436 */ ?>
<h1 style="display:none;"></h1>
<h1><?php echo esc_html( $this->get_plugin_title() ); ?></h1>
<p><?php printf( esc_html__( '%1$s only runs at the Network Admin level. As there is no Tools menu in the Network Admin, the %2$s menu item is located under Settings.', 'wp-migrate-db' ), esc_html( $this->get_plugin_title() ), sprintf( '"<a href="%s">%s</a>"', esc_url( network_admin_url( 'settings.php?page=' . $this->core_slug ) ), esc_html( $this->get_plugin_title() ) ) ); ?></p>
</div>

View File

@@ -0,0 +1,69 @@
<div class="wrap wpmdb">
<?php /* This is a hack to get sitewide notices to appear above the visible title. https://github.com/deliciousbrains/wp-migrate-db-pro/issues/1436 */ ?>
<h1 style="display:none;"></h1>
<div id="icon-tools" class="icon32"><br/></div>
<h1><?php echo $this->get_plugin_title(); ?></h1>
<h2 class="nav-tab-wrapper">
<?php $this->plugin_tabs(); ?>
</h2>
<?php do_action( 'wpmdb_notices' ); ?>
<?php
$hide_warning = apply_filters( 'wpmdb_hide_safe_mode_warning', false );
$safe_mode = ( function_exists( 'ini_get' ) && ini_get( 'safe_mode' ) );
if ( $safe_mode && ! $hide_warning ) {
?>
<div class="updated warning inline-message">
<?php
_e( "<strong>PHP Safe Mode Enabled</strong> &mdash; We do not officially support running this plugin in safe mode because <code>set_time_limit()</code> has no effect. Therefore we can't extend the run time of the script and ensure it doesn't time out before the migration completes. We haven't disabled the plugin however, so you're free to cross your fingers and hope for the best. However, if you have trouble, we can't help you until you turn off safe mode.", 'wp-migrate-db' );
if ( function_exists( 'ini_get' ) ) {
printf( __( 'Your current PHP run time limit is set to %s seconds.', 'wp-migrate-db' ), ini_get( 'max_execution_time' ) );
} ?>
</div>
<?php
}
?>
<div class="updated warning ie-warning inline-message" style="display: none;">
<?php _e( "<strong>Internet Explorer Not Supported</strong> &mdash; Less than 2% of our customers use IE, so we've decided not to spend time supporting it. We ask that you use Firefox or a Webkit-based browser like Chrome or Safari instead. If this is a problem for you, please let us know.", 'wp-migrate-db' ); ?>
</div>
<?php
$hide_warning = apply_filters( 'wpmdb_hide_set_time_limit_warning', false );
if ( false == $this->set_time_limit_available() && ! $hide_warning && ! $safe_mode ) {
?>
<div class="updated warning inline-message">
<?php
_e( "<strong>PHP Function Disabled</strong> &mdash; The <code>set_time_limit()</code> function is currently disabled on your server. We use this function to ensure that the migration doesn't time out. We haven't disabled the plugin however, so you're free to cross your fingers and hope for the best. You may want to contact your web host to enable this function.", 'wp-migrate-db' );
if ( function_exists( 'ini_get' ) ) {
printf( __( 'Your current PHP run time limit is set to %s seconds.', 'wp-migrate-db' ), ini_get( 'max_execution_time' ) );
} ?>
</div>
<?php
}
?>
<div id="wpmdb-main">
<?php
// select profile if more than > 1 profile saved
if ( ! empty( $this->settings['profiles'] ) && ! isset( $_GET['wpmdb-profile'] ) ) {
$this->template( 'profile' );
} else {
$this->template( 'migrate' );
}
$this->template( 'settings' );
$this->template( 'addons' );
$this->template( 'help' );
$this->template_part( array( 'sidebar' ) );
?>
</div>
<!-- end #wpmdb-main -->
</div> <!-- end .wrap -->

View File

@@ -0,0 +1,53 @@
<div class="option-section backup-options" style="display: block;">
<label for="create-backup" class="backup-checkbox checkbox-label">
<input type="checkbox" id="create-backup" value="1" autocomplete="off" name="create_backup"<?php $this->maybe_checked( $loaded_profile['create_backup'] ); ?> />
<span class="action-text pull"><?php _e( 'Backup the local database before replacing it', 'wp-migrate-db' ); ?></span>
<span class="action-text push"><?php _e( 'Backup the remote database before replacing it', 'wp-migrate-db' ); ?></span>
<span class="action-text find_replace"><?php _e( 'Backup the database before running the find &amp; replace', 'wp-migrate-db' ); ?></span>
<br/>
<span class="option-description backup-description"><?php _e( 'An SQL file will be saved to', 'wp-migrate-db' ); ?> <span class="uploads-dir"><?php echo $this->get_short_uploads_dir(); ?></span></span>
</label>
<div class="indent-wrap expandable-content">
<ul>
<li>
<label for="backup-only-with-prefix">
<input type="radio" id="backup-only-with-prefix" value="backup_only_with_prefix" name="backup_option"<?php echo( $loaded_profile['backup_option'] == 'backup_only_with_prefix' ? ' checked="checked"' : '' ); ?> >
<?php _e( 'Backup all tables with prefix', 'wp-migrate-db' ); ?> "<span class="backup-table-prefix"><?php echo $wpdb->base_prefix; ?></span>"
</label>
</li>
<li>
<label for="backup-selected">
<input type="radio" id="backup-selected" value="backup_selected" name="backup_option"<?php echo( $loaded_profile['backup_option'] == 'backup_selected' ? ' checked="checked"' : '' ); ?> >
<?php _e( 'Backup only tables selected for migration', 'wp-migrate-db' ); ?>
</label>
</li>
<li>
<label for="backup-manual-select">
<input type="radio" id="backup-manual-select" value="backup_manual_select" name="backup_option"<?php echo( $loaded_profile['backup_option'] == 'backup_manual_select' ? ' checked="checked"' : '' ); ?> >
<?php _e( 'Backup only selected tables below', 'wp-migrate-db' ); ?>
</label>
</li>
</ul>
<div class="backup-tables-wrap select-wrap">
<select multiple="multiple" name="select_backup[]" id="select-backup" class="multiselect">
<?php foreach ( $this->get_table_sizes( 'backup' ) as $table => $size ) :
$size = (int) $size * 1024;
if ( ! empty( $loaded_profile['select_backup'] ) && in_array( $table, $loaded_profile['select_backup'] ) ) {
printf( '<option value="%1$s" selected="selected">%1$s (%2$s)</option>', $table, size_format( $size ) );
} else {
printf( '<option value="%1$s">%1$s (%2$s)</option>', $table, size_format( $size ) );
}
endforeach; ?>
</select>
<br/>
<a href="#" class="multiselect-select-all js-action-link"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-deselect-all js-action-link"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-invert-selection js-action-link"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
</div>
</div>
<p class="backup-option-disabled inline-message error-notice notification-message" style="display: none;"><?php printf( __( 'The backup option has been disabled as your local uploads directory is currently not writeable. The following directory should have 755 permissions: <span class="upload-directory-location">%s</span></p>', 'wp-migrate-db' ), $this->get_upload_info( 'path' ) ); ?>
</div>

View File

@@ -0,0 +1,12 @@
<div class="updated warning inline-message">
<p>
<?php
printf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled which will prevent WP Migrate DB Pro from functioning properly. You should either disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add any sites that you\'d like to migrate to or from with WP Migrate DB Pro to <code>WP_ACCESSIBLE_HOSTS</code> (api.deliciousbrains.com must be added to <code>WP_ACCESSIBLE_HOSTS</code> for the API to work). More information on this can be found <a href="%s" target="_blank">here</a>.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/' );
?>
</p>
<?php
/* translators: 1: Remind Me Later, 2: Dismiss */
printf( _x( '%1$s | %2$s', 'Block External actions', 'wp-migrate-db' ), $reminder, $dismiss );
?>
</div>

View File

@@ -0,0 +1,17 @@
<tr class="wpmdb-setting-title">
<td colspan="2"><h3><?php _e( 'Connection Info', 'wp-migrate-db' ); ?></h3></td>
</tr>
<tr class="option-section connecton-info-wrap">
<td colspan="2">
<textarea id="connection_info" class="connection-info" readonly><?php echo $connection_info; ?></textarea>
<div class="reset-button-wrap clearfix">
<a class="button copy-api-key js-action-link">
<?php _e( 'Copy to Clipboard', 'wp-migrate-db' ); ?>
<span class="copy-api-key-confirmation"><?php _e( 'Copied', 'wp-migrate-db' ); ?></span>
</a>
<a class="button reset-api-key js-action-link"><?php _e( 'Reset Secret Key', 'wp-migrate-db' ); ?></a>
</div>
</td>
</tr>

View File

@@ -0,0 +1,40 @@
<div class="option-section" style="display: block;">
<label for="exclude-post-types" class="exclude-post-types-checkbox checkbox-label">
<input type="checkbox" id="exclude-post-types" value="1" autocomplete="off" name="exclude_post_types"<?php $this->maybe_checked( $loaded_profile['exclude_post_types'] ); ?> />
<?php _e( 'Exclude Post Types', 'wp-migrate-db' ); ?>
</label>
<div class="indent-wrap expandable-content post-type-select-wrap" style="display: none;">
<div class="select-post-types-wrap select-wrap">
<div class="exclude-post-types-warning" style="display: none; opacity: 0;">
<p>
<span class="migrate-msg"><?php _e( 'WARNING: All of the following post types will be absent in the destination posts table after migration:', 'wp-migrate-db' ); ?></span>
<span class="find-replace-msg"><?php _e( 'WARNING: The following post types will not be included in the find &amp; replace:', 'wp-migrate-db' ); ?></span>
<br>
<span class="excluded-post-types">
<?php
if ( ! empty( $loaded_profile['select_post_types'] ) ) {
echo '<code>' . implode( '</code>, <code>', array_map( 'esc_html', $loaded_profile['select_post_types'] ) ) . '</code>';
}
?>
</span>
</p>
</div>
<select multiple="multiple" name="select_post_types[]" id="select-post-types" class="multiselect" autocomplete="off">
<?php foreach ( $this->get_post_types() as $post_type ) :
if ( ! empty( $loaded_profile['select_post_types'] ) && in_array( $post_type, $loaded_profile['select_post_types'] ) ) {
printf( '<option value="%1$s" selected="selected">%1$s</option>', $post_type );
} else {
printf( '<option value="%1$s">%1$s</option>', $post_type );
}
endforeach; ?>
</select>
<br/>
<a href="#" class="multiselect-select-all js-action-link"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-deselect-all js-action-link"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-invert-selection js-action-link"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<div class="notification-message warning-notice inline-message invalid-licence">
<?php echo $this->get_licence_status_message(); ?>
</div>

View File

@@ -0,0 +1,12 @@
<div class="support">
<h3><?php _e( 'Email Support', 'wp-migrate-db' ); ?></h3>
<div class="support-content">
<?php if ( ! empty( $licence ) ) : ?>
<p><?php _e( 'Fetching license details, please wait...', 'wp-migrate-db' ); ?></p>
<?php else : ?>
<p><?php _e( 'We couldn\'t find your license information. Please switch to the settings tab and enter your license.', 'wp-migrate-db' ); ?></p>
<p><?php _e( 'Once completed, you may visit this tab to view your support details.', 'wp-migrate-db' ); ?></p>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,24 @@
<tr class="wpmdb-setting-title">
<td colspan="2"><h3><?php _e( 'Your License', 'wp-migrate-db' ); ?></h3></td>
</tr>
<tr class="licence-form option-section licence-wrap" method="post" action="#settings">
<td colspan="2">
<?php if ( $this->is_licence_constant() ) : ?>
<p>
<?php _e( 'The license key is currently defined in wp-config.php.', 'wp-migrate-db' ); ?>
</p>
<?php else : ?>
<?php if ( ! empty( $licence ) ) :
echo $this->get_formatted_masked_licence();
?>
<p class="licence-status"></p>
<?php else : ?>
<div class="licence-not-entered">
<input type="text" class="licence-input" autocomplete="off"/>
<button class="button register-licence" type="button"><?php _e( 'Activate License', 'wp-migrate-db' ); ?></button>
<p class="licence-status"></p>
</div>
<?php endif; ?>
<?php endif; ?>
</td>
</tr>

View File

@@ -0,0 +1,19 @@
<?php
foreach ( $this->addons as $addon_basename => $addon ) :
if ( false == $this->is_addon_outdated( $addon_basename ) || false == is_plugin_active( $addon_basename ) ) {
continue;
}
$update_url = wp_nonce_url( network_admin_url( 'update.php?action=upgrade-plugin&plugin=' . urlencode( $addon_basename ) ), 'upgrade-plugin_' . $addon_basename );
$addon_slug = current( explode( '/', $addon_basename ) );
if ( isset( $GLOBALS['wpmdb_meta'][ $addon_slug ]['version'] ) ) {
$version = ' (' . $GLOBALS['wpmdb_meta'][ $addon_slug ]['version'] . ')';
} else {
$version = '';
}
?>
<div class="updated warning inline-message">
<strong>Update Required</strong> &mdash;
<?php printf( __( 'The version of the %1$s addon you have installed%2$s is out-of-date and will not work with this version WP Migrate DB Pro. <a href="%3$s">Update Now</a>', 'wp-migrate-db' ), $addon['name'], $version, $update_url ); ?>
</div>
<?php
endforeach;

View File

@@ -0,0 +1,18 @@
<li class="pull-list">
<label for="pull"<?php echo ( $this->is_valid_licence() ) ? '' : ' class="disabled"'; ?>>
<input id="pull" type="radio" value="pull" name="action"<?php echo ( $loaded_profile['action'] == 'pull' && $this->is_pro ) ? ' checked="checked"' : ''; ?><?php echo ( $this->is_valid_licence() ) ? '' : ' disabled="disabled"'; ?> />
<?php _ex( 'Pull', 'Import data from remote database', 'wp-migrate-db' ); ?><span class="option-description"><?php _e( 'Replace this site\'s db with remote db', 'wp-migrate-db' ); ?></span>
</label>
<ul>
<li></li>
</ul>
</li>
<li class="push-list">
<label for="push"<?php echo ( $this->is_valid_licence() ) ? '' : ' class="disabled"'; ?>>
<input id="push" type="radio" value="push" name="action"<?php echo ( $loaded_profile['action'] == 'push' && $this->is_pro ) ? ' checked="checked"' : ''; ?><?php echo ( $this->is_valid_licence() ) ? '' : ' disabled="disabled"'; ?> />
<?php _ex( 'Push', 'Export data to remote database', 'wp-migrate-db' ); ?><span class="option-description"><?php _e( 'Replace remote db with this site\'s db', 'wp-migrate-db' ); ?></span>
</label>
<ul>
<li></li>
</ul>
</li>

View File

@@ -0,0 +1,54 @@
<tr class="wpmdb-setting-title">
<td colspan="2"><h3><?php _e( 'Request Settings', 'wp-migrate-db' ); ?></h3></td>
</tr>
<tr>
<td>
<?php $this->template( 'checkbox', 'common', array( 'key' => 'verify_ssl' ) ); ?>
</td>
<td>
<h4><?php _e( 'Certificate Verification', 'wp-migrate-db' ); ?> <a href="#" class="general-helper replace-guid-helper js-action-link"></a>
<div class="ssl-verify-message helper-message">
<?php _e( 'We disable SSL verification by default because a lot of people\'s environments are not setup for it to work. For example, with XAMPP, you have to manually enable OpenSSL by editing the php.ini. Without SSL verification, an HTTPS connection is vulnerable to a man-in-the-middle attack, so we do recommend you configure your environment and enable this.', 'wp-migrate-db' ); ?>
</div>
<span class="setting-status"></span>
</h4>
<p><?php _e( 'Verify the authenticity of the remote servers TLS certificate. ', 'wp-migrate-db' ); ?></p>
</td>
</tr>
<tr>
<td colspan="2">
<div class="slider-outer-wrapper max-request-size">
<div class="clearfix slider-label-wrapper">
<div class="slider-label"><span><?php _e( 'Maximum Request Size', 'wp-migrate-db' ); ?></span>
<a class="general-helper slider-helper js-action-link" href="#"></a>
<div class="slider-message helper-message">
<?php printf( __( 'We\'ve detected that your server supports requests up to %s, but it\'s possible that your server has limitations that we could not detect. To be on the safe side, we set the default to 1 MB, but you can try throttling it up to get better performance. If you\'re getting a 413 error or having trouble with time outs, try throttling this setting down.', 'wp-migrate-db' ), size_format( $this->get_bottleneck( 'max' ) ) ); ?>
</div>
</div>
<div class="amount"></div>
</div>
<div class="slider"></div>
</div>
</td>
</tr>
<tr class="option-section">
<td colspan="2">
<div class="slider-outer-wrapper delay-between-requests">
<div class="clearfix slider-label-wrapper">
<div class="slider-label"><span><?php _e( 'Delay Between Requests', 'wp-migrate-db' ); ?></span>
<a class="general-helper slider-helper js-action-link" href="#"></a>
<div class="slider-message helper-message">
<?php printf( __( 'Some servers have rate limits which the plugin can hit when performing migrations. If you\'re experiencing migration failures due to server rate limits, you should set this to one or more seconds to alleviate the problem.', 'wp-migrate-db' ) ); ?>
</div>
</div>
<div class="amount"></div>
</div>
<div class="slider"></div>
</div>
</td>
</tr>

View File

@@ -0,0 +1,9 @@
<div class="updated warning inline-message">
<strong><?php _e( 'Improve Security', 'wp-migrate-db' ); ?></strong> &mdash;
<?php printf( __( 'We have implemented a more secure method of secret key generation since your key was generated. We recommend you <a href="%s">visit the Settings tab</a> and reset your secret key.', 'wp-migrate-db' ), '#settings' ); ?>
<br/>
<?php
/* translators: 1: Remind Me Later, 2: Dismiss */
printf( _x( '%1$s | %2$s', 'Improve Security actions', 'wp-migrate-db' ), $reminder, $dismiss );
?>
</div>

View File

@@ -0,0 +1,50 @@
<div class="option-section">
<div class="header-expand-collapse clearfix">
<div class="expand-collapse-arrow collapsed">&#x25BC;</div>
<div class="option-heading tables-header"><?php _ex( 'Tables', 'Database tables', 'wp-migrate-db' ); ?></div>
</div>
<div class="indent-wrap expandable-content table-select-wrap" style="display: none;">
<ul class="option-group table-migrate-options">
<li>
<label for="migrate-only-with-prefix">
<input id="migrate-only-with-prefix" class="multiselect-toggle" type="radio" value="migrate_only_with_prefix" name="table_migrate_option"<?php echo( $loaded_profile['table_migrate_option'] == 'migrate_only_with_prefix' ? ' checked="checked"' : '' ); ?> />
<?php _e( 'Migrate all tables with prefix', 'wp-migrate-db' ); ?> "<span class="table-prefix"><?php echo esc_html( $wpdb->base_prefix ); ?></span>"
</label>
</li>
<li>
<label for="migrate-selected">
<input id="migrate-selected" class="multiselect-toggle show-multiselect" type="radio" value="migrate_select" name="table_migrate_option"<?php echo( $loaded_profile['table_migrate_option'] == 'migrate_select' ? ' checked="checked"' : '' ); ?> />
<?php _e( 'Migrate only selected tables below', 'wp-migrate-db' ); ?>
</label>
</li>
</ul>
<div class="select-tables-wrap select-wrap">
<select multiple="multiple" name="select_tables[]" id="select-tables" class="multiselect" autocomplete="off">
<?php
$table_sizes = $this->get_table_sizes();
$temp_prefix_length = strlen( $this->temp_prefix );
foreach ( $this->get_tables() as $table ) :
if( ! isset( $table_sizes[ $table ] ) || $this->temp_prefix === substr( $table, 0, $temp_prefix_length ) ) {
continue;
}
$size = (int) $table_sizes[ $table ] * 1024;
if ( ! empty( $loaded_profile['select_tables'] ) && in_array( $table, $loaded_profile['select_tables'] ) ) {
printf( '<option value="%1$s" selected="selected">%1$s (%2$s)</option>', esc_html( $table ), size_format( $size ) );
} else {
printf( '<option value="%1$s">%1$s (%2$s)</option>', esc_html( $table ), size_format( $size ) );
}
endforeach;
?>
</select>
<br/>
<a href="#" class="multiselect-select-all js-action-link"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-deselect-all js-action-link"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
<span class="select-deselect-divider">/</span>
<a href="#" class="multiselect-invert-selection js-action-link"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
</div>
</div>
</div>

View File

@@ -0,0 +1,19 @@
<tr class="wpmdb-setting-title">
<td colspan="2"><h3><?php _e( 'Permissions', 'wp-migrate-db' ); ?></h3></td>
</tr>
<tr>
<td><?php $this->template( 'checkbox', 'common', array( 'key' => 'allow_pull' ) ); ?></td>
<td>
<h4><?php _e( 'Pull', 'wp-migrate-db' ); ?> <span class="setting-status"></span></h4>
<p><?php _e( 'Process requests to pull data from this install, copying it elsewhere.', 'wp-migrate-db' ); ?></p>
</td>
</tr>
<tr class="option-section">
<td><?php $this->template( 'checkbox', 'common', array( 'key' => 'allow_push' ) ); ?></td>
<td>
<h4><?php _e( 'Push', 'wp-migrate-db' ); ?> <span class="setting-status"></span></h4>
<p><?php _e( 'Process requests to push data to this install, overwriting its data.', 'wp-migrate-db' ); ?></p>
</td>
</tr>

View File

@@ -0,0 +1,19 @@
<div class="videos">
<h3><?php _ex( 'Videos', 'Tutorial videos', 'wp-migrate-db' ); ?></h3>
<iframe class="video-viewer" style="display: none;" width="640" height="360" src="" frameborder="0" allowfullscreen></iframe>
<ul>
<?php foreach ( $videos as $id => $video ) : ?>
<li class="video" data-video-id="<?php echo $id; ?>">
<a href="//www.youtube.com/watch?v=<?php echo $id; ?>" target="_blank"><img src="//img.youtube.com/vi/<?php echo $id; ?>/0.jpg" alt=""/></a>
<h4><?php echo $video['title']; ?></h4>
<p>
<?php echo $video['desc']; ?>
</p>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@@ -0,0 +1,17 @@
<div class="migrate-tab content-tab">
<p class="saved-migration-profile-label"><?php _e( 'Would you like to use a saved migration profile?', 'wp-migrate-db' ); ?></p>
<ul class="migration-profile-options">
<?php
foreach ( $this->settings['profiles'] as $key => $profile ) {
++ $key
?>
<li>
<a href="<?php echo $this->plugin_base . '&wpmdb-profile=' . $key; ?>"><?php printf( '%s - %s', $key, esc_html( $profile['name'] ) ); ?></a>
<span class="main-list-delete-profile-link" data-profile-id="<?php echo $key; ?>">&times;</span>
</li>
<?php } ?>
<li>
<a href="<?php echo $this->plugin_base . '&wpmdb-profile=-1'; ?>"><?php _e( 'Nope, let\'s start fresh...', 'wp-migrate-db' ); ?></a>
</li>
</ul>
</div>

View File

@@ -0,0 +1,7 @@
<div class="settings-tab content-tab">
<form method="post" id="settings-form" action="#settings" autocomplete="off">
<table class="form-table">
<?php $this->template_part( array( 'connection_info', 'toggle_remote_requests', 'licence', 'request_settings', 'compatibility', 'max_request_size' ) ); ?>
</table>
</form>
</div> <!-- end .settings-tab -->