Ticket #3498 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

Deactivate All on plugins admin page

Reported by: shorty114 Owned by: rob1n
Priority: low Milestone: 2.2
Component: Administration Version: 2.1
Severity: minor Keywords: has-patch commit
Cc:

Description

It would be handy to have a "Deactivate All" button on the WordPress Plugins admin page. I just had to go through and deactivate each and every one by hand to debug an error, and it wasn't fun.

Attachments

wp_plugins_deactivate_all.diff Download (2.2 KB) - added by charleshooper 5 years ago.
"Deactivate all plugins" feature addition
wp_plugins_cleanup.diff Download (6.5 KB) - added by charleshooper 5 years ago.
Cleans up admin plugin page and adds "deactivate all" feature
3498.diff Download (1.4 KB) - added by rob1n 5 years ago.
3498.2.diff Download (1.7 KB) - added by rob1n 5 years ago.
3498.3.diff Download (1.4 KB) - added by rob1n 5 years ago.
Whoops

Change History

  • Owner shorty114 deleted

(Offtopic) Is that the same error you reported on the WP-SlimStat website? To fix it, you need to work around a bug in the plugin by changing the WPLANG value in wp-config.php from blank to 'en'.

When I am bulk deactivating plugins, I simply use the middle-mouse button and close all the tabs that I have opened after they have finished loading. I find that is quite fast enough for my needs.

  • Milestone changed from 2.1 to 2.2

How about a "Deactivate Plugins" plugin that, when activated, deactivates all plugins (including itself) ?

I've written a plugin that does this.

 Download Here

Just a simple link for 2.1, maybe?

  • Keywords has-patch needs-testing added

This seemed like an excellent opportunity for me to get the WordPress core a little better so I've created a patch to add a "deactivate all plugins" link to the plugins page. It can be found below the list of plugins on wp-admin/plugins.php

"Deactivate all plugins" feature addition

  • Version set to 2.1

charleshooper,

Good first effort! Only thing I see that definitely needs to change is the calling of wp_nonce_url() It won't work the way you have it. Instead of manually coding the action=deactivate-all part into the query string, try passing 'deactivate-all' as a second parameter.

wp_nonce_url('plugins.php', 'deactivate-all')

That'll take care of adding the action part to the URL as well as integrating the action name into the nonce itself (making it specific to the action, in addition to the other things that go into the mix like user and time).

That doesn't seem to work. All of the other calls to wp_nonce_url() also look similar to mine, perhaps I'm missing something?

I've got another patch ... this one just cleans up wp-admin/plugins.php and creates 3 new functions: plugin_activate($plugin), plugin_deactivate($plugin), plugin_deactivate_all() and plugin_sanity_check()

These are just created from what was in wp-admin/plugins.php already. These can be found in wp-admin/plugin-functions.php and is required by wp-admin/admin.php

Cleans up admin plugin page and adds "deactivate all" feature

comment:9 follow-up: ↓ 10   charleshooper5 years ago

(offtopic) If I were to accept these tickets would they be noticed by the people who make the changesets?

It'd be easier for me to keep track of what I've submitted patches to if I could but if that's something that's reserved more for the people committing the changes then I don't want to make things more difficult

comment:10 in reply to: ↑ 9   foolswisdom5 years ago

Replying to charleshooper:

(offtopic) If I were to accept these tickets would they be noticed by the people who make the changesets?

People that create the patch generally assign it to themselves, so what you were doing is fine. You can also add your username to the Cc: list .

  • Owner set to charleshooper
  • Status changed from new to assigned

Excellent. Thank you.

  • Milestone changed from 2.2 to 2.3
  • Owner changed from charleshooper to rob1n
  • Status changed from assigned to new
  • Milestone changed from 2.3 to 2.2

rob1n5 years ago

  • Keywords commit added; needs-testing removed
  • Status changed from new to assigned

Added new patch with support for nonces, etc. Tested too.

  • Status changed from assigned to new

rob1n5 years ago

rob1n5 years ago

Whoops

  • Status changed from new to closed
  • Resolution set to fixed

(In [5156]) Deactivate All Plugins feature. fixes #3498

Note: See TracTickets for help on using tickets.