[wp-hackers] Plugin queries executed even when plugin is not being called?

Otto otto at ottodestruct.com
Wed Jan 21 05:47:12 GMT 2009


On Tue, Jan 20, 2009 at 12:27 PM, Derek Hogue <derek at amphibian.info> wrote:
> Hey all - is this expected behaviour, or have I coded this incorrectly
> perhaps?
>
> My plugin makes its own queries (to its own DB tables) through $wpdb.  These
> queries are all within functions in my plugin files, and these functions are
> called via either template tags, my plugin's widget or my plugin's
> shortcodes.
>
> However, as soon as my plugin is activated, WP's queries shoot up on every
> single page load, as though every query within every function in the plugin
> is being executed regardless of whether you're on a page that actually calls
> any of these functions, or whether you even have called these functions
> anywhere in your theme.
>
> Any ideas as to why this might be?  Needless to say, my users are a little
> miffed at this.

In your admin-upgrade.php file:

$gpo['db_verson'] < $gigpress['db_version']

You misspelled "version" there. I think that might be causing all your
extra queries.

-Otto


More information about the wp-hackers mailing list