Code Duplication    Length = 14-14 lines in 2 locations

projects/packages/post-images/src/class-post-images.php 1 location

@@ 508-521 (lines=14) @@
505
506
		$permalink = get_permalink( $post_id );
507
508
		if ( function_exists( 'blavatar_domain' ) && function_exists( 'blavatar_exists' ) && function_exists( 'blavatar_url' ) ) {
509
			$domain = \blavatar_domain( $permalink );
510
511
			if ( ! \blavatar_exists( $domain ) ) {
512
				return array();
513
			}
514
515
			$url = \blavatar_url( $domain, 'img', $size );
516
		} else {
517
			$url = get_site_icon_url( $size );
518
			if ( ! $url ) {
519
				return array();
520
			}
521
		}
522
523
		return array(
524
			array(

projects/plugins/jetpack/class.jetpack-post-images.php 1 location

@@ 510-523 (lines=14) @@
507
508
		$permalink = get_permalink( $post_id );
509
510
		if ( function_exists( 'blavatar_domain' ) && function_exists( 'blavatar_exists' ) && function_exists( 'blavatar_url' ) ) {
511
			$domain = blavatar_domain( $permalink );
512
513
			if ( ! blavatar_exists( $domain ) ) {
514
				return array();
515
			}
516
517
			$url = blavatar_url( $domain, 'img', $size );
518
		} else {
519
			$url = get_site_icon_url( $size );
520
			if ( ! $url ) {
521
				return array();
522
			}
523
		}
524
525
		return array(
526
			array(