Code Duplication    Length = 5-7 lines in 2 locations

modules/publicize/publicize.php 1 location

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

class.jetpack-gutenberg.php 1 location

@@ 508-514 (lines=7) @@
505
			? filemtime( JETPACK__PLUGIN_DIR . $blocks_dir . 'editor.js' )
506
			: JETPACK__VERSION;
507
508
		if ( method_exists( 'Jetpack', 'build_raw_urls' ) ) {
509
			$site_fragment = Jetpack::build_raw_urls( home_url() );
510
		} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
511
			$site_fragment = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
512
		} else {
513
			$site_fragment = '';
514
		}
515
516
		wp_enqueue_script(
517
			'jetpack-blocks-editor',