From 8d64dc4e6b3048e23906f17c1e8ed0e6d218f9c8 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 24 May 2015 08:04:55 +0000 Subject: [PATCH] Shiny Updates: Handle the case where the plugin is installed into a different directory than it previously existed in. A good example of this is when the plugin being updated is currently installed as 'Plugin-Name' but the canonical directory is 'plugin-name', but it can also occur when the plugin is installed in 'super-cool-plugin' and it's canonical name is 'average-plugin'. Fixes #32465 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@32570 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 1addff7934..5ff3acd64a 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -2902,6 +2902,7 @@ function wp_ajax_update_plugin() { 'oldVersion' => '', 'newVersion' => '', ); + $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); if ( $plugin_data['Version'] ) { $status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); @@ -2939,7 +2940,8 @@ function wp_ajax_update_plugin() { wp_send_json_error( $status ); } - $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + $plugin_data = get_plugins( '/' . $result[ $plugin ]['destination_name'] ); + $plugin_data = reset( $plugin_data ); if ( $plugin_data['Version'] ) { $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );