Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#59213 new enhancement

Disable the wp_safe_redirect(), or wp_redirect() in the register_activation_hook when batch activating plugins

Reported by: rajinsharwar's profile rajinsharwar Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Plugins Keywords: needs-patch
Focuses: administration Cc:

Description

For example, I have plugin A and plugin B. And plugin A has a wp_redirect() with the register_activation_hook to redirect the admin to the plugin's Settings page after activation.

So now, if I try to batch activate both plugins, we will see that after activating plugin A, I am redirected to the settings page of plugin A, and plugin B didn't get activated because of this. So, in essence, it's breaking the activating loop without activating all the selected plugins. This is really annoying when you are debugging issues with plugins that all have redirection rules after activation.

I am proposing to stop the execution of wp_redirect() whenever there is a batch activation of plugins. This behaviour is evident when using the troubleshooting mode of the Health Check & Troubleshooting plugin.

Change History (2)

#1 @johnbillion
3 months ago

  • Focuses administration added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Yes please.

#2 @SergeyBiryukov
3 months ago

Related/duplicate: #40252, #40454.

Note: See TracTickets for help on using tickets.