Opened 15 years ago
Closed 15 years ago
#12741 closed defect (bug) (fixed)
Plugin Editor Allows editing active plugins; Plugin listing doesnt list Edit for active plugins
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
The UI on the Plugin listing page does not Link to the plugin editor for active plugins.
The Plugin Editor supports editing active plugins (Both in the plugin dropdown selection, As well as including a deactivation/error-scrape/livepreview functionality to prevent the blog going down due to an edit).
This inconsistancy should probably be changed, Either:
- Link to the plugin editor even for active plugins
- Prevent the plugin editor from editing active plugins
I noticed this whilst working on #10925
Attachments (1)
Change History (17)
#2
follow-up:
↓ 3
@
15 years ago
No possibility, imo.
Quote agree, I was just pointing out the option :)
Could be an idea, but I think the current situation is also fine. (No need to actively propagate the feature.)
"If the admin wants to edit an active plugin, let him do it."
See, This is what i was coming up against, If someone -wants- to do it, let them, They're not going to break the install by doing so (Thanks to the fatal error handling code).
My initial reason for bringing this up was due to the mis-match of the actions on the Active vs. Inactve plugins in the list, I wanted to edit an active plugin, I could edit the inactive plugins either side of it, but not the active plugin in the middle.
#3
in reply to:
↑ 2
@
15 years ago
Hi,
My initial reason for bringing this up was due to the mis-match of the actions on the Active vs. Inactve plugins in the list, I wanted to edit an active plugin, I could edit the inactive plugins either side of it, but not the active plugin in the middle.
Yep, just changed my opinion :-) I was afraid a little that unexperienced users might do that, but then again they are the admin (and others won't see the link). And as they can't really break anything, yes, that link should be there. :-)
#5
@
15 years ago
- Keywords has-patch added; needs-patch dev-feedback removed
Woops, just noticed that the absence of the link would actually be a regression. The "Edit" link is there for active and inactive plugins in WP < 3.0.
It got moved to inactive plugins only in this changeset: [12903]
Attached patch also shows it for active plugins.
A question that I could not answer, as I don't have MS test-install at the moment: Might additional checks for more than the "edit_plugins" cap necessary on MS installs, like checks for is_super_admin()? We don't want admins to edit plugins which are also active on other sites of the networks, right?! :-) This probably should also be checked for the drop down menu way of accessing the plugin editor.
#6
@
15 years ago
There were a series of changesets related to the plugin links and network plugins. Most thinks that broke / regressed were fixed, guess this one wasn't noticed. (I doubt it was intentional.)
edit_plugins is all that is necessary to check. In map_meta_cap() we deny a good number of privileges to non-super admins, including that one.
#8
@
15 years ago
The "Edit" link is now after the "Delete" link for inactive plugins, which is differing from WP < 3.0 behavior, (which was the reason why I rather duplicated code in my patch instead of moving it after the if-else-statement.)
I'm not really having a problem with that, it's just that we are moving a potentially dangerous link to the middle (I know that there is a AYS after clicking it and people should be able to read, but after reading this article, I would say that this is not the best place.)
Opinions?
#9
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Agree, delete should be at the end. We could probably use a trick to not duplicate code once, i.e.
$actions['edit'] = true; ... if ( isset( $actions['edit'] ) ) $actions['edit'] = ...
X-ref [12287] as an idea.
#10
@
15 years ago
- Keywords has-patch removed
Yeah, [12287] should work great here. Forgot it used array_filter().
We need an order:
Network Only (text only)
Network Activate
Activate
Network Deactivate / Deactivate (only one would show)
Edit
Delete
That look good?
#11
@
15 years ago
Hm, I didnt notice that re-ordering of actions.
It might be better to just add it in the block like TobiasBg suggested..
#12
@
15 years ago
Another option, given the small number of items here, Is to leave the if($is_active).. branch for Activation/Deactivation only, and change it to as such:
} // end if $is_active if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>'; if ( !$is_active && current_user_can('delete_plugins') ) $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; } // end if $context
#14
@
15 years ago
The only outstanding question is whether the delete link should be red.
That incidentally happened when I keyed the delete link as 'delete', thus creating <span class="delete">, which in action links makes the link go red.
I keyed it as plugin_delete instead for now. Will need feedback from Jane on this, then we're all set.
Could be an idea, but I think the current situation is also fine. (No need to actively propagate the feature.)
No possibility, imo. If the admin wants to edit an active plugin, let him do it.