diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index ce698225..ac84e031 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -225,9 +225,32 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { function old_extensions_notice() { $show = false; + $old_extensions = array( + 'bbpress', + 'followers', + 'friends', + 'instagram', + 'mailchimp', + 'messaging', + 'mycred', + 'notices', + 'notifications', + 'online', + 'private-content', + 'profile-completeness', + 'recaptcha', + 'reviews', + 'social-activity', + 'social-login', + 'terms-conditions', + 'user-tags', + 'verified-users', + 'woocommerce', + ); + $slugs = array_map( function( $item ) { return 'um-' . $item . '/um-' . $item . '.php'; - }, array_keys( UM()->dependencies()->ext_required_version ) ); + }, $old_extensions ); $active_plugins = UM()->dependencies()->get_active_plugins(); foreach ( $slugs as $slug ) { diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php index d25f1f9a..b0fe53b9 100644 --- a/includes/class-dependencies.php +++ b/includes/class-dependencies.php @@ -57,6 +57,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) { 'woocommerce' => '2.0.1', 'restrict-content' => '2.0', 'beaver-builder' => '2.0', + 'gdpr' => '1.0.0', ); diff --git a/includes/class-init.php b/includes/class-init.php index 249a103e..bcd10906 100644 --- a/includes/class-init.php +++ b/includes/class-init.php @@ -30,6 +30,7 @@ if ( ! class_exists( 'UM' ) ) { * @method UM_Terms_Conditions_API Terms_Conditions_API() * @method UM_Private_Content_API Private_Content_API() * @method UM_User_Location_API User_Location_API() + * @method UM_GDPR_API GDPR_API() * */ final class UM extends UM_Functions { @@ -385,47 +386,6 @@ if ( ! class_exists( 'UM' ) ) { } - /** - * Show notice for customers with old extension's versions - */ - /*function old_extensions_notice() { - if ( ! is_admin() ) { - return; - } - - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { - return; - } - - $show = false; - - $slugs = array_map( function( $item ) { - return 'um-' . $item . '/um-' . $item . '.php'; - }, array_keys( $this->dependencies()->ext_required_version ) ); - - $active_plugins = $this->dependencies()->get_active_plugins(); - foreach ( $slugs as $slug ) { - if ( in_array( $slug, $active_plugins ) ) { - $plugin_data = get_plugin_data( um_path . '..' . DIRECTORY_SEPARATOR . $slug ); - if ( version_compare( '2.0', $plugin_data['Version'], '>' ) ) { - $show = true; - break; - } - } - } - - if ( ! $show ) { - return; - } - - /*global $um_woocommerce; - remove_action( 'init', array( $um_woocommerce, 'plugin_check' ), 1 ); - $um_woocommerce->plugin_inactive = true;* - - echo '
' . sprintf( __( '%s %s requires 2.0 extensions. You have pre 2.0 extensions installed on your site.
Please update %s extensions to latest versions. For more info see this doc.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, ultimatemember_plugin_name, 'http://docs.ultimatemember.com/article/266-updating-to-2-0-versions-of-extensions' ) . '