[wp-hackers] How to check a new plugin?

Jeremy Clarke jer at simianuprising.com
Tue Nov 23 16:40:34 UTC 2010


On Mon, Nov 22, 2010 at 1:32 PM, Bill Dennen <dennen at gmail.com> wrote:

> One suggestion for the plugin directory -- put the onus on plugin
> developers to state whether or not their plugin creates additional
> database tables, and other things. They could list the hooks they use,
> for example.
>
>
Taking this one step further the plugin repo could automatically scan
plugins when they are committed/updated and make a list of internal
code/hooks they use. I wouldn't know where to start but I imagine this would
be possible with PHP. It could present an automated list of things the
plugin does, something like:

* Actions used: init, wp, pre_get_posts, wp_head
* Filters used: the_posts, get_permalink
* Uses options api for storage
* Use transients api for storage
* Performs custom SQL statements // i.e. uses $wpdb->query or
$wpdb->get_results etc.
* Alters database using API // i.e. dbdelta() or whatever that system is
* Uses HTTP api
* Creates custom post type: "bananas"

etc.

Obviously it would be a lot of work to make it completely exthaustive, but
as an admin of network sites I would always look at such a list and consider
it if it was available. If nothing else it would give you a starting point
for diving into the code, like "wtf is it using custom SQL for, this plugin
shouldn't need that", then you can look for $wpdb and see what the queries
are so you can consider whether they are worth it.

Seeing GOOD APIs it's using would also be valuable. Any plugin taking
advantage of the HTTP api and Transients api is already a head above the
rest in my books. It shows that the dev is familar with WP and you are less
likely to deal with bugs caused by re-inventing the wheel.

Alternately this could be a plugin which does such evaluations of other
plugins on the same WordPress installation. If this exists already someone
please post a link :D

-- 
Jeremy Clarke • http://jeremyclarke.org
Code and Design • globalvoicesonline.org


More information about the wp-hackers mailing list