WPMU: Making Stats Plugins Work With Plugin Commander

Okay, so there is one little problem with PC that can really drive ya nuts when dealing with certain plugins. I first noticed it while playing with the WordPress.com Stats and Google Analytics for WordPress: both place the links to their config pages on the main Plugins page in the WP admin. And since one of the primary reasons to use PC is to turn off that all-or-nothing Plugins page… I was kinda stuck.

So after a bit of Googling turned up nothing of value, I decided to poke around within the plugin files themselves and see what was up. This wasn’t a particularly appealing activity, since I’m a Coldfusion guy with only the slimmest grasp of PHP. Turns out, a fix is pretty easy.

For example, inside googleanalytics.php, I found a line that began:

add_submenu_page('plugins.php'

All I had to do was change that bit to read:

add_submenu_page('edit.php'

…and the link popped right up under “Manage” in the admin. A similar tweak to the WordPress.com stats.php fixed it, too. Now I can allow blog owners their choice of statistical plugins without having to let ‘em run wild with everything else.

UPDATE 2008-01-23: The rearranging of menus in WP 2.7 meant that I ended up moving some of my modded plugins to places other than the (now non-existent) “Manage” page.

This entry was posted in Technology and tagged , , . Bookmark the permalink.

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>