Code Duplication    Length = 12-12 lines in 2 locations

modules/photon-cdn.php 2 locations

@@ 183-194 (lines=12) @@
180
			return false;
181
		}
182
183
		foreach ( $wp_scripts->registered as $handle => $thing ) {
184
			if ( wp_startswith( $thing->src, self::CDN ) ) {
185
				continue;
186
			}
187
			if ( wp_startswith( $thing->src, $plugin_directory_url ) ) {
188
				$local_path = substr( $thing->src, strlen( $plugin_directory_url ) );
189
				if ( in_array( $local_path, $assets, true ) ) {
190
					$wp_scripts->registered[ $handle ]->src = sprintf( self::CDN . 'p/%1$s/%2$s/%3$s', $plugin_slug, $current_version, $local_path );
191
					$wp_scripts->registered[ $handle ]->ver = null;
192
				}
193
			}
194
		}
195
		foreach ( $wp_styles->registered as $handle => $thing ) {
196
			if ( wp_startswith( $thing->src, self::CDN ) ) {
197
				continue;
@@ 195-206 (lines=12) @@
192
				}
193
			}
194
		}
195
		foreach ( $wp_styles->registered as $handle => $thing ) {
196
			if ( wp_startswith( $thing->src, self::CDN ) ) {
197
				continue;
198
			}
199
			if ( wp_startswith( $thing->src, $plugin_directory_url ) ) {
200
				$local_path = substr( $thing->src, strlen( $plugin_directory_url ) );
201
				if ( in_array( $local_path, $assets, true ) ) {
202
					$wp_styles->registered[ $handle ]->src = sprintf( self::CDN . 'p/%1$s/%2$s/%3$s', $plugin_slug, $current_version, $local_path );
203
					$wp_styles->registered[ $handle ]->ver = null;
204
				}
205
			}
206
		}
207
	}
208
209
	/**