Code Duplication    Length = 12-12 lines in 2 locations

modules/photon.php 2 locations

@@ 71-82 (lines=12) @@
68
			return false;
69
		}
70
71
		foreach ( $wp_scripts->registered as $handle => $thing ) {
72
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
73
				continue;
74
			}
75
			if ( wp_startswith( $thing->src, $plugin_directory_url ) ) {
76
				$local_path = substr( $thing->src, strlen( $plugin_directory_url ) );
77
				if ( in_array( $local_path, $assets ) ) {
78
					$wp_scripts->registered[ $handle ]->src = sprintf('https://c0.wp.com/p/%1$s/%2$s/%3$s', $plugin_slug, $current_version, $local_path );
79
					$wp_scripts->registered[ $handle ]->ver = null;
80
				}
81
			}
82
		}
83
		foreach ( $wp_styles->registered as $handle => $thing ) {
84
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
85
				continue;
@@ 83-94 (lines=12) @@
80
				}
81
			}
82
		}
83
		foreach ( $wp_styles->registered as $handle => $thing ) {
84
			if ( wp_startswith( $thing->src, 'https://c0.wp.com/' ) ) {
85
				continue;
86
			}
87
			if ( wp_startswith( $thing->src, $plugin_directory_url ) ) {
88
				$local_path = substr( $thing->src, strlen( $plugin_directory_url ) );
89
				if ( in_array( $local_path, $assets ) ) {
90
					$wp_styles->registered[ $handle ]->src = sprintf('https://c0.wp.com/p/%1$s/%2$s/%3$s', $plugin_slug, $current_version, $local_path );
91
					$wp_styles->registered[ $handle ]->ver = null;
92
				}
93
			}
94
		}
95
	}
96
97
	/**