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
1173
			if ( isset( $metadata['sizes'] ) ) {
1174
				/**
@@ 1205-1208 (lines=4) @@
1202
1203
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
1204
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1205
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
1206
				$response['height'] = $metadata['height'];
1207
				$response['width']  = $metadata['width'];
1208
			}
1209
1210
			if ( isset( $metadata['length'] ) ) {
1211
				$response['length'] = $metadata['length'];

functions.opengraph.php 1 location

@@ 282-285 (lines=4) @@
279
				$image = array();
280
				foreach ( (array) $post_images as $post_image ) {
281
					$image['src'] = $post_image['src'];
282
					if ( isset( $post_image['src_width'], $post_image['src_height'] ) ) {
283
						$image['width']  = $post_image['src_width'];
284
						$image['height'] = $post_image['src_height'];
285
					}
286
				}
287
			}
288
		}