From 96922900c528d5948489bb7d6efc449dfde94826 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 22 Mar 2019 12:59:02 +0000 Subject: [PATCH] Plugins: Remove `wp_is_wp_compatible()` and `wp_is_php_compatible()` functions added in [44978] for now, to discuss use cases and better naming. See #46599, #43992. git-svn-id: https://develop.svn.wordpress.org/trunk@44981 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/plugin.php | 4 ++-- src/wp-includes/functions.php | 26 -------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index 2db58a7c15..23bc994749 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -1090,8 +1090,8 @@ function validate_plugin_requirements( $plugin ) { return true; } - $plugin_data['wp_compatible'] = wp_is_wp_compatible( $plugin_data['requires'] ); - $plugin_data['php_compatible'] = wp_is_php_compatible( $plugin_data['requires_php'] ); + $plugin_data['wp_compatible'] = version_compare( get_bloginfo( 'version' ), $plugin_data['requires'], '>=' ); + $plugin_data['php_compatible'] = version_compare( phpversion(), $plugin_data['requires_php'], '>=' ); $plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ); diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index b8a0a7db07..86cdabe7e0 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -6897,29 +6897,3 @@ function wp_direct_php_update_button() { ); echo '

'; } - -/** - * Checks compatibility with the current WordPress version. - * - * @since 5.2.0 - * - * @param string $required Minimum required WordPress version. - * @return bool True if required version is compatible or empty, false if not. - */ -function wp_is_wp_compatible( $required ) { - $wp_version = get_bloginfo( 'version' ); - - return empty( $required ) || version_compare( $wp_version, $required, '>=' ); -} - -/** - * Checks compatibility with the current PHP version. - * - * @since 5.2.0 - * - * @param string $required Minimum required PHP version. - * @return bool True if required version is compatible or empty, false if not. - */ -function wp_is_php_compatible( $required ) { - return empty( $required ) || version_compare( phpversion(), $required, '>=' ); -}