| @@ 88-95 (lines=8) @@ | ||
| 85 | return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); |
|
| 86 | } |
|
| 87 | ||
| 88 | public function estimate_full_sync_actions( $config ) { |
|
| 89 | global $wpdb; |
|
| 90 | ||
| 91 | $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
|
| 92 | $count = $wpdb->get_var( $query ); |
|
| 93 | ||
| 94 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 95 | } |
|
| 96 | ||
| 97 | private function get_where_sql( $config ) { |
|
| 98 | $where_sql = Settings::get_blacklisted_post_types_sql(); |
|
| @@ 142-149 (lines=8) @@ | ||
| 139 | 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 ); |
|
| 140 | } |
|
| 141 | ||
| 142 | public function estimate_full_sync_actions( $config ) { |
|
| 143 | global $wpdb; |
|
| 144 | ||
| 145 | $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
|
| 146 | $count = $wpdb->get_var( $query ); |
|
| 147 | ||
| 148 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 149 | } |
|
| 150 | ||
| 151 | private function get_where_sql( $config ) { |
|
| 152 | return '1=1'; |
|