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

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