Code Duplication    Length = 22-25 lines in 4 locations

projects/plugins/jetpack/class.jetpack-idc.php 2 locations

@@ 586-610 (lines=25) @@
583
		return apply_filters( 'jetpack_idc_second_step_header_lead', $string );
584
	}
585
586
	function get_migrate_site_action_explanation() {
587
		$html = wp_kses(
588
			sprintf(
589
				__(
590
					'Yes. <a href="%1$s">%2$s</a> is replacing <a href="%3$s">%4$s</a>. I would like to
591
					migrate my stats and subscribers from <a href="%3$s">%4$s</a> to <a href="%1$s">%2$s</a>.',
592
					'jetpack'
593
				),
594
				esc_url( get_home_url() ),
595
				self::prepare_url_for_display( get_home_url() ),
596
				esc_url( self::$wpcom_home_url ),
597
				untrailingslashit( Jetpack::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
598
			),
599
			array( 'a' => array( 'href' => array() ) )
600
		);
601
602
		/**
603
		 * Allows overriding of the default text for explaining the migrate site action.
604
		 *
605
		 * @since 4.4.0
606
		 *
607
		 * @param string $html The HTML to be displayed
608
		 */
609
		return apply_filters( 'jetpack_idc_migrate_site_explanation', $html );
610
	}
611
612
	function get_migrate_site_button_text() {
613
		$string = esc_html__( 'Migrate Stats &amp; Subscribers', 'jetpack' );
@@ 625-649 (lines=25) @@
622
		return apply_filters( 'jetpack_idc_migrate_site_button_text', $string );
623
	}
624
625
	function get_start_fresh_action_explanation() {
626
		$html = wp_kses(
627
			sprintf(
628
				__(
629
					'No. <a href="%1$s">%2$s</a> is a new and different website that\'s separate from
630
					<a href="%3$s">%4$s</a>. It requires  a new connection to WordPress.com for new stats and subscribers.',
631
					'jetpack'
632
				),
633
				esc_url( get_home_url() ),
634
				self::prepare_url_for_display( get_home_url() ),
635
				esc_url( self::$wpcom_home_url ),
636
				untrailingslashit( Jetpack::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
637
			),
638
			array( 'a' => array( 'href' => array() ) )
639
		);
640
641
		/**
642
		 * Allows overriding of the default text for explaining the start fresh action.
643
		 *
644
		 * @since 4.4.0
645
		 *
646
		 * @param string $html The HTML to be displayed
647
		 */
648
		return apply_filters( 'jetpack_idc_start_fresh_explanation', $html );
649
	}
650
651
	function get_start_fresh_button_text() {
652
		$string = esc_html__( 'Start Fresh &amp; Create New Connection', 'jetpack' );

projects/packages/identity-crisis/src/class-identity-crisis.php 2 locations

@@ 863-884 (lines=22) @@
860
	 *
861
	 * @return string
862
	 */
863
	public function get_migrate_site_action_explanation() {
864
		$html = wp_kses(
865
			sprintf(
866
			/* translators: %s: Site URL. */
867
				__( 'Yes. <a href="%1$s">%2$s</a> is replacing <a href="%3$s">%4$s</a>. I would like to migrate my stats and subscribers from <a href="%3$s">%4$s</a> to <a href="%1$s">%2$s</a>.', 'jetpack' ),
868
				esc_url( get_home_url() ),
869
				self::prepare_url_for_display( get_home_url() ),
870
				esc_url( self::$wpcom_home_url ),
871
				untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
872
			),
873
			array( 'a' => array( 'href' => array() ) )
874
		);
875
876
		/**
877
		 * Allows overriding of the default text for explaining the migrate site action.
878
		 *
879
		 * @param string $html The HTML to be displayed.
880
		 *
881
		 * @since 1.0.0
882
		 */
883
		return apply_filters( 'jetpack_idc_migrate_site_explanation', $html );
884
	}
885
886
	/**
887
	 * Returns the migrate site button text.
@@ 909-930 (lines=22) @@
906
	 *
907
	 * @return string
908
	 */
909
	public function get_start_fresh_action_explanation() {
910
		$html = wp_kses(
911
			sprintf(
912
			/* translators: %s: Site URL. */
913
				__( 'No. <a href="%1$s">%2$s</a> is a new and different website that\'s separate from <a href="%3$s">%4$s</a>. It requires  a new connection to WordPress.com for new stats and subscribers.', 'jetpack' ),
914
				esc_url( get_home_url() ),
915
				self::prepare_url_for_display( get_home_url() ),
916
				esc_url( self::$wpcom_home_url ),
917
				untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
918
			),
919
			array( 'a' => array( 'href' => array() ) )
920
		);
921
922
		/**
923
		 * Allows overriding of the default text for explaining the start fresh action.
924
		 *
925
		 * @param string $html The HTML to be displayed.
926
		 *
927
		 * @since 1.0.0
928
		 */
929
		return apply_filters( 'jetpack_idc_start_fresh_explanation', $html );
930
	}
931
932
	/**
933
	 * Returns the start fresh button text.