/**
* Disconnects from the Jetpack servers.
* Forgets all connection details and tells the Jetpack servers to do the same.
* @static
*/
public static function disconnect($update_activated_state = true)
{
wp_clear_scheduled_hook('jetpack_clean_nonces');
Jetpack::clean_nonces(true);
Jetpack::load_xml_rpc_client();
$xml = new Jetpack_IXR_Client();
$xml->query('jetpack.deregister');
Jetpack_Options::delete_option(array('register', 'blog_token', 'user_token', 'user_tokens', 'master_user', 'time_diff', 'fallback_no_verify_ssl_certs'));
if ($update_activated_state) {
Jetpack_Options::update_option('activated', 4);
}
// Disable the Heartbeat cron
Jetpack_Heartbeat::init()->deactivate();
}