@@ 55-62 (lines=8) @@ | ||
52 | return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); |
|
53 | } |
|
54 | ||
55 | public function estimate_full_sync_actions( $config ) { |
|
56 | global $wpdb; |
|
57 | ||
58 | $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
|
59 | $count = $wpdb->get_var( $query ); |
|
60 | ||
61 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
62 | } |
|
63 | ||
64 | private function get_where_sql( $config ) { |
|
65 | $where_sql = Jetpack_Sync_Settings::get_blacklisted_post_types_sql(); |
@@ 103-110 (lines=8) @@ | ||
100 | return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_woocommerce_order_items', $this->order_item_table_name, 'order_item_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); |
|
101 | } |
|
102 | ||
103 | public function estimate_full_sync_actions( $config ) { |
|
104 | global $wpdb; |
|
105 | ||
106 | $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
|
107 | $count = $wpdb->get_var( $query ); |
|
108 | ||
109 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
110 | } |
|
111 | ||
112 | private function get_where_sql( $config ) { |
|
113 | return '1=1'; |