Sidebars are registered in the option 'sidebars_widgets'
.
To see what’s in and what not, try this:
add_action( 'wp_footer', 'show_my_sidebars' );
function show_my_sidebars()
{
$sw = get_option( 'sidebars_widgets' );
print '<pre>' . htmlspecialchars( print_r( $sw, TRUE ) ) . '</pre>';
}
Sample output:
Array
(
[sidebar-footer-left] => Array
(
[0] => archives-3
)
[sidebar-footer-right] => Array
(
[0] => recent-comments-3
)[array_version] => 3
)
So check the option in per activation hook and insert your widgets if they aren’t already in there.
And stop using if ( function_exists('register_sidebar') )
. Do you really want to support four years old WP versions?