mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Merge branch 'master' of https://github.com/ultimatemember/ultimatemember
This commit is contained in:
@@ -534,9 +534,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
|
||||
|
||||
function need_upgrade() {
|
||||
if ( ! empty( UM()->admin_upgrade()->necessary_packages ) ) {
|
||||
|
||||
$url = add_query_arg( array( 'page' => 'um_upgrade' ), admin_url( 'admin.php' ) );
|
||||
|
||||
ob_start(); ?>
|
||||
|
||||
<p>
|
||||
<?php printf( __( '<strong>%s version %s</strong> needs to be updated for correct working.<br />It is necessary to update the structure of the database and options that are associated with <strong>%s %s</strong>.<br />Please visit <a href="%s">"Upgrade"</a> page and run the upgrade process.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, ultimatemember_plugin_name, ultimatemember_version, $url ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo esc_url( $url ) ?>" class="button button-primary"><?php _e( 'Upgrade Now', 'ultimate-member' ) ?></a>
|
||||
|
||||
</p>
|
||||
|
||||
<?php $message = ob_get_clean();
|
||||
|
||||
$this->add_notice( 'upgrade', array(
|
||||
'class' => 'error',
|
||||
'message' => '<p>' . sprintf( __( '<strong>%s version %s</strong> needs to be updated. Please visit to "Upgrade" page <a href="%s">here</a> and run the upgrade process.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, add_query_arg( array( 'page' => 'um_upgrade' ), admin_url( 'admin.php' ) ) ) . '</p>',
|
||||
'message' => $message,
|
||||
), 4 );
|
||||
} else {
|
||||
if ( isset( $_GET['msg'] ) && 'updated' == $_GET['msg'] ) {
|
||||
|
||||
@@ -1033,12 +1033,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'textarea_rows' => 6
|
||||
)
|
||||
),
|
||||
array(
|
||||
'id' => 'menu_item_workaround',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'WP Menu Item Custom Fields Workaround','ultimate-member' ),
|
||||
'tooltip' => __( 'Turn on this option if you don\'t see WP Menu Item Restriction options','ultimate-member' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'um_allow_tracking',
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -140,12 +140,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
* Upgrade Menu Callback Page
|
||||
*/
|
||||
function upgrade_page() {
|
||||
$um_last_version_upgrade = get_option( 'um_last_version_upgrade' ); ?>
|
||||
$um_last_version_upgrade = get_option( 'um_last_version_upgrade', __( 'empty', 'ultimate-member' ) ); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Ultimate Member - Upgrade Process', 'ultimate-member' ) ?></h2>
|
||||
<p>You have installed <?php echo ultimatemember_version ?> you need to upgrade your previous <?php echo $um_last_version_upgrade ?></p>
|
||||
<h4>Upgrade Log</h4>
|
||||
<h2><?php printf( __( '%s - Upgrade Process', 'ultimate-member' ), ultimatemember_plugin_name ) ?></h2>
|
||||
<p><?php printf( __( 'You have installed %s version. Your latest DB version is %s. Before the click to "Run" button make sure that did the following:', 'ultimate-member' ), ultimatemember_version, $um_last_version_upgrade ) ?></p>
|
||||
<ul style="list-style: inside;">
|
||||
<li><?php _e( 'Create full site\'s backup.', 'ultimate-member' ) ?></li>
|
||||
<li><?php _e( 'Set maintenance mode (if you need)', 'ultimate-member' ) ?></li>
|
||||
<li><?php _e( 'You have nice Internet connection', 'ultimate-member' ) ?></li>
|
||||
</ul>
|
||||
<p><?php _e( 'After the click to "Run" button, the update process will be started. All information will be displayed in "Upgrade Log" field.', 'ultimate-member' ); ?></p>
|
||||
<p><?php _e( 'If the update was successful, you will see a corresponding message. Otherwise, contact technical support if the update failed.', 'ultimate-member' ); ?></p>
|
||||
<h4><?php printf( __( 'Upgrade Log' ), ultimatemember_plugin_name ) ?></h4>
|
||||
<div id="upgrade_log" style="width: 100%;height:300px; overflow: auto;border: 1px solid #a1a1a1;margin: 0 0 10px 0;"></div>
|
||||
<div>
|
||||
<input type="button" id="run_upgrade" class="button button-primary" value="<?php esc_attr_e( 'Run', 'ultimate-member' ) ?>"/>
|
||||
|
||||
@@ -114,6 +114,8 @@ if ( ! empty( $_POST['role'] ) ) {
|
||||
|
||||
update_option( "um_role_{$id}_meta", $role_meta );
|
||||
|
||||
UM()->user()->remove_cache_all_users();
|
||||
|
||||
um_js_redirect( $redirect );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user