slug = 'autosuggest';
$this->title = esc_html__( 'Autosuggest', 'elasticpress' );
$this->summary = __( 'Suggest relevant content as text is entered into the search field.', 'elasticpress' );
$this->docs_url = __( 'https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#autosuggest', 'elasticpress' );
$this->requires_install_reindex = true;
$this->default_settings = [
'endpoint_url' => '',
'autosuggest_selector' => '',
'trigger_ga_event' => '0',
];
$this->available_during_installation = true;
parent::__construct();
}
/**
* Output feature box long
*
* @since 2.4
*/
public function output_feature_box_long() {
?>
=' ) || 0 === stripos( $wp_version, '5.2-' ) ) {
printf(
/* translators: 1:
tag (ElasticPress.io); 2. ; 3:
tag (KB article); 4. ; 5:
tag (Site Health Debug Section); 6. ; */
esc_html__( 'You are directly connected to %1$sElasticPress.io%2$s, ensuring the most performant Autosuggest experience. %3$sLearn more about what this means%4$s or %5$sclick here for debug information%6$s.', 'elasticpress' ),
'
',
'',
'
',
'',
'
',
''
);
} else {
printf(
/* translators: 1:
tag (ElasticPress.io); 2. ; 3:
tag (KB article); 4. ; */
esc_html__( 'You are directly connected to %1$sElasticPress.io%2$s, ensuring the most performant Autosuggest experience. %1$sLearn more about what this means%2$s.', 'elasticpress' ),
'
',
'',
'
',
''
);
if ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined( 'WP_EP_DEBUG' ) && WP_EP_DEBUG ) ) {
?>
[],
'postStatus' => [],
'searchFields' => [],
'returnFields' => '',
]
);
$fields = [
wp_sprintf( esc_html__( 'Post Types: %l', 'elasticpress' ), $allowed_params['postTypes'] ),
wp_sprintf( esc_html__( 'Post Status: %l', 'elasticpress' ), $allowed_params['postStatus'] ),
wp_sprintf( esc_html__( 'Search Fields: %l', 'elasticpress' ), $allowed_params['searchFields'] ),
wp_sprintf( esc_html__( 'Returned Fields: %s', 'elasticpress' ), var_export( $allowed_params['returnFields'], true ) ), // phpcs:ignore
];
echo implode( '
', $fields ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
?>
epio_retrieve_autosuggest_allowed();
if ( is_wp_error( $allowed_params ) || ( isset( $allowed_params['status'] ) && 200 !== $allowed_params['status'] ) ) {
$allowed_params = [];
break;
}
if ( empty( $allowed_params ) ) {
$this->epio_send_autosuggest_public_request( true );
}
}
return $allowed_params;
}
}