WPMU Administration Plugins

September 25, 2008  | 
22 Comments

As I browsed through the competition plugins here on wpmu.org, I noticed that several of them were strictly administration plugins.  Meaning all of the actions were strictly used once a user is logged in and within the administration menu.

Yet on the installations they were still being placed in the mu-plugins folder.

Here are my thoughts and please correct me if I am wrong, which wouldn’t be the first and certainly not the last.

Every person/bot/spider/rss feed/etc that requests one of the pages on one of your blogs, will loop through the entire mu-plugins folder.

If you have 50 plugins in there, that could potentially take up a lot of needed resources on your server, especially if the plugin deals strictly with administration features.  Why should an average reader have to load 5-10 files of administration plugins when they will never use them?

A different approach:

Create a separate folder in your wp-content folder.  Let’s call it admin-plugins. ie. /wp-content/admin-plugins. Then every mu plugin that strictly deals with administration side functions, meaning in the wp-admin area, drop it in that folder.

Then in your mu-plugins folder, you can add this file:

http://realestatetomato.com/wpmu-director.txt

(Copy file, paste in source code editor, change name to wpmu-director.php, upload to mu-plugins)

This small piece of code will determine whether or not the /wp-admin section of the blog is being called then and only then, load your mu administration plugins.

I would love to hear your guy’s thoughts on this…

What say you?

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

22 Responses to WPMU Administration Plugins

  1. Would an alternative be to put the plugin in the regular plugin folder, and then deactivate it for userblogs, deactivate user conntrol over it, and allow it solely for the main blog? (using plugin commander). That way you needn’t introduce nonstandard directories.

    unrelated – the list of plugins submitted for the Competition seems to be out of date on the official contest page.

  2. The advantage of putting a plugin in the plugins directory is that it can be activated per blog. domain1.com has plugin A running on it while domain2.com does not.

    So the files for that plugin will be parsed for domain1.com/wp-admin and domain1.com/post1 but not for domain2.com/wp-admin or domain2.com/post1.

    The idea with mu-plugins is that they are parsed for domain1.com/wp-admin, domain1.com/post, domain2.com/wp-admin, domain2.com/post1.

    If you create an admin-plugins directory then the files would be parsed if domain1.com/wp-admin and domain2.com/wp-admin but not for domain1.com/post and domain2.com/post

    As long as you put the nonstandard directories in your wp-content folder, it shouldn’t cause you any problems, as when you upgrade that is the one folder you don’t delete.

  3. Nice idea. How about using the is_admin() check (which only returns TRUE if you are in the admin panel) instead of the folder check?

  4. Perfect. I updated the txt file.

  5. Is it working on your install?

  6. You mean included in the plugin?

  7. ok guys, let me repeat this:

    putting plugins into this new folder, instaed of mu-plugins folder helps by not loading the plugins if the user is not browsing in the backend, right?

    I sugest you take the is_admin check out, because a blog owner can add unlimited users who might not be admins but also use plugins that are active inside the backend…

    Btw. how does a plugin inside mu-plugins comapre to a plugin inside plugins folder (automatically activated by plugin commander? is it the same? will it be called as often?

    I think the idea Jason had is pretty brilliant, but I will not use the is_admin check. Thx for sharing the idea :-)

  8. Right.

    is_admin() is actually a template function which searches the uri request path and returns true if it finds wp-admin/. You can find this file in wp-includes/functions.php. I think you are thinking of is_site_admin() which will verify if the user is a site admin or not.

    function is_admin () {
    global $wp_query;

    return ( $wp_query->is_admin || strstr($_SERVER['REQUEST_URI'], ‘wp-admin/’) );
    }

    The mu-plugins folder gets looped through per load in the wp-settings.php file.

    Plugin Commander attaches itself to the wpmunewblog action hook and auto activates various plugins.

    Differences that I can see right off the bat. Several plugins actually install tables and what not with a wordpress activation hook. I can think of cforms, which I use on a lot of my blogs. I don’t believe you can dump this in the mu-plugins folder because it needs to be activated or installed. Plugin commander works quite nicely for this need.

    Mu-plugins folder is set up for more global changes. For instance, tomorrow morning there will be an article that I published explaining the benefits of a global robots.txt file which is a perfect example of a plugin that works better as a mu-plugin instead of a plugins plugin :)

  9. thx for this insights and sharing them

  10. check this and not working.. :( with wpmu 1.5.1

  11. Haven’t tried it with anything lower than 2.6.1… You should probably upgrade.

  12. ic.. it’s not compatibe with aziz plugin.. Yet Another Recent Posts Plugin

  13. What do you mean it’s not compatible? What error are you receiving?

    I haven’t looked at ah_recent_posts_mu but right off the bat it looks like the plugin adds functionality to the external side of the blog. Meaning not admin, and should not be included in the admin-plugins folder.

  14. This is a great idea. I’m running a number of plugins to make WPMU more user-friendly on the back end, and switching them from mu-plugins to admin-plugins is like free money. Thank you!

  15. Pingback: WPMU Performance « And Yet It Moves

  16. Зря не используете FeedBurner

  17. Админчег :) У меня к тебе небольшое предложение, хоть и не по теме блога ;) Напиши пожалуйста свой обзор передачи Гордон Кихот. Особенно прошлый выпуск, про Шансон.

    Спасибо :) Удачи дружище

  18. wpmu.org, админ. Кто писал про последнее китайское предупреждение ? Извини. Я надеюсь мы найдем компромисс ? 1. Поставь на блог-комментирование хорошую каптчу. 2. Пошли урлы своих блогов сюда chezanah@gmail.com и ты избавишься от меня. Ещё раз приношу извинения. издержки производства…

  19. Hey, I’ve been using your plugin and found an issue. It breaks any plugin that tries to add buttons to TinyMCE, because when the system makes a callback to load PHP files from wp-include, it’s not technically an “admin” page. I’m not sure if there’s an easy way to address this but I thought I’d let ya know. Thanks for the clever idea, it works well for other plugins!

  20. @steve Thanks for the heads up. In my installation I actually have a wpmu-sites.php and wpmu-companies.php file in my wp-admin directory. But for the plugin competition, I tried moving everything over to the plugin files. Which brought some unexpected results/bugs. I will be spending some more time in the near future fixing it up, cleaning bugs and releasing some new features.

  21. GRRR, where did the file go?

  22. his is a wonderful idea. I’m running a number of plugins to make WPMU more user-friendly.

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting