Make WordPress Core

Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#20104 closed enhancement (fixed)

Show network-activated plugins on site plugins screen

Reported by: nacin's profile nacin Owned by: johnbillion's profile johnbillion
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has-patch
Focuses: multisite Cc:

Description

Per http://wpdevel.wordpress.com/2011/12/23/core-team-meetup-recap-multisite/, one action item is:

Include network activated plugins in the plugins menu and give message that it is automatically on for the whole network (if admin/have rights to see plugins screen).

To enable the plugins screen for a network, a super admin can go to network/settings.php and enable the menu.

Network-activated plugins should still show on this screen to site administrators. (They just can't activate them.) This should require a few tweaks to the plugins list table.

Attachments (9)

20104.diff (3.5 KB) - added by abackstrom 12 years ago.
20104.2.diff (15.5 KB) - added by nacin 12 years ago.
20104.3.diff (3.6 KB) - added by johnbillion 9 years ago.
network_active_settings.png (30.4 KB) - added by DrewAPicture 9 years ago.
Screen Shot 2015-10-05 at 20.58.08.png (34.5 KB) - added by johnbillion 9 years ago.
20104.4.diff (4.6 KB) - added by johnbillion 9 years ago.
Screen Shot 2015-10-07 at 12.30.41.png (43.4 KB) - added by johnbillion 9 years ago.
Screen Shot 2015-10-22 at 12.32.04 AM.png (95.1 KB) - added by johnjamesjacoby 9 years ago.
20104.5.diff (909 bytes) - added by johnjamesjacoby 9 years ago.
Set default $restrict variable values to prevent notices

Download all attachments as: .zip

Change History (47)

#1 @Japh
12 years ago

  • Cc japh@… added

#2 @DrewAPicture
12 years ago

  • Cc xoodrew@… added

#3 @kawauso
12 years ago

  • Cc kawauso added

@abackstrom
12 years ago

#4 @abackstrom
12 years ago

Current patch co-opts the actions list to display the text "Network Active" under the plugin name.

#5 @dempsey
12 years ago

  • Cc dempsey@… added

#6 @nacin
12 years ago

In IRC we've decided to punt this. I have some cleanup I am going to drop in for now.

@nacin
12 years ago

#7 @nacin
12 years ago

In [20525]:

Clean up plugins.php with regards to recently edited files, deactivations, and the network admin. see #20468, #20104.

  • Limit recently_activated to the site dashboard, and properly remove bulk-activated plugins from the array.
  • Remove code used from before the network admin, such as the unused 'network' plugin_status.
  • Don't try to deactivate a plugin already deactivated.
  • Use more specific caps (manage_network_plugins) rather than is_super_admin().

#8 @nacin
12 years ago

  • Milestone changed from 3.4 to Future Release

#9 @DrewAPicture
12 years ago

  • Keywords dev-feedback added

Came across this issue again today, would be nice to get it in for 3.5.

Last edited 12 years ago by DrewAPicture (previous) (diff)

#10 @jeremyfelt
11 years ago

  • Component changed from Multisite to Plugins
  • Focuses multisite added

#11 @jeremyfelt
10 years ago

  • Type changed from defect (bug) to enhancement

Ideas on how to solve this would be interesting. I like the idea of showing off some plugins that are activated network wide to site owners. Here's the IRC conversation to punt before 3.4 shipped.

  • A network plugin could offer site specific settings through a settings link on this page, though that's not something that should occur by default as most plugins won't be expecting that.
  • Network admins may want to hide some plugins from this list.

Would a filter that defaults to false work? Then a network admin could opt in with a plugin to show the plugins.

#12 @wpdavis
9 years ago

yes plz. At the very least, a filter or site setting would be nice. It would help site owners better understand the behavior of their sites, which can be hard to do if there are plugins running you don't know about. Even as a network admin, I'm often confused if I look at a site's activated plugins and don't see what I'm expecting.

#13 @Ipstenu
9 years ago

At this point, while useful, it would need to be something people could disable or filter. A lot of networks don't want users to know what plugins are network active or not, since it's like mu plugins. They can't do anything about it and have no debug capabilities, so it doesn't matter for anything other than 'what plugin am I using?' informationally.

That said, it would help debug site specific issues.

Maybe, like mu, a separate tab for network wide plugins? That would easily differentiate for per site admins.

#14 @jeremyfelt
9 years ago

I'm wondering if we could start by having it only visible for network (super) admins with a filter to enable for site administrators that have plugin access. I know I've gone crazy before as a super admin trying to figure out where a plugin is.

#15 @Ipstenu
9 years ago

I like that idea Jeremy. My gut tells me that a lot of people who keep a locked down network (which is a higher number than one might think) would prefer this.

#16 @jeremyfelt
9 years ago

  • Keywords needs-patch added; dev-feedback removed

@johnbillion
9 years ago

#17 @johnbillion
9 years ago

  • Keywords has-patch dev-feedback has-screenshot added; needs-patch removed

In 20104.3.diff I've taken a somewhat simpler approach.

If the current user can manage network plugins, then network-active plugins are included alongside other plugins in the 'All' and 'Active' tabs on a single site Plugins screen (and they show up in search results too). Each network-active plugin's actions list is replaced with a 'Network Active' message, its checkbox is not displayed, and thus no actions are available from this screen.

This also introduces a show_network_active_plugins filter, which allows the inclusion of network-active plugins on this screen to be controlled.

Thoughts?

Screenshot:

https://i.imgur.com/cOQpCZj.png

This ticket was mentioned in Slack in #core-multisite by johnbillion. View the logs.


9 years ago

#19 @DrewAPicture
9 years ago

Some notes on 20104.3.diff:

  • Per the screenshot, is it just me, or does the "Network Active" text look a bit too large? I see it's registered as an action, so maybe it's just that the linked row actions look smaller
  • In the filter doc, we should either mention that passing a falsey value will disable showing network active plugins, or instead do a stricter boolean check on $show_network_active
  • I really like the idea of simply interspersing the network active plugins in the list, and thereby making them also searchable
  • I agree on hiding the checkboxes, that's the obvious way to go

#20 @DrewAPicture
9 years ago

I take back what I said about the "Network Active" text being too large. Looks a lot better with the patch applied than in the screenshot.

#21 @DrewAPicture
9 years ago

See network_active_settings.png for what this looks like when a plugin has added a settings link to the the row actions.

#22 @johnbillion
9 years ago

  • Keywords ux-feedback added; dev-feedback removed
  • Milestone changed from Future Release to 4.4

Screenshot above confirms that the plugin action links are working as expected. EDD prepends its settings link, whereas Stream appends it.

#23 @johnbillion
9 years ago

  • Owner set to johnbillion
  • Status changed from new to accepted

@johnbillion
9 years ago

#24 follow-up: @johnbillion
9 years ago

20104.4.diff introduces another tweak. Inactive network-only plugins (plugins with Network: true in their plugin header) are now also shown to Super Admins on an individual sites' Plugins screen. The screenshot above demonstrates the four possible states:

  • Network Plugin Auditor: an inactive network-only plugin.
  • oEmbed API: an active plugin.
  • Posts 2 Posts: an inactive plugin.
  • Query Monitor: a network-active plugin.
Last edited 9 years ago by johnbillion (previous) (diff)

This ticket was mentioned in Slack in #core-multisite by johnbillion. View the logs.


9 years ago

#26 in reply to: ↑ 24 @DrewAPicture
9 years ago

  • Keywords has-screenshots commit added; has-screenshot removed

Replying to johnbillion:

20104.4.diff introduces another tweak. Inactive network-only plugins (plugins with Network: true in their plugin header) are now also shown to Super Admins on an individual sites' Plugins screen. The screenshot above demonstrates the four possible states:

  • Network Plugin Auditor: an inactive network-only plugin.
  • oEmbed API: an active plugin.
  • Posts 2 Posts: an inactive plugin.
  • Query Monitor: a network-active plugin.

I'm not sure how useful it is to show network-only-not-activated plugins in the single site view, though I suppose for consistency it might make sense since we're exposing everything else.

#27 @jeremyfelt
9 years ago

Just deployed this into our production environment and everything is looking great.

I agree with Drew about inactive network-only plugins, though I personally don't have any configured so I'm not sure how useful it is.

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


9 years ago

#29 @Ipstenu
9 years ago

Re network-only-not-activated plugins. Since only the super admin can see this out of the box, it's good to know that before you activate a per-site plugin that does something, do you have a multisiteable one?

Also if you did decide to roll this out to per-site admins as well, they could know not to ask for things to be installed because there's a network one. And then argue for it's activation ;)

#30 @johnbillion
9 years ago

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

In 35151:

Include network-active plugins and inactive network-only plugins on the Plugins listing screen for individual sites on Multisite.

These plugins are only shown to users with the manage_network_plugins capability, which is Super Admins by default. This new feature lowers the blood pressure of Super Admins who may browse or search the Plugins listing screen of an individual site, having forgotten that a particular plugin is network-active. Showing inactive network-only plugins here also reduces friction when searching the Plugins listing screen on individual sites.

This change introduces a show_network_active_plugins filter which controls whether the network-active plugins and inactive network-only plugins are shown. This can be used to enable this functionality for regular site admininstrators, or, indeed, to disable this functionality for Super Admins.

Fixes #20104

#31 @johnjamesjacoby
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Throwing notices on "Drop-ins" & "Must-use" views:

Notice: Undefined variable: restrict_network_active in /srv/www/wordpress-develop/src/wp-admin/includes/class-wp-plugins-list-table.php on line 665

Notice: Undefined variable: restrict_network_only in /srv/www/wordpress-develop/src/wp-admin/includes/class-wp-plugins-list-table.php on line 665
Last edited 9 years ago by johnjamesjacoby (previous) (diff)

@johnjamesjacoby
9 years ago

Set default $restrict variable values to prevent notices

#32 @johnbillion
9 years ago

  • Keywords ux-feedback has-screenshots commit removed
  • Status changed from reopened to reviewing

#33 @wonderboymusic
9 years ago

  • Milestone changed from 4.4 to Future Release

#34 @johnjamesjacoby
9 years ago

This should probably go back to 4.4; the debug notices are a regression since 4.3.

This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.


9 years ago

#36 @wonderboymusic
9 years ago

  • Milestone changed from Future Release to 4.4

#37 @wonderboymusic
9 years ago

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

In 35361:

Plugins: after [35151], set default $restrict_network_* values to prevent notices.

Props johnjamesjacoby.
Fixes #20104.

Note: See TracTickets for help on using tickets.