is_wpcom_simple() || class_exists( '\Jetpack_Options' ); } /** * Get the site ID. * * @return int The site ID. */ public function get_site_id() { return \Jetpack_Options::get_option( 'id' ); } /** * Get the key. * * @return string The key. */ public function get_key() { if ( ( new Host() )->is_wpcom_simple() ) { // phpcs:ignore ImportDetection.Imports.RequireImports.Symbol return defined( 'EARN_JWT_SIGNING_KEY' ) ? EARN_JWT_SIGNING_KEY : false; } $token = ( new Tokens() )->get_access_token(); if ( ! isset( $token->secret ) ) { return false; } return $token->secret; } /** * Returns true if the current authenticated user has a pending subscription to the current site. * * @return bool */ public function is_current_user_pending_subscriber(): bool { return self::BLOG_SUB_PENDING === $this->get_token_property( 'blog_sub' ); } }