Code Duplication    Length = 8-8 lines in 2 locations

sal/class.json-api-post-base.php 1 location

@@ 464-471 (lines=8) @@
461
		}
462
463
		// TODO factor this out
464
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
465
			$active_blog = get_active_blog_for_user( $user->ID );
466
			$site_id     = $active_blog->get_id();
467
			$profile_URL = "http://en.gravatar.com/{$user->user_login}";
468
		} else {
469
			$profile_URL = 'http://en.gravatar.com/' . md5( strtolower( trim( $user->user_email ) ) );
470
			$site_id     = -1;
471
		}
472
473
		$author = array(
474
			'ID'          => (int) $user->ID,

class.json-api-endpoints.php 1 location

@@ 1095-1102 (lines=8) @@
1092
				$URL        = $user->user_url;
1093
				$nice       = $user->user_nicename;
1094
			}
1095
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM && ! $is_jetpack ) {
1096
				$active_blog = get_active_blog_for_user( $ID );
1097
				$site_id     = $active_blog->blog_id;
1098
				$profile_URL = "https://en.gravatar.com/{$login}";
1099
			} else {
1100
				$profile_URL = 'https://en.gravatar.com/' . md5( strtolower( trim( $email ) ) );
1101
				$site_id     = -1;
1102
			}
1103
1104
			$avatar_URL = $this->api->get_avatar_url( $email );
1105
		}