Code Duplication    Length = 12-12 lines in 2 locations

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
					'http://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;

modules/widgets/googleplus-badge.php 1 location

@@ 79-90 (lines=12) @@
76
	}
77
78
	function widget( $args, $instance ) {
79
		if ( empty( $instance['href'] ) || ! $this->is_valid_googleplus_url( $instance['href'] ) ) {
80
			if ( current_user_can( 'edit_theme_options' ) ) {
81
				echo $args['before_widget'];
82
				echo '<p>' . sprintf(
83
					__( 'It looks like your Google+ URL is incorrectly configured. Please check it in your <a href="%s">widget settings</a>.', 'jetpack' ),
84
					admin_url( 'widgets.php' )
85
				) . '</p>';
86
				echo $args['after_widget'];
87
			}
88
			echo '<!-- Invalid Google+ URL -->';
89
			return;
90
		}
91
92
		/** This filter is documented in core/src/wp-includes/default-widgets.php */
93
		$title = apply_filters( 'widget_title', $instance['title'] );