Ticket #4176 (closed enhancement: fixed)

Opened 1 year ago

Last modified 3 months ago

Option to "Reactivate All Plugins" after deactivating them

Reported by: dougal Assigned to: westi
Priority: normal Milestone: 2.5
Component: Administration Version:
Severity: normal Keywords: plugins, activation, has-patch, needs-testing plugin-management
Cc: dougal@gunters.org

Description

The new "Deactivate All Plugins" function is great. Now we just need a quick way to "Reactivate All". Patch attached.

When the "Deactivate All" function is used, this will store the old plugin list in an option named 'deactivated_plugins'. When the plugin page sees that the 'active_plugins' option is empty, but 'deactivated_plugins' is not empty, it will present a "Reactivate All Plugins" button.

When an attempt to reactivate the previous set of plugins is made, each plugin is tested in turn, and errors in individual plugins will be listed, if possible (e.g. if a plugin was deleted between the "Deactivate All" and the "Reactivate All").

A fatal PHP error in a plugin will cause the reactivation to abort, and no plugins will be activated. I was hoping that I could just ignore that one plugin, but couldn't find a way, due to the lack of real exception handling in PHP 4.

I tried to test what I could think of, but any third-party testing would also be appreciated.

Attachments

reactivate-plugins.diff (5.5 kB) - added by dougal on 04/20/07 16:46:21.
Patch to wp-admin/plugins.php to add "Reactivate All Plugins" function. Patch against branches/2.2 r5290
reactivate-plugins.2.diff (5.6 kB) - added by DD32 on 09/02/07 01:29:50.
Reactivate All Plugins against 2.3beta
reactivate-plugins+output2.diff (4.3 kB) - added by DD32 on 09/02/07 01:30:30.
Reactivate All Plugins(And also catch non-fatal errors)

Change History

04/20/07 16:46:21 changed by dougal

  • attachment reactivate-plugins.diff added.

Patch to wp-admin/plugins.php to add "Reactivate All Plugins" function. Patch against branches/2.2 r5290

04/21/07 02:04:14 changed by rob1n

  • milestone changed from 2.2 to 2.3.

I really think this is a niche case. Apart from upgrading (and I leave all my plugins active when I upgrade, personally), the use for Deactivate All Plugins was initially to get everything deactivated, in a hurry, in case some plugin was causing a fatal error of some kind, or to debug.

I'm -0.5. I think the way it's implemented could be improved, but I personally have no better way so I'm not going to add or detract based on that.

04/21/07 11:38:56 changed by DD32

I really think this is a niche case Not entirely, Anyone who finds "Deactivate All" will find this one useful, Its painful to have to re-enable each one one-by-one, especially when you just want to deactivate all the plugins to see if an issue is being caused by them(Plugins), or something completely different. I implemented something very similar in my GSOC WordPress Update plugin(no public as of yet), and was intending on submitting the "re-activate all" part as a trac ticket for Core when i got some spare time.

So i think its a good idea for integration.

04/21/07 14:03:41 changed by schulte

I can see the casual user of WP hitting the "Deactivate All Plugins" button and suddenly finding things awry, needing that quick fix to restore their plugins to the prior, activated state. I don't think you can have one of these actions without the other.

Patched. Tires kicked on 2.3-alpha (rev 5291). Seemed to go as expected. Removal of a plugin after deactivation/reactivation was handled gracefully.

+1

04/22/07 04:00:32 changed by markjaquith

I think this is necessary functionality if we have a "Deactivate All" button.

+1

05/10/07 02:15:56 changed by torbens

Definitely very useful! This also might help to overcome one's inhibition to perform a minor security update...

But why not incorporating functionality provided by this plugin (http://www.wiso.cz/2007/03/07/my-new-wordpress-plugin-wp-enhanced-plugin-manager-10/) into the core. This could be very useful.

+1

(follow-up: ↓ 7 ) 08/24/07 23:43:16 changed by DD32

Any chance of this going into 2.3, I realise its Feature frozen, But this is really only the other half of the "Deactivate All" function IMO.

(in reply to: ↑ 6 ) 09/01/07 16:15:27 changed by westi

  • keywords changed from plugins, activation, has-patch, needs-testing to plugins, activation, needs-patch, needs-testing.
  • owner changed from anonymous to westi.
  • status changed from new to assigned.

Replying to DD32:

Any chance of this going into 2.3, I realise its Feature frozen, But this is really only the other half of the "Deactivate All" function IMO.

I think we could slip this into 2.3 - I see the lack of reactivate as a bug ;-)

However the current patch doesn't apply cleanly.

So we need a new tested patch ;-)

Marking as needs-patch

09/02/07 01:29:50 changed by DD32

  • attachment reactivate-plugins.2.diff added.

Reactivate All Plugins against 2.3beta

09/02/07 01:30:30 changed by DD32

  • attachment reactivate-plugins+output2.diff added.

Reactivate All Plugins(And also catch non-fatal errors)

09/02/07 01:34:07 changed by DD32

  • keywords changed from plugins, activation, needs-patch, needs-testing to plugins, activation, has-patch, needs-testing.

I suggest to apply "reactivate-plugins+output2.diff". It catches non-fatal errors during the re-activation and reports on them.

After submitting them here i've noticed there may be some unneeded code in there from the last patch, But the code works fine still.

09/02/07 01:35:51 changed by DD32

Also note to anyone testing: Activating plugins in Subdirectories is brocken as of posting this, Its not the patch(Had me worried there for a bit) See #4884

09/13/07 05:21:40 changed by ryan

  • milestone changed from 2.3 to 2.4.

12/14/07 05:14:43 changed by darkdragon

  • keywords changed from plugins, activation, has-patch, needs-testing to plugins, activation, has-patch, needs-testing plugin-management.

01/06/08 19:33:24 changed by hansengel

I think it would be better to word it as Activate All. I'll test this and reply with the results.

01/09/08 09:37:27 changed by ryan

(In [6580]) Plugin reactivation. Props dougal. see #4176

01/09/08 09:39:31 changed by ryan

That adds a reactivate_all_plugins() function. Not all of the error collection that was in the original patches is still present. The errors aren't that interesting since only non-fatal ones will actually be collected, and the only non-fatal one likely to be encountered is if the plugin goes missing after being deactivated.

01/09/08 18:35:38 changed by dougal

Yay me! Can't wait to grab the latest svn and try it out "for real" :)

Since there was always some disagreement about what to actually call it, I had an idea: How about instead of "Deactivate/Reactivate all plugins", if we used something akin to "Safe Mode", a la Windows? That's really what this is about, anyways.

Thoughts?

02/27/08 22:22:55 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.