Code Duplication    Length = 4-4 lines in 3 locations

class.json-api-endpoints.php 2 locations

@@ 1168-1171 (lines=4) @@
1165
1166
		if ( in_array( $ext, array( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {
1167
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1168
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
1169
				$response['height'] = $metadata['height'];
1170
				$response['width'] = $metadata['width'];
1171
			}
1172
			if ( is_array( $metadata['sizes'] ) ) {
1173
			      	foreach ( $metadata['sizes'] as $size => $size_details ) {
1174
			      	      	$response['thumbnails'][ $size ] = dirname( $response['URL'] ) . '/' . $size_details['file'];
@@ 1188-1191 (lines=4) @@
1185
1186
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
1187
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1188
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
1189
				$response['height'] = $metadata['height'];
1190
				$response['width']  = $metadata['width'];
1191
			}
1192
1193
			if ( isset( $metadata['length'] ) ) {
1194
				$response['length'] = $metadata['length'];

functions.opengraph.php 1 location

@@ 272-275 (lines=4) @@
269
				$image = array();
270
				foreach ( (array) $post_images as $post_image ) {
271
					$image['src'] = $post_image['src'];
272
					if ( isset( $post_image['src_width'], $post_image['src_height'] ) ) {
273
						$image['width']  = $post_image['src_width'];
274
						$image['height'] = $post_image['src_height'];
275
					}
276
				}
277
			}
278
		}