From 5d14060affd3dfa6855e7e7e3f80138a7a89f879 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 18 Oct 2017 15:45:59 +0300 Subject: [PATCH] - fixed dependencies with extensions, which installed with wrong folder name; - added notice when UM is installed with wrong folder name; --- includes/admin/class-admin.php | 20 ++++++++++++++++++++ includes/class-dependencies.php | 11 +++++++++++ 2 files changed, 31 insertions(+) diff --git a/includes/admin/class-admin.php b/includes/admin/class-admin.php index f80830aa..5c9dfacf 100644 --- a/includes/admin/class-admin.php +++ b/includes/admin/class-admin.php @@ -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 ) { ?> + +
+

+ %s with wrong folder name. Correct folder name is "ultimate-member".', 'ultimate-member' ), ultimatemember_plugin_name ) ?> +

+
+ + "%s" %s extension\'s folder name.', 'ultimate-member' ), $ext_title, $ext_ver ) . + '
' . + sprintf( __( 'Correct folder name is "%s"', 'ultimate-member' ), "um-{$ext_key}" ); + + return $message; + } } return true;