private function set_urls($url, $domain)
{
update_option('home', $url);
/**
* Updating the siteurl option will start the URL renaming plugin.
* So, yes, the following code is correct, even though siteurl will get updated two times!
*/
if ($domain) {
update_option('siteurl', $domain);
}
update_option('siteurl', $url);
}