@@ 104-111 (lines=8) @@ | ||
101 | 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 ); |
|
102 | } |
|
103 | ||
104 | public function estimate_full_sync_actions( $config ) { |
|
105 | global $wpdb; |
|
106 | ||
107 | $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
|
108 | $count = $wpdb->get_var( $query ); |
|
109 | ||
110 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
111 | } |
|
112 | ||
113 | private function get_where_sql( $config ) { |
|
114 | return '1=1'; |
@@ 60-67 (lines=8) @@ | ||
57 | return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); |
|
58 | } |
|
59 | ||
60 | public function estimate_full_sync_actions( $config ) { |
|
61 | global $wpdb; |
|
62 | ||
63 | $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
|
64 | $count = $wpdb->get_var( $query ); |
|
65 | ||
66 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
67 | } |
|
68 | ||
69 | private function get_where_sql( $config ) { |
|
70 | $where_sql = Jetpack_Sync_Settings::get_blacklisted_post_types_sql(); |