mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +09:00
- WPCS for defined constants;
* um_url -> UM_URL * um_path -> UM_PATH * um_plugin -> UM_PLUGIN * ultimatemember_version -> UM_VERSION * ultimatemember_plugin_name -> UM_PLUGIN_NAME
This commit is contained in:
@@ -215,9 +215,9 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
add_action( 'init', array( &$this, 'old_update_patch' ), 0 );
|
||||
|
||||
//run activation
|
||||
register_activation_hook( um_plugin, array( &$this, 'activation' ) );
|
||||
register_activation_hook( UM_PLUGIN, array( &$this, 'activation' ) );
|
||||
|
||||
register_deactivation_hook( um_plugin, array( &$this, 'deactivation' ) );
|
||||
register_deactivation_hook( UM_PLUGIN, array( &$this, 'deactivation' ) );
|
||||
|
||||
if ( is_multisite() && ! defined( 'DOING_AJAX' ) ) {
|
||||
add_action( 'wp_loaded', array( $this, 'maybe_network_activation' ) );
|
||||
@@ -430,7 +430,7 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
$array = explode( '\\', strtolower( $class ) );
|
||||
$array[ count( $array ) - 1 ] = 'class-'. end( $array );
|
||||
if ( strpos( $class, 'um_ext' ) === 0 ) {
|
||||
$full_path = str_replace( 'ultimate-member', '', untrailingslashit( um_path ) ) . str_replace( '_', '-', $array[1] ) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR;
|
||||
$full_path = str_replace( 'ultimate-member', '', untrailingslashit( UM_PATH ) ) . str_replace( '_', '-', $array[1] ) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR;
|
||||
unset( $array[0], $array[1] );
|
||||
$path = implode( DIRECTORY_SEPARATOR, $array );
|
||||
$path = str_replace( '_', '-', $path );
|
||||
@@ -442,7 +442,7 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
array( 'um\\', '_', '\\' ),
|
||||
array( $slash, '-', $slash ),
|
||||
$class );
|
||||
$full_path = um_path . 'includes' . $path . '.php';
|
||||
$full_path = UM_PATH . 'includes' . $path . '.php';
|
||||
}
|
||||
|
||||
if( isset( $full_path ) && file_exists( $full_path ) ) {
|
||||
@@ -487,7 +487,7 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
|
||||
delete_network_option( get_current_network_id(), 'um_maybe_network_wide_activation' );
|
||||
|
||||
if ( is_plugin_active_for_network( um_plugin ) ) {
|
||||
if ( is_plugin_active_for_network( UM_PLUGIN ) ) {
|
||||
// get all blogs
|
||||
$blogs = get_sites();
|
||||
if ( ! empty( $blogs ) ) {
|
||||
@@ -510,7 +510,7 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
//first install
|
||||
$version = get_option( 'um_version' );
|
||||
if ( ! $version ) {
|
||||
update_option( 'um_last_version_upgrade', ultimatemember_version );
|
||||
update_option( 'um_last_version_upgrade', UM_VERSION );
|
||||
|
||||
add_option( 'um_first_activation_date', time() );
|
||||
|
||||
@@ -522,8 +522,8 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
UM()->options()->update( 'rest_api_version', '1.0' );
|
||||
}
|
||||
|
||||
if ( $version != ultimatemember_version ) {
|
||||
update_option( 'um_version', ultimatemember_version );
|
||||
if ( $version != UM_VERSION ) {
|
||||
update_option( 'um_version', UM_VERSION );
|
||||
}
|
||||
|
||||
//run setup
|
||||
|
||||
Reference in New Issue
Block a user