Code Duplication    Length = 22-25 lines in 4 locations

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

@@ 865-886 (lines=22) @@
862
	 *
863
	 * @return string
864
	 */
865
	public function get_migrate_site_action_explanation() {
866
		$html = wp_kses(
867
			sprintf(
868
			/* translators: %s: Site URL. */
869
				__( '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' ),
870
				esc_url( get_home_url() ),
871
				self::prepare_url_for_display( get_home_url() ),
872
				esc_url( self::$wpcom_home_url ),
873
				untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
874
			),
875
			array( 'a' => array( 'href' => array() ) )
876
		);
877
878
		/**
879
		 * Allows overriding of the default text for explaining the migrate site action.
880
		 *
881
		 * @param string $html The HTML to be displayed.
882
		 *
883
		 * @since 4.4.0
884
		 */
885
		return apply_filters( 'jetpack_idc_migrate_site_explanation', $html );
886
	}
887
888
	/**
889
	 * Returns the migrate site button text.
@@ 911-932 (lines=22) @@
908
	 *
909
	 * @return string
910
	 */
911
	public function get_start_fresh_action_explanation() {
912
		$html = wp_kses(
913
			sprintf(
914
			/* translators: %s: Site URL. */
915
				__( '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' ),
916
				esc_url( get_home_url() ),
917
				self::prepare_url_for_display( get_home_url() ),
918
				esc_url( self::$wpcom_home_url ),
919
				untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) )
920
			),
921
			array( 'a' => array( 'href' => array() ) )
922
		);
923
924
		/**
925
		 * Allows overriding of the default text for explaining the start fresh action.
926
		 *
927
		 * @param string $html The HTML to be displayed.
928
		 *
929
		 * @since 4.4.0
930
		 */
931
		return apply_filters( 'jetpack_idc_start_fresh_explanation', $html );
932
	}
933
934
	/**
935
	 * Returns the start fresh button text.

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

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