Index: src/wp-admin/js/updates.js =================================================================== --- src/wp-admin/js/updates.js (revision 31975) +++ src/wp-admin/js/updates.js (working copy) @@ -191,6 +191,31 @@ }; /** + * Add an admin notice on plugin install success or failure. + * + * @since 4.2.0 + * + * @param {string} plugin The plugin name or slug + * @param {string} className Class of the notice to add, either updated or error. + * + */ + wp.updates.addAdminNotice = function( plugin, className ) { + /** + * Add a success admin notice at the top of the page. + */ + var $messageorigin = $( '.plugin-notice.' + className ).first(), + message = $messageorigin.clone().insertAfter( $messageorigin ), + $message = $( message ), + $messageP = $message.find( 'p' ), + capitalizedSlug = plugin.charAt( 0 ).toUpperCase() + plugin.slice( 1 ); + newtext = capitalizedSlug + $messageP.text(); + + $message.removeClass( 'hidden' ); + $messageP.text( newtext ); + + }; + + /** * On a successful plugin update, update the UI with the result. * * @since 4.2.0 @@ -204,6 +229,8 @@ $updateMessage = $pluginRow.next().find( '.update-message' ); $pluginRow.addClass( 'updated' ).removeClass( 'update' ); + wp.updates.addAdminNotice( response.slug, 'updated' ); + // Update the version number in the row. var newText = $pluginRow.find('.plugin-version-author-uri').html().replace( response.oldVersion, response.newVersion ); $pluginRow.find('.plugin-version-author-uri').html( newText ); @@ -248,6 +275,8 @@ } if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { $message = $( '[data-slug="' + response.slug + '"]' ).next().find( '.update-message' ); + wp.updates.addAdminNotice( response.slug, 'error' ); + } else if ( 'plugin-install' === pagenow ) { $message = $( '.plugin-card-' + response.slug ).find( '.update-now' ); } Index: src/wp-admin/plugins.php =================================================================== --- src/wp-admin/plugins.php (revision 31975) +++ src/wp-admin/plugins.php (working copy) @@ -450,7 +450,8 @@ if ( $s ) printf( '' . __('Search results for “%s”') . '', esc_html( $s ) ); ?> - +
+