You appear to be a bot. Output may be restricted
Description
Sync Health Tests.
Disabled: Results in a failing test (recommended) Delayed: Results in failing test (recommended) Error: Results in failing test (critical)
Usage
Jetpack_Cxn_Tests::test__sync_health();
Parameters
Returns
void
Source
File name: jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php
Lines:
1 to 100 of 142
protected function test__sync_health() { $name = __FUNCTION__; if ( ! $this->helper_is_jetpack_connected() ) { // If the site is not connected, there is no point in testing Sync health. return self::skipped_test( array( 'name' => $name, 'show_in_site_health' => false, ) ); } // Sync is enabled. if ( Sync_Settings::is_sync_enabled() ) { if ( Sync_Health::get_status() === Sync_Health::STATUS_OUT_OF_SYNC ) { /* * Sync has experienced Data Loss. */ $description = '<p>'; $description .= esc_html__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ); $description .= '</p>'; $description .= '<p>'; $description .= sprintf( '<span class="dashicons fail"><span class="screen-reader-text">%1$s</span></span> ', esc_html__( 'Error', 'jetpack' ) ); $description .= wp_kses( __( 'Jetpack has detected that data is not properly in sync which may be impacting some of your site’s functionality. <strong>Click <a id="full_sync_request_link" href="#">here</a> to start a full sync</strong> to align Jetpack with your site data. If you still notice this error after running a full sync, please contact support for additional assistance.', 'jetpack' ), array( 'a' => array( 'id' => array(), 'href' => array(), ), 'strong' => array(), ) ); $description .= '</p>'; return self::failing_test( array( 'name' => $name, 'label' => __( 'Jetpack has detected an error syncing your site.', 'jetpack' ), 'severity' => 'critical', 'action' => Redirect::get_url( 'jetpack-contact-support' ), 'action_label' => __( 'Contact Jetpack Support', 'jetpack' ), 'short_description' => __( 'Jetpack has detected that data is not properly in sync which may be impacting some of your site’s functionality. We recommend a full sync to align Jetpack with your site data. If you still notice this error after running a full sync, please contact support for additional assistance.', 'jetpack' ), 'long_description' => $description, ) ); } else { // Get the Sync Queue. $sender = Sync_Sender::get_instance(); $sync_queue = $sender->get_sync_queue(); // lag exceeds 5 minutes. if ( $sync_queue->lag() > 5 * MINUTE_IN_SECONDS ) { $description = '<p>'; $description .= esc_html__( 'The information synced by Jetpack ensures that Jetpack Search, Related Posts and other features are aligned with your site’s current content.', 'jetpack' ); $description .= '</p>'; $description .= '<p>'; $description .= sprintf( '<span class="dashicons dashicons-clock" style="color: orange;"><span class="screen-reader-text">%1$s</span></span> ', /* translators: name, used to describe a clock icon. */ esc_html__( 'Clock', 'jetpack' ) ); $description .= wp_kses( sprintf( /* translators: placeholder is a number of minutes. */ _n( 'Jetpack has identified a delay while syncing individual content updates. Certain features might be slower than usual, but this is only temporary while sync catches up with recent changes to your site. <strong>We’re seeing a current delay of %1$d minute.</strong>', 'Jetpack has identified a delay while syncing individual content updates. Certain features might be slower than usual, but this is only temporary while sync catches up with recent changes to your site. <strong>We’re seeing a current delay of %1$d minutes.</strong>', (int) ( $sync_queue->lag() / MINUTE_IN_SECONDS ), 'jetpack' ), number_format_i18n( $sync_queue->lag() / MINUTE_IN_SECONDS ) ), array( 'strong' => array() ) ); $description .= '</p>'; return self::informational_test( array( 'name' => $name, 'label' => __( 'Jetpack is experiencing a delay syncing your site.', 'jetpack' ), 'severity' => 'recommended', 'action' => null, 'action_label' => null, 'short_description' => __( 'Jetpack is experiencing a delay syncing your site.', 'jetpack' ), 'long_description' => $description, ) ); } else { // Sync is Healthy. return self::passing_test( array( 'name' => $name ) );