[wp-trac] [WordPress Trac] #57220: New plugin header for requirering network installation

WordPress Trac noreply at wordpress.org
Mon Nov 28 21:17:19 UTC 2022


#57220: New plugin header for requirering network installation
-------------------------+-----------------------------
 Reporter:  petitphp     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Plugins      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 There is currently no way for developers to mark a plugin as “only working
 on a multisite installation”. If such a requirement is necessary, the
 plugin has to run a check during the plugin initialization and stop its
 execution (and maybe show an error notice to the user).

 Alternatively, users have no obvious way to know is a plugin explicitly
 require a multisite to work.

 WordPress provides a “Network” header for plugins which allow plugins to
 specify if they should be activated at the network level when use in a
 multisite, but it doesn’t stop activation on non-multisite installations.

 This proposal is for adding a new header `Requires Network` to allow
 plugins to specifically require a multisite installation to be activated.

 {{{#!php
 <?php
 /**
  * Plugin Name: My Custom Plugin
  * Description: A plugin requiring a network installation to work.
  * Plugin URI: https://example.com
  * Version: 1.0.0
  * Requires Network: true
  */
 }}}

 The new header is complementary to the existing `Network` header and not
 meant to replace it.

 After a quick look in the core, I think implementing this header would
 also involve other parts of the WordPress ecosystem :
 * **WP.org plugin API**: include a flag “requires_network” to allow plugin
 install table to support the new requirement,
 * **WP-CLI**: plugin install/activate commands need to support the new
 requirement

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57220>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list