Added login request
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Addons
|
||||
*
|
||||
* @var string $view
|
||||
* @var object $addons
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap woocommerce wc_addons_wrap">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons' ) ); ?>" class="nav-tab nav-tab-active"><?php _e( 'Browse Extensions', 'woocommerce' ); ?></a>
|
||||
|
||||
<?php
|
||||
$count_html = WC_Helper_Updater::get_updates_count_html();
|
||||
$menu_title = sprintf( __( 'WooCommerce.com Subscriptions %s', 'woocommerce' ), $count_html );
|
||||
?>
|
||||
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons§ion=helper' ) ); ?>" class="nav-tab"><?php echo $menu_title; ?></a>
|
||||
</nav>
|
||||
|
||||
<h1 class="screen-reader-text"><?php _e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
|
||||
|
||||
<?php if ( $sections ) : ?>
|
||||
<ul class="subsubsub">
|
||||
<?php foreach ( $sections as $section ) : ?>
|
||||
<li>
|
||||
<a
|
||||
class="<?php echo $current_section === $section->slug ? 'current' : ''; ?>"
|
||||
href="<?php echo admin_url( 'admin.php?page=wc-addons§ion=' . esc_attr( $section->slug ) ); ?>">
|
||||
<?php echo esc_html( $section->label ); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php if ( isset( $_GET['search'] ) ) : ?>
|
||||
<h1 class="search-form-title" >
|
||||
<?php printf( __( 'Showing search results for: %s', 'woocommerce' ), '<strong>' . esc_html( $_GET['search'] ) . '</strong>' ); ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="search-form" method="GET">
|
||||
<button type="submit">
|
||||
<span class="dashicons dashicons-search"></span>
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
name="search"
|
||||
value="<?php echo esc_attr( isset( $_GET['search'] ) ? $_GET['search'] : '' ); ?>"
|
||||
placeholder="<?php _e( 'Enter a search term and press enter', 'woocommerce' ); ?>">
|
||||
<input type="hidden" name="page" value="wc-addons">
|
||||
<?php $page_section = ( isset( $_GET['section'] ) && '_featured' !== $_GET['section'] ) ? $_GET['section'] : '_all'; ?>
|
||||
<input type="hidden" name="section" value="<?php echo esc_attr( $page_section ); ?>">
|
||||
</form>
|
||||
<?php if ( '_featured' === $current_section ) : ?>
|
||||
<div class="addons-featured">
|
||||
<?php
|
||||
$featured = WC_Admin_Addons::get_featured();
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( '_featured' !== $current_section && $addons ) : ?>
|
||||
<?php if ( 'shipping_methods' === $current_section ) : ?>
|
||||
<div class="addons-shipping-methods">
|
||||
<?php WC_Admin_Addons::output_wcs_banner_block(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<ul class="products">
|
||||
<?php foreach ( $addons as $addon ) : ?>
|
||||
<?php
|
||||
if ( 'shipping_methods' === $current_section ) {
|
||||
// Do not show USPS or Canada Post extensions for US and CA stores, respectively.
|
||||
$country = WC()->countries->get_base_country();
|
||||
if ( 'US' === $country
|
||||
&& false !== strpos(
|
||||
$addon->link, 'woocommerce.com/products/usps-shipping-method'
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if ( 'CA' === $country
|
||||
&& false !== strpos(
|
||||
$addon->link, 'woocommerce.com/products/canada-post-shipping-method'
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li class="product">
|
||||
<a href="<?php echo esc_attr( $addon->link ); ?>">
|
||||
<?php if ( ! empty( $addon->image ) ) : ?>
|
||||
<span class="product-img-wrap"><img src="<?php echo esc_url( $addon->image ); ?>"/></span>
|
||||
<?php else : ?>
|
||||
<h2><?php echo esc_html( $addon->title ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
|
||||
<p><?php echo wp_kses_post( $addon->excerpt ); ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<p><?php printf( __( 'Our catalog of WooCommerce Extensions can be found on WooCommerce.com here: <a href="%s">WooCommerce Extensions Catalog</a>', 'woocommerce' ), 'https://woocommerce.com/product-category/woocommerce-extensions/' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'Storefront' !== $theme['Name'] && '_featured' !== $current_section ) : ?>
|
||||
<div class="storefront">
|
||||
<a href="<?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?>" target="_blank"><img src="<?php echo WC()->plugin_url(); ?>/assets/images/storefront.png" alt="Storefront" /></a>
|
||||
<h2><?php _e( 'Looking for a WooCommerce theme?', 'woocommerce' ); ?></h2>
|
||||
<p><?php _e( 'We recommend Storefront, the <em>official</em> WooCommerce theme.', 'woocommerce' ); ?></p>
|
||||
<p><?php _e( 'Storefront is an intuitive, flexible and <strong>free</strong> WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.', 'woocommerce' ); ?></p>
|
||||
<p>
|
||||
<a href="https://woocommerce.com/storefront/" target="_blank" class="button"><?php _e( 'Read all about it', 'woocommerce' ); ?></a>
|
||||
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-theme&theme=storefront' ), 'install-theme_storefront' ) ); ?>" class="button button-primary"><?php _e( 'Download & install', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Product Export
|
||||
*
|
||||
* @package WooCommerce/Admin/Export
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_enqueue_script( 'wc-product-export' );
|
||||
|
||||
$exporter = new WC_Product_CSV_Exporter();
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<h1><?php esc_html_e( 'Export Products', 'woocommerce' ); ?></h1>
|
||||
|
||||
<div class="woocommerce-exporter-wrapper">
|
||||
<form class="woocommerce-exporter">
|
||||
<header>
|
||||
<span class="spinner is-active"></span>
|
||||
<h2><?php esc_html_e( 'Export products to a CSV file', 'woocommerce' ); ?></h2>
|
||||
<p><?php esc_html_e( 'This tool allows you to generate and download a CSV file containing a list of all products.', 'woocommerce' ); ?></p>
|
||||
</header>
|
||||
<section>
|
||||
<table class="form-table woocommerce-exporter-options">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="woocommerce-exporter-columns"><?php esc_html_e( 'Which columns should be exported?', 'woocommerce' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="woocommerce-exporter-columns" class="woocommerce-exporter-columns wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all columns', 'woocommerce' ); ?>">
|
||||
<?php
|
||||
foreach ( $exporter->get_default_column_names() as $column_id => $column_name ) {
|
||||
echo '<option value="' . esc_attr( $column_id ) . '">' . esc_html( $column_name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
<option value="downloads"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></option>
|
||||
<option value="attributes"><?php esc_html_e( 'Attributes', 'woocommerce' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="woocommerce-exporter-types"><?php esc_html_e( 'Which product types should be exported?', 'woocommerce' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="woocommerce-exporter-types" class="woocommerce-exporter-types wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all products', 'woocommerce' ); ?>">
|
||||
<?php
|
||||
foreach ( wc_get_product_types() as $value => $label ) {
|
||||
echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $label ) . '</option>';
|
||||
}
|
||||
?>
|
||||
<option value="variation"><?php esc_html_e( 'Product variations', 'woocommerce' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="woocommerce-exporter-meta"><?php esc_html_e( 'Export custom meta?', 'woocommerce' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="checkbox" id="woocommerce-exporter-meta" value="1" />
|
||||
<label for="woocommerce-exporter-meta"><?php esc_html_e( 'Yes, export all custom meta', 'woocommerce' ); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php do_action( 'woocommerce_product_export_row' ); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<progress class="woocommerce-exporter-progress" max="100" value="0"></progress>
|
||||
</section>
|
||||
<div class="wc-actions">
|
||||
<button type="submit" class="woocommerce-exporter-button button button-primary" value="<?php esc_attr_e( 'Generate CSV', 'woocommerce' ); ?>"><?php esc_html_e( 'Generate CSV', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Reports
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<?php
|
||||
foreach ( $reports as $key => $report_group ) {
|
||||
echo '<a href="' . admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ) . '" class="nav-tab ';
|
||||
if ( $current_tab == $key ) {
|
||||
echo 'nav-tab-active';
|
||||
}
|
||||
echo '">' . esc_html( $report_group['title'] ) . '</a>';
|
||||
}
|
||||
|
||||
do_action( 'wc_reports_tabs' );
|
||||
?>
|
||||
</nav>
|
||||
<?php
|
||||
if ( sizeof( $reports[ $current_tab ]['reports'] ) > 1 ) {
|
||||
?>
|
||||
<ul class="subsubsub">
|
||||
<li>
|
||||
<?php
|
||||
|
||||
$links = array();
|
||||
|
||||
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
|
||||
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&report=' . urlencode( $key ) . '" class="';
|
||||
|
||||
if ( $key == $current_report ) {
|
||||
$link .= 'current';
|
||||
}
|
||||
|
||||
$link .= '">' . $report['title'] . '</a>';
|
||||
|
||||
$links[] = $link;
|
||||
}
|
||||
|
||||
echo implode( ' | </li><li>', $links );
|
||||
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
<br class="clear" />
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
|
||||
$report = $reports[ $current_tab ]['reports'][ $current_report ];
|
||||
|
||||
if ( ! isset( $report['hide_title'] ) || true != $report['hide_title'] ) {
|
||||
echo '<h1>' . esc_html( $report['title'] ) . '</h1>';
|
||||
} else {
|
||||
echo '<h1 class="screen-reader-text">' . esc_html( $report['title'] ) . '</h1>';
|
||||
}
|
||||
|
||||
if ( $report['description'] ) {
|
||||
echo '<p>' . $report['description'] . '</p>';
|
||||
}
|
||||
|
||||
if ( $report['callback'] && ( is_callable( $report['callback'] ) ) ) {
|
||||
call_user_func( $report['callback'], $current_report );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Status Database Logs
|
||||
*
|
||||
* @package WooCommerce/Admin/Logs
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="post" id="mainform" action="">
|
||||
<?php $log_table_list->search_box( __( 'Search logs', 'woocommerce' ), 'log' ); ?>
|
||||
<?php $log_table_list->display(); ?>
|
||||
|
||||
<input type="hidden" name="page" value="wc-status" />
|
||||
<input type="hidden" name="tab" value="logs" />
|
||||
|
||||
<?php submit_button( __( 'Flush all logs', 'woocommerce' ), 'delete', 'flush-logs' ); ?>
|
||||
<?php wp_nonce_field( 'woocommerce-status-logs' ); ?>
|
||||
</form>
|
||||
<?php
|
||||
wc_enqueue_js(
|
||||
"jQuery( '#flush-logs' ).click( function() {
|
||||
if ( window.confirm('" . esc_js( __( 'Are you sure you want to clear all logs from the database?', 'woocommerce' ) ) . "') ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});"
|
||||
);
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Status Logs
|
||||
*
|
||||
* @package WooCommerce/Admin/Logs
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ( $logs ) : ?>
|
||||
<div id="log-viewer-select">
|
||||
<div class="alignleft">
|
||||
<h2>
|
||||
<?php echo esc_html( $viewed_log ); ?>
|
||||
<?php if ( ! empty( $handle ) ) : ?>
|
||||
<a class="page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => $handle ), admin_url( 'admin.php?page=wc-status&tab=logs' ) ), 'remove_log' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="alignright">
|
||||
<form action="<?php echo esc_url( admin_url( 'admin.php?page=wc-status&tab=logs' ) ); ?>" method="post">
|
||||
<select name="log_file">
|
||||
<?php foreach ( $logs as $log_key => $log_file ) : ?>
|
||||
<?php
|
||||
$timestamp = filemtime( WC_LOG_DIR . $log_file );
|
||||
/* translators: 1: last access date 2: last access time */
|
||||
$date = sprintf( __( '%1$s at %2$s', 'woocommerce' ), date_i18n( wc_date_format(), $timestamp ), date_i18n( wc_time_format(), $timestamp ) );
|
||||
?>
|
||||
<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>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<button type="submit" class="button" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>"><?php esc_html_e( 'View', 'woocommerce' ); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div id="log-viewer">
|
||||
<pre><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></pre>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="updated woocommerce-message inline"><p><?php esc_html_e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,876 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Status Report.
|
||||
*
|
||||
* @package WooCommerce
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $wpdb;
|
||||
|
||||
if ( ! class_exists( 'WC_REST_System_Status_Controller', false ) ) {
|
||||
wp_die( 'Cannot load the REST API to access WC_REST_System_Status_Controller.' );
|
||||
}
|
||||
|
||||
$system_status = new WC_REST_System_Status_Controller();
|
||||
$environment = $system_status->get_environment_info();
|
||||
$database = $system_status->get_database_info();
|
||||
$post_type_counts = $system_status->get_post_type_counts();
|
||||
$active_plugins = $system_status->get_active_plugins();
|
||||
$theme = $system_status->get_theme_info();
|
||||
$security = $system_status->get_security_info();
|
||||
$settings = $system_status->get_settings();
|
||||
$pages = $system_status->get_pages();
|
||||
$plugin_updates = new WC_Plugin_Updates();
|
||||
$untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, 'minor' );
|
||||
?>
|
||||
<div class="updated woocommerce-message inline">
|
||||
<p>
|
||||
<?php esc_html_e( 'Please copy and paste this information in your ticket when contacting support:', 'woocommerce' ); ?>
|
||||
</p>
|
||||
<p class="submit">
|
||||
<a href="#" class="button-primary debug-report"><?php esc_html_e( 'Get system report', 'woocommerce' ); ?></a>
|
||||
<a class="button-secondary docs" href="https://docs.woocommerce.com/document/understanding-the-woocommerce-system-status-report/" target="_blank">
|
||||
<?php esc_html_e( 'Understanding the status report', 'woocommerce' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
<div id="debug-report">
|
||||
<textarea readonly="readonly"></textarea>
|
||||
<p class="submit">
|
||||
<button id="copy-for-support" class="button-primary" href="#" data-tip="<?php esc_attr_e( 'Copied!', 'woocommerce' ); ?>">
|
||||
<?php esc_html_e( 'Copy for support', 'woocommerce' ); ?>
|
||||
</button>
|
||||
</p>
|
||||
<p class="copy-error hidden">
|
||||
<?php esc_html_e( 'Copying to clipboard failed. Please press Ctrl/Cmd+C to copy.', 'woocommerce' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<table class="wc_status_table widefat" cellspacing="0" id="status">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="WordPress Environment"><h2><?php esc_html_e( 'WordPress environment', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="Home URL"><?php esc_html_e( 'Home URL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The homepage URL of your site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['home_url'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Site URL"><?php esc_html_e( 'Site URL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The root URL of your site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['site_url'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version"><?php esc_html_e( 'WooCommerce version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of WooCommerce installed on your site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['version'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Log Directory Writable"><?php esc_html_e( 'Log directory writable', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Several WooCommerce extensions can write logs which makes debugging problems easier. The directory must be writable for this to happen.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['log_directory_writable'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span> <code class="private">' . esc_html( $environment['log_directory'] ) . '</code></mark> ';
|
||||
} else {
|
||||
/* Translators: %1$s: Log directory, %2$s: Log directory constant */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'To allow logging, make %1$s writable or define a custom %2$s.', 'woocommerce' ), '<code>' . esc_html( $environment['log_directory'] ) . '</code>', '<code>WC_LOG_DIR</code>' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WP Version"><?php esc_html_e( 'WordPress version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of WordPress installed on your site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$latest_version = get_transient( 'woocommerce_system_status_wp_version_check' );
|
||||
|
||||
if ( false === $latest_version ) {
|
||||
$version_check = wp_remote_get( 'https://api.wordpress.org/core/version-check/1.7/' );
|
||||
$api_response = json_decode( wp_remote_retrieve_body( $version_check ), true );
|
||||
|
||||
if ( $api_response && isset( $api_response['offers'], $api_response['offers'][0], $api_response['offers'][0]['version'] ) ) {
|
||||
$latest_version = $api_response['offers'][0]['version'];
|
||||
} else {
|
||||
$latest_version = $environment['wp_version'];
|
||||
}
|
||||
set_transient( 'woocommerce_system_status_wp_version_check', $latest_version, DAY_IN_SECONDS );
|
||||
}
|
||||
|
||||
if ( version_compare( $environment['wp_version'], $latest_version, '<' ) ) {
|
||||
/* Translators: %1$s: Current version, %2$s: New version */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - There is a newer version of WordPress available (%2$s)', 'woocommerce' ), esc_html( $environment['wp_version'] ), esc_html( $latest_version ) ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes">' . esc_html( $environment['wp_version'] ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WP Multisite"><?php esc_html_e( 'WordPress multisite', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Whether or not you have WordPress Multisite enabled.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo ( $environment['wp_multisite'] ) ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WP Memory Limit"><?php esc_html_e( 'WordPress memory limit', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The maximum amount of memory (RAM) that your site can use at one time.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['wp_memory_limit'] < 67108864 ) {
|
||||
/* Translators: %1$s: Memory limit, %2$s: Docs link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - We recommend setting memory to at least 64MB. See: %2$s', 'woocommerce' ), esc_html( size_format( $environment['wp_memory_limit'] ) ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . esc_html__( 'Increasing memory allocated to PHP', 'woocommerce' ) . '</a>' ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes">' . esc_html( size_format( $environment['wp_memory_limit'] ) ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WP Debug Mode"><?php esc_html_e( 'WordPress debug mode', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not WordPress is in Debug Mode.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php if ( $environment['wp_debug_mode'] ) : ?>
|
||||
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
|
||||
<?php else : ?>
|
||||
<mark class="no">–</mark>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WP Cron"><?php esc_html_e( 'WordPress cron', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not WP Cron Jobs are enabled.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php if ( $environment['wp_cron'] ) : ?>
|
||||
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
|
||||
<?php else : ?>
|
||||
<mark class="no">–</mark>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Language"><?php esc_html_e( 'Language', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The current language used by WordPress. Default = English', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['language'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="External object cache"><?php esc_html_e( 'External object cache', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not WordPress is using an external object cache.', 'woocommerce' ) ); ?></td>
|
||||
<td>
|
||||
<?php if ( $environment['external_object_cache'] ) : ?>
|
||||
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
|
||||
<?php else : ?>
|
||||
<mark class="no">–</mark>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Server Environment"><h2><?php esc_html_e( 'Server environment', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="Server Info"><?php esc_html_e( 'Server info', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Information about the web server that is currently hosting your site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['server_info'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="PHP Version"><?php esc_html_e( 'PHP version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of PHP installed on your hosting server.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( version_compare( $environment['php_version'], '7.2', '>=' ) ) {
|
||||
echo '<mark class="yes">' . esc_html( $environment['php_version'] ) . '</mark>';
|
||||
} else {
|
||||
$update_link = ' <a href="https://docs.woocommerce.com/document/how-to-update-your-php-version/" target="_blank">' . esc_html__( 'How to update your PHP version', 'woocommerce' ) . '</a>';
|
||||
$class = 'error';
|
||||
|
||||
if ( version_compare( $environment['php_version'], '5.4', '<' ) ) {
|
||||
$notice = '<span class="dashicons dashicons-warning"></span> ' . __( 'WooCommerce will run under this version of PHP, however, some features such as geolocation are not compatible. Support for this version will be dropped in the next major release. We recommend using PHP version 7.2 or above for greater performance and security.', 'woocommerce' ) . $update_link;
|
||||
} elseif ( version_compare( $environment['php_version'], '5.6', '<' ) ) {
|
||||
$notice = '<span class="dashicons dashicons-warning"></span> ' . __( 'WooCommerce will run under this version of PHP, however, it has reached end of life. We recommend using PHP version 7.2 or above for greater performance and security.', 'woocommerce' ) . $update_link;
|
||||
} elseif ( version_compare( $environment['php_version'], '7.2', '<' ) ) {
|
||||
$notice = __( 'We recommend using PHP version 7.2 or above for greater performance and security.', 'woocommerce' ) . $update_link;
|
||||
$class = 'recommendation';
|
||||
}
|
||||
|
||||
echo '<mark class="' . esc_attr( $class ) . '">' . esc_html( $environment['php_version'] ) . ' - ' . wp_kses_post( $notice ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( function_exists( 'ini_get' ) ) : ?>
|
||||
<tr>
|
||||
<td data-export-label="PHP Post Max Size"><?php esc_html_e( 'PHP post max size', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The largest filesize that can be contained in one post.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( size_format( $environment['php_post_max_size'] ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="PHP Time Limit"><?php esc_html_e( 'PHP time limit', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups)', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['php_max_execution_time'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="PHP Max Input Vars"><?php esc_html_e( 'PHP max input vars', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['php_max_input_vars'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="cURL Version"><?php esc_html_e( 'cURL version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of cURL installed on your server.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $environment['curl_version'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="SUHOSIN Installed"><?php esc_html_e( 'SUHOSIN installed', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo $environment['suhosin_installed'] ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
if ( $environment['mysql_version'] ) :
|
||||
?>
|
||||
<tr>
|
||||
<td data-export-label="MySQL Version"><?php esc_html_e( 'MySQL version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of MySQL installed on your hosting server.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( version_compare( $environment['mysql_version'], '5.6', '<' ) && ! strstr( $environment['mysql_version_string'], 'MariaDB' ) ) {
|
||||
/* Translators: %1$s: MySQL version, %2$s: Recommended MySQL version. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - We recommend a minimum MySQL version of 5.6. See: %2$s', 'woocommerce' ), esc_html( $environment['mysql_version_string'] ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . esc_html__( 'WordPress requirements', 'woocommerce' ) . '</a>' ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes">' . esc_html( $environment['mysql_version_string'] ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td data-export-label="Max Upload Size"><?php esc_html_e( 'Max upload size', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The largest filesize that can be uploaded to your WordPress installation.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( size_format( $environment['max_upload_size'] ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Default Timezone is UTC"><?php esc_html_e( 'Default timezone is UTC', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The default timezone for your server.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( 'UTC' !== $environment['default_timezone'] ) {
|
||||
/* Translators: %s: default timezone.. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'woocommerce' ), esc_html( $environment['default_timezone'] ) ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="fsockopen/cURL"><?php esc_html_e( 'fsockopen/cURL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['fsockopen_or_curl_enabled'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'woocommerce' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="SoapClient"><?php esc_html_e( 'SoapClient', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['soapclient_enabled'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s classname and link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'woocommerce' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="DOMDocument"><?php esc_html_e( 'DOMDocument', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['domdocument_enabled'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s: classname and link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'woocommerce' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="GZip"><?php esc_html_e( 'GZip', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'GZip (gzopen) is used to open the GEOIP database from MaxMind.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['gzip_enabled'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s: classname and link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Your server does not support the %s function - this is required to use the GeoIP database from MaxMind.', 'woocommerce' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Multibyte String"><?php esc_html_e( 'Multibyte string', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['mbstring_enabled'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s: classname and link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'woocommerce' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Remote Post"><?php esc_html_e( 'Remote post', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'PayPal uses this method of communicating when sending back transaction information.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['remote_post_successful'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s: function name. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%s failed. Contact your hosting provider.', 'woocommerce' ), 'wp_remote_post()' ) . ' ' . esc_html( $environment['remote_post_response'] ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Remote Get"><?php esc_html_e( 'Remote get', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'WooCommerce plugins may use this method of communication when checking for plugin updates.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $environment['remote_get_successful'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s: function name. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%s failed. Contact your hosting provider.', 'woocommerce' ), 'wp_remote_get()' ) . ' ' . esc_html( $environment['remote_get_response'] ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$rows = apply_filters( 'woocommerce_system_status_environment_rows', array() );
|
||||
foreach ( $rows as $row ) {
|
||||
if ( ! empty( $row['success'] ) ) {
|
||||
$css_class = 'yes';
|
||||
$icon = '<span class="dashicons dashicons-yes"></span>';
|
||||
} else {
|
||||
$css_class = 'error';
|
||||
$icon = '<span class="dashicons dashicons-no-alt"></span>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td data-export-label="<?php echo esc_attr( $row['name'] ); ?>"><?php echo esc_html( $row['name'] ); ?>:</td>
|
||||
<td class="help"><?php echo esc_html( isset( $row['help'] ) ? $row['help'] : '' ); ?></td>
|
||||
<td>
|
||||
<mark class="<?php echo esc_attr( $css_class ); ?>">
|
||||
<?php echo wp_kses_post( $icon ); ?> <?php echo wp_kses_data( ! empty( $row['note'] ) ? $row['note'] : '' ); ?>
|
||||
</mark>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Database"><h2><?php esc_html_e( 'Database', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="WC Database Version"><?php esc_html_e( 'WooCommerce database version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The version of WooCommerce that the database is formatted for. This should be the same as your WooCommerce version.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $database['wc_database_version'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Database Prefix"><?php esc_html_e( 'Database prefix', 'woocommerce' ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<?php
|
||||
if ( strlen( $database['database_prefix'] ) > 20 ) {
|
||||
/* Translators: %1$s: Database prefix, %2$s: Docs link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - We recommend using a prefix with less than 20 characters. See: %2$s', 'woocommerce' ), esc_html( $database['database_prefix'] ), '<a href="https://docs.woocommerce.com/document/completed-order-email-doesnt-contain-download-links/#section-2" target="_blank">' . esc_html__( 'How to update your database table prefix', 'woocommerce' ) . '</a>' ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes">' . esc_html( $database['database_prefix'] ) . '</mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ( $settings['geolocation_enabled'] ) { ?>
|
||||
<tr>
|
||||
<td data-export-label="MaxMind GeoIP Database"><?php esc_html_e( 'MaxMind GeoIP database', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The GeoIP database from MaxMind is used to geolocate customers.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( version_compare( $environment['php_version'], '5.4', '<' ) ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . wp_kses_post( __( 'MaxMind GeoIP database requires at least PHP 5.4.', 'woocommerce' ) ) . '</mark>';
|
||||
} elseif ( file_exists( $database['maxmind_geoip_database'] ) ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span> <code class="private">' . esc_html( $database['maxmind_geoip_database'] ) . '</code></mark> ';
|
||||
} else {
|
||||
/* Translators: %1$s: Library url, %2$s: install path. */
|
||||
printf( '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'The MaxMind GeoIP Database does not exist - Geolocation will not function. You can download and install it manually from %1$s to the path: %2$s. Scroll down to "Downloads" and download the "MaxMind DB binary, gzipped" file next to "GeoLite2 Country". Please remember to uncompress GeoLite2-Country_xxxxxxxx.tar.gz and upload the GeoLite2-Country.mmdb file only.', 'woocommerce' ), '<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/">https://dev.maxmind.com/geoip/geoip2/geolite2/</a>', '<code class="private">' . esc_html( $database['maxmind_geoip_database'] ) . '</code>' ) . '</mark>', esc_html( WC_LOG_DIR ) );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td><?php esc_html_e( 'Total Database Size', 'woocommerce' ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['data'] + $database['database_size']['index'] ) ); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php esc_html_e( 'Database Data Size', 'woocommerce' ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['data'] ) ); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php esc_html_e( 'Database Index Size', 'woocommerce' ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['index'] ) ); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php foreach ( $database['database_tables']['woocommerce'] as $table => $table_data ) { ?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $table ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<?php
|
||||
if ( ! $table_data ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Table does not exist', 'woocommerce' ) . '</mark>';
|
||||
} else {
|
||||
/* Translators: %1$f: Table size, %2$f: Index size. */
|
||||
printf( esc_html__( 'Data: %1$.2fMB + Index: %2$.2fMB', 'woocommerce' ), esc_html( wc_format_decimal( $table_data['data'], 2 ) ), esc_html( wc_format_decimal( $table_data['index'], 2 ) ) );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php foreach ( $database['database_tables']['other'] as $table => $table_data ) { ?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $table ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<?php
|
||||
/* Translators: %1$f: Table size, %2$f: Index size. */
|
||||
printf( esc_html__( 'Data: %1$.2fMB + Index: %2$.2fMB', 'woocommerce' ), esc_html( wc_format_decimal( $table_data['data'], 2 ) ), esc_html( wc_format_decimal( $table_data['index'], 2 ) ) );
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Post Type Counts"><h2><?php esc_html_e( 'Post Type Counts', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $post_type_counts as $post_type ) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $post_type->type ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td><?php echo absint( $post_type->count ); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Security"><h2><?php esc_html_e( 'Security', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="Secure connection (HTTPS)"><?php esc_html_e( 'Secure connection (HTTPS)', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Is the connection to your store secure?', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php if ( $security['secure_connection'] ) : ?>
|
||||
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
|
||||
<?php else : ?>
|
||||
<mark class="error"><span class="dashicons dashicons-warning"></span>
|
||||
<?php
|
||||
/* Translators: %s: docs link. */
|
||||
echo wp_kses_post( sprintf( __( 'Your store is not using HTTPS. <a href="%s" target="_blank">Learn more about HTTPS and SSL Certificates</a>.', 'woocommerce' ), 'https://docs.woocommerce.com/document/ssl-and-https/' ) );
|
||||
?>
|
||||
</mark>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Hide errors from visitors"><?php esc_html_e( 'Hide errors from visitors', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Error messages can contain sensitive information about your store environment. These should be hidden from untrusted visitors.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php if ( $security['hide_errors'] ) : ?>
|
||||
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
|
||||
<?php else : ?>
|
||||
<mark class="error"><span class="dashicons dashicons-warning"></span><?php esc_html_e( 'Error messages should not be shown to visitors.', 'woocommerce' ); ?></mark>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Active Plugins (<?php echo count( $active_plugins ); ?>)"><h2><?php esc_html_e( 'Active plugins', 'woocommerce' ); ?> (<?php echo count( $active_plugins ); ?>)</h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $active_plugins as $plugin ) {
|
||||
if ( ! empty( $plugin['name'] ) ) {
|
||||
$dirname = dirname( $plugin['plugin'] );
|
||||
|
||||
// Link the plugin name to the plugin url if available.
|
||||
$plugin_name = esc_html( $plugin['name'] );
|
||||
if ( ! empty( $plugin['url'] ) ) {
|
||||
$plugin_name = '<a href="' . esc_url( $plugin['url'] ) . '" aria-label="' . esc_attr__( 'Visit plugin homepage', 'woocommerce' ) . '" target="_blank">' . $plugin_name . '</a>';
|
||||
}
|
||||
|
||||
$version_string = '';
|
||||
$network_string = '';
|
||||
if ( strstr( $plugin['url'], 'woothemes.com' ) || strstr( $plugin['url'], 'woocommerce.com' ) ) {
|
||||
if ( ! empty( $plugin['version_latest'] ) && version_compare( $plugin['version_latest'], $plugin['version'], '>' ) ) {
|
||||
/* translators: %s: plugin latest version */
|
||||
$version_string = ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'woocommerce' ), $plugin['version_latest'] ) . '</strong>';
|
||||
}
|
||||
|
||||
if ( false !== $plugin['network_activated'] ) {
|
||||
$network_string = ' – <strong style="color:black;">' . esc_html__( 'Network enabled', 'woocommerce' ) . '</strong>';
|
||||
}
|
||||
}
|
||||
$untested_string = '';
|
||||
if ( array_key_exists( $plugin['plugin'], $untested_plugins ) ) {
|
||||
$untested_string = ' – <strong style="color:red;">' . esc_html__( 'Not tested with the active version of WooCommerce', 'woocommerce' ) . '</strong>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo wp_kses_post( $plugin_name ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<?php
|
||||
/* translators: %s: plugin author */
|
||||
printf( esc_html__( 'by %s', 'woocommerce' ), esc_html( $plugin['author_name'] ) );
|
||||
echo ' – ' . esc_html( $plugin['version'] ) . $version_string . $untested_string . $network_string; // WPCS: XSS ok.
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Settings"><h2><?php esc_html_e( 'Settings', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="API Enabled"><?php esc_html_e( 'API enabled', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Does your site have REST API enabled?', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo $settings['api_enabled'] ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>' : '<mark class="no">–</mark>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Force SSL"><?php esc_html_e( 'Force SSL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Does your site force a SSL Certificate for transactions?', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo $settings['force_ssl'] ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>' : '<mark class="no">–</mark>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Currency"><?php esc_html_e( 'Currency', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'What currency prices are listed at in the catalog and which currency gateways will take payments in.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $settings['currency'] ); ?> (<?php echo esc_html( $settings['currency_symbol'] ); ?>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Currency Position"><?php esc_html_e( 'Currency position', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The position of the currency symbol.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $settings['currency_position'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Thousand Separator"><?php esc_html_e( 'Thousand separator', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The thousand separator of displayed prices.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $settings['thousand_separator'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Decimal Separator"><?php esc_html_e( 'Decimal separator', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The decimal separator of displayed prices.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $settings['decimal_separator'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Number of Decimals"><?php esc_html_e( 'Number of decimals', 'woocommerce' ); ?></td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The number of decimal points shown in displayed prices.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $settings['number_of_decimals'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Taxonomies: Product Types"><?php esc_html_e( 'Taxonomies: Product types', 'woocommerce' ); ?></th>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'A list of taxonomy terms that can be used in regard to order/product statuses.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$display_terms = array();
|
||||
foreach ( $settings['taxonomies'] as $slug => $name ) {
|
||||
$display_terms[] = strtolower( $name ) . ' (' . $slug . ')';
|
||||
}
|
||||
echo implode( ', ', array_map( 'esc_html', $display_terms ) );
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Taxonomies: Product Visibility"><?php esc_html_e( 'Taxonomies: Product visibility', 'woocommerce' ); ?></th>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'A list of taxonomy terms used for product visibility.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$display_terms = array();
|
||||
foreach ( $settings['product_visibility_terms'] as $slug => $name ) {
|
||||
$display_terms[] = strtolower( $name ) . ' (' . $slug . ')';
|
||||
}
|
||||
echo implode( ', ', array_map( 'esc_html', $display_terms ) );
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="WC Pages"><h2><?php esc_html_e( 'WooCommerce pages', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$alt = 1;
|
||||
foreach ( $pages as $page ) {
|
||||
$error = false;
|
||||
|
||||
if ( $page['page_id'] ) {
|
||||
/* Translators: %s: page name. */
|
||||
$page_name = '<a href="' . get_edit_post_link( $page['page_id'] ) . '" aria-label="' . sprintf( esc_html__( 'Edit %s page', 'woocommerce' ), esc_html( $page['page_name'] ) ) . '">' . esc_html( $page['page_name'] ) . '</a>';
|
||||
} else {
|
||||
$page_name = esc_html( $page['page_name'] );
|
||||
}
|
||||
|
||||
echo '<tr><td data-export-label="' . esc_attr( $page_name ) . '">' . wp_kses_post( $page_name ) . ':</td>';
|
||||
/* Translators: %s: page name. */
|
||||
echo '<td class="help">' . wc_help_tip( sprintf( esc_html__( 'The URL of your %s page (along with the Page ID).', 'woocommerce' ), $page_name ) ) . '</td><td>';
|
||||
|
||||
// Page ID check.
|
||||
if ( ! $page['page_set'] ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Page not set', 'woocommerce' ) . '</mark>';
|
||||
$error = true;
|
||||
} elseif ( ! $page['page_exists'] ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Page ID is set, but the page does not exist', 'woocommerce' ) . '</mark>';
|
||||
$error = true;
|
||||
} elseif ( ! $page['page_visible'] ) {
|
||||
/* Translators: %s: docs link. */
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . wp_kses_post( sprintf( __( 'Page visibility should be <a href="%s" target="_blank">public</a>', 'woocommerce' ), 'https://codex.wordpress.org/Content_Visibility' ) ) . '</mark>';
|
||||
$error = true;
|
||||
} else {
|
||||
// Shortcode check.
|
||||
if ( $page['shortcode_required'] ) {
|
||||
if ( ! $page['shortcode_present'] ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Page does not contain the shortcode.', 'woocommerce' ), esc_html( $page['shortcode'] ) ) . '</mark>';
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $error ) {
|
||||
echo '<mark class="yes">#' . absint( $page['page_id'] ) . ' - ' . esc_html( str_replace( home_url(), '', get_permalink( $page['page_id'] ) ) ) . '</mark>';
|
||||
}
|
||||
|
||||
echo '</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Theme"><h2><?php esc_html_e( 'Theme', 'woocommerce' ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="Name"><?php esc_html_e( 'Name', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The name of the current active theme.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $theme['name'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Version"><?php esc_html_e( 'Version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The installed version of the current active theme.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
echo esc_html( $theme['version'] );
|
||||
if ( version_compare( $theme['version'], $theme['version_latest'], '<' ) ) {
|
||||
/* translators: %s: theme latest version */
|
||||
echo ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'woocommerce' ), esc_html( $theme['version_latest'] ) ) . '</strong>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Author URL"><?php esc_html_e( 'Author URL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The theme developers URL.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $theme['author_url'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Child Theme"><?php esc_html_e( 'Child theme', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not the current theme is a child theme.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $theme['is_child_theme'] ) {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
} else {
|
||||
/* Translators: %s docs link. */
|
||||
echo '<span class="dashicons dashicons-no-alt"></span> – ' . wp_kses_post( sprintf( __( 'If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'woocommerce' ), 'https://codex.wordpress.org/Child_Themes' ) );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( $theme['is_child_theme'] ) : ?>
|
||||
<tr>
|
||||
<td data-export-label="Parent Theme Name"><?php esc_html_e( 'Parent theme name', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The name of the parent theme.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $theme['parent_name'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Parent Theme Version"><?php esc_html_e( 'Parent theme version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The installed version of the parent theme.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
echo esc_html( $theme['parent_version'] );
|
||||
if ( version_compare( $theme['parent_version'], $theme['parent_version_latest'], '<' ) ) {
|
||||
/* translators: %s: parent theme latest version */
|
||||
echo ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'woocommerce' ), esc_html( $theme['parent_version_latest'] ) ) . '</strong>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Parent Theme Author URL"><?php esc_html_e( 'Parent theme author URL', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'The parent theme developers URL.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td><?php echo esc_html( $theme['parent_author_url'] ); ?></td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<tr>
|
||||
<td data-export-label="WooCommerce Support"><?php esc_html_e( 'WooCommerce support', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo wc_help_tip( esc_html__( 'Displays whether or not the current active theme declares WooCommerce support.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ( ! $theme['has_woocommerce_support'] ) {
|
||||
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Not declared', 'woocommerce' ) . '</mark>';
|
||||
} else {
|
||||
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Templates"><h2><?php esc_html_e( 'Templates', 'woocommerce' ); ?><?php echo wc_help_tip( esc_html__( 'This section shows any files that are overriding the default WooCommerce template pages.', 'woocommerce' ) ); ?></h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ( $theme['has_woocommerce_file'] ) : ?>
|
||||
<tr>
|
||||
<td data-export-label="Archive Template"><?php esc_html_e( 'Archive template', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"> </td>
|
||||
<td><?php esc_html_e( 'Your theme has a woocommerce.php file, you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.', 'woocommerce' ); ?></td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<?php if ( ! empty( $theme['overrides'] ) ) : ?>
|
||||
<tr>
|
||||
<td data-export-label="Overrides"><?php esc_html_e( 'Overrides', 'woocommerce' ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<?php
|
||||
$total_overrides = count( $theme['overrides'] );
|
||||
for ( $i = 0; $i < $total_overrides; $i++ ) {
|
||||
$override = $theme['overrides'][ $i ];
|
||||
if ( $override['core_version'] && ( empty( $override['version'] ) || version_compare( $override['version'], $override['core_version'], '<' ) ) ) {
|
||||
$current_version = $override['version'] ? $override['version'] : '-';
|
||||
printf(
|
||||
/* Translators: %1$s: Template name, %2$s: Template version, %3$s: Core version. */
|
||||
esc_html__( '%1$s version %2$s is out of date. The core version is %3$s', 'woocommerce' ),
|
||||
'<code>' . esc_html( $override['file'] ) . '</code>',
|
||||
'<strong style="color:red">' . esc_html( $current_version ) . '</strong>',
|
||||
esc_html( $override['core_version'] )
|
||||
);
|
||||
} else {
|
||||
echo esc_html( $override['file'] );
|
||||
}
|
||||
if ( ( count( $theme['overrides'] ) - 1 ) !== $i ) {
|
||||
echo ', ';
|
||||
}
|
||||
echo '<br />';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else : ?>
|
||||
<tr>
|
||||
<td data-export-label="Overrides"><?php esc_html_e( 'Overrides', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"> </td>
|
||||
<td>–</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( true === $theme['has_outdated_templates'] ) : ?>
|
||||
<tr>
|
||||
<td data-export-label="Outdated Templates"><?php esc_html_e( 'Outdated templates', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"> </td>
|
||||
<td>
|
||||
<mark class="error">
|
||||
<span class="dashicons dashicons-warning"></span>
|
||||
</mark>
|
||||
<a href="https://docs.woocommerce.com/document/fix-outdated-templates-woocommerce/" target="_blank">
|
||||
<?php esc_html_e( 'Learn how to update', 'woocommerce' ); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php do_action( 'woocommerce_system_status_report' ); ?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Status Tools
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="options.php">
|
||||
<?php settings_fields( 'woocommerce_status_settings_fields' ); ?>
|
||||
<table class="wc_status_table wc_status_table--tools widefat" cellspacing="0">
|
||||
<tbody class="tools">
|
||||
<?php foreach ( $tools as $action => $tool ) : ?>
|
||||
<tr class="<?php echo sanitize_html_class( $action ); ?>">
|
||||
<th>
|
||||
<strong class="name"><?php echo esc_html( $tool['name'] ); ?></strong>
|
||||
<p class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></p>
|
||||
</th>
|
||||
<td class="run-tool">
|
||||
<a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wc-status&tab=tools&action=' . $action ), 'debug_action' ); ?>" class="button button-large <?php echo esc_attr( $action ); ?>"><?php echo esc_html( $tool['button'] ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Page - Status
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] ) : 'status';
|
||||
$tabs = array(
|
||||
'status' => __( 'System status', 'woocommerce' ),
|
||||
'tools' => __( 'Tools', 'woocommerce' ),
|
||||
'logs' => __( 'Logs', 'woocommerce' ),
|
||||
);
|
||||
$tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<?php
|
||||
foreach ( $tabs as $name => $label ) {
|
||||
echo '<a href="' . admin_url( 'admin.php?page=wc-status&tab=' . $name ) . '" class="nav-tab ';
|
||||
if ( $current_tab == $name ) {
|
||||
echo 'nav-tab-active';
|
||||
}
|
||||
echo '">' . $label . '</a>';
|
||||
}
|
||||
?>
|
||||
</nav>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
|
||||
<?php
|
||||
switch ( $current_tab ) {
|
||||
case 'tools':
|
||||
WC_Admin_Status::status_tools();
|
||||
break;
|
||||
case 'logs':
|
||||
WC_Admin_Status::status_logs();
|
||||
break;
|
||||
default:
|
||||
if ( array_key_exists( $current_tab, $tabs ) && has_action( 'woocommerce_admin_status_content_' . $current_tab ) ) {
|
||||
do_action( 'woocommerce_admin_status_content_' . $current_tab );
|
||||
} else {
|
||||
WC_Admin_Status::status_report();
|
||||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Settings
|
||||
*
|
||||
* @package WooCommerce
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'woocommerce_sections_' . $current_tab ) || has_action( 'woocommerce_settings_' . $current_tab ) || has_action( 'woocommerce_settings_tabs_' . $current_tab );
|
||||
$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
|
||||
|
||||
if ( ! $tab_exists ) {
|
||||
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<?php
|
||||
|
||||
foreach ( $tabs as $slug => $label ) {
|
||||
echo '<a href="' . esc_html( admin_url( 'admin.php?page=wc-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_settings_tabs' );
|
||||
|
||||
?>
|
||||
</nav>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
|
||||
<?php
|
||||
do_action( 'woocommerce_sections_' . $current_tab );
|
||||
|
||||
self::show_messages();
|
||||
|
||||
do_action( 'woocommerce_settings_' . $current_tab );
|
||||
do_action( 'woocommerce_settings_tabs_' . $current_tab ); // @deprecated hook. @todo remove in 4.0.
|
||||
?>
|
||||
<p class="submit">
|
||||
<?php if ( empty( $GLOBALS['hide_save_button'] ) ) : ?>
|
||||
<button name="save" class="button-primary woocommerce-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php wp_nonce_field( 'woocommerce-settings' ); ?>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,313 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Bulk Edit Products
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<fieldset class="inline-edit-col-right">
|
||||
<div id="woocommerce-fields-bulk" class="inline-edit-col">
|
||||
|
||||
<h4><?php _e( 'Product data', 'woocommerce' ); ?></h4>
|
||||
|
||||
<?php do_action( 'woocommerce_product_bulk_edit_start' ); ?>
|
||||
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Price', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="change_regular_price change_to" name="change_regular_price">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'1' => __( 'Change to:', 'woocommerce' ),
|
||||
'2' => __( 'Increase existing price by (fixed amount or %):', 'woocommerce' ),
|
||||
'3' => __( 'Decrease existing price by (fixed amount or %):', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="change-input">
|
||||
<input type="text" name="_regular_price" class="text regular_price" placeholder="<?php printf( esc_attr__( 'Enter price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Sale', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="change_sale_price change_to" name="change_sale_price">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'1' => __( 'Change to:', 'woocommerce' ),
|
||||
'2' => __( 'Increase existing sale price by (fixed amount or %):', 'woocommerce' ),
|
||||
'3' => __( 'Decrease existing sale price by (fixed amount or %):', 'woocommerce' ),
|
||||
'4' => __( 'Set to regular price decreased by (fixed amount or %):', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="change-input">
|
||||
<input type="text" name="_sale_price" class="text sale_price" placeholder="<?php printf( esc_attr__( 'Enter sale price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Tax status', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_status" name="_tax_status">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'taxable' => __( 'Taxable', 'woocommerce' ),
|
||||
'shipping' => __( 'Shipping only', 'woocommerce' ),
|
||||
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Tax class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_class" name="_tax_class">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'standard' => __( 'Standard', 'woocommerce' ),
|
||||
);
|
||||
|
||||
$tax_classes = WC_Tax::get_tax_classes();
|
||||
|
||||
if ( ! empty( $tax_classes ) ) {
|
||||
foreach ( $tax_classes as $class ) {
|
||||
$options[ sanitize_title( $class ) ] = esc_html( $class );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( wc_product_weight_enabled() ) : ?>
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Weight', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="change_weight change_to" name="change_weight">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'1' => __( 'Change to:', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="change-input">
|
||||
<input type="text" name="_weight" class="text weight" placeholder="<?php printf( esc_attr__( '%1$s (%2$s)', 'woocommerce' ), wc_format_localized_decimal( 0 ), get_option( 'woocommerce_weight_unit' ) ); ?>" value="">
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( wc_product_dimensions_enabled() ) : ?>
|
||||
<div class="inline-edit-group dimensions">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'L/W/H', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="change_dimensions change_to" name="change_dimensions">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'1' => __( 'Change to:', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="change-input">
|
||||
<input type="text" name="_length" class="text length" placeholder="<?php printf( esc_attr__( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
|
||||
<input type="text" name="_width" class="text width" placeholder="<?php printf( esc_attr__( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
|
||||
<input type="text" name="_height" class="text height" placeholder="<?php printf( esc_attr__( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="shipping_class" name="_shipping_class">
|
||||
<option value=""><?php _e( '— No change —', 'woocommerce' ); ?></option>
|
||||
<option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
foreach ( $shipping_class as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $value->slug ) . '">' . $value->name . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Visibility', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="visibility" name="_visibility">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'visible' => __( 'Catalog & search', 'woocommerce' ),
|
||||
'catalog' => __( 'Catalog', 'woocommerce' ),
|
||||
'search' => __( 'Search', 'woocommerce' ),
|
||||
'hidden' => __( 'Hidden', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Featured', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="featured" name="_featured">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'yes' => __( 'Yes', 'woocommerce' ),
|
||||
'no' => __( 'No', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'In stock?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="stock_status" name="_stock_status">
|
||||
<?php
|
||||
echo '<option value="">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>';
|
||||
|
||||
foreach ( wc_get_product_stock_status_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<?php if ( 'yes' == get_option( 'woocommerce_manage_stock' ) ) : ?>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Manage stock?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="manage_stock" name="_manage_stock">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'yes' => __( 'Yes', 'woocommerce' ),
|
||||
'no' => __( 'No', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft stock_qty_field">
|
||||
<span class="title"><?php _e( 'Stock qty', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="change_stock change_to" name="change_stock">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'1' => __( 'Change to:', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="change-input">
|
||||
<input type="text" name="_stock" class="text stock" placeholder="<?php esc_attr_e( 'Stock qty', 'woocommerce' ); ?>" step="any" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Backorders?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="backorders" name="_backorders">
|
||||
<?php
|
||||
echo '<option value="">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>';
|
||||
|
||||
foreach ( wc_get_product_backorder_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php esc_html_e( 'Sold individually?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="sold_individually" name="_sold_individually">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( '— No change —', 'woocommerce' ),
|
||||
'yes' => __( 'Yes', 'woocommerce' ),
|
||||
'no' => __( 'No', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<?php do_action( 'woocommerce_product_bulk_edit_end' ); ?>
|
||||
|
||||
<input type="hidden" name="woocommerce_bulk_edit" value="1" />
|
||||
<input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo wp_create_nonce( 'woocommerce_quick_edit_nonce' ); ?>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Email Template Preview
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquet diam a facilisis eleifend. Cras ac justo felis. Mauris faucibus, orci eu blandit fermentum, lorem nibh sollicitudin mi, sit amet interdum metus urna ut lacus.</p>
|
||||
|
||||
<p>Phasellus quis varius augue. Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>
|
||||
|
||||
<h2>Lorem ipsum dolor</h2>
|
||||
|
||||
<p>Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Custom Notices
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', $notice ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
<?php echo wp_kses_post( wpautop( $notice_html ) ); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Install
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message wc-connect">
|
||||
<p><?php _e( '<strong>Welcome to WooCommerce</strong> – You‘re almost ready to start selling :)', 'woocommerce' ); ?></p>
|
||||
<p class="submit"><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-setup' ) ); ?>" class="button-primary"><?php _e( 'Run the Setup Wizard', 'woocommerce' ); ?></a> <a class="button-secondary skip" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'install' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Skip setup', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Legacy Shipping.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message woocommerce-legacy-shipping-notice">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'legacy_shipping' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p class="main"><strong><?php _e( 'New:', 'woocommerce' ); ?> <?php _e( 'Shipping zones', 'woocommerce' ); ?></strong> – <?php _e( 'a group of regions that can be assigned different shipping methods and rates.', 'woocommerce' ); ?></p>
|
||||
<p><?php _e( 'Legacy shipping methods (flat rate, international flat rate, local pickup and delivery, and free shipping) are deprecated but will continue to work as normal for now. <b><em>They will be removed in future versions of WooCommerce</em></b>. We recommend disabling these and setting up new rates within shipping zones as soon as possible.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="submit">
|
||||
<?php if ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) : ?>
|
||||
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>"><?php _e( 'Setup shipping zones', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?>
|
||||
<a class="button-secondary" href="https://docs.woocommerce.com/document/setting-up-shipping-zones/"><?php _e( 'Learn more about shipping zones', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - No Shipping methods.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message woocommerce-no-shipping-methods-notice">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_shipping_methods' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p class="main"><strong><?php _e( 'Add shipping methods & zones', 'woocommerce' ); ?></strong></p>
|
||||
<p><?php _e( 'Shipping is currently enabled, but you have not added any shipping methods to your shipping zones.', 'woocommerce' ); ?></p>
|
||||
<p><?php _e( 'Customers will not be able to purchase physical goods from your store until a shipping method is available.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="submit">
|
||||
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>"><?php _e( 'Setup shipping zones', 'woocommerce' ); ?></a>
|
||||
<a class="button-secondary" href="https://docs.woocommerce.com/document/setting-up-shipping-zones/"><?php _e( 'Learn more about shipping zones', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Regenerating thumbnails.
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'regenerating_thumbnails' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Cancel thumbnail regeneration', 'woocommerce' ); ?></a>
|
||||
|
||||
<p><?php esc_html_e( 'Thumbnail regeneration is running in the background. Depending on the amount of images in your store this may take a while.', 'woocommerce' ); ?></p>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Secure connection.
|
||||
*
|
||||
* @package WooCommerce\Admin\Notices
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_secure_connection' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post( sprintf(
|
||||
/* translators: %s: documentation URL */
|
||||
__( 'Your store does not appear to be using a secure connection. We highly recommend serving your entire website over an HTTPS connection to help keep customer data secure. <a href="%s">Learn more here.</a>', 'woocommerce' ),
|
||||
'https://docs.woocommerce.com/document/ssl-and-https/'
|
||||
) );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Simplify Commerce.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$plugin_slug = 'woocommerce-gateway-simplify-commerce';
|
||||
|
||||
if ( current_user_can( 'install_plugins' ) ) {
|
||||
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ), 'install-plugin_' . $plugin_slug );
|
||||
} else {
|
||||
$url = 'https://wordpress.org/plugins/' . $plugin_slug;
|
||||
}
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'simplify_commerce' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p><?php _e( '<strong>The Simplify Commerce payment gateway is deprecated</strong> – Please install our new free Simplify Commerce plugin from WordPress.org. Simplify Commerce will be removed from WooCommerce core in a future update.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="submit"><a href="<?php echo esc_url( $url ); ?>" class="wc-update-now button-primary"><?php _e( 'Install our new Simplify Commerce plugin', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Template Check
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$theme = wp_get_theme();
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'template_files' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p><?php printf( __( '<strong>Your theme (%1$s) contains outdated copies of some WooCommerce template files.</strong> These files may need updating to ensure they are compatible with the current version of WooCommerce. You can see which files are affected from the <a href="%2$s">system status page</a>. If in doubt, check with the author of the theme.', 'woocommerce' ), esc_html( $theme['Name'] ), esc_url( admin_url( 'admin.php?page=wc-status' ) ) ); ?></p>
|
||||
<p class="submit"><a class="button-primary" href="https://docs.woocommerce.com/document/template-structure/" target="_blank"><?php _e( 'Learn more about templates', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Theme Support
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message wc-connect">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'theme_support' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p><?php printf( __( '<strong>Your theme does not declare WooCommerce support</strong> – Please read our <a href="%1$s" target="_blank">integration</a> guide or check out our <a href="%2$s" target="_blank">Storefront</a> theme which is totally free to download and designed specifically for use with WooCommerce.', 'woocommerce' ), esc_url( apply_filters( 'woocommerce_docs_url', 'https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/', 'theme-compatibility' ) ), esc_url( self_admin_url( 'theme-install.php?theme=storefront' ) ) ); ?></p>
|
||||
<p class="submit">
|
||||
<a href="https://woocommerce.com/storefront/?utm_source=notice&utm_medium=product&utm_content=storefront&utm_campaign=woocommerceplugin" class="button-primary" target="_blank"><?php _e( 'Read more about Storefront', 'woocommerce' ); ?></a>
|
||||
<a href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woocommerce.com/document/third-party-custom-theme-compatibility/?utm_source=notice&utm_medium=product&utm_content=themecompatibility&utm_campaign=woocommerceplugin' ) ); ?>" class="button-secondary" target="_blank"><?php _e( 'Theme integration guide', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Update
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message wc-connect">
|
||||
<p><strong><?php _e( 'WooCommerce data update', 'woocommerce' ); ?></strong> – <?php _e( 'We need to update your store database to the latest version.', 'woocommerce' ); ?></p>
|
||||
<p class="submit"><a href="<?php echo esc_url( add_query_arg( 'do_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ) ); ?>" class="wc-update-now button-primary"><?php _e( 'Run the updater', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery( '.wc-update-now' ).click( 'click', function() {
|
||||
return window.confirm( '<?php echo esc_js( __( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'woocommerce' ) ); ?>' ); // jshint ignore:line
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Updated
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message wc-connect woocommerce-message--success">
|
||||
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'update', remove_query_arg( 'do_update_woocommerce' ) ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
|
||||
|
||||
<p><?php _e( 'WooCommerce data update complete. Thank you for updating to the latest version!', 'woocommerce' ); ?></p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Notice - Updating
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="updated woocommerce-message wc-connect">
|
||||
<p><strong><?php _e( 'WooCommerce data update', 'woocommerce' ); ?></strong> – <?php _e( 'Your database is being updated in the background.', 'woocommerce' ); ?> <a href="<?php echo esc_url( add_query_arg( 'force_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ) ); ?>"><?php _e( 'Taking a while? Click here to run it now.', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Quick Edit Product
|
||||
*
|
||||
* @package admin.
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
|
||||
<fieldset class="inline-edit-col-left">
|
||||
<div id="woocommerce-fields" class="inline-edit-col">
|
||||
|
||||
<h4><?php esc_html_e( 'Product data', 'woocommerce' ); ?></h4>
|
||||
|
||||
<?php do_action( 'woocommerce_product_quick_edit_start' ); ?>
|
||||
|
||||
<?php if ( wc_product_sku_enabled() ) : ?>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_sku" class="text sku" value="">
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="price_fields">
|
||||
<label>
|
||||
<span class="title"><?php esc_html_e( 'Price', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_regular_price" class="text wc_input_price regular_price" placeholder="<?php esc_attr_e( 'Regular price', 'woocommerce' ); ?>" value="">
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<label>
|
||||
<span class="title"><?php esc_html_e( 'Sale', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_sale_price" class="text wc_input_price sale_price" placeholder="<?php esc_attr_e( 'Sale price', 'woocommerce' ); ?>" value="">
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_status" name="_tax_status">
|
||||
<?php
|
||||
$options = array(
|
||||
'taxable' => __( 'Taxable', 'woocommerce' ),
|
||||
'shipping' => __( 'Shipping only', 'woocommerce' ),
|
||||
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_class" name="_tax_class">
|
||||
<?php
|
||||
$options = array(
|
||||
'' => __( 'Standard', 'woocommerce' ),
|
||||
);
|
||||
|
||||
$tax_classes = WC_Tax::get_tax_classes();
|
||||
|
||||
if ( ! empty( $tax_classes ) ) {
|
||||
foreach ( $tax_classes as $class ) {
|
||||
$options[ sanitize_title( $class ) ] = esc_html( $class );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( wc_product_weight_enabled() || wc_product_dimensions_enabled() ) : ?>
|
||||
<div class="dimension_fields">
|
||||
|
||||
<?php if ( wc_product_weight_enabled() ) : ?>
|
||||
<label>
|
||||
<span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_weight" class="text weight" placeholder="<?php echo esc_attr( wc_format_localized_decimal( 0 ) ); ?>" value="">
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( wc_product_dimensions_enabled() ) : ?>
|
||||
<div class="inline-edit-group dimensions">
|
||||
<div>
|
||||
<span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value="">
|
||||
<input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value="">
|
||||
<input type="text" name="_height" class="text wc_input_decimal height" placeholder="<?php esc_attr_e( 'Height', 'woocommerce' ); ?>" value="">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="inline-edit-group">
|
||||
<span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="shipping_class" name="_shipping_class">
|
||||
<option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
foreach ( $shipping_class as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="visibility" name="_visibility">
|
||||
<?php
|
||||
$options = apply_filters(
|
||||
'woocommerce_product_visibility_options', array(
|
||||
'visible' => __( 'Catalog & search', 'woocommerce' ),
|
||||
'catalog' => __( 'Catalog', 'woocommerce' ),
|
||||
'search' => __( 'Search', 'woocommerce' ),
|
||||
'hidden' => __( 'Hidden', 'woocommerce' ),
|
||||
)
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="alignleft featured">
|
||||
<input type="checkbox" name="_featured" value="1">
|
||||
<span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
|
||||
<div class="inline-edit-group manage_stock_field">
|
||||
<label class="manage_stock">
|
||||
<input type="checkbox" name="_manage_stock" value="1">
|
||||
<span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<label class="stock_status_field">
|
||||
<span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="stock_status" name="_stock_status">
|
||||
<?php
|
||||
foreach ( wc_get_product_stock_status_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="stock_fields">
|
||||
<?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
|
||||
<label class="stock_qty_field">
|
||||
<span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="number" name="_stock" class="text stock" step="any" value="">
|
||||
</span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<label class="alignleft backorder_field">
|
||||
<span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="backorders" name="_backorders">
|
||||
<?php
|
||||
foreach ( wc_get_product_backorder_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<?php do_action( 'woocommerce_product_quick_edit_end' ); ?>
|
||||
|
||||
<input type="hidden" name="woocommerce_quick_edit" value="1" />
|
||||
<input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo esc_attr( wp_create_nonce( 'woocommerce_quick_edit_nonce' ) ); ?>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin View: Report by Date (with date filters)
|
||||
*
|
||||
* @package WooCommerce/Admin/Reporting
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="poststuff" class="woocommerce-reports-wide">
|
||||
<div class="postbox">
|
||||
|
||||
<?php if ( 'custom' === $current_range && isset( $_GET['start_date'], $_GET['end_date'] ) ) : ?>
|
||||
<h3 class="screen-reader-text">
|
||||
<?php
|
||||
/* translators: 1: start date 2: end date */
|
||||
printf(
|
||||
esc_html__( 'From %1$s to %2$s', 'woocommerce' ),
|
||||
esc_html( wc_clean( wp_unslash( $_GET['start_date'] ) ) ),
|
||||
esc_html( wc_clean( wp_unslash( $_GET['end_date'] ) ) )
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<?php else : ?>
|
||||
<h3 class="screen-reader-text"><?php echo esc_html( $ranges[ $current_range ] ); ?></h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="stats_range">
|
||||
<?php $this->get_export_button(); ?>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ( $ranges as $range => $name ) {
|
||||
echo '<li class="' . ( $current_range == $range ? 'active' : '' ) . '"><a href="' . esc_url( remove_query_arg( array( 'start_date', 'end_date' ), add_query_arg( 'range', $range ) ) ) . '">' . esc_html( $name ) . '</a></li>';
|
||||
}
|
||||
?>
|
||||
<li class="custom <?php echo ( 'custom' === $current_range ) ? 'active' : ''; ?>">
|
||||
<?php esc_html_e( 'Custom:', 'woocommerce' ); ?>
|
||||
<form method="GET">
|
||||
<div>
|
||||
<?php
|
||||
// Maintain query string.
|
||||
foreach ( $_GET as $key => $value ) {
|
||||
if ( is_array( $value ) ) {
|
||||
foreach ( $value as $v ) {
|
||||
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '[]" value="' . esc_attr( sanitize_text_field( $v ) ) . '" />';
|
||||
}
|
||||
} else {
|
||||
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '" value="' . esc_attr( sanitize_text_field( $value ) ) . '" />';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="range" value="custom" />
|
||||
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( wp_unslash( $_GET['start_date'] ) ) : ''; ?>" name="start_date" class="range_datepicker from" /><?php //@codingStandardsIgnoreLine ?>
|
||||
<span>–</span>
|
||||
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( wp_unslash( $_GET['end_date'] ) ) : ''; ?>" name="end_date" class="range_datepicker to" /><?php //@codingStandardsIgnoreLine ?>
|
||||
<button type="submit" class="button" value="<?php esc_attr_e( 'Go', 'woocommerce' ); ?>"><?php esc_html_e( 'Go', 'woocommerce' ); ?></button>
|
||||
<?php wp_nonce_field( 'custom_range', 'wc_reports_nonce', false ); ?>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if ( empty( $hide_sidebar ) ) : ?>
|
||||
<div class="inside chart-with-sidebar">
|
||||
<div class="chart-sidebar">
|
||||
<?php if ( $legends = $this->get_chart_legend() ) : ?>
|
||||
<ul class="chart-legend">
|
||||
<?php foreach ( $legends as $legend ) : ?>
|
||||
<?php // @codingStandardsIgnoreStart ?>
|
||||
<li style="border-color: <?php echo $legend['color']; ?>" <?php if ( isset( $legend['highlight_series'] ) ) echo 'class="highlight_series ' . ( isset( $legend['placeholder'] ) ? 'tips' : '' ) . '" data-series="' . esc_attr( $legend['highlight_series'] ) . '"'; ?> data-tip="<?php echo isset( $legend['placeholder'] ) ? $legend['placeholder'] : ''; ?>">
|
||||
<?php echo $legend['title']; ?>
|
||||
</li>
|
||||
<?php // @codingStandardsIgnoreEnd ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<ul class="chart-widgets">
|
||||
<?php foreach ( $this->get_chart_widgets() as $widget ) : ?>
|
||||
<li class="chart-widget">
|
||||
<?php if ( $widget['title'] ) : ?>
|
||||
<h4><?php echo esc_html( $widget['title'] ); ?></h4>
|
||||
<?php endif; ?>
|
||||
<?php call_user_func( $widget['callback'] ); ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="main">
|
||||
<?php $this->get_main_chart(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="inside">
|
||||
<?php $this->get_main_chart(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user