Make WordPress Core

Changeset 58254


Ignore:
Timestamp:
05/30/2024 04:15:18 PM (6 months ago)
Author:
hellofromTonya
Message:

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.

Location:
branches/6.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/js/_enqueues/wp/updates.js

    r58083 r58254  
    26652665
    26662666        /**
    2667          * Click handler for plugin activations in plugin activation view.
     2667         * Click handler for plugin activations in plugin activation modal view.
    26682668         *
    26692669         * @since 6.5.0
     2670         * @since 6.5.4 Redirect the parent window to the activation URL.
    26702671         *
    26712672         * @param {Event} event Event interface.
    26722673         */
    2673         $pluginFilter.on( 'click', '.activate-now', function( event ) {
    2674             var $activateButton = $( event.target );
    2675 
     2674        $document.on( 'click', '#plugin-information-footer .activate-now', function( event ) {
    26762675            event.preventDefault();
    2677 
    2678             if ( $activateButton.hasClass( 'activating-message' ) || $activateButton.hasClass( 'button-disabled' ) ) {
    2679                 return;
    2680             }
    2681 
    2682             $activateButton
    2683                 .removeClass( 'activate-now button-primary' )
    2684                 .addClass( 'activating-message' )
    2685                 .attr(
    2686                     'aria-label',
    2687                     sprintf(
    2688                         /* translators: %s: Plugin name. */
    2689                         _x( 'Activating %s', 'plugin' ),
    2690                         $activateButton.data( 'name' )
    2691                     )
    2692                 )
    2693                 .text( __( 'Activating...' ) );
    2694 
    2695             wp.updates.activatePlugin(
    2696                 {
    2697                     name: $activateButton.data( 'name' ),
    2698                     slug: $activateButton.data( 'slug' ),
    2699                     plugin: $activateButton.data( 'plugin' )
    2700                 }
    2701             );
     2676            window.parent.location.href = $( event.target ).attr( 'href' );
    27022677        });
    27032678
Note: See TracChangeset for help on using the changeset viewer.