Code Duplication    Length = 9-12 lines in 2 locations

modules/widgets/facebook-likebox.php 1 location

@@ 65-73 (lines=9) @@
62
63
		$like_args = $this->normalize_facebook_args( $instance['like_args'] );
64
65
		if ( empty( $like_args['href'] ) || ! $this->is_valid_facebook_url( $like_args['href'] ) ) {
66
			if ( current_user_can( 'edit_theme_options' ) ) {
67
				echo $before_widget;
68
				echo '<p>' . sprintf( __( 'It looks like your Facebook URL is incorrectly configured. Please check it in your <a href="%s">widget settings</a>.', 'jetpack' ), admin_url( 'widgets.php' ) ) . '</p>';
69
				echo $after_widget;
70
			}
71
			echo '<!-- Invalid Facebook Page URL -->';
72
			return;
73
		}
74
75
		/** This filter is documented in core/src/wp-includes/default-widgets.php */
76
		$title    = apply_filters( 'widget_title', $instance['title'] );

modules/widgets/goodreads.php 1 location

@@ 56-67 (lines=12) @@
53
		/** This filter is documented in core/src/wp-includes/default-widgets.php */
54
		$title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '' );
55
56
		if ( empty( $instance['user_id'] ) || 'invalid' === $instance['user_id'] ) {
57
			if ( current_user_can( 'edit_theme_options' ) ) {
58
				echo $args['before_widget'];
59
				echo '<p>' . sprintf(
60
					__( 'You need to enter your numeric user ID for the <a href="%1$s">Goodreads Widget</a> to work correctly. <a href="%2$s" target="_blank">Full instructions</a>.', 'jetpack' ),
61
					esc_url( admin_url( 'widgets.php' ) ),
62
					'https://support.wordpress.com/widgets/goodreads-widget/#goodreads-user-id'
63
				) . '</p>';
64
				echo $args['after_widget'];
65
			}
66
			return;
67
		}
68
69
		if ( ! array_key_exists( $instance['shelf'], $this->shelves ) ) {
70
			return;