| @@ -6,23 +6,18 @@ | ||
| 6 | 6 | * @package elasticpress |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | use ElasticPress\Dashboard; |
| 10 | +use ElasticPress\Elasticsearch; | |
| 11 | +use ElasticPress\IndexHelper; | |
| 10 | 12 | use ElasticPress\Utils; |
| 11 | -use ElasticPress\Elasticsearch; | |
| 12 | 13 | |
| 13 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 15 | exit; // Exit if accessed directly. |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | -$action = 'options.php'; | |
| 18 | +$index_meta = IndexHelper::factory()->get_index_meta(); | |
| 18 | 19 | |
| 19 | -$index_meta = Utils\get_option( 'ep_index_meta', [] ); | |
| 20 | - | |
| 21 | -if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) { | |
| 22 | - $action = ''; | |
| 23 | -} | |
| 24 | - | |
| 25 | 20 | $version = Elasticsearch::factory()->get_elasticsearch_version(); |
| 26 | 21 | |
| 27 | 22 | $host = Utils\get_host(); |
| 28 | 23 | $is_epio = Utils\is_epio(); |
| @@ -37,11 +32,10 @@ | ||
| 37 | 32 | <div class="error-overlay <?php if ( ! empty( $index_meta ) ) : ?>syncing<?php endif; ?>"></div> |
| 38 | 33 | <div class="wrap"> |
| 39 | 34 | <h1><?php esc_html_e( 'Settings', 'elasticpress' ); ?></h1> |
| 40 | 35 | |
| 41 | - <form action="<?php echo esc_url( $action ); ?>" method="post" class="ep-settings"> | |
| 42 | - <?php settings_fields( 'elasticpress' ); ?> | |
| 43 | - <?php settings_errors(); ?> | |
| 36 | + <form action="" method="post" class="ep-settings"> | |
| 37 | + <?php wp_nonce_field( 'elasticpress_settings', 'ep_settings_nonce' ); ?> | |
| 44 | 38 | |
| 45 | 39 | <div class="ep-credentials"> |
| 46 | 40 | <?php if ( ! $wpconfig ) : ?> |
| 47 | 41 | <h2 class="nav-tab-wrapper ep-credentials-tabs"> |
| @@ -139,14 +133,14 @@ | ||
| 139 | 133 | * @return {boolean} New value |
| 140 | 134 | */ |
| 141 | 135 | if ( apply_filters( 'ep_admin_show_credentials', true ) ) : |
| 142 | 136 | ?> |
| 143 | - <input <?php if ( defined( 'EP_CREDENTIALS' ) && EP_CREDENTIALS ) : ?>disabled<?php endif; ?> type="text" value="<?php echo esc_attr( $credentials['token'] ); ?>" name="ep_credentials[token]" id="ep_token"> | |
| 137 | + <input <?php if ( defined( 'EP_CREDENTIALS' ) && EP_CREDENTIALS ) : ?>disabled<?php endif; ?> type="password" value="" autocomplete="off" placeholder="<?php echo esc_attr( $credentials['token'] ? '••••••••' : '' ); ?>" name="ep_credentials[token]" id="ep_token"> | |
| 144 | 138 | <?php endif ?> |
| 145 | 139 | <?php if ( defined( 'EP_CREDENTIALS' ) && EP_CREDENTIALS ) : ?> |
| 146 | - <p class="description"><?php esc_html_e( 'Your Subscription Token is set in wp-config.php', 'elasticpress' ); ?></p> | |
| 140 | + <p class="description"><?php esc_html_e( 'Your subscription token is defined in wp-config.php and is hidden for security.', 'elasticpress' ); ?></p> | |
| 147 | 141 | <?php else : ?> |
| 148 | - <p class="description"><?php esc_html_e( 'Plug in your subscription token here.', 'elasticpress' ); ?></p> | |
| 142 | + <p class="description"><?php esc_html_e( 'Your subscription token is saved and is hidden for security. Enter a new value to update it.', 'elasticpress' ); ?></p> | |
| 149 | 143 | <?php endif; ?> |
| 150 | 144 | </td> |
| 151 | 145 | </tr> |
| 152 | 146 | <?php endif; ?> |