Code Duplication    Length = 10-10 lines in 2 locations

modules/photon.php 2 locations

@@ 37-46 (lines=10) @@
34
35
		$known_core_files = self::get_core_checksums();
36
		$site_url = trailingslashit( site_url() );
37
		foreach ( $wp_scripts->registered as $handle => $thing ) {
38
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
39
				continue;
40
			}
41
			$src = ltrim( str_replace( $site_url, '', $thing->src ), '/' );
42
			if ( in_array( $src, $known_core_files ) ) {
43
				$wp_scripts->registered[ $handle ]->src = sprintf('https://c0.wp.com/c/%1$s/%2$s', $wp_version, $src );
44
				$wp_scripts->registered[ $handle ]->ver = null;
45
			}
46
		}
47
		foreach ( $wp_styles->registered as $handle => $thing ) {
48
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
49
				continue;
@@ 47-56 (lines=10) @@
44
				$wp_scripts->registered[ $handle ]->ver = null;
45
			}
46
		}
47
		foreach ( $wp_styles->registered as $handle => $thing ) {
48
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
49
				continue;
50
			}
51
			$src = ltrim( str_replace( $site_url, '', $thing->src ), '/' );
52
			if ( in_array( $src, $known_core_files ) ) {
53
				$wp_styles->registered[ $handle ]->src = sprintf('https://c0.wp.com/c/%1$s/%2$s', $wp_version, $src );
54
				$wp_styles->registered[ $handle ]->ver = null;
55
			}
56
		}
57
58
		self::cdnize_plugin_assets( 'jetpack', JETPACK__VERSION );
59
	}