[wp-trac] [WordPress Trac] #60992: Plugin management: AJAX plugin activation consequences

WordPress Trac noreply at wordpress.org
Thu Apr 11 09:11:25 UTC 2024


#60992: Plugin management: AJAX plugin activation consequences
--------------------------+-----------------------------
 Reporter:  jeherve       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  6.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This change was introduced in #22316 (changeset r57545).

 ----------

 When a site owner activates a plugin on their site, 2 things may happen:

 - The plugin's feature may be available right away.
 - The plugin may require some configuration before it can be used ; this
 is often handled via options on a custom Settings screen created with the
 Settings API.

 There were typically 3 ways site owners learn about such settings screens:

 1. Upon activating the plugin, they are redirected to the settings screen.
 This is often done via the `activated_plugin` hook
 ([https://developer.wordpress.org/reference/hooks/activated_plugin/
 reference]). It has been around since WP 2.9.
 2. Upon activating the plugin, they are redirected to the Plugins list
 table, where they see a "Settings" link next to the plugin they just
 activated. This is often done via the `plugin_action_links_{$plugin_file}`
 hook
 ([https://developer.wordpress.org/reference/hooks/plugin_action_links_plugin_file/
 reference]), introduced in WP 2.7.
 3. Upon activating the plugin, they are redirected to the Plugins list
 table and scan their WordPress navigation menu to search for the new menu
 item, and thus the next step in the setup.

 **These 3 paths to plugin configuration are no longer available in
 WordPress 6.5.**

 Indeed, starting in WordPress 6.5, we no longer refresh the page on plugin
 activation ; the plugins are activated via an AJAX request. As a result,
 the plugin's code (settings screen registration, hooks) aren't run until
 the site owner refreshes the page or navigates to a different page.

 This seems like a regression in the user experience, and something we
 should fix.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60992>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list