Code Duplication    Length = 11-14 lines in 2 locations

sync/class.jetpack-sync-full.php 2 locations

@@ 31-44 (lines=14) @@
28
		$client->force_sync_constants();
29
	}
30
31
	private function enqueue_all_posts() {
32
		global $wpdb;
33
34
		// I hope this is never bigger than RAM...
35
		$post_ids = $wpdb->get_col( "SELECT id FROM $wpdb->posts");
36
37
		// Request posts in groups of N for efficiency
38
		$chunked_post_ids = array_chunk( $post_ids, self::$array_chunk_size );
39
40
		// Send each chunk as an array of objects
41
		foreach ( $chunked_post_ids as $chunk ) {
42
			$posts = get_posts( array( 'post__in' => $chunk, 'post_status' => 'any' ) );
43
			do_action( 'jp_full_sync_posts', $posts );
44
		}
45
	}
46
47
	private function enqueue_all_comments() {
@@ 47-57 (lines=11) @@
44
		}
45
	}
46
47
	private function enqueue_all_comments() {
48
		global $wpdb;
49
50
		$comment_ids = $wpdb->get_col( "SELECT comment_id FROM $wpdb->comments");
51
		$chunked_comment_ids = array_chunk( $comment_ids, self::$array_chunk_size );
52
53
		foreach ( $chunked_comment_ids as $chunk ) {
54
			$comments = get_comments( array( 'comment__in' => $chunk ) );
55
			do_action( 'jp_full_sync_comments', $comments );
56
		}
57
	}
58
	
59
}