[wp-trac] [WordPress Trac] #60504: Plugin dependencies: Account for mu-plugin as dependency

WordPress Trac noreply at wordpress.org
Mon Feb 12 13:49:46 UTC 2024


#60504: Plugin dependencies: Account for mu-plugin as dependency
-----------------------------+---------------------
 Reporter:  johnbillion      |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  6.5
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  critical         |  Resolution:
 Keywords:  needs-testing    |     Focuses:
-----------------------------+---------------------

Comment (by knutsp):

 Tricky, since dependency is annotated by the plugin slug (dir), but MU
 plugins don't necessary have such, only the name of the main file as
 unique id (among MU plugins).

 Some thinkable solutions, as a start:
 1. Use the name of the MU plugin file ( WooCommerce.php as woocommerce ).
 Contra: MU plugins may be loaded by a file in the parent mu-plugins dir,
 not directly by WP.
 2. Require a textdomain equal to the slug, as for language packs. This is
 met by most widely used ones.
 3. Require plugins that can be recommended as MU plugins to filter the
 plugin list used for dependency checking, injecting their slug/textdomain
 into the array.
 4. Issue a code snippet added as MU plugin that does this filtering to
 rescue those who have got locked in the described situation. Contra: Needs
 ftp or file system access.
 5. Make WP 5.0 detect and warn if a major plugin is loaded as MU. This
 detection may be based on a limited list of constants, functions or
 classes. Contra: Will never be complete

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60504#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list