[wp-hackers] How to Make Plugin MU-Capable

Jorge Peña jorgepblank at gmail.com
Thu Jun 5 20:30:21 GMT 2008


I've updated the source and I think I'm almost done getting it working, if
anyone would be so kind as to get the HEAD revision of
http://svn.wp-plugins.org/wp-recaptcha/trunk/ and test it I would really
appreciate it.

On Thu, Jun 5, 2008 at 12:48 PM, Jorge Peña <jorgepblank at gmail.com> wrote:

> Thanks! I looked at your Super Cache plugin which is MU friendly supposedly
> and I saw this line in the readme.txt:
>
> If you are using WordPress MU you will need to install this in
> 'wp-content/mu-plugins/wp-super-cache/' and the file wp-cache.php must be
> copied into the mu-plugins directory.
>
> Must I do something like this too then? Also in the mu-plugins directory
> one cannot put plugin folders like say the entire wp-recaptcha folder? Only
> PHP scripts? In that case if I have more files like stylesheets and
> libraries then I will need to do what you said in the above line right? Ah I
> finally found what I was looking for:
>
> add_submenu_page('wpmu-admin.php', __('WP Super Cache'), __('WP Super
> Cache'), 'manage_options', __FILE__, 'wp_cache_manager');
> add_options_page('WP Super Cache', 'WP Super Cache', 'manage_options',
> __FILE__, 'wp_cache_manager');
>
> That allows me to place the options page under the so called admin settings
> or whatever, which was what someone was telling me about, I assume. I guess
> is_site_admin is a WPMU only check then.
>
> Thanks for any help you can provide Donncha!
>
>
> On Thu, Jun 5, 2008 at 3:22 AM, Donncha O Caoimh <donncha at linux.ie> wrote:
>
>> Hi,
>>
>> The main difference between WP and MU for plugins is where the plugin
>> lives. There is a plugins folder still, but there's also an mu-plugins
>> folder too. Any file in mu-plugins will be included/loaded on every request.
>> It's likely that your plugin will be dropped in there.
>>
>> Also, almost every user on an MU site is untrusted, even admins. The only
>> people who should have access to edit css or html in your plugin are site
>> admins. You can check if the current user is one by using the
>> is_site_admin() function, any time after init.
>>
>> Donncha
>>
>> Jorge Peña wrote:
>>
>>> Hello, I'm the developer for a plugin (wp-recaptcha) and it has been my
>>> intention (Due to many requests) to make it MU-capable, the only
>>> 'problem'
>>> is I haven't gotten around to figuring out what it is that this entails.
>>>
>>> Does MU use actions and filters? The main filters I use are:
>>>
>>> wp_head - CSS for the reCAPTCHA related things on the blog such as hidden
>>> emails (filter)
>>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
>


-- 
- Blaenk Denum


More information about the wp-hackers mailing list