Make WordPress Core

Opened 2 years ago

Closed 2 weeks ago

#24744 closed enhancement (invalid)

Prevent user to activate a plugin network wide

Reported by: wpfo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Plugins Keywords: reporter-feedback
Focuses: multisite Cc:


So long we have not Settings API for network_wide activated plugins we need a way to prevent user to activate a plugin network wide.

Possible Solution:
New header in Plugin File Header: Blog
Blog - Boolean. Whether the plugin can only be activated per-site.
If true - Action link 'Network Activate' will be hiden in Network Admin Plugins Table
(problems are the bulk_actions in this approach).

We have now no way to prevent user to activate a plugin network wide.
All 'plugin_action_links' Filters work only if a plugin is already activated.
Or am I missing something?

we could have only one header for all activation modes e.g.
Activation (or ActivationMode) - String

Network - plugin can only be activated network wide.
Blog - plugin can only be activated per-site.
Both - plugin can be activated network wide or per-site.

Change History (6)

comment:1 @johnbillion2 years ago

  • Keywords reporter-feedback added; needs-patch removed

What's the use case for preventing a plugin from being activated network-wide?

comment:2 @nacin2 years ago

  • Type changed from defect (bug) to enhancement

comment:3 @jeremyfelt21 months ago

  • Component changed from Network Admin to Plugins

comment:4 @cfoellmann21 months ago

Wouldn't it be more consistent if we altered the "Network" header to allow

 Network: false (boolean)

to disallow "Network activation"?

I could integrate this into #26925

Last edited 21 months ago by cfoellmann (previous) (diff)

comment:5 @cfoellmann21 months ago

We could add this to #26909 since the other ticket is a duplicate.

comment:6 @chriscct72 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Not a ton of people wanting this. For those who want something like this, a better solution would be to add a filter on $network_wide in activate_plugin() and then have a second plugin that does the limitations, rather than yet another plugin header, thus allowing for more fine grained control.

Note: See TracTickets for help on using tickets.