Code Duplication    Length = 4-5 lines in 3 locations

modules/publicize/publicize.php 3 locations

@@ 506-509 (lines=4) @@
503
				}
504
505
				$unique_id = null;
506
				if ( ! empty( $connection->unique_id ) ) {
507
					$unique_id = $connection->unique_id;
508
				} else if ( ! empty( $connection['connection_data']['token_id'] ) ) {
509
					$unique_id = $connection['connection_data']['token_id'];
510
				}
511
512
				$test_results[] = array(
@@ 973-976 (lines=4) @@
970
					continue;
971
				}
972
973
				if ( !empty( $connection->unique_id ) )
974
					$unique_id = $connection->unique_id;
975
				else if ( !empty( $connection['connection_data']['token_id'] ) )
976
					$unique_id = $connection['connection_data']['token_id'];
977
978
				// This was a wp-admin request, so we need to check the state of checkboxes
979
				if ( $from_web ) {
@@ 1110-1114 (lines=5) @@
1107
			// services have multiple connections.
1108
			foreach ( $connections as $connection ) {
1109
				$unique_id = '';
1110
				if ( ! empty( $connection->unique_id ) )
1111
					$unique_id = $connection->unique_id;
1112
				else if ( ! empty( $connection['connection_data']['token_id'] ) )
1113
					$unique_id = $connection['connection_data']['token_id'];
1114
1115
				// Did we skip this connection?
1116
				if ( get_post_meta( $post_id, $this->POST_SKIP . $unique_id,  true ) ) {
1117
					continue;