diff --git a/includes/classes/IndexHelper.php b/includes/classes/IndexHelper.php index 7e7ed28d85..4b3f501787 100644 --- a/includes/classes/IndexHelper.php +++ b/includes/classes/IndexHelper.php @@ -806,9 +806,10 @@ protected function index_cleanup() { * @since 4.2.0 */ protected function update_last_index() { - $start_time = $this->index_meta['start_time']; - $totals = $this->index_meta['totals']; - $method = $this->index_meta['method']; + $start_time = $this->index_meta['start_time']; + $totals = $this->index_meta['totals']; + $method = $this->index_meta['method']; + $is_full_sync = $this->index_meta['put_mapping']; $this->index_meta = null; @@ -820,6 +821,7 @@ protected function update_last_index() { $totals['end_time_gmt'] = time(); $totals['total_time'] = microtime( true ) - $start_time; $totals['method'] = $method; + $totals['is_full_sync'] = $is_full_sync; Utils\update_option( 'ep_last_cli_index', $totals, false ); Utils\update_option( 'ep_last_index', $totals, false ); } diff --git a/includes/classes/StatusReport/LastSync.php b/includes/classes/StatusReport/LastSync.php index e096e08ba1..70582093c5 100644 --- a/includes/classes/StatusReport/LastSync.php +++ b/includes/classes/StatusReport/LastSync.php @@ -71,6 +71,10 @@ public function get_groups() : array { $sync_info['method'] = $methods[ $sync_info['method'] ] ?? $sync_info['method']; } + if ( isset( $sync_info['is_full_sync'] ) ) { + $sync_info['is_full_sync'] = $sync_info['is_full_sync'] ? esc_html__( 'Yes', 'elasticpress' ) : esc_html__( 'No', 'elasticpress' ); + } + $labels = [ 'total' => esc_html__( 'Total', 'elasticpress' ), 'synced' => esc_html__( 'Synced', 'elasticpress' ), @@ -78,6 +82,7 @@ public function get_groups() : array { 'failed' => esc_html__( 'Failed', 'elasticpress' ), 'errors' => esc_html__( 'Errors', 'elasticpress' ), 'method' => esc_html__( 'Method', 'elasticpress' ), + 'is_full_sync' => esc_html__( 'Full Sync', 'elasticpress' ), 'end_date_time' => esc_html__( 'End Date Time', 'elasticpress' ), 'start_date_time' => esc_html__( 'Start Date Time', 'elasticpress' ), 'total_time' => esc_html__( 'Total Time', 'elasticpress' ), @@ -90,7 +95,7 @@ public function get_groups() : array { * the usual `array_replace(array_flip())` strategy to reorder an array adds a wrong numeric value to the * non-existent row. */ - $preferred_order = [ 'method', 'start_date_time', 'end_date_time', 'total_time', 'total', 'synced', 'skipped', 'failed', 'errors' ]; + $preferred_order = [ 'method', 'is_full_sync', 'start_date_time', 'end_date_time', 'total_time', 'total', 'synced', 'skipped', 'failed', 'errors' ]; $ordered_sync_info = []; foreach ( $preferred_order as $field ) { if ( array_key_exists( $field, $sync_info ) ) { diff --git a/tests/cypress/integration/general.cy.js b/tests/cypress/integration/general.cy.js index 9e9a50184e..431e820ff3 100644 --- a/tests/cypress/integration/general.cy.js +++ b/tests/cypress/integration/general.cy.js @@ -113,13 +113,14 @@ describe('WordPress can perform standard ElasticPress actions', { tags: '@slow' cy.get('[aria-controls="health-check-accordion-block-ep-last-sync"]').click(); cy.get('#health-check-accordion-block-ep-last-sync .health-check-table').as('syncTable'); cy.get('@syncTable').get('tr:nth-child(1) td').should('contain.text', 'Method'); - cy.get('@syncTable').get('tr:nth-child(2) td').should('contain.text', 'Start Date Time'); - cy.get('@syncTable').get('tr:nth-child(3) td').should('contain.text', 'End Date Time'); - cy.get('@syncTable').get('tr:nth-child(4) td').should('contain.text', 'Total Time'); - cy.get('@syncTable').get('tr:nth-child(5) td').should('contain.text', 'Total'); - cy.get('@syncTable').get('tr:nth-child(6) td').should('contain.text', 'Synced'); - cy.get('@syncTable').get('tr:nth-child(7) td').should('contain.text', 'Skipped'); - cy.get('@syncTable').get('tr:nth-child(8) td').should('contain.text', 'Failed'); - cy.get('@syncTable').get('tr:nth-child(9) td').should('contain.text', 'Errors'); + cy.get('@syncTable').get('tr:nth-child(2) td').should('contain.text', 'Full Sync'); + cy.get('@syncTable').get('tr:nth-child(3) td').should('contain.text', 'Start Date Time'); + cy.get('@syncTable').get('tr:nth-child(4) td').should('contain.text', 'End Date Time'); + cy.get('@syncTable').get('tr:nth-child(5) td').should('contain.text', 'Total Time'); + cy.get('@syncTable').get('tr:nth-child(6) td').should('contain.text', 'Total'); + cy.get('@syncTable').get('tr:nth-child(7) td').should('contain.text', 'Synced'); + cy.get('@syncTable').get('tr:nth-child(8) td').should('contain.text', 'Skipped'); + cy.get('@syncTable').get('tr:nth-child(9) td').should('contain.text', 'Failed'); + cy.get('@syncTable').get('tr:nth-child(10) td').should('contain.text', 'Errors'); }); });