Code Duplication    Length = 5-7 lines in 2 locations

modules/publicize/publicize.php 1 location

@@ 1239-1243 (lines=5) @@
1236
1237
function publicize_calypso_url() {
1238
	$calypso_sharing_url = 'https://wordpress.com/sharing/';
1239
	if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) {
1240
		$site_suffix = Jetpack::build_raw_urls( home_url() );
1241
	} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
1242
		$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
1243
	}
1244
1245
	if ( $site_suffix ) {
1246
		return $calypso_sharing_url . $site_suffix;

class.jetpack-gutenberg.php 1 location

@@ 519-525 (lines=7) @@
516
			? filemtime( JETPACK__PLUGIN_DIR . $blocks_dir . 'editor.js' )
517
			: JETPACK__VERSION;
518
519
		if ( method_exists( 'Jetpack', 'build_raw_urls' ) ) {
520
			$site_fragment = Jetpack::build_raw_urls( home_url() );
521
		} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
522
			$site_fragment = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
523
		} else {
524
			$site_fragment = '';
525
		}
526
527
		wp_enqueue_script(
528
			'jetpack-blocks-editor',