Code Duplication    Length = 11-13 lines in 3 locations

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

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