Hefta-Gaub Development Blog

April 26, 2007

New Version of Sub-directory Plugin… now acts more like WordPress

Filed under: development, Wordpress plugins, WordpressMU — zappoman @ 10:47 pm

I’ve updated the subdir-mu-plugins Plugin to behave a little bit more like WordPress’s plugins and a little less like WordPress MU’s plugins. The latest version (0.42.2) can be found here.

Here’s a little background:

WordPress single instance will only load files that have the “Plugin Name:” directive. This is partly related to the fact that WordPress supports disabling plugins through a user interface. WordPressMU supports this feature as well for the plugins placed in the “wp-content/plugins” directory. But these plugins are enabled and disabled on a blog by blog basis. For those plugins in “wp-conten/mu-plugins” it will load all PHP files. So for example, if a plugin has extra support PHP files that aren’t safe to load all the time (but can be loaded at the right time by the plugin for example) these types of plugins don’t work well in WordPressMU.

My original version of this subdirectory plugin was intended to mimic the original WordPressMU behavior of loading all php files. Well, this seemed like a good idea at the time, but really the point of this plugin was to allow you to use more WordPress (non-MU) designed plugins… those that lived in subdirectories. And well, many of those plugins also depend on WordPress’s behavior of not loading PHP files that don’t contain the “Plugin Name:” directive. So I’ve decided this original behavior wasn’t the best idea.

The new version will scan subdirectories and attempt to read the plugin-info from all PHP files and only load those PHP files who have a “Plugin Name” directive.

I’ve now changed the behavior of this subdirectory loading plugin to behave a little more like WordPress. Namely it will only load files from subdirectories that have a “Plugin Name” directive.



  1. very usefull plugin..really!!!

    good job!

    Comment by Romania Connection — January 14, 2008 @ 1:10 pm

  2. Works perfect! Just do not forget to make some modifications in plugins as they display sometimes a sub menus in Options menu. So users may access and modify plugins behaviour.

    Alternative solution is, of cause if it’s allowed by your server configuration, to make symbolic links to the plugin main script ( the one who has “Plugin Name:” directive) from mu-plugins directory.


    Comment by Konstantin — April 16, 2008 @ 4:34 pm

  3. getting trouble testing this plugin 😦
    i got these when unplugged other plugin (lighter admin menus)
    Warning: include(lighteradminmenus/lighteradminmenus.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\terminalmusik\wp-content\mu-plugins\lighteradminmenus.php on line 2

    Warning: include() [function.include]: Failed opening 'lighteradminmenus/lighteradminmenus.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\terminalmusik\wp-content\mu-plugins\lighteradminmenus.php on line 2

    how to make this clean?
    thank you..


    Comment by indojepang — April 24, 2008 @ 8:26 am

  4. Ups never mind.. my mistake.. the plugin has 2 folders.. forgot to unplugged the other too.. now it’s workin fine..

    Hi brad the recent posts with thumbnails in sweat365.com, how do u do that? is it a WPMU plugin?
    And the blog thumbnails is that avatarpack or Xiando plugins?
    I’m testing those 2 can’t get it work on my localhost 😦

    please help me give a direction..
    thank’s a lot

    Comment by indojepang — April 24, 2008 @ 9:03 am

  5. Is this plugin still available? The url above leads to a 404. Please shoot me an email and let me know.

    Comment by Rob — March 5, 2009 @ 7:17 pm

  6. Is this plugin still available..would like to try it!

    Comment by Adrian — September 17, 2009 @ 4:48 pm

  7. Do you mind if I quote a few of your articles as long
    as I provide credit and sources back to your weblog?

    My website is in the very same niche as yours and my visitors would really benefit from some of the information you provide here.
    Please let me know if this okay with you. Appreciate it!

    Comment by — October 9, 2014 @ 10:57 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: