Upgrade/Install: Restore Activate button's href native behavior.

Restores the Activate button's `href` native behavior by changing the AJAX activation handler introduced in 6.5.0. It restores the pre-6.5 behavior of clicking the "Activate" button, i.e. navigates the user to the button's `href` (i.e. to the `plugins.php` UI).

Why?

Feedback was given after shipping [57545] in 6.5.0 (but was unknown during the development and testing cycles) revealed significant impacts for plugins who's users valued the onboarding / configuration experiences.

6.5.3's [58081] and [58083] added a new user action / step to the workflow. Though helpful, it did not fully resolve the impacts.

For the minor, this commit seeks to restore only the "Activate" button's `href` pre-6.5 native behavior to resolve the regression.

The next phase of the Add Plugins workflow can then continue in a major release to gain the benefits of a full major to move it from ideation through the development phases. (See #61040). The questions of redirect, how / should configuration be in the workflow, etc. can best be explored and experimented with in a major.

Follow-up to [57545], [58081], [58083].

Reviewed by jorbin.
Merges [58250] to the 6.5 branch.

Props costdev, jorbin, hellofromTonya, afragen, kevinwhoffman, azaozz, adrianduffell, beaulebens, hmbashar, illuminea, ironprogrammer, jjj, lopo, louiswol94, mikachan, nerrad, mukesh27, peterwilsoncc, pooja1210, smub, swissspidy.

Fixes #61319.
See #22316, #60992.
Built from https://develop.svn.wordpress.org/branches/6.5@58254


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2024-05-30 16:17:12 +00:00
parent 0ea1a2d092
commit 7a1673ba76
3 changed files with 6 additions and 31 deletions

View File

@ -2664,41 +2664,16 @@
} );
/**
* Click handler for plugin activations in plugin activation view.
* Click handler for plugin activations in plugin activation modal view.
*
* @since 6.5.0
* @since 6.5.4 Redirect the parent window to the activation URL.
*
* @param {Event} event Event interface.
*/
$pluginFilter.on( 'click', '.activate-now', function( event ) {
var $activateButton = $( event.target );
$document.on( 'click', '#plugin-information-footer .activate-now', function( event ) {
event.preventDefault();
if ( $activateButton.hasClass( 'activating-message' ) || $activateButton.hasClass( 'button-disabled' ) ) {
return;
}
$activateButton
.removeClass( 'activate-now button-primary' )
.addClass( 'activating-message' )
.attr(
'aria-label',
sprintf(
/* translators: %s: Plugin name. */
_x( 'Activating %s', 'plugin' ),
$activateButton.data( 'name' )
)
)
.text( __( 'Activating...' ) );
wp.updates.activatePlugin(
{
name: $activateButton.data( 'name' ),
slug: $activateButton.data( 'slug' ),
plugin: $activateButton.data( 'plugin' )
}
);
window.parent.location.href = $( event.target ).attr( 'href' );
});
/**

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5.4-alpha-58253';
$wp_version = '6.5.4-alpha-58254';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.