| @@ 117-124 (lines=8) @@ | ||
| 114 | 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 ); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function estimate_full_sync_actions( $config ) { |
|
| 118 | global $wpdb; |
|
| 119 | ||
| 120 | $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
|
| 121 | $count = $wpdb->get_var( $query ); |
|
| 122 | ||
| 123 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 124 | } |
|
| 125 | ||
| 126 | private function get_where_sql( $config ) { |
|
| 127 | return '1=1'; |
|
| @@ 74-81 (lines=8) @@ | ||
| 71 | return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function estimate_full_sync_actions( $config ) { |
|
| 75 | global $wpdb; |
|
| 76 | $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
|
| 77 | $count = $wpdb->get_var( $query ); |
|
| 78 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 79 | } |
|
| 80 | ||
| 81 | private function get_where_sql( $config ) { |
|
| 82 | $where_sql = Jetpack_Sync_Settings::get_blacklisted_post_types_sql(); |
|
| 83 | // config is a list of post IDs to sync |
|
| 84 | if ( is_array( $config ) ) { |
|