WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9835 closed defect (bug) (fixed)

Plugin Delete action link

Reported by: dd32 Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: UI Keywords: has-patch
Focuses: Cc:

Description

Patch adds a Delete action link to inactive plugins.

Patch also flicks user back to the 'All Plugins' page when the page they were on no longer contains any plugins (eg. If they've deleted all the plugins for that view)

Attachments (2)

9835.diff (1.6 KB) - added by dd32 5 years ago.
9835.2.diff (3.0 KB) - added by dd32 5 years ago.

Download all attachments as: .zip

Change History (8)

dd325 years ago

comment:1 westi5 years ago

  • Keywords needs-patch added; has-patch removed

Currently with this patch applied once you delete a plugin the navigation on the plugins page get wrecked as the navigation links turn into delete links.

Looking at the code this looks like a general issue with the delete case.

This doesn't happen with the bulk delete.

I guess we may need a wp_redirect() call at the end of the delete action.

comment:2 dd325 years ago

The issue of the paging being mangled is a bit of a problem with the paging code IMO.. The fact that it expects all current url params should be passed.

Still, An updated patch which uses a temporary transient to cache the deletion result past a wp_redirect() is attached in a moment.

I have a feeling that $_SERVERREQUEST_URI? needs to have &deleted=true &updated=true, and all the other get variables removed so as to allow paging/screen options/other url's using add_query_arg() off the current URI to work as expected. - I'll probably make another ticket for that in a moment.

dd325 years ago

comment:3 dd325 years ago

  • Keywords has-patch added; needs-patch removed

attachment 9835.2.diff added

  • Same as before
  • Implements a transient cache for the plugin deletion status.
  • Cleans up the Request_URI from temporary variables for paging/screen options
    • May need to check up that this hasn't been overlooked on other pages - Quite a few of the older pages include that code, some may not include them.. particularly when functionalities have been since added

comment:4 westi5 years ago

Patch looks good.

I wonder whether we should make the transient keyed on user_id as well to ensure we don't get clashing keys with multiple users accessing the admin at the sametime.

comment:5 dd325 years ago

I wonder whether we should make the transient keyed on user_id as well to ensure we don't get clashing keys with multiple users accessing the admin at the sametime.

mmm Sounds like a good idea, Its highly unlikely 2 admin users would delete plugins within a few milliseconds of eachother, but its still a possibility. (Note, That accesing the plugin page isnt enough to trigger the message, it also has to have the ?deleted arg present)

If you want to commit, throw a $user_ID in there :)

comment:6 westi5 years ago

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

(In [11371]) Add an action link to allow for plugins to be deleted individually. Also switch to storing the deletion information and redirecting before displaying. Fixes #9835 props DD32.

Note: See TracTickets for help on using tickets.