+
+ public static function connect_jetpack_user() {
+
+ if ( $jetpack_user = self::get_jetpack_user() ) {
+ if ( isset( $jetpack_user['user_id'] ) && isset( $jetpack_user['api_key'] ) ) {
+ $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'], array( 'action' => 'connect_jetpack_user' ) );
+
+ if ( is_object( $akismet_user ) ) {
+ self::save_key( $akismet_user->api_key );
+ return in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) );
+ }
+ }
+ }
+
+ return false;
+ }