| @@ -1,11 +1,17 @@ | ||
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +?> | |
| 1 | 6 | <div class="wrap"> |
| 2 | - <h2><?php echo __('Unauthorized access log', 'easy-basic-authentication'); ?></h2> | |
| 7 | + <h2><?php echo esc_html__('Unauthorized access log', 'easy-basic-authentication'); ?></h2> | |
| 3 | 8 | <p> |
| 4 | 9 | <form method="post" action="<?php echo esc_url(admin_url('admin.php?page=basic-auth-login')); ?>"> |
| 10 | + <?php wp_nonce_field('eba_clear_logs', 'eba_clear_nonce'); ?> | |
| 5 | 11 | <input type="hidden" name="clear_mode" value="1"> |
| 6 | 12 | <button type="submit" class="button button-primary"> |
| 7 | - <?php echo __('Clear log', 'easy-basic-authentication'); ?> | |
| 13 | + <?php echo esc_html__('Clear log', 'easy-basic-authentication'); ?> | |
| 8 | 14 | </button> |
| 9 | 15 | </form> |
| 10 | 16 | </p> |
| 11 | 17 | <table class="wp-list-table widefat fixed striped"> |
| @@ -10,25 +16,25 @@ | ||
| 10 | 16 | </p> |
| 11 | 17 | <table class="wp-list-table widefat fixed striped"> |
| 12 | 18 | <thead> |
| 13 | 19 | <tr> |
| 14 | - <th><?php echo __('ID', 'easy-basic-authentication'); ?></th> | |
| 15 | - <th><?php echo __('IP Address', 'easy-basic-authentication'); ?></th> | |
| 16 | - <th><?php echo __('Date', 'easy-basic-authentication'); ?></th> | |
| 17 | - <th><?php echo __('Browser', 'easy-basic-authentication'); ?></th> | |
| 18 | - <th><?php echo __('Request URI', 'easy-basic-authentication'); ?></th> | |
| 20 | + <th><?php echo esc_html__('ID', 'easy-basic-authentication'); ?></th> | |
| 21 | + <th><?php echo esc_html__('IP Address', 'easy-basic-authentication'); ?></th> | |
| 22 | + <th><?php echo esc_html__('Date', 'easy-basic-authentication'); ?></th> | |
| 23 | + <th><?php echo esc_html__('Browser', 'easy-basic-authentication'); ?></th> | |
| 24 | + <th><?php echo esc_html__('Request URI', 'easy-basic-authentication'); ?></th> | |
| 19 | 25 | </tr> |
| 20 | 26 | </thead> |
| 21 | 27 | <tbody> |
| 22 | 28 | <?php |
| 23 | - foreach ($user_log_data as $entry) { | |
| 24 | - $new = $entry['viewed']?'':' ('.__('new', 'easy-basic-authentication').')'; | |
| 29 | + foreach ($user_log_data as $basic_auth_entry) { | |
| 30 | + $basic_auth_new = $basic_auth_entry['viewed']?'':' ('.esc_html__('new', 'easy-basic-authentication').')'; | |
| 25 | 31 | echo "<tr>"; |
| 26 | - echo "<td>" . esc_html($entry['id']) .$new. "</td>"; | |
| 27 | - echo "<td>" . esc_html($entry['ip']) . "</td>"; | |
| 28 | - echo "<td>" . esc_html($entry['data']) . "</td>"; | |
| 29 | - echo "<td>" . esc_html($entry['browser']) . "</td>"; | |
| 30 | - echo "<td>" . esc_html(isset($entry['request_uri'])?$entry['request_uri']:'') . "</td>"; | |
| 32 | + echo "<td>" . esc_html($basic_auth_entry['id']) .esc_attr($basic_auth_new). "</td>"; | |
| 33 | + echo "<td>" . esc_html($basic_auth_entry['ip']) . "</td>"; | |
| 34 | + echo "<td>" . esc_html($basic_auth_entry['data']) . "</td>"; | |
| 35 | + echo "<td>" . esc_html($basic_auth_entry['browser']) . "</td>"; | |
| 36 | + echo "<td>" . esc_html(isset($basic_auth_entry['request_uri'])?$basic_auth_entry['request_uri']:'') . "</td>"; | |
| 31 | 37 | echo "</tr>"; |
| 32 | 38 | } |
| 33 | 39 | ?> |
| 34 | 40 | </tbody> |