Code Duplication    Length = 20-23 lines in 6 locations

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

@@ 702-722 (lines=21) @@
699
	 *
700
	 * @return string
701
	 */
702
	public function get_first_step_header_lead() {
703
		$html = wp_kses(
704
			sprintf(
705
			/* translators: %s: Safe mode docs URL and site URL. */
706
				__( 'Jetpack has been placed into <a href="%1$s">Safe mode</a> because we noticed this is an exact copy of <a href="%2$s">%3$s</a>.', 'jetpack' ),
707
				esc_url( self::get_safe_mod_doc_url() ),
708
				esc_url( self::$wpcom_home_url ),
709
				self::prepare_url_for_display( esc_url_raw( self::$wpcom_home_url ) )
710
			),
711
			array( 'a' => array( 'href' => array() ) )
712
		);
713
714
		/**
715
		 * Allows overriding of the default header text in the first step of the Safe Mode notice.
716
		 *
717
		 * @param string $html The HTML to be displayed.
718
		 *
719
		 * @since 4.4.0
720
		 */
721
		return apply_filters( 'jetpack_idc_first_step_header_lead', $html );
722
	}
723
724
	/**
725
	 * Returns the first step header explanation.
@@ 754-773 (lines=20) @@
751
	 *
752
	 * @return string
753
	 */
754
	public function get_confirm_safe_mode_action_explanation() {
755
		$html = wp_kses(
756
			sprintf(
757
			/* translators: %s: Site URL. */
758
				__( 'Is this website a temporary duplicate of <a href="%1$s">%2$s</a> for the purposes of testing, staging or development? If so, we recommend keeping it in Safe Mode.', 'jetpack' ),
759
				esc_url( untrailingslashit( self::$wpcom_home_url ) ),
760
				self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) )
761
			),
762
			array( 'a' => array( 'href' => array() ) )
763
		);
764
765
		/**
766
		 * Allows overriding of the default text used to explain the confirm safe mode action.
767
		 *
768
		 * @param string $html The HTML to be displayed.
769
		 *
770
		 * @since 4.4.0
771
		 */
772
		return apply_filters( 'jetpack_idc_confirm_safe_mode_explanation', $html );
773
	}
774
775
	/**
776
	 * Returns the confirm safe mode button text.
@@ 798-817 (lines=20) @@
795
	 *
796
	 * @return string
797
	 */
798
	public function get_first_step_fix_connection_action_explanation() {
799
		$html = wp_kses(
800
			sprintf(
801
			/* translators: %s: Site URL. */
802
				__( 'If this is a separate and new website, or the new home of <a href="%1$s">%2$s</a>, we recommend turning Safe Mode off, and re-establishing your connection to WordPress.com.', 'jetpack' ),
803
				esc_url( untrailingslashit( self::$wpcom_home_url ) ),
804
				self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) )
805
			),
806
			array( 'a' => array( 'href' => array() ) )
807
		);
808
809
		/**
810
		 * Allows overriding of the default text used to explain the fix Jetpack connection action.
811
		 *
812
		 * @param string $html The HTML to be displayed.
813
		 *
814
		 * @since 4.4.0
815
		 */
816
		return apply_filters( 'jetpack_idc_first_fix_connection_explanation', $html );
817
	}
818
819
	/**
820
	 * Returns the first step fix connection button text.

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

@@ 445-467 (lines=23) @@
442
		<?php
443
	}
444
445
	function get_first_step_header_lead() {
446
		$html = wp_kses(
447
			sprintf(
448
				__(
449
					'Jetpack has been placed into <a href="%1$s">Safe mode</a> because we noticed this is an exact copy of <a href="%2$s">%3$s</a>.',
450
					'jetpack'
451
				),
452
				esc_url( self::get_safe_mod_doc_url() ),
453
				esc_url( self::$wpcom_home_url ),
454
				self::prepare_url_for_display( esc_url_raw( self::$wpcom_home_url ) )
455
			),
456
			array( 'a' => array( 'href' => array() ) )
457
		);
458
459
		/**
460
		 * Allows overriding of the default header text in the first step of the Safe Mode notice.
461
		 *
462
		 * @since 4.4.0
463
		 *
464
		 * @param string $html The HTML to be displayed
465
		 */
466
		return apply_filters( 'jetpack_idc_first_step_header_lead', $html );
467
	}
468
469
	function get_first_step_header_explanation() {
470
		$html = wp_kses(
@@ 492-514 (lines=23) @@
489
		return apply_filters( 'jetpack_idc_first_step_header_explanation', $html );
490
	}
491
492
	function get_confirm_safe_mode_action_explanation() {
493
		$html = wp_kses(
494
			sprintf(
495
				__(
496
					'Is this website a temporary duplicate of <a href="%1$s">%2$s</a> for the purposes
497
					of testing, staging or development? If so, we recommend keeping it in Safe Mode.',
498
					'jetpack'
499
				),
500
				esc_url( untrailingslashit( self::$wpcom_home_url ) ),
501
				self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) )
502
			),
503
			array( 'a' => array( 'href' => array() ) )
504
		);
505
506
		/**
507
		 * Allows overriding of the default text used to explain the confirm safe mode action.
508
		 *
509
		 * @since 4.4.0
510
		 *
511
		 * @param string $html The HTML to be displayed
512
		 */
513
		return apply_filters( 'jetpack_idc_confirm_safe_mode_explanation', $html );
514
	}
515
516
	function get_confirm_safe_mode_button_text() {
517
		$string = esc_html__( 'Confirm Safe Mode', 'jetpack' );
@@ 529-551 (lines=23) @@
526
		return apply_filters( 'jetpack_idc_confirm_safe_mode_button_text', $string );
527
	}
528
529
	function get_first_step_fix_connection_action_explanation() {
530
		$html = wp_kses(
531
			sprintf(
532
				__(
533
					'If this is a separate and new website, or the new home of <a href="%1$s">%2$s</a>,
534
					we recommend turning Safe Mode off, and re-establishing your connection to WordPress.com.',
535
					'jetpack'
536
				),
537
				esc_url( untrailingslashit( self::$wpcom_home_url ) ),
538
				self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) )
539
			),
540
			array( 'a' => array( 'href' => array() ) )
541
		);
542
543
		/**
544
		 * Allows overriding of the default text used to explain the fix Jetpack connection action.
545
		 *
546
		 * @since 4.4.0
547
		 *
548
		 * @param string $html The HTML to be displayed
549
		 */
550
		return apply_filters( 'jetpack_idc_first_fix_connection_explanation', $html );
551
	}
552
553
	function get_first_step_fix_connection_button_text() {
554
		$string = esc_html__( "Fix Jetpack's Connection", 'jetpack' );