2014-07-28 14:50:11 +00:00
< ? php
/**
* Admin View : Page - Status Report
*/
2014-07-28 15:16:35 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
exit ; // Exit if accessed directly
}
2014-07-28 14:50:11 +00:00
?>
2014-01-13 11:34:58 +00:00
< div class = " updated woocommerce-message " >
2014-07-18 20:55:14 +00:00
< p >< ? php _e ( 'Please copy and paste this information in your ticket when contacting support:' , 'woocommerce' ); ?> </p>
2013-11-19 11:22:59 +00:00
< p class = " submit " >< a href = " # " class = " button-primary debug-report " >< ? php _e ( 'Get System Report' , 'woocommerce' ); ?> </a></p>
2014-07-29 15:06:58 +00:00
< div id = " debug-report " >
< textarea readonly = " readonly " ></ textarea >
< p class = " submit " >< button id = " copy-for-support " class = " button-primary " href = " # " data - tip = " <?php _e( 'Copied!', 'woocommerce' ); ?> " >< ? php _e ( 'Copy for Support' , 'woocommerce' ); ?> </button></p>
</ div >
2013-07-18 14:22:05 +00:00
</ div >
< br />
2014-08-26 17:13:39 +00:00
< table class = " wc_status_table widefat " cellspacing = " 0 " id = " status " >
2013-07-18 14:22:05 +00:00
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Environment' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'Home URL' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo home_url (); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'Site URL' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo site_url (); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WC Version' , 'woocommerce' ); ?> :</td>
2013-11-25 14:01:32 +00:00
< td >< ? php echo esc_html ( WC () -> version ); ?> </td>
2013-07-18 14:22:05 +00:00
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WC Database Version' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo esc_html ( get_option ( 'woocommerce_db_version' ) ); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WP Version' , 'woocommerce' ); ?> :</td>
2013-09-04 17:13:09 +00:00
< td >< ? php bloginfo ( 'version' ); ?> </td>
2013-07-18 14:25:17 +00:00
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WP Multisite Enabled' , 'woocommerce' ); ?> :</td>
2013-07-18 14:25:17 +00:00
< td >< ? php if ( is_multisite () ) echo __ ( 'Yes' , 'woocommerce' ); else echo __ ( 'No' , 'woocommerce' ); ?> </td>
2013-07-18 14:22:05 +00:00
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'Web Server Info' , 'woocommerce' ); ?> :</td>
2013-08-07 21:05:09 +00:00
< td >< ? php echo esc_html ( $_SERVER [ 'SERVER_SOFTWARE' ] ); ?> </td>
2013-07-18 14:22:05 +00:00
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'PHP Version' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php if ( function_exists ( 'phpversion' ) ) echo esc_html ( phpversion () ); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'MySQL Version' , 'woocommerce' ); ?> :</td>
2014-04-01 18:10:06 +00:00
< td >
< ? php
/** @global wpdb $wpdb */
global $wpdb ;
echo $wpdb -> db_version ();
?>
</ td >
2013-07-18 14:22:05 +00:00
</ tr >
2014-08-26 16:54:25 +00:00
< tr >
< td >< ? php _e ( 'WP Active Plugins' , 'woocommerce' ); ?> :</td>
< td >< ? php echo count ( ( array ) get_option ( 'active_plugins' ) ); ?> </td>
</ tr >
2013-07-18 14:22:05 +00:00
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WP Memory Limit' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php
2013-11-25 13:34:21 +00:00
$memory = wc_let_to_num ( WP_MEMORY_LIMIT );
2013-07-18 14:22:05 +00:00
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' ), size_format ( $memory ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>' ;
} else {
echo '<mark class="yes">' . size_format ( $memory ) . '</mark>' ;
}
?> </td>
</ tr >
< tr >
2013-08-07 21:05:09 +00:00
< td >< ? php _e ( 'WP Debug Mode' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php if ( defined ( 'WP_DEBUG' ) && WP_DEBUG ) echo '<mark class="yes">' . __ ( 'Yes' , 'woocommerce' ) . '</mark>' ; else echo '<mark class="no">' . __ ( 'No' , 'woocommerce' ) . '</mark>' ; ?> </td>
</ tr >
2013-08-07 21:05:09 +00:00
< tr >
< td >< ? php _e ( 'WP Language' , 'woocommerce' ); ?> :</td>
2014-09-04 10:33:30 +00:00
< td >< ? php echo get_locale (); ?> </td>
2013-08-07 21:05:09 +00:00
</ tr >
2013-07-18 14:22:05 +00:00
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WP Max Upload Size' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo size_format ( wp_max_upload_size () ); ?> </td>
</ tr >
< ? php if ( function_exists ( 'ini_get' ) ) : ?>
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'PHP Post Max Size' , 'woocommerce' ); ?> :</td>
2013-11-25 13:34:21 +00:00
< td >< ? php echo size_format ( wc_let_to_num ( ini_get ( 'post_max_size' ) ) ); ?> </td>
2013-07-18 14:22:05 +00:00
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'PHP Time Limit' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo ini_get ( 'max_execution_time' ); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'PHP Max Input Vars' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo ini_get ( 'max_input_vars' ); ?> </td>
</ tr >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'SUHOSIN Installed' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo extension_loaded ( 'suhosin' ) ? __ ( 'Yes' , 'woocommerce' ) : __ ( 'No' , 'woocommerce' ); ?> </td>
</ tr >
< ? php endif ; ?>
2013-09-09 11:20:22 +00:00
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'WC Logging' , 'woocommerce' ); ?> :</td>
2013-09-09 11:20:22 +00:00
< td >< ? php
2014-05-28 10:12:35 +00:00
if ( @ fopen ( WC_LOG_DIR . 'test-log.log' , 'a' ) ) {
printf ( '<mark class="yes">' . __ ( 'Log directory (%s) is writable.' , 'woocommerce' ) . '</mark>' , WC_LOG_DIR );
} else {
printf ( '<mark class="error">' . __ ( 'Log directory (<code>%s</code>) is not writable. To allow logging, make this writable or define a custom <code>WC_LOG_DIR</code>.' , 'woocommerce' ) . '</mark>' , WC_LOG_DIR );
}
2013-09-09 11:20:22 +00:00
?> </td>
</ tr >
2013-08-14 18:21:49 +00:00
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'Default Timezone' , 'woocommerce' ); ?> :</td>
2013-08-14 18:21:49 +00:00
< td >< ? php
$default_timezone = date_default_timezone_get ();
if ( 'UTC' !== $default_timezone ) {
echo '<mark class="error">' . sprintf ( __ ( 'Default timezone is %s - it should be UTC' , 'woocommerce' ), $default_timezone ) . '</mark>' ;
} else {
echo '<mark class="yes">' . sprintf ( __ ( 'Default timezone is %s' , 'woocommerce' ), $default_timezone ) . '</mark>' ;
} ?>
</ td >
</ tr >
2013-07-18 14:22:05 +00:00
< ? php
$posting = array ();
// fsockopen/cURL
$posting [ 'fsockopen_curl' ][ 'name' ] = __ ( 'fsockopen/cURL' , 'woocommerce' );
if ( function_exists ( 'fsockopen' ) || function_exists ( 'curl_init' ) ) {
if ( function_exists ( 'fsockopen' ) && function_exists ( 'curl_init' )) {
2014-08-26 17:01:31 +00:00
$posting [ 'fsockopen_curl' ][ 'note' ] = __ ( 'Your server has fsockopen and cURL enabled.' , 'woocommerce' );
2013-07-18 14:22:05 +00:00
} elseif ( function_exists ( 'fsockopen' )) {
$posting [ 'fsockopen_curl' ][ 'note' ] = __ ( 'Your server has fsockopen enabled, cURL is disabled.' , 'woocommerce' );
} else {
$posting [ 'fsockopen_curl' ][ 'note' ] = __ ( 'Your server has cURL enabled, fsockopen is disabled.' , 'woocommerce' );
}
$posting [ 'fsockopen_curl' ][ 'success' ] = true ;
} else {
$posting [ 'fsockopen_curl' ][ 'note' ] = __ ( '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>' ;
$posting [ 'fsockopen_curl' ][ 'success' ] = false ;
}
// SOAP
$posting [ 'soap_client' ][ 'name' ] = __ ( 'SOAP Client' , 'woocommerce' );
if ( class_exists ( 'SoapClient' ) ) {
2014-08-26 17:01:31 +00:00
$posting [ 'soap_client' ][ 'note' ] = __ ( 'Your server has the SOAP Client class enabled.' , 'woocommerce' );
2013-07-18 14:22:05 +00:00
$posting [ 'soap_client' ][ 'success' ] = true ;
} else {
$posting [ 'soap_client' ][ 'note' ] = sprintf ( __ ( 'Your server does not have the <a href="%s">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.' , 'woocommerce' ), 'http://php.net/manual/en/class.soapclient.php' ) . '</mark>' ;
$posting [ 'soap_client' ][ 'success' ] = false ;
}
// WP Remote Post Check
$posting [ 'wp_remote_post' ][ 'name' ] = __ ( 'WP Remote Post' , 'woocommerce' );
$request [ 'cmd' ] = '_notify-validate' ;
$params = array (
'sslverify' => false ,
'timeout' => 60 ,
2013-11-25 14:01:32 +00:00
'user-agent' => 'WooCommerce/' . WC () -> version ,
2013-07-18 14:22:05 +00:00
'body' => $request
);
$response = wp_remote_post ( 'https://www.paypal.com/cgi-bin/webscr' , $params );
if ( ! is_wp_error ( $response ) && $response [ 'response' ][ 'code' ] >= 200 && $response [ 'response' ][ 'code' ] < 300 ) {
2014-08-26 17:01:31 +00:00
$posting [ 'wp_remote_post' ][ 'note' ] = __ ( 'wp_remote_post() was successful - PayPal IPN is working.' , 'woocommerce' );
2013-07-18 14:22:05 +00:00
$posting [ 'wp_remote_post' ][ 'success' ] = true ;
} elseif ( is_wp_error ( $response ) ) {
$posting [ 'wp_remote_post' ][ 'note' ] = __ ( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider. Error:' , 'woocommerce' ) . ' ' . $response -> get_error_message ();
$posting [ 'wp_remote_post' ][ 'success' ] = false ;
} else {
$posting [ 'wp_remote_post' ][ 'note' ] = __ ( 'wp_remote_post() failed. PayPal IPN may not work with your server.' , 'woocommerce' );
$posting [ 'wp_remote_post' ][ 'success' ] = false ;
}
$posting = apply_filters ( 'woocommerce_debug_posting' , $posting );
foreach ( $posting as $post ) { $mark = ( isset ( $post [ 'success' ] ) && $post [ 'success' ] == true ) ? 'yes' : 'error' ;
?>
< tr >
< td >< ? php echo esc_html ( $post [ 'name' ] ); ?> :</td>
< td >
< mark class = " <?php echo $mark ; ?> " >
< ? php echo wp_kses_data ( $post [ 'note' ] ); ?>
</ mark >
</ td >
</ tr >
< ? php
}
?>
</ tbody >
2013-11-11 15:41:32 +00:00
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Locale' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< ? php
$locale = localeconv ();
2013-11-19 11:22:59 +00:00
foreach ( $locale as $key => $val )
2013-11-11 15:41:32 +00:00
if ( in_array ( $key , array ( 'decimal_point' , 'mon_decimal_point' , 'thousands_sep' , 'mon_thousands_sep' ) ) )
2014-09-11 09:49:56 +00:00
echo '<tr><td>' . $key . ':</td><td>' . ( $val ? $val : __ ( 'N/A' , 'woocommerce' ) ) . '</td></tr>' ;
2013-11-11 15:41:32 +00:00
?>
</ tbody >
2013-07-18 14:22:05 +00:00
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Plugins' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< tr >
< td >< ? php _e ( 'Installed Plugins' , 'woocommerce' ); ?> :</td>
< td >< ? php
$active_plugins = ( array ) get_option ( 'active_plugins' , array () );
if ( is_multisite () )
$active_plugins = array_merge ( $active_plugins , get_site_option ( 'active_sitewide_plugins' , array () ) );
$wc_plugins = array ();
foreach ( $active_plugins as $plugin ) {
$plugin_data = @ get_plugin_data ( WP_PLUGIN_DIR . '/' . $plugin );
$dirname = dirname ( $plugin );
$version_string = '' ;
if ( ! empty ( $plugin_data [ 'Name' ] ) ) {
2013-07-31 02:31:19 +00:00
// link the plugin name to the plugin url if available
$plugin_name = $plugin_data [ 'Name' ];
if ( ! empty ( $plugin_data [ 'PluginURI' ] ) ) {
2013-11-20 18:54:01 +00:00
$plugin_name = '<a href="' . esc_url ( $plugin_data [ 'PluginURI' ] ) . '" title="' . __ ( 'Visit plugin homepage' , 'woocommerce' ) . '">' . $plugin_name . '</a>' ;
2013-07-31 02:31:19 +00:00
}
2013-07-18 14:22:05 +00:00
if ( strstr ( $dirname , 'woocommerce' ) ) {
2014-02-19 14:05:32 +00:00
if ( false === ( $version_data = get_transient ( md5 ( $plugin ) . '_version_data' ) ) ) {
2013-07-18 14:22:05 +00:00
$changelog = wp_remote_get ( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );
$cl_lines = explode ( " \n " , wp_remote_retrieve_body ( $changelog ) );
if ( ! empty ( $cl_lines ) ) {
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match ( '/^[0-9]/' , $cl_line ) ) {
$date = str_replace ( '.' , '-' , trim ( substr ( $cl_line , 0 , strpos ( $cl_line , '-' ) ) ) );
$version = preg_replace ( '~[^0-9,.]~' , '' , stristr ( $cl_line , " version " ) );
$update = trim ( str_replace ( " * " , " " , $cl_lines [ $line_num + 1 ] ) );
$version_data = array ( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
2014-08-26 18:02:41 +00:00
set_transient ( md5 ( $plugin ) . '_version_data' , $version_data , DAY_IN_SECONDS );
2013-07-18 14:22:05 +00:00
break ;
}
}
}
}
2014-02-26 09:55:27 +00:00
if ( ! empty ( $version_data [ 'version' ] ) && version_compare ( $version_data [ 'version' ], $plugin_data [ 'Version' ], '>' ) )
2013-07-18 14:22:05 +00:00
$version_string = ' – <strong style="color:red;">' . $version_data [ 'version' ] . ' ' . __ ( 'is available' , 'woocommerce' ) . '</strong>' ;
}
2013-07-31 02:31:19 +00:00
$wc_plugins [] = $plugin_name . ' ' . __ ( 'by' , 'woocommerce' ) . ' ' . $plugin_data [ 'Author' ] . ' ' . __ ( 'version' , 'woocommerce' ) . ' ' . $plugin_data [ 'Version' ] . $version_string ;
2013-07-18 14:22:05 +00:00
}
}
if ( sizeof ( $wc_plugins ) == 0 )
echo '-' ;
else
echo implode ( ', <br/>' , $wc_plugins );
?> </td>
</ tr >
</ tbody >
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Settings' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< tr >
2014-08-26 17:01:31 +00:00
< td >< ? php _e ( 'Force SSL' , 'woocommerce' ); ?> :</td>
2013-07-18 14:22:05 +00:00
< td >< ? php echo get_option ( 'woocommerce_force_ssl_checkout' ) === 'yes' ? '<mark class="yes">' . __ ( 'Yes' , 'woocommerce' ) . '</mark>' : '<mark class="no">' . __ ( 'No' , 'woocommerce' ) . '</mark>' ; ?> </td>
</ tr >
</ tbody >
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'WC Pages' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< ? php
$check_pages = array (
2014-03-03 14:47:19 +00:00
_x ( 'Shop Base' , 'Page setting' , 'woocommerce' ) => array (
2013-07-18 14:22:05 +00:00
'option' => 'woocommerce_shop_page_id' ,
'shortcode' => ''
),
2014-03-03 14:47:19 +00:00
_x ( 'Cart' , 'Page setting' , 'woocommerce' ) => array (
2013-07-18 14:22:05 +00:00
'option' => 'woocommerce_cart_page_id' ,
2013-10-23 13:55:18 +00:00
'shortcode' => '[' . apply_filters ( 'woocommerce_cart_shortcode_tag' , 'woocommerce_cart' ) . ']'
2013-07-18 14:22:05 +00:00
),
2014-03-03 14:47:19 +00:00
_x ( 'Checkout' , 'Page setting' , 'woocommerce' ) => array (
2013-07-18 14:22:05 +00:00
'option' => 'woocommerce_checkout_page_id' ,
2013-10-23 13:55:18 +00:00
'shortcode' => '[' . apply_filters ( 'woocommerce_checkout_shortcode_tag' , 'woocommerce_checkout' ) . ']'
2013-07-18 14:22:05 +00:00
),
2014-03-03 14:47:19 +00:00
_x ( 'My Account' , 'Page setting' , 'woocommerce' ) => array (
2013-07-18 14:22:05 +00:00
'option' => 'woocommerce_myaccount_page_id' ,
2013-10-23 13:55:18 +00:00
'shortcode' => '[' . apply_filters ( 'woocommerce_my_account_shortcode_tag' , 'woocommerce_my_account' ) . ']'
2013-07-18 14:22:05 +00:00
)
);
$alt = 1 ;
foreach ( $check_pages as $page_name => $values ) {
if ( $alt == 1 ) echo '<tr>' ; else echo '<tr>' ;
echo '<td>' . esc_html ( $page_name ) . ':</td><td>' ;
$error = false ;
$page_id = get_option ( $values [ 'option' ] );
// Page ID check
if ( ! $page_id ) {
echo '<mark class="error">' . __ ( 'Page not set' , 'woocommerce' ) . '</mark>' ;
$error = true ;
} else {
// Shortcode check
if ( $values [ 'shortcode' ] ) {
$page = get_post ( $page_id );
if ( empty ( $page ) ) {
echo '<mark class="error">' . sprintf ( __ ( 'Page does not exist' , 'woocommerce' ) ) . '</mark>' ;
$error = true ;
} else if ( ! strstr ( $page -> post_content , $values [ 'shortcode' ] ) ) {
echo '<mark class="error">' . sprintf ( __ ( 'Page does not contain the shortcode: %s' , 'woocommerce' ), $values [ 'shortcode' ] ) . '</mark>' ;
$error = true ;
}
}
}
if ( ! $error ) echo '<mark class="yes">#' . absint ( $page_id ) . ' - ' . str_replace ( home_url (), '' , get_permalink ( $page_id ) ) . '</mark>' ;
echo '</td></tr>' ;
$alt = $alt * - 1 ;
}
?>
</ tbody >
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'WC Taxonomies' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< tr >
< td >< ? php _e ( 'Product Types' , 'woocommerce' ); ?> :</td>
< td >< ? php
$display_terms = array ();
$terms = get_terms ( 'product_type' , array ( 'hide_empty' => 0 ) );
foreach ( $terms as $term )
$display_terms [] = $term -> name . ' (' . $term -> slug . ')' ;
echo implode ( ', ' , array_map ( 'esc_html' , $display_terms ) );
?> </td>
</ tr >
</ tbody >
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Theme' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
2014-06-27 19:37:59 +00:00
< ? php
$active_theme = wp_get_theme ();
if ( $active_theme -> { 'Author URI' } == 'http://www.woothemes.com' ) :
2013-09-13 12:38:36 +00:00
2014-02-19 14:05:32 +00:00
$theme_dir = substr ( strtolower ( str_replace ( ' ' , '' , $active_theme -> Name ) ), 0 , 45 );
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
if ( false === ( $theme_version_data = get_transient ( $theme_dir . '_version_data' ) ) ) :
2013-09-13 12:38:36 +00:00
2014-06-27 19:37:59 +00:00
$theme_changelog = wp_remote_get ( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt' );
2013-09-08 02:26:26 +00:00
$cl_lines = explode ( " \n " , wp_remote_retrieve_body ( $theme_changelog ) );
if ( ! empty ( $cl_lines ) ) :
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match ( '/^[0-9]/' , $cl_line ) ) :
$theme_date = str_replace ( '.' , '-' , trim ( substr ( $cl_line , 0 , strpos ( $cl_line , '-' ) ) ) );
$theme_version = preg_replace ( '~[^0-9,.]~' , '' , stristr ( $cl_line , " version " ) );
$theme_update = trim ( str_replace ( " * " , " " , $cl_lines [ $line_num + 1 ] ) );
$theme_version_data = array ( 'date' => $theme_date , 'version' => $theme_version , 'update' => $theme_update , 'changelog' => $theme_changelog );
2014-08-27 13:37:03 +00:00
set_transient ( $theme_dir . '_version_data' , $theme_version_data , DAY_IN_SECONDS );
2013-09-08 02:26:26 +00:00
break ;
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
endif ;
}
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
endif ;
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
endif ;
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
endif ;
?>
2013-07-18 14:22:05 +00:00
< tbody >
2014-06-27 19:37:59 +00:00
< tr >
< td >< ? php _e ( 'Theme Name' , 'woocommerce' ); ?> :</td>
< td >< ? php
2013-09-08 02:26:26 +00:00
echo $active_theme -> Name ;
2014-06-27 19:37:59 +00:00
?> </td>
</ tr >
< tr >
< td >< ? php _e ( 'Theme Version' , 'woocommerce' ); ?> :</td>
< td >< ? php
2013-09-08 02:26:26 +00:00
echo $active_theme -> Version ;
2013-09-13 12:38:36 +00:00
2013-09-08 02:26:26 +00:00
if ( ! empty ( $theme_version_data [ 'version' ] ) && version_compare ( $theme_version_data [ 'version' ], $active_theme -> Version , '!=' ) )
echo ' – <strong style="color:red;">' . $theme_version_data [ 'version' ] . ' ' . __ ( 'is available' , 'woocommerce' ) . '</strong>' ;
2014-06-27 19:37:59 +00:00
?> </td>
</ tr >
< tr >
2014-08-03 11:59:17 +00:00
< td >< ? php _e ( 'Theme Author URL' , 'woocommerce' ); ?> :</td>
2014-06-27 19:37:59 +00:00
< td >< ? php
2013-09-08 02:26:26 +00:00
echo $active_theme -> { 'Author URI' };
2014-06-27 19:37:59 +00:00
?> </td>
</ tr >
2014-08-03 11:59:17 +00:00
< tr >
< td >< ? php _e ( 'Is Child Theme' , 'woocommerce' ); ?> :</td>
< td >< ? php echo is_child_theme () ? '<mark class="yes">' . __ ( 'Yes' , 'woocommerce' ) . '</mark>' : '<mark class="no">' . __ ( 'No' , 'woocommerce' ) . '</mark>' ; ?> </td>
</ tr >
< ? php
if ( is_child_theme () ) :
$parent_theme = wp_get_theme ( $active_theme -> Template );
?>
< tr >
2014-08-15 19:08:43 +00:00
< td >< ? php _e ( 'Parent Theme Name' , 'woocommerce' ); ?> :</td>
2014-08-03 11:59:17 +00:00
< td >< ? php echo $parent_theme -> Name ; ?> </td>
</ tr >
< tr >
< td >< ? php _e ( 'Parent Theme Version' , 'woocommerce' ); ?> :</td>
< td >< ? php echo $parent_theme -> Version ; ?> </td>
</ tr >
< tr >
< td >< ? php _e ( 'Parent Theme Author URL' , 'woocommerce' ); ?> :</td>
< td >< ? php
echo $parent_theme -> { 'Author URI' };
?> </td>
</ tr >
2014-08-03 12:05:49 +00:00
< ? php endif ?>
2014-06-27 19:37:59 +00:00
< tr >
< td >< ? php _e ( 'WooCommerce Support' , 'woocommerce' ); ?> :</td>
< td >< ? php
2014-06-27 19:42:23 +00:00
if ( ! current_theme_supports ( 'woocommerce' ) && ! in_array ( $active_theme -> template , wc_get_core_supported_themes () ) ) {
2014-06-27 19:37:59 +00:00
echo '<mark class="error">' . __ ( 'Not Declared' , 'woocommerce' ) . '</mark>' ;
} else {
echo '<mark class="yes">' . __ ( 'Yes' , 'woocommerce' ) . '</mark>' ;
}
?> </td>
</ tr >
2013-07-18 14:22:05 +00:00
</ tbody >
< thead >
< tr >
< th colspan = " 2 " >< ? php _e ( 'Templates' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
2014-06-09 13:57:02 +00:00
< ? php
2013-07-18 14:22:05 +00:00
2014-06-09 13:57:02 +00:00
$template_paths = apply_filters ( 'woocommerce_template_overrides_scan_paths' , array ( 'WooCommerce' => WC () -> plugin_path () . '/templates/' ) );
$scanned_files = array ();
$found_files = array ();
2014-02-11 13:33:56 +00:00
2014-06-09 13:57:02 +00:00
foreach ( $template_paths as $plugin_name => $template_path ) {
$scanned_files [ $plugin_name ] = WC_Admin_Status :: scan_template_files ( $template_path );
}
2014-02-11 13:33:56 +00:00
2014-06-09 13:57:02 +00:00
foreach ( $scanned_files as $plugin_name => $files ) {
foreach ( $files as $file ) {
if ( file_exists ( get_stylesheet_directory () . '/' . $file ) ) {
$theme_file = get_stylesheet_directory () . '/' . $file ;
} elseif ( file_exists ( get_stylesheet_directory () . '/woocommerce/' . $file ) ) {
$theme_file = get_stylesheet_directory () . '/woocommerce/' . $file ;
} elseif ( file_exists ( get_template_directory () . '/' . $file ) ) {
$theme_file = get_template_directory () . '/' . $file ;
} elseif ( file_exists ( get_template_directory () . '/woocommerce/' . $file ) ) {
$theme_file = get_template_directory () . '/woocommerce/' . $file ;
} else {
$theme_file = false ;
}
2014-02-11 13:33:56 +00:00
2014-06-09 13:57:02 +00:00
if ( $theme_file ) {
$core_version = WC_Admin_Status :: get_file_version ( WC () -> plugin_path () . '/templates/' . $file );
$theme_version = WC_Admin_Status :: get_file_version ( $theme_file );
2014-02-11 13:33:56 +00:00
2014-06-09 13:57:02 +00:00
if ( $core_version && ( empty ( $theme_version ) || version_compare ( $theme_version , $core_version , '<' ) ) ) {
2014-09-11 14:31:55 +00:00
$found_files [ $plugin_name ][] = sprintf ( __ ( '<code>%s</code> version <strong style="color:red">%s</strong> is out of date. The core version is %s' , 'woocommerce' ), str_replace ( WP_CONTENT_DIR . '/themes/' , '' , $theme_file ), $theme_version ? $theme_version : '-' , $core_version );
2014-06-09 13:57:02 +00:00
} else {
2014-09-11 14:31:55 +00:00
$found_files [ $plugin_name ][] = sprintf ( '<code>%s</code>' , str_replace ( WP_CONTENT_DIR . '/themes/' , '' , $theme_file ) );
2013-09-26 09:02:38 +00:00
}
2013-07-18 14:22:05 +00:00
}
}
2014-06-09 13:57:02 +00:00
}
2013-07-18 14:22:05 +00:00
2014-06-09 13:57:02 +00:00
if ( $found_files ) {
foreach ( $found_files as $plugin_name => $found_plugin_files ) {
?>
< tr >
2014-02-11 13:33:56 +00:00
< td >< ? php _e ( 'Template Overrides' , 'woocommerce' ); ?> (<?php echo $plugin_name; ?>):</td>
< td >< ? php echo implode ( ', <br/>' , $found_plugin_files ); ?> </td>
2014-06-09 13:57:02 +00:00
</ tr >
2014-02-11 13:33:56 +00:00
< ? php
2013-07-18 14:22:05 +00:00
}
2014-06-09 13:57:02 +00:00
} else {
?>
< tr >
< td >< ? php _e ( 'Template Overrides' , 'woocommerce' ); ?> :</td>
< td >< ? php _e ( 'No overrides present in theme.' , 'woocommerce' ); ?> </td>
</ tr >
< ? php
}
?>
2013-07-18 14:22:05 +00:00
</ tbody >
</ table >
< script type = " text/javascript " >
2014-08-26 17:13:39 +00:00
/**
* wc_strPad
*
* @ param { var } i string default
* @ param { var } l how many repeat s
* @ param { var } s string to repeat
* @ param { var } w where s should indent
* @ return { var } string modified
*/
jQuery . wc_strPad = function ( i , l , s , w ) {
2013-07-18 14:22:05 +00:00
var o = i . toString ();
2014-08-26 17:13:39 +00:00
if ( ! s ) { s = '0' ; }
while ( o . length < l ) {
2013-07-18 14:22:05 +00:00
// empty
2014-08-26 17:13:39 +00:00
if ( w == 'undefined' ){
2013-07-18 14:22:05 +00:00
o = s + o ;
2014-08-26 17:13:39 +00:00
} else {
2013-07-18 14:22:05 +00:00
o = o + s ;
}
}
return o ;
};
2014-08-26 17:13:39 +00:00
jQuery ( 'a.debug-report' ) . click ( function (){
var report = " " ;
jQuery ( '#status thead, #status tbody' ) . each ( function (){
2013-07-18 14:22:05 +00:00
2013-09-13 12:38:36 +00:00
if ( jQuery ( this ) . is ( 'thead' ) ) {
2013-07-18 14:22:05 +00:00
2013-09-13 12:38:36 +00:00
report = report + " \n ### " + jQuery . trim ( jQuery ( this ) . text () ) + " ### \n \n " ;
2013-07-18 14:22:05 +00:00
} else {
2014-08-26 17:13:39 +00:00
jQuery ( 'tr' , jQuery ( this ) ) . each ( function (){
2013-07-18 14:22:05 +00:00
2014-08-26 17:13:39 +00:00
var the_name = jQuery . wc_strPad ( jQuery . trim ( jQuery ( this ) . find ( 'td:eq(0)' ) . text () ), 25 , ' ' );
var the_value = jQuery . trim ( jQuery ( this ) . find ( 'td:eq(1)' ) . text () );
2013-09-13 12:38:36 +00:00
var value_array = the_value . split ( ', ' );
2013-07-18 14:22:05 +00:00
2014-08-26 17:13:39 +00:00
if ( value_array . length > 1 ) {
2013-07-18 14:22:05 +00:00
2014-08-26 17:13:39 +00:00
// If value have a list of plugins ','
// Split to add new line
2013-09-13 12:38:36 +00:00
var output = '' ;
var temp_line = '' ;
2014-08-26 17:13:39 +00:00
jQuery . each ( value_array , function ( key , line ){
var tab = ( key == 0 ) ? 0 : 25 ;
2013-07-18 14:22:05 +00:00
temp_line = temp_line + jQuery . wc_strPad ( '' , tab , ' ' , 'f' ) + line + '\n' ;
2014-08-26 17:28:05 +00:00
});
2013-07-18 14:22:05 +00:00
2013-09-13 12:38:36 +00:00
the_value = temp_line ;
2013-07-18 14:22:05 +00:00
}
2013-09-13 12:38:36 +00:00
report = report + '' + the_name + the_value + " \n " ;
2014-08-26 17:28:05 +00:00
});
2013-07-18 14:22:05 +00:00
}
2014-08-26 17:28:05 +00:00
});
2013-07-18 14:22:05 +00:00
2013-09-13 12:38:36 +00:00
try {
2014-08-26 17:13:39 +00:00
jQuery ( " #debug-report " ) . slideDown ();
jQuery ( " #debug-report textarea " ) . val ( report ) . focus () . select ();
jQuery ( this ) . fadeOut ();
2013-09-13 12:38:36 +00:00
return false ;
2014-08-26 17:13:39 +00:00
} catch ( e ){
console . log ( e );
}
2013-07-18 14:22:05 +00:00
2013-09-13 12:38:36 +00:00
return false ;
2013-07-18 14:22:05 +00:00
});
2014-07-29 15:06:58 +00:00
jQuery ( document ) . ready ( function ( $ ) {
$ ( '#copy-for-support' ) . tipTip ({
'attribute' : 'data-tip' ,
'activation' : 'click' ,
'fadeIn' : 50 ,
'fadeOut' : 50 ,
'delay' : 0
});
2014-08-26 17:13:39 +00:00
$ ( 'body' ) . on ( 'copy' , '#copy-for-support' , function ( e ) {
2014-07-29 15:06:58 +00:00
e . clipboardData . clearData ();
e . clipboardData . setData ( 'text/plain' , $ ( '#debug-report textarea' ) . val () );
e . preventDefault ();
});
});
2013-09-08 02:26:26 +00:00
</ script >