Code Duplication    Length = 13-13 lines in 2 locations

sync/class.jetpack-sync-module-users.php 1 location

@@ 218-230 (lines=13) @@
215
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_users', $wpdb->usermeta, 'user_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
216
	}
217
218
	public function estimate_full_sync_actions( $config ) {
219
		global $wpdb;
220
221
		$query = "SELECT count(*) FROM $wpdb->usermeta";
222
223
		if ( $where_sql = $this->get_where_sql( $config ) ) {
224
			$query .= ' WHERE ' . $where_sql;
225
		}
226
227
		$count = $wpdb->get_var( $query );
228
229
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
230
	}
231
232
	private function get_where_sql( $config ) {
233
		global $wpdb;

sync/class.jetpack-sync-module-comments.php 1 location

@@ 96-108 (lines=13) @@
93
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_comments', $wpdb->comments, 'comment_ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
94
	}
95
96
	public function estimate_full_sync_actions( $config ) {
97
		global $wpdb;
98
99
		$query = "SELECT count(*) FROM $wpdb->comments";
100
		
101
		if ( $where_sql = $this->get_where_sql( $config ) ) {
102
			$query .= ' WHERE ' . $where_sql;
103
		}
104
105
		$count = $wpdb->get_var( $query );
106
107
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
108
	}
109
110
	private function get_where_sql( $config ) {
111
		if ( is_array( $config ) ) {