As I’ve continued to learn about WordPress MU, I have discovered a world which is surprisingly undiscovered, it seems. The veterans at WordPress are already familiar with how things work, but the documentation isn’t there quite yet (in truth, there’s precious little on even plain WordPress). Meanwhile, the site WPMUDEV.org has been assembled to help out developers, but that’s woefully incomplete and often inaccurate.
The funny thing is: the WPMUDEV people have recently announced a premium service for those who want to spend a bit of extra cash. Well, given the inconsistencies of the publicly-available content, I have trouble understanding why anyone would pay extra, but to each his own.
Case in point: the Post Ratings plugin that has allegedly been retooled to work with WordPress MU. I won’t bore you with the gory details, but suffice it to say, the plugin was most definitely not working on this very basic site. I decided to take the opportunity to play around with it and see if I could get it to work, and in doing so, learn a little bit more about the way MU deals with plugins. I’ve decided to go over some basic concepts here before eventually putting them into the WikiMU.
/plugins vs. /mu-plugins
One very confusing concept behind MU plugins is the difference between the two plugin directories. This seems to be a fairly frequent subject of discussion on the MU forums, but really, it’s not that difficult when you get down to brass tacks.
Plugins stored in the /mu-plugins folder are site-wide, mandatory plugins that the Administrator of the site controls. Administrators of individual blogs have no control over these plugins and do not see them except where they have an effect on the final product.
Plugins stored in the /plugins folder are available site wide, but Administrators of individual blogs can determine whether or not to include the plugin on their blogs. Now, the tricky part about this is that there is an option under Site Admin that allows or disallows the “Plugins” menu for Administrators site-wide. If you don’t check this box, plugins saved to the /plugins folder won’t be available to site Admins to use.
Well, now, hold on a minute. . . What’s the point of the check box to enable plugin control? I don’t know the answer to that, but it seems a bit superfluous. Whatever is the case, none of this is at all obvious when you install MU.
A second challenge is the fact that plugins installed in the /mu- directory shouldn’t just be dropped in and forgotten about. You’d like to be able to set options for these plugins, but so far, I’ve not seen a single plugin that actually provides control panels.
Developing Plugins for MU
It is the lack of control panels that makes working with MU plugins so challenging. In fact, as near as I can tell, it is precisely this barrier that is preventing me from working with the Ratings plugin in MU. The plugin requires you to set a default rating icon (stars, bars or squares) and since I don’t have an Admin panel that I can see, I cannot set this option along with who-knows-what other options.
So going forward, I’m going to need to figure out how the Post Ratings plugin creates its panels and hack that to move the panel somewhere accessible. Any other future plugins will also need to take this need into account. I still don’t know how they do this yet; I asked the question in the MU Forums and was told that there are plugins on WPMUDEV.org that do this, so I should just check them out. Well, considering the luck I’ve had with the crappy plugins on this page, I think I can be forgiven if I don’t care to keep pluging in stuff that doesn’t work until I find the right one.
I think perhaps I’m going to try to work on some sort of convention that allows for a plugin to be stored in either the /plugins directory or the mu-plugins directory, changing the admin panel appropriately to match. But of course, this is all very far in the future. I’m going to need to have more than an hour to sit down and play if I’m going to work on a project like that, which at the moment is all I have.