Example #1
0
    $index_meta = get_option('ep_index_meta', false);
}
?>

<?php 
require_once dirname(__FILE__) . '/header.php';
?>

<div class="error-overlay <?php 
if (!empty($index_meta)) {
    ?>
syncing<?php 
}
?>
 <?php 
if (!ep_elasticsearch_can_connect()) {
    ?>
cant-connect<?php 
}
?>
"></div>
<div class="wrap">
	<h1><?php 
esc_html_e('ElasticPress', 'elasticpress');
?>
</h1>

	<h2><?php 
esc_html_e("ElasticPress, the fast and flexible query engine for WordPress, let's you supercharge your website through a variety of modules. Activate the ones you need below:", 'elasticpress');
?>
</h2>
Example #2
0
 /**
  * Provide better error messaging for common connection errors
  *
  * @since 0.9.3
  */
 private function _connect_check()
 {
     $host = ep_get_host();
     if (empty($host)) {
         WP_CLI::error(__('There is no Elasticsearch host set up. Either add one through the dashboard or define one in wp-config.php', 'elasticpress'));
     } elseif (!ep_elasticsearch_can_connect()) {
         WP_CLI::error(__('Unable to reach Elasticsearch Server! Check that service is running.', 'elasticpress'));
     }
 }
Example #3
0
    /**
     * Print out mid sync warning notice
     *
     * @since  2.1
     */
    public function action_bad_host_notice()
    {
        if (!isset(get_current_screen()->id) || strpos(get_current_screen()->id, 'elasticpress') === false) {
            return;
        }
        // Don't show message on intro page
        if (!empty($_GET['page']) && 'elasticpress-intro' === $_GET['page']) {
            return;
        }
        if (defined('EP_IS_NETWORK') && EP_IS_NETWORK) {
            if (!is_network_admin()) {
                return;
            }
            $url = admin_url('network/admin.php?page=elasticpress-settings');
            $options_host = get_site_option('ep_host');
        } else {
            if (is_network_admin()) {
                return;
            }
            $url = admin_url('admin.php?page=elasticpress-settings');
            $options_host = get_option('ep_host');
        }
        /**
         * If we are on the setting screen and a host has never been set in the options table or defined, then let's
         * assume this is our first time and not show an obvious message.
         */
        if (!empty($_GET['page']) && 'elasticpress-settings' === $_GET['page'] && false === $options_host && (!defined('EP_HOST') || !EP_HOST)) {
            return;
        }
        $host = ep_get_host();
        if (empty($host) || !ep_elasticsearch_can_connect()) {
            ?>
			<div class="notice notice-warning">
				<p><?php 
            printf(__('There is a problem with connecting to your Elasticsearch host. You will need to <a href="%s">fix it</a> for ElasticPress to work.', 'elasticpress'), esc_url($url));
            ?>
</p>
			</div>
			<?php 
        }
    }