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

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