Just as a further note:
I tried using the Search in Content and received the following error:
Looking @ post content …
… in table posts, field post_content: The inquiry could not be implemented: Table ‘mydatabase_global.wp_1_posts’ doesn’t exist
I think this should make it more clear that your plugin is currently not compatible with a multi-database configuration.
As your plugin is designed to search and replace in the database; it makes sense that it would work with multisite if multisite is using a single db. However, to work with a multidb configuration it should first check if multidb is being used and how many db are being used: 16, 256, or 4096 (these are the most common). Then if multidb is used if you are doing a global search and replace it would have to go through each database making the search and replace.
I have a fix database plugin that I customized to make it work using something like the following:
function fdb_fix_database($targetdb = "") {
global $wpdb;
global $blog_id;
set_time_limit(1800);
if(empty($blog_id) || ($blog_id == 1) || is_network_admin()) {
$dataset = $targetdb;
}
else
{
$hash_value = md5($blog_id);
if (DB_SCALING == '16'){
$dataset = substr($hash_value, 0, 1);
} else if (DB_SCALING == '256'){
$dataset = substr($hash_value, 0, 2);
} else if (DB_SCALING == '4096'){
$dataset = substr($hash_value, 0, 3);
} else {
$dataset = substr($hash_value, 0, 1);
}
}
global $db_servers;
$server = $db_servers[$dataset][0];
$dbcon = @mysql_connect( $server['lhost'], $server['user'], $server['password'],true);
if ( !@mysql_select_db( $server['name'] , $dbcon ) )
{
echo "error";
}
if (empty($blog_id) || ($blog_id == 1) || is_network_admin())
{
$tablelist = getresult(@mysql_query( "show tables ", $dbcon ));
}
else
{
$tablelist = getresult(@mysql_query( "show tables from " . $server['name'] . " like '%\_".$blog_id."\_%'", $dbcon ));
}
foreach ($tablelist as $tar) {
$tablename = $tar[0];
Sorry if it is a bit messy but this should give you the idea.
It would be fantastic if you also added a Network Admin page so that you could search and replace globally on a multisite install and then the normal search and replace page could be used for search and replace on a single site.
Pat