Code Duplication    Length = 11-13 lines in 3 locations

_inc/lib/functions.wp-notify.php 3 locations

@@ 99-109 (lines=11) @@
96
				/* translators: 1: blog name, 2: post title */
97
				$subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title );
98
			break;
99
		case 'pingback':
100
			/* translators: 1: Post title */
101
			$notify_message = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n";
102
			/* translators: 1: Trackback/pingback website name, 2: website IP address, 3: website hostname */
103
			$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
104
			/* translators: %s: Site URL */
105
			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
106
			/* translators: %s: Comment Content */
107
			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
108
			$notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
109
			/* translators: 1: blog name, 2: post title */
110
			$subject = sprintf( __( '[%1$s] Pingback: "%2$s"' ), $blogname, $post->post_title );
111
			break;
112
		default: // Comments.
@@ 86-96 (lines=11) @@
83
	$moderate_on_wpcom = ! in_array( false, array_map( 'jetpack_notify_is_user_connected_by_email', $emails ) );
84
85
	switch ( $comment->comment_type ) {
86
		case 'trackback':
87
			/* translators: 1: Post title */
88
			$notify_message = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n";
89
			/* translators: 1: Trackback/pingback website name, 2: website IP address, 3: website hostname */
90
			$notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
91
			/* translators: %s: Site URL */
92
			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
93
			/* translators: %s: Comment Content */
94
			$notify_message     .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
95
				$notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
96
				/* translators: 1: blog name, 2: post title */
97
				$subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title );
98
			break;
99
		case 'pingback':
@@ 289-301 (lines=13) @@
286
			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
287
			$notify_message .= __( 'Pingback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n";
288
			break;
289
		default: // Comments.
290
			/* translators: 1: Post title */
291
			$notify_message  = sprintf( __( 'A new comment on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n";
292
			$notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n";
293
			/* translators: 1: Comment author name, 2: comment author's IP address, 3: comment author's hostname */
294
			$notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
295
			/* translators: 1: Comment author URL */
296
			$notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
297
			/* translators: 1: Trackback/pingback/comment author URL */
298
			$notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
299
			/* translators: 1: Comment text */
300
			$notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
301
			break;
302
	}
303
304
	/** This filter is documented in core/src/wp-includes/pluggable.php */