Developing Plugins for WordPress MU


Developing Plugins for WordPress MU

The process of developing plugins for WordPress MU doesn’t differ from that for traditional Word- Press plugins. The same necessary identifying information is needed for WordPress MU to recognize the plugin as a plugin. The differences are in the database, and somewhat in the directory structure. Your plugins can reside either in wp-content/plugins/, which you’ll recognize, or in wp-plugin/muplugins/. The latter is something of an autorun for plugins; if you drop them there they won’t show up on the Plugins page in the WordPress MU admin interface, and they’ll be considered activated all the time. The only way to deactivate a plugin in mu-plugins is to delete it from the folder. They are known as site-wide plugins.

Actual plugin development is just as for stand-alone WordPress. You do, however, need to make sure you’re not relying on creating additional database tables, because that won’t be allowed. Editing core tables in the database will also present problems, but some changes are known to work so you’ll have to try for yourself, or check out any of the hacked plugins out there. Other than doing database stuff, there really aren’t all that many issues with WordPress MU. You may want to check out the WordPress MU functions to further open the doors to MU plugin development: codex.wordpress.org/WPMU_Functions.

Another thing to consider when creating plugins for WordPress MU is how they are intended to be used. Naturally this always applies, but since you can run WordPress MU in so many ways, open or closed, with plugins enabled for bloggers, just for admin, and so on, you may have to rethink the way the plugin works.

All in all, don’t be daunted by WordPress MU when it comes to plugin development. It is basically the same, and will most likely actually be the same in the future. A merge is in the works, according to the WordPress developers, so the issues you’re experiencing with MU plugins right now may actually work themselves out on their own.

Site-wide WordPress MU Plugins

Plugins placed in wp-content/mu-plugins/ are called site-wide plugins, and they are always activated per default. To uninstall or even make them inactive you need to remove them, which makes them a bit special. After all, not being able to turn offa feature may change the way things work. As of WordPress MU 2.8, the option to activate plugins site-wide from within admin was added.

This means that you can activate plugins located in wp-content/plugins/ to be active site-wide, just like the mu-plugins. This is of course a lot more user-friendly, so you should definitely consider managing site-wide plugin-powered features this way, rather than with mu-plugins. After all, since WordPress MU supports automatic updates, just like regular WordPress, the more that are available at a click from within the admin interface, the better.

So that’s it, you’re writing a plugin. Now you can share it with the world by releasing it in the official WordPress directory.

Good Practice for Releasing Plugins

Just like with themes, there is an official plugin directory on wordpress.org where you can host your plugins. You don’t have to, of course, but it is through this that the users can get the automatic update to work, and keeping them up-to-date with your latest fixes is usually a good idea. However, there are some terms that your plugins needs to fulfill to be hosted on wordpress. org:

Th e plugins needs to be licensed under a GPL-compatible license.

The plugin can’t do anything illegal, nor be “morally offensive.”

The plugin needs to be hosted in the wordpress.org subversion repository.

The plugin needs a valid readme file.

To get access, you need to be a wordpress.org user. Then, submit your plugin (wordpress.org/extend/plugins/add/) and wait for approval. This process can take some time, depending on workload of the people involved. When approved, you’ll get access to the subversion directory, to which you submit a zip archive containing the plugin, along with a valid readme file. Yes, valid; there is a readme validator that makes sure that all the data needed for the wordpress.org directory to list the plugin information is there: wordpress.org/extend/plugins/about/validator/.

You should read the Developer FAQ for the Plugin Directory before submitting a plugin to make sure you have the most up-to-date information on the matter. This will almost certainly speed up the approval process. You’ll find it here: wordpress.org/extend/plugins/about/faq/.

The benefits of being hosted in the wordpress.org repository are not only the automatic update functionality from within the actual users’ admin interfaces, but also the statistics it adds. You’ll see how many people have downloaded the plugin, get ratings, and you can get comments on it. Not only that, wordpress.org is also the central point for WordPress, which means chances are people will find your plugin, as opposed to just hosting it on your own site and hoping people come across it. Add the new in-admin plugin search interface, and your plugin can be found from within any up-to-date WordPress system out there, and installed at a few clicks at that. That is, if you’re in the wordpress.org repository. So get in there!

This Is Really All You Need

Developing WordPress plugins differs quite a lot from creating WordPress themes. Sure, there are a lot of similarities but in the end what you’re really doing is writing PHP scripts that tap into the WordPress functionality. That means that while just about anyone with a little scripting knowledge can bend WordPress themes to their will, the same just doesn’t apply when it comes to plugins. You need to understand PHP, and you need to be wary when working with plugins since you can wreck a lot, especially if you’re tinkering with the database. That being said, if you know a little PHP then developing plugins can be the solution to building the site you want, so knock yourself out.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Webworldarticles.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.


This article was sent to us by: Jennifer I. at 05132010

Related Articles

1. Wordpress Plugins and Functions PHP
Plugins and Functions PHP WordPress themes and plugins usually work pretty much by themselves, coming together only when it comes to implementing features. Th...

2. When to Use Wordpress functions php
When to Use functions.php When, then, is it really a good idea to use functions.php? I have a rule for that too: only use functions. php when the added function...

3. Are you using WordPress as a CMS
WordPress as a CMS Using WordPress for things other than blogging is something that comes naturally to a lot of developers today, but not so much for the ge...

4. Things to Consider When Using WordPress as a CMS
Things to Consider When Using WordPress as a CMS So you’re considering using WordPress as a CMS for a project huh? Great, and probably a good choice too...

5. Trimming WordPress to the Essentials
Trimming WordPress to the Essentials Usually, when doing work for clients or other people within your organization, you’ll have to think a little bit diff...

6. Wordpress Static Pages and News Content
Static Pages and News Content I touched upon static Pages and categories as a news model previously. It is truly a great tool whenever you need to roll out a ty...

7. Making Widgets a Little More Dynamic
Putting Widgets to Good Use Widgets and widget areas are your friends when rolling out WordPress as a CMS. It is perhaps not as important for the small and stat...

8. Wordpress The Header and Footer Templates
The Job Board The first special project we’ll work on is a job board. You have probably seen this kind of site already, where people and companies can pos...

9. When using TDO Mini Forms to build this solution
Receiving the Jobs There are numerous ways to receive the actual content for the job listings. The easiest way would be to just have people e-mail listings to y...

10. Running a Web Shop on WordPress
WordPress and E-Commerce It goes without saying that WordPress can be used to sell stuff. In its simplest form you’ll run a weblog or traditional site wit...