[wp-hackers] How many plugins can a WP installation bare?

Sergey Biryukov sergeybiryukov.ru at gmail.com
Tue Aug 10 01:29:28 UTC 2010


> http://wordpress.org/extend/plugins/wptuner/
>
> Unfortunately the repo votes for it make it seem like 3.0 isn't supported. I
> haven't tried it with 3.0 yet.

I seem to have found a temporary solution for WP Tuner 0.9.6 on WordPress 3.0.x.

1. Create wp-content/db.php with this code:
<?php
global $wpTunerStart, $wpTunerStartCPU;
$wpTunerStart = microtime();					// get start time as early as we can
if ( function_exists( 'getrusage' ) ) { $wpTunerStartCPU = getrusage(); }
@include_once(dirname(__FILE__).'/plugins/wptuner/wptunertop.php'); //
fire up WPTuner
?>
Note the global variables and slightly different path if copying the
code from wp-config.php.
2. Remove the plugin's code from wp-config.php.
3. Open wptunertop.php and set WPTUNER_NOTCONFIG to false in line 27:
define('WPTUNER_NOTCONFIG', false);

That's it.

The purpose of wptunertop.php is to load the plugin as early as
possible, before the inclusion of wp-db.php, which is then included by
the plugin itself. This approach is not compatible with WordPress 3.0,
because wpdb constructor calls is_multisite(), which is not defined
yet due to the wrong calling sequence.

Being called from wp-content/db.php, the file is still loaded before
database initialization, so the plugin works as intended.

--
Sergey


More information about the wp-hackers mailing list