ElasticPress icon indicating copy to clipboard operation
ElasticPress copied to clipboard

Display last sync info in site health screen

Open oscarssanchez opened this issue 2 years ago • 2 comments

Description of the Change

This PR adds the sync info in the site health screen

Closes #2856

Closes #

How to test the Change

Changelog Entry

Added - Display last sync info in site health screen

Credits

Props @oscarssanchez , @felipeelia

Checklist:

  • [ ] I agree to follow this project's Code of Conduct.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my change.
  • [ ] All new and existing tests pass.

oscarssanchez avatar Aug 02 '22 11:08 oscarssanchez

@oscarssanchez did you test this if the last sync threw some errors? The following snippet will likely throw errors related to the field limits, if you need:

add_filter(
	'ep_prepare_meta_data',
	function( $post_meta, $post ) {
		for ( $i = 0; $i < 100; $i++ ) {
			$post_meta[ "test_meta_{$i}_title_{$post->ID}" ] = 'Lorem';
			$post_meta[ "test_meta_{$i}_body_{$post->ID}" ]  = 'Ipsum';
		}
		return $post_meta;
	},
	10,
	2
);

felipeelia avatar Aug 02 '22 11:08 felipeelia

@oscarssanchez did you test this if the last sync threw some errors? The following snippet will likely throw errors related to the field limits, if you need:

add_filter(
	'ep_prepare_meta_data',
	function( $post_meta, $post ) {
		for ( $i = 0; $i < 100; $i++ ) {
			$post_meta[ "test_meta_{$i}_title_{$post->ID}" ] = 'Lorem';
			$post_meta[ "test_meta_{$i}_body_{$post->ID}" ]  = 'Ipsum';
		}
		return $post_meta;
	},
	10,
	2
);

Yes errors seem to be logged correctly as well.

oscarssanchez avatar Aug 09 '22 01:08 oscarssanchez