mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 21:23:39 +09:00
- fixed dependencies with extensions, which installed with wrong folder name;
- added notice when UM is installed with wrong folder name;
This commit is contained in:
@@ -14,10 +14,30 @@ if ( ! class_exists( 'Admin' ) ) {
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'admin_init' ), 0 );
|
||||
|
||||
add_action( 'admin_notices', array( $this, 'check_wrong_install_folder' ), 3 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function check_wrong_install_folder() {
|
||||
$invalid_folder = false;
|
||||
|
||||
$slug_array = explode( '/', um_plugin );
|
||||
if ( $slug_array[0] != 'ultimate-member' )
|
||||
$invalid_folder = true;
|
||||
|
||||
if ( $invalid_folder ) { ?>
|
||||
|
||||
<div class="error">
|
||||
<p>
|
||||
<?php printf( __( 'You have installed <strong>%s</strong> with wrong folder name. Correct folder name is <strong>"ultimate-member"</strong>.', 'ultimate-member' ), ultimatemember_plugin_name ) ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -139,6 +139,17 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
|
||||
}
|
||||
|
||||
return $message;
|
||||
} else {
|
||||
//check correct folder name for extensions
|
||||
if ( ! self::$active_plugins ) self::init();
|
||||
|
||||
if ( ! in_array( "um-{$ext_key}/um-{$ext_key}.php", self::$active_plugins ) && ! array_key_exists( "um-{$ext_key}/um-{$ext_key}.php", self::$active_plugins ) ) {
|
||||
$message = sprintf( __( 'Please check <strong>"%s" %s</strong> extension\'s folder name.', 'ultimate-member' ), $ext_title, $ext_ver ) .
|
||||
'<br />' .
|
||||
sprintf( __( 'Correct folder name is <strong>"%s"</strong>', 'ultimate-member' ), "um-{$ext_key}" );
|
||||
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user