WPMU: Premium Blogs

I’ve started writing a plugin for WPMU to allow the management of a ‘premium blog’ option that will control plugin availablity, disble ads and other things.

It’s a long way from done, but I figured I’d post my very early beta here for feedback. This represents only a few hours of work so far, so it has a long way to go, but hopefully you can get an idea of where I am going with it.

It currently consists of three files.

  • premium-blog.php - to be placed in /wp-content/mu-plugins
  • premium.php - to be placed in /wp-admin
  • premium-plugins.php - to be placed in /wp-admin

Also, one line needs to be added to /wp-admin/plugins.php - it is detailed in the comments at the top of premium-plugins.php

In it’s current state it allows a site admin to define premium blogs (through the Site Admin -> Blogs -> Edit interface) and then can manage the plugins available to users (only the plugin management menu, if they are already activated it will not deactivate them).

It also offers the function premiumBlogs::isPremium() which can be called from a theme for example to conditionally include (or exclude) content (such as AdSense code or something).

My immediate plans include:

  • Auto de-activate disallowed plugins from non-premium blogs.
  • Allow ad management - define code to be used for ads, then simply call premiumBlogs::ad($id) to display that ad in a theme for non-premium blogs.

It should also be possible to make it set arbitary settings for premium blogs (larger upload space in conjuction with my Z-Space plugin perhaps?).

What else?

Download:
Premium Blogs - v0.1a


About this entry