function __construct()
{
$this->jetpack = Jetpack::init();
// Don't use COOKIEHASH as it could be shared across installs && is non-unique in multisite.
// @see: https://twitter.com/nacin/status/378246957451333632
self::$hash = md5(get_option('siteurl'));
add_filter('jetpack_xmlrpc_methods', array($this, 'xmlrpc_methods'));
// @todo remove sync from subscriptions and move elsewhere...
// Add Configuration Page
add_action('admin_init', array($this, 'configure'));
// Set up the subscription widget.
add_action('widgets_init', array($this, 'widget_init'));
// Catch subscription widget submits
if (isset($_REQUEST['jetpack_subscriptions_widget'])) {
add_action('template_redirect', array($this, 'widget_submit'));
}
// Set up the comment subscription checkboxes
add_action('comment_form', array($this, 'comment_subscribe_init'));
// Catch comment posts and check for subscriptions.
add_action('comment_post', array($this, 'comment_subscribe_submit'), 50, 2);
// Adds post meta checkbox in the post submit metabox
add_action('post_submitbox_misc_actions', array($this, 'subscription_post_page_metabox'));
add_action('transition_post_status', array($this, 'maybe_send_subscription_email'), 10, 3);
add_filter('jetpack_published_post_flags', array($this, 'set_post_flags'), 10, 2);
}