This commit is contained in:
Mike Jolley 2012-05-21 09:25:34 +01:00
parent c912169b55
commit 2946189745
4 changed files with 25 additions and 13 deletions

View File

@ -22,9 +22,9 @@ function woocommerce_admin_help_tab_content() {
'<p>' . sprintf(__( 'Thank you for using WooCommerce :) Should you need help using or extending WooCommerce please <a href="%s">read the documentation</a>. For further assistance you can use the <a href="%s">community forum</a> or if you have access, <a href="%s">the members forum</a>.', 'woocommerce' ), 'http://www.woothemes.com/woocommerce-docs/', 'http://www.woothemes.com/support-forum/?viewforum=150', 'http://www.woothemes.com/support-forum/') . '</p>' .
'<p>' . __( 'If you are having problems, or to assist us with support, please check the debugging page to identify any problems with your configuration:', 'woocommerce' ) . '</p>' .
'<p>' . __( 'If you are having problems, or to assist us with support, please check the status page to identify any problems with your configuration:', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url('tools.php?page=woocommerce_debug') . '" class="button">' . __( 'Debugging Info &amp; Tools', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . admin_url('admin.php?page=woocommerce_status') . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>' .
'<p>' . sprintf(__( 'If you come across a bug, or wish to contribute to the project you can also <a href="%s">get involved on GitHub</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce') . '</p>'

View File

@ -15,6 +15,7 @@
* Sets up the admin menus in wordpress.
*/
add_action('admin_menu', 'woocommerce_admin_menu', 9);
add_action('admin_menu', 'woocommerce_admin_menu_after', 50);
function woocommerce_admin_menu() {
global $menu, $woocommerce;
@ -29,18 +30,22 @@ function woocommerce_admin_menu() {
$reports_page = add_submenu_page('woocommerce', __('Reports', 'woocommerce'), __('Reports', 'woocommerce') , 'view_woocommerce_reports', 'woocommerce_reports', 'woocommerce_reports_page');
add_submenu_page('edit.php?post_type=product', __('Attributes', 'woocommerce'), __('Attributes', 'woocommerce'), 'manage_woocommerce_products', 'woocommerce_attributes', 'woocommerce_attributes_page');
$status_page = add_submenu_page( 'tools.php', __('WooCommerce Debug', 'woocommerce'), __('WC Debug', 'woocommerce') , 'manage_woocommerce', 'woocommerce_debug', 'woocommerce_debug_page');
add_action('load-' . $main_page, 'woocommerce_admin_help_tab');
add_action('load-' . $reports_page, 'woocommerce_admin_help_tab');
$print_css_on = array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_reports', 'tools_page_woocommerce_debug', 'product_page_woocommerce_attributes', 'edit-tags.php', 'edit.php', 'index.php', 'post-new.php', 'post.php' );
$print_css_on = array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_reports', 'woocommerce_page_woocommerce_status', 'product_page_woocommerce_attributes', 'edit-tags.php', 'edit.php', 'index.php', 'post-new.php', 'post.php' );
foreach ( $print_css_on as $page )
add_action( 'admin_print_styles-'. $page, 'woocommerce_admin_css' );
}
function woocommerce_admin_menu_after() {
$status_page = add_submenu_page( 'woocommerce', __('WooCommerce Status', 'woocommerce'), __('System Status', 'woocommerce') , 'manage_woocommerce', 'woocommerce_status', 'woocommerce_status_page');
}
/**
* Highlights the correct top level admin menu item for post type add screens.
*/
@ -176,9 +181,9 @@ function woocommerce_attributes_page() {
include_once( 'woocommerce-admin-attributes.php' );
woocommerce_attributes();
}
function woocommerce_debug_page() {
include_once( 'woocommerce-admin-debug.php' );
woocommerce_debug();
function woocommerce_status_page() {
include_once( 'woocommerce-admin-status.php' );
woocommerce_status();
}
/**

View File

@ -7,7 +7,7 @@
* @package WooCommerce
*/
function woocommerce_debug() {
function woocommerce_status() {
global $woocommerce;
$tools = apply_filters( 'wc_debug_tools', array(
@ -26,7 +26,7 @@ function woocommerce_debug() {
?>
<div class="wrap woocommerce">
<div class="icon32 icon32-woocommerce-status" id="icon-woocommerce"><br /></div>
<h2><?php _e( 'Debugging Information', 'woocommerce' ); ?> <a href="#" class="add-new-h2 debug-report"><?php _e('Generate report', 'woocommerce'); ?></a></h2>
<h2><?php _e( 'System Status', 'woocommerce' ); ?> <a href="#" class="add-new-h2 debug-report"><?php _e('Generate report', 'woocommerce'); ?></a></h2>
<?php
if ( ! empty( $_GET['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) ) {
@ -269,7 +269,13 @@ function woocommerce_debug() {
<tr>
<td><?php _e('WP Memory Limit','woocommerce')?></td>
<td><?php
echo wp_convert_bytes_to_hr( woocommerce_let_to_num( WP_MEMORY_LIMIT ) );
$memory = woocommerce_let_to_num( WP_MEMORY_LIMIT );
if ( $memory < 67108864 ) {
echo '<mark class="error">' . sprintf( __('%s - We recommend setting memory to at least 64MB. See: <a href="%s">Increasing memory allocated to PHP</a>', 'woocommerce'), wp_convert_bytes_to_hr( $memory ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>';
} else {
echo '<mark class="yes">' . wp_convert_bytes_to_hr( $memory ) . '</mark>';
}
?></td>
</tr>
<tr>
@ -373,7 +379,7 @@ function woocommerce_debug() {
<td><?php echo $tool['name']; ?></td>
<td>
<p>
<a href="<?php echo wp_nonce_url( admin_url('tools.php?page=woocommerce_debug&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo $tool['button']; ?></a>
<a href="<?php echo wp_nonce_url( admin_url('admin.php?page=woocommerce_status&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo $tool['button']; ?></a>
<span class="description"><?php echo $tool['desc']; ?></span>
</p>
</td>

View File

@ -149,6 +149,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
==
* Tweak - Change debug page to status page to make it more noticeable.
* Tweak - Broken up settings pages to ease development
* Fix - Strange error where detecting the page (is_page etc) would break the canonical redirect in some instances when hooked into 'wp'. Used the later get_header hook instead.
* Fix - fix for https://bugs.php.net/bug.php?id=61166 (thanks Max Rice)