html-admin-dashboard-setup.php
5 months ago
html-admin-page-addons-category-nav.php
4 years ago
html-admin-page-product-export.php
1 year ago
html-admin-page-reports.php
2 years ago
html-admin-page-status-logs-db.php
2 years ago
html-admin-page-status-logs.php
2 years ago
html-admin-page-status-report.php
1 month ago
html-admin-page-status-tools.php
2 years ago
html-admin-page-status.php
8 years ago
html-admin-settings.php
1 month ago
html-bulk-edit-product.php
1 year ago
html-email-template-preview.php
1 year ago
html-notice-base-table-missing.php
3 years ago
html-notice-custom.php
8 years ago
html-notice-download-dir-sync-complete.php
2 years ago
html-notice-install.php
5 years ago
html-notice-legacy-shipping.php
11 months ago
html-notice-maxmind-license-key.php
6 years ago
html-notice-no-shipping-methods.php
2 years ago
html-notice-redirect-only-download.php
4 years ago
html-notice-regenerating-lookup-table.php
5 years ago
html-notice-regenerating-thumbnails.php
8 years ago
html-notice-secure-connection.php
2 years ago
html-notice-sync-on-read-disabled.php
3 months ago
html-notice-template-check.php
2 years ago
html-notice-update.php
4 months ago
html-notice-updated.php
7 years ago
html-notice-updating.php
6 years ago
html-notice-uploads-directory-is-unprotected.php
2 years ago
html-notice-wp-php-minimum-requirements.php
2 years ago
html-quick-edit-product.php
1 year ago
html-report-by-date.php
5 years ago
html-admin-page-status-logs.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Status Logs |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Logs |
| 6 | */ |
| 7 | |
| 8 | use Automattic\WooCommerce\Utilities\LoggingUtil; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | $log_directory = LoggingUtil::get_log_directory(); |
| 15 | |
| 16 | ?> |
| 17 | <?php if ( $logs ) : ?> |
| 18 | <div id="log-viewer-select"> |
| 19 | <div class="alignleft"> |
| 20 | <h2> |
| 21 | <?php echo esc_html( $viewed_log ); ?> |
| 22 | <?php if ( ! empty( $viewed_log ) ) : ?> |
| 23 | <a class="page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title( $viewed_log ) ), admin_url( 'admin.php?page=wc-status&tab=logs' ) ), 'remove_log' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'woocommerce' ); ?></a> |
| 24 | <?php endif; ?> |
| 25 | </h2> |
| 26 | </div> |
| 27 | <div class="alignright"> |
| 28 | <form action="<?php echo esc_url( admin_url( 'admin.php?page=wc-status&tab=logs' ) ); ?>" method="post"> |
| 29 | <select class="wc-enhanced-select" name="log_file"> |
| 30 | <?php foreach ( $logs as $log_key => $log_file ) : ?> |
| 31 | <?php |
| 32 | $timestamp = filemtime( $log_directory . $log_file ); |
| 33 | $date = sprintf( |
| 34 | /* translators: 1: last access date 2: last access time 3: last access timezone abbreviation */ |
| 35 | __( '%1$s at %2$s %3$s', 'woocommerce' ), |
| 36 | wp_date( wc_date_format(), $timestamp ), |
| 37 | wp_date( wc_time_format(), $timestamp ), |
| 38 | wp_date( 'T', $timestamp ) |
| 39 | ); |
| 40 | ?> |
| 41 | <option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo esc_html( $log_file ); ?> (<?php echo esc_html( $date ); ?>)</option> |
| 42 | <?php endforeach; ?> |
| 43 | </select> |
| 44 | <button type="submit" class="button" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>"><?php esc_html_e( 'View', 'woocommerce' ); ?></button> |
| 45 | </form> |
| 46 | </div> |
| 47 | <div class="clear"></div> |
| 48 | </div> |
| 49 | <div id="log-viewer"> |
| 50 | <pre><?php echo esc_html( file_get_contents( $log_directory . $viewed_log ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></pre> |
| 51 | </div> |
| 52 | <?php else : ?> |
| 53 | <div class="updated woocommerce-message inline"><p><?php esc_html_e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div> |
| 54 | <?php endif; ?> |
| 55 |