Code Duplication    Length = 10-10 lines in 2 locations

modules/photon-cdn.php 2 locations

@@ 71-80 (lines=10) @@
68
69
		if ( self::is_public_version( $version ) ) {
70
			$site_url = trailingslashit( site_url() );
71
			foreach ( $wp_scripts->registered as $handle => $thing ) {
72
				if ( wp_startswith( $thing->src, self::CDN ) ) {
73
					continue;
74
				}
75
				$src = ltrim( str_replace( $site_url, '', $thing->src ), '/' );
76
				if ( self::is_js_or_css_file( $src ) && in_array( substr( $src, 0, 9 ), array( 'wp-admin/', 'wp-includ' ) ) ) {
77
					$wp_scripts->registered[ $handle ]->src = sprintf( self::CDN . 'c/%1$s/%2$s', $version, $src );
78
					$wp_scripts->registered[ $handle ]->ver = null;
79
				}
80
			}
81
			foreach ( $wp_styles->registered as $handle => $thing ) {
82
				if ( wp_startswith( $thing->src, self::CDN ) ) {
83
					continue;
@@ 81-90 (lines=10) @@
78
					$wp_scripts->registered[ $handle ]->ver = null;
79
				}
80
			}
81
			foreach ( $wp_styles->registered as $handle => $thing ) {
82
				if ( wp_startswith( $thing->src, self::CDN ) ) {
83
					continue;
84
				}
85
				$src = ltrim( str_replace( $site_url, '', $thing->src ), '/' );
86
				if ( self::is_js_or_css_file( $src ) && in_array( substr( $src, 0, 9 ), array( 'wp-admin/', 'wp-includ' ) ) ) {
87
					$wp_styles->registered[ $handle ]->src = sprintf( self::CDN . 'c/%1$s/%2$s', $version, $src );
88
					$wp_styles->registered[ $handle ]->ver = null;
89
				}
90
			}
91
		}
92
93
		self::cdnize_plugin_assets( 'jetpack', JETPACK__VERSION );