Code Duplication    Length = 12-12 lines in 2 locations

modules/shortcodes/facebook.php 1 location

@@ 130-141 (lines=12) @@
127
 * @param array  $args oEmbed remote get arguments.
128
 * @param string $url  URL to be inspected.
129
 */
130
function jetpack_facebook_oembed_remote_get_args( $args, $url ) {
131
	if ( ! wp_startswith( $url, Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ) . '/oembed/1.0/' ) ) {
132
		return $args;
133
	}
134
135
	$method         = 'GET';
136
	$signed_request = Client::build_signed_request(
137
		compact( 'url', 'method' )
138
	);
139
140
	return $signed_request['request'];
141
}
142
143
/**
144
 * Fetches a Facebook API access token used for query for Facebook embed information, if one is set.

modules/shortcodes/instagram.php 1 location

@@ 267-278 (lines=12) @@
264
 * @param array  $args oEmbed remote get arguments.
265
 * @param string $url  URL to be inspected.
266
 */
267
function jetpack_instagram_oembed_remote_get_args( $args, $url ) {
268
	if ( ! wp_startswith( $url, Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ) . '/wpcom/v2/oembed-proxy/instagram/' ) ) {
269
		return $args;
270
	}
271
272
	$method         = 'GET';
273
	$signed_request = Client::build_signed_request(
274
		compact( 'url', 'method' )
275
	);
276
277
	return $signed_request['request'];
278
}
279
280
/**
281
 * Fetches a Facebook API access token used for query for Instagram embed information, if one is set.