Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#12139 closed enhancement (fixed)

Deprecate Site Wide Only: true in favor of Network: true

Reported by: wpmuguru's profile wpmuguru Owned by: westi's profile westi
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has-patch
Focuses: multisite Cc:

Description

1- Currently network only plugins are recognized by

Site Wide Only: true

We should add support for network only so site wide only can be deprecated in a future version.

Network Only: true

2-When activated, network only plugins are added to the active plugins list on the blog/site and the network meta active_sitewide_plugins. If the plugin file is missing, it is removed from the active plugins but left in the active sitewide plugins. Until the plugin file is restored and deactivated, the super admin has an error message on the plugins screen whenever they visit it:

The plugin 1265383606 has been deactivated due to an error: Plugin file does not exist.

(Note also that is a timestamp vs the plugin name.)

When a network plugin is activated, it does not need to be added to the active plugins list on the site/blog.

Attachments (4)

12139.diff (1.6 KB) - added by nacin 14 years ago.
12139.2.diff (5.0 KB) - added by nacin 14 years ago.
Uses API for Network: true and Site Wide Only: true headers
12139.3.diff (5.2 KB) - added by nacin 14 years ago.
Uses API, plus adds deprecated warning.
12139.4.diff (1.0 KB) - added by nacin 14 years ago.
Missing is_multisite() check prevented a Network plugin on a single blog install from having an Activate link.

Download all attachments as: .zip

Change History (16)

#1 @wpmuguru
14 years ago

(In [12970]) add support for network only to identify network plugins, see #12139

#2 @nacin
14 years ago

Semantically, should there be a difference between Network and Site Wide?

A plugin that is "Site Wide: Only" can be installed sitewide, or !is_multisite(). But a "Network Only" plugin seems to connotate that the plugin can be only run when the Network feature is on, and cannot be run when !is_multisite().

I'm not sure if there should be a difference or needs to be a distinction. I just wanted to point that out.

Also, I'm looking into part 2. validate_active_plugins() and deactivate_plugins() need some tweaks it looks like.

#3 @nacin
14 years ago

"Network Wide" would be a better choice re: terminology without changing behavior.

Do we want the ability for a plugin to say, "Sorry, I can only run when is_multisite()"? In that case, "Network: Required" sounds like a good header.

@nacin
14 years ago

#4 @ryan
14 years ago

(In [12974]) Network plugin activation cleanup. Props nacin. see #12139

#5 @wpmuguru
14 years ago

(In [12975]) Change Network Only to Network for network plugins, props nacin, see #12139

#6 @wpmuguru
14 years ago

  • Milestone changed from 3.0 to Future Release
  • Summary changed from Network plugins do not deactivate correctly when plugin file is missing to Deprecate Site Wide Only: true in favor of Network: true
  • Type changed from defect (bug) to enhancement

Keeping this for a future release to deprecate Site Wide Only.

@nacin
14 years ago

Uses API for Network: true and Site Wide Only: true headers

#7 @nacin
14 years ago

  • Milestone changed from Future Release to 3.0

Patch three incorporates a _deprecated_argument() call. It only triggers when Network is missing AND Site Wide Only exists. A plugin author that includes both trying to cover the bases or maintain compat (even though he shouldn't need to do either) is probably aware of what he's doing.

_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The <code>%1$s</code> plugin header is deprecated. Use <code>%2$s</code> instead.' ), 'Site Wide Only: true', 'Network: true' ) );

Moving back to 3.0, I guess. Should be handled now or never.

@nacin
14 years ago

Uses API, plus adds deprecated warning.

#9 @ryan
14 years ago

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

@nacin
14 years ago

Missing is_multisite() check prevented a Network plugin on a single blog install from having an Activate link.

#10 @nacin
14 years ago

  • Keywords has-patch added
  • Resolution fixed deleted
  • Status changed from closed to reopened

A missing is_multisite() check prevents a Network plugin on a single blog install from having an Activate link. 12139.4.diff

#11 @wpmuguru
14 years ago

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

(In [12996]) Add activate link for network plugins in single site install, props nacin, fixes #12139

#12 @nacin
14 years ago

(In [13155]) Add "Network Activate" option to Bulk Actions menu on plugins.php. See #11644, #12139

Note: See TracTickets for help on using tickets.