Merge branch 'master' of github.com:woothemes/woocommerce

This commit is contained in:
Barry Kooij 2014-10-24 15:21:03 +02:00
commit 3d35ab559c
26 changed files with 248 additions and 321 deletions

View File

@ -4,7 +4,7 @@ module.exports = function( grunt ) {
grunt.initConfig({
// setting folder templates
// Setting folder templates.
dirs: {
css: 'assets/css',
fonts: 'assets/fonts',

File diff suppressed because one or more lines are too long

View File

@ -144,6 +144,7 @@ mark.amount {
/* Status page */
table.wc_status_table {
margin-bottom: 1em;
tr {
&:nth-child(2n) {
th, td {
@ -153,12 +154,16 @@ table.wc_status_table {
}
th {
font-weight: bold;
padding: 9px;
}
td:first-child {
width: 20%;
width: 33%;
}
td.help {
width: 1em;
}
td {
padding: 6px 9px;
padding: 9px;
font-size: 1.1em;
mark {
@ -177,6 +182,9 @@ table.wc_status_table {
margin: 0;
}
}
.help_tip {
cursor: help;
}
}
#debug-report {
display: none;

File diff suppressed because one or more lines are too long

View File

@ -290,7 +290,11 @@ jQuery( function( $ ) {
result = $.parseJSON( code );
if ( result.result === 'success' ) {
if ( result.redirect.indexOf( "https://" ) != -1 || result.redirect.indexOf( "http://" ) != -1 ) {
window.location = result.redirect;
} else {
window.location = decodeURI( result.redirect );
}
} else if ( result.result === 'failure' ) {
throw 'Result failure';
} else {

File diff suppressed because one or more lines are too long

View File

@ -8,4 +8,4 @@
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
!function(a){function b(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var c,d=a.ui.mouse.prototype,e=d._mouseInit,f=d._mouseDestroy;d._touchStart=function(a){var d=this;!c&&d._mouseCapture(a.originalEvent.changedTouches[0])&&(c=!0,d._touchMoved=!1,b(a,"mouseover"),b(a,"mousemove"),b(a,"mousedown"))},d._touchMove=function(a){c&&(this._touchMoved=!0,b(a,"mousemove"))},d._touchEnd=function(a){c&&(b(a,"mouseup"),b(a,"mouseout"),this._touchMoved||b(a,"click"),c=!1)},d._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),e.call(b)},d._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),f.call(b)}}}(jQuery);

View File

@ -49,7 +49,7 @@ class WC_Meta_Box_Order_Notes {
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
</div>
<p class="meta">
<abbr class="exact-date" title="<?php echo $note->comment_date_gmt; ?> GMT"><?php printf( __( 'added on %1$s at %2$s', 'woocommerce' ), date_i18n( wc_date_format(), strtotime( $note->comment_date_gmt ) ), date_i18n( wc_time_format(), strtotime( $note->comment_date_gmt ) ) ); ?></abbr>
<abbr class="exact-date" title="<?php echo $note->comment_date; ?>"><?php printf( __( 'added on %1$s at %2$s', 'woocommerce' ), date_i18n( wc_date_format(), strtotime( $note->comment_date ) ), date_i18n( wc_time_format(), strtotime( $note->comment_date ) ) ); ?></abbr>
<?php if ( $note->comment_author !== __( 'WooCommerce', 'woocommerce' ) ) printf( ' ' . __( 'by %s', 'woocommerce' ), $note->comment_author ); ?>
<a href="#" class="delete_note"><?php _e( 'Delete note', 'woocommerce' ); ?></a>
</p>

View File

@ -1033,15 +1033,15 @@ class WC_Meta_Box_Product_Data {
}
if ( isset( $_POST['_tax_status'] ) ) {
update_post_meta( $post_id, '_tax_status', stripslashes( $_POST['_tax_status'] ) );
update_post_meta( $post_id, '_tax_status', wc_clean( $_POST['_tax_status'] ) );
}
if ( isset( $_POST['_tax_class'] ) ) {
update_post_meta( $post_id, '_tax_class', stripslashes( $_POST['_tax_class'] ) );
update_post_meta( $post_id, '_tax_class', wc_clean( $_POST['_tax_class'] ) );
}
if ( isset( $_POST['_purchase_note'] ) ) {
update_post_meta( $post_id, '_purchase_note', stripslashes( $_POST['_purchase_note'] ) );
update_post_meta( $post_id, '_purchase_note', wp_kses_post( stripslashes( $_POST['_purchase_note'] ) ) );
}
// Featured
@ -1212,8 +1212,8 @@ class WC_Meta_Box_Product_Data {
} else {
$date_from = isset( $_POST['_sale_price_dates_from'] ) ? $_POST['_sale_price_dates_from'] : '';
$date_to = isset( $_POST['_sale_price_dates_to'] ) ? $_POST['_sale_price_dates_to'] : '';
$date_from = isset( $_POST['_sale_price_dates_from'] ) ? wc_clean( $_POST['_sale_price_dates_from'] ) : '';
$date_to = isset( $_POST['_sale_price_dates_to'] ) ? wc_clean( $_POST['_sale_price_dates_to'] ) : '';
// Dates
if ( $date_from ) {
@ -1348,9 +1348,8 @@ class WC_Meta_Box_Product_Data {
$ids = $_POST['upsell_ids'];
foreach ( $ids as $id ) {
if ( $id && $id > 0 ) {
$upsells[] = $id;
$upsells[] = absint( $id );
}
}
@ -1367,7 +1366,7 @@ class WC_Meta_Box_Product_Data {
foreach ( $ids as $id ) {
if ( $id && $id > 0 ) {
$crosssells[] = $id;
$crosssells[] = absint( $id );
}
}
@ -1424,11 +1423,11 @@ class WC_Meta_Box_Product_Data {
if ( 'external' == $product_type ) {
if ( isset( $_POST['_product_url'] ) ) {
update_post_meta( $post_id, '_product_url', esc_attr( $_POST['_product_url'] ) );
update_post_meta( $post_id, '_product_url', esc_url_raw( $_POST['_product_url'] ) );
}
if ( isset( $_POST['_button_text'] ) ) {
update_post_meta( $post_id, '_button_text', esc_attr( $_POST['_button_text'] ) );
update_post_meta( $post_id, '_button_text', wc_clean( $_POST['_button_text'] ) );
}
}

View File

@ -278,7 +278,7 @@ if ( 'yes' == get_option( 'woocommerce_calc_taxes' ) ) {
<div class="clear"></div>
<div class="refund-actions">
<?php if ( false !== $payment_gateway && $payment_gateway->supports( 'refunds' ) ) : ?>
<button type="button" class="button button-primary do-api-refund"><?php printf( _x( 'Refund %s via %s', 'Refund $amount', 'woocommerce' ), '<span class="wc-order-refund-amount">' . wc_price( 0, array( 'currency' => $order->get_order_currency() ) ) . '</span>', $order->payment_method_title ); ?></button>
<button type="button" class="button button-primary do-api-refund"><?php printf( _x( 'Refund %s via %s', 'Refund $amount', 'woocommerce' ), '<span class="wc-order-refund-amount">' . wc_price( 0, array( 'currency' => $order->get_order_currency() ) ) . '</span>', ( ! empty( $payment_gateway->method_title ) ? $payment_gateway->method_title : $payment_gateway->get_title() ) ); ?></button>
<?php endif; ?>
<button type="button" class="button button-primary do-manual-refund"><?php _e( 'Refund manually', 'woocommerce' ); ?></button>
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>

View File

@ -48,6 +48,7 @@ class WC_Report_Low_In_Stock extends WC_Report_Stock {
AND posts.post_status = 'publish'
AND postmeta2.meta_key = '_manage_stock' AND postmeta2.meta_value = 'yes'
AND postmeta.meta_key = '_stock' AND CAST(postmeta.meta_value AS SIGNED) <= '{$stock}'
AND postmeta.meta_key = '_stock' AND CAST(postmeta.meta_value AS SIGNED) > '{$nostock}'
";
$this->items = $wpdb->get_results( $wpdb->prepare( "SELECT posts.ID as id, posts.post_parent as parent {$query_from} GROUP BY posts.ID ORDER BY posts.post_title DESC LIMIT %d, %d;", ( $current_page - 1 ) * $per_page, $per_page ) );

View File

@ -112,7 +112,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'_line_total' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'function' => 'SUM',
'name' => 'order_item_amount'
),
'post_date' => array(
@ -121,7 +121,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'name' => 'post_date'
),
),
'group_by' => 'ID, product_id',
'group_by' => 'ID, product_id, post_date',
'query_type' => 'get_results',
'filter_range' => true
) );
@ -329,8 +329,16 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
label: "' . esc_js( $data['category'] ) . '",
data: jQuery.parseJSON( "' . json_encode( $series ) . '" ),
color: "' . $color . '",
bars: { fillColor: "' . $color . '", fill: true, show: true, lineWidth: 1, align: "center", barWidth: ' . $width * 0.75 . ', stack: false },
' . $this->get_currency_tooltip() . '",
bars: {
fillColor: "' . $color . '",
fill: true,
show: true,
lineWidth: 1,
align: "center",
barWidth: ' . $width * 0.75 . ',
stack: false
},
' . $this->get_currency_tooltip() . ',
enable_tooltip: true,
prepend_label: true
},';

View File

@ -19,37 +19,35 @@ if ( ! defined( 'ABSPATH' ) ) {
</div>
<br/>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'WordPress Environment', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e( 'Home URL', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The URL of your site\'s homepage.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The URL of your site\'s homepage.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo home_url(); ?></td>
</tr>
<tr>
<td><?php _e( 'Site URL', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The root URL of your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The root URL of your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo site_url(); ?></td>
</tr>
<tr>
<td><?php _e( 'WC Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce installed on your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce installed on your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo esc_html( WC()->version ); ?></td>
</tr>
<tr>
<td><?php _e( 'WC Database Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce that the database is formatted for. This should be the same as your WooCommerce Version.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce that the database is formatted for. This should be the same as your WooCommerce Version.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo esc_html( get_option( 'woocommerce_db_version' ) ); ?></td>
</tr>
<tr>
<td><?php _e( 'WC Logging', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Several WooCommerce extension can write logs which makes debugging problems easier. The directory must be writable for this to happen.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Several WooCommerce extension can write logs which makes debugging problems easier. The directory must be writable for this to happen.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
if ( @fopen( WC_LOG_DIR . 'test-log.log', 'a' ) ) {
printf( '<mark class="yes">' . __( 'Log directory (%s) is writable.', 'woocommerce' ) . '</mark>', WC_LOG_DIR );
@ -60,22 +58,22 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<tr>
<td><?php _e( 'WP Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WordPress installed on your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WordPress installed on your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php bloginfo('version'); ?></td>
</tr>
<tr>
<td><?php _e( 'WP Multisite Enabled', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Whether or not you have WordPress Multisite enabled.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Whether or not you have WordPress Multisite enabled.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php if ( is_multisite() ) echo __( 'Yes', 'woocommerce' ); else echo __( 'No', 'woocommerce' ); ?></td>
</tr>
<tr>
<td><?php _e( 'WP Active Plugins', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The number of active plugins on your website.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The number of active plugins on your website.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo count( (array) get_option( 'active_plugins' ) ); ?></td>
</tr>
<tr>
<td><?php _e( 'WP Memory Limit', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The maximum amount of memory (RAM) that your site can use at one time.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The maximum amount of memory (RAM) that your site can use at one time.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
$memory = wc_let_to_num( WP_MEMORY_LIMIT );
@ -88,59 +86,59 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<tr>
<td><?php _e( 'WP Debug Mode', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not WordPress is in Debug Mode.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not WordPress is in Debug Mode.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<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>
<tr>
<td><?php _e( 'WP Language', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The current language used by WordPress. Default = English', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The current language used by WordPress. Default = English', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo get_locale() ?></td>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Server Environment', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e( 'Web Server Info', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Information about the web server that is currently hosting your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Information about the web server that is currently hosting your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
</tr>
<tr>
<td><?php _e( 'PHP Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of PHP installed on your hosting server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of PHP installed on your hosting server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php if ( function_exists( 'phpversion' ) ) echo esc_html( phpversion() ); ?></td>
</tr>
<?php if ( function_exists( 'ini_get' ) ) : ?>
<tr>
<td><?php _e('PHP Post Max Size', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The largest filesize that can be contained in one post.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The largest filesize that can be contained in one post.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo size_format( wc_let_to_num( ini_get('post_max_size') ) ); ?></td>
</tr>
<tr>
<td><?php _e('PHP Time Limit', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups)', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups)', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo ini_get('max_execution_time'); ?></td>
</tr>
<tr>
<td><?php _e( 'PHP Max Input Vars', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo ini_get('max_input_vars'); ?></td>
</tr>
<tr>
<td><?php _e( 'SUHOSIN Installed', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( '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.
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( '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' ) . '">[?]</a>'; ?></td>
<td><?php echo extension_loaded( 'suhosin' ) ? __( 'Yes', 'woocommerce' ) : __( 'No', 'woocommerce' ); ?></td>
</tr>
<?php endif; ?>
<tr>
<td><?php _e( 'MySQL Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of MySQL installed on your hosting server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of MySQL installed on your hosting server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td>
<?php
/** @global wpdb $wpdb */
@ -151,12 +149,12 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
</tr>
<tr>
<td><?php _e( 'Max Upload Size', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The largest filesize that can be uploaded to your WordPress installation.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The largest filesize that can be uploaded to your WordPress installation.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo size_format( wp_max_upload_size() ); ?></td>
</tr>
<tr>
<td><?php _e( 'Default Timezone', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The default timezone for your server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The default timezone for your server.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
$default_timezone = date_default_timezone_get();
if ( 'UTC' !== $default_timezone ) {
@ -257,13 +255,13 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
}
?>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Locale', 'woocommerce' ); ?></th>
<th colspan="3"><?php _e( 'Server Locale', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
$locale = localeconv();
@ -276,29 +274,25 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
foreach ( $locale as $key => $val ) {
if ( in_array( $key, array( 'decimal_point', 'mon_decimal_point', 'thousands_sep', 'mon_thousands_sep' ) ) ) {
echo '<tr><td>' . $key . ':</td><td><a href="#" class="help_tip" data-tip="' . esc_attr( $locale_help[$key] ) . '">[?]</a></td><td>' . ( $val ? $val : __( 'N/A', 'woocommerce' ) ) . '</td></tr>';
echo '<tr><td>' . $key . ':</td><td class="help"><a href="#" class="help_tip" data-tip="' . esc_attr( $locale_help[$key] ) . '">[?]</a></td><td>' . ( $val ? $val : __( 'N/A', 'woocommerce' ) ) . '</td></tr>';
}
}
?>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Plugins', 'woocommerce' ); ?><?php echo ' <a href="#" class="help_tip" data-tip="' . esc_attr__( 'This section displays all of the WooCommerce related plugins installed on your site. From this area, you can see the current version numbers of your software and if any of your extensions have available updates.', 'woocommerce' ) . '">[?]</a>'; ?></th>
<th colspan="3"><?php _e( 'Active Plugins', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e( 'Installed Plugins','woocommerce' ); ?>:</td>
<td>&nbsp;</td>
<td><?php
<?php
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() )
if ( is_multisite() ) {
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
$wc_plugins = array();
}
foreach ( $active_plugins as $plugin ) {
@ -310,7 +304,8 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
if ( ! empty( $plugin_data['Name'] ) ) {
// link the plugin name to the plugin url if available
$plugin_name = $plugin_data['Name'];
$plugin_name = esc_html( $plugin_data['Name'] );
if ( ! empty( $plugin_data['PluginURI'] ) ) {
$plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . __( 'Visit plugin homepage' , 'woocommerce' ) . '">' . $plugin_name . '</a>';
}
@ -336,88 +331,86 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
}
if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '>' ) ) {
$version_string = ' &ndash; <strong style="color:red;">' . $version_data['version'] . ' ' . __( 'is available', 'woocommerce' ) . '</strong>';
$version_string = ' &ndash; <strong style="color:red;">' . esc_html( sprintf( _x( '%s is available', 'Version info', 'woocommerce' ), $version_data['version'] ) ) . '</strong>';
}
if ( $plugin_data['Network'] != false ) {
$network_string = ' &ndash; <stfong style="color:black;">' . __( 'Network enabled', 'woocommerce' ) . '</strong>';
$network_string = ' &ndash; <strong style="color:black;">' . __( 'Network enabled', 'woocommerce' ) . '</strong>';
}
}
$wc_plugins[] = $plugin_name . ' ' . __( 'by', 'woocommerce' ) . ' ' . $plugin_data['Author'] . ' ' . __( 'version', 'woocommerce' ) . ' ' . $plugin_data['Version'] . $version_string . $network_string;
}
}
if ( sizeof( $wc_plugins ) == 0 )
echo '-';
else
echo implode( ', <br/>', $wc_plugins );
?></td>
?>
<tr>
<td><?php echo $plugin_name; ?></td>
<td class="help">&nbsp;</td>
<td><?php echo sprintf( _x( 'by %s', 'by author', 'woocommerce' ), $plugin_data['Author'] ) . ' &ndash; ' . esc_html( $plugin_data['Version'] ) . $version_string . $network_string; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Settings', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e( 'API Enabled', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have REST API enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have REST API enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo 'yes' === get_option( 'woocommerce_api_enabled' ) ? '<mark class="yes">'.__( 'Yes', 'woocommerce' ).'</mark>' : '<mark class="no">'.__( 'No', 'woocommerce' ).'</mark>'; ?></td>
</tr>
<tr>
<td><?php _e( 'Taxes enabled', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have taxes enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have taxes enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo 'yes' === get_option( 'woocommerce_calc_taxes' ) ? '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>' : '<mark class="no">' . __( 'No', 'woocommerce' ) . '</mark>'; ?></td>
</tr>
<tr>
<td><?php _e( 'Shipping enabled', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have shipping enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site have shipping enabled?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo 'yes' === get_option( 'woocommerce_calc_shipping' ) ? '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>' : '<mark class="no">' . __( 'No', 'woocommerce' ) . '</mark>'; ?></td>
</tr>
<tr>
<td><?php _e( 'Force SSL', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site force a SSL Certificate for transactions?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Does your site force a SSL Certificate for transactions?', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) ? '<mark class="yes">'.__( 'Yes', 'woocommerce' ).'</mark>' : '<mark class="no">'.__( 'No', 'woocommerce' ).'</mark>'; ?></td>
</tr>
<tr>
<td><?php _e( 'Currency', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'What currency prices are listed at in the catalog and which currency gateways will take payments in.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'What currency prices are listed at in the catalog and which currency gateways will take payments in.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo get_woocommerce_currency(); ?> (<?php echo get_woocommerce_currency_symbol() ?>)</td>
</tr>
<tr>
<td><?php _e( 'Currency Position', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The position of the currency symbol.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The position of the currency symbol.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo get_option( 'woocommerce_currency_pos' ); ?></td>
</tr>
<tr>
<td><?php _e( 'Thousand Separator', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The thousand separator of displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The thousand separator of displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo wp_specialchars_decode( stripslashes( get_option( 'woocommerce_price_thousand_sep' ) ), ENT_QUOTES ); ?></td>
</tr>
<tr>
<td><?php _e( 'Decimal Separator', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The decimal separator of displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The decimal separator of displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo wp_specialchars_decode( stripslashes( get_option( 'woocommerce_price_decimal_sep' ) ), ENT_QUOTES ); ?></td>
</tr>
<tr>
<td><?php _e( 'Number of Decimals', 'woocommerce' ) ?></td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The number of decimal points shown in displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The number of decimal points shown in displayed prices.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo get_option( 'woocommerce_price_num_decimals' ); ?></td>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'WC Pages', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
$check_pages = array(
@ -448,7 +441,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
foreach ( $check_pages as $page_name => $values ) {
echo '<tr><td>' . esc_html( $page_name ) . ':</td>';
echo '<td><a href="#" class="help_tip" data-tip="' . esc_attr( $values['help'] ) . '">[?]</a></td><td>';
echo '<td class="help"><a href="#" class="help_tip" data-tip="' . esc_attr( $values['help'] ) . '">[?]</a></td><td>';
$error = false;
@ -485,17 +478,17 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
}
?>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'WC Taxonomies', 'woocommerce' ); ?><?php echo ' <a href="#" class="help_tip" data-tip="' . esc_attr__( 'A list of taxonomy terms that can be used in regard to order/product statuses.', 'woocommerce' ) . '">[?]</a>'; ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e( 'Product Types', 'woocommerce' ); ?>:</td>
<td>&nbsp;</td>
<td class="help">&nbsp;</td>
<td><?php
$display_terms = array();
$terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) );
@ -505,13 +498,13 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?></td>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Theme', 'woocommerce' ); ?></th>
</tr>
</thead>
<?php
$active_theme = wp_get_theme();
if ( $active_theme->{'Author URI'} == 'http://www.woothemes.com' ) :
@ -546,12 +539,12 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
<tbody>
<tr>
<td><?php _e( 'Theme Name', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The name of the current active theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The name of the current active theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo $active_theme->Name; ?></td>
</tr>
<tr>
<td><?php _e( 'Theme Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The installed version of the current active theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The installed version of the current active theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
echo $active_theme->Version;
@ -562,12 +555,12 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
</tr>
<tr>
<td><?php _e( 'Theme Author URL', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The developer or plugin\'s URL.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The developer or plugin\'s URL.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo $active_theme->{'Author URI'}; ?></td>
</tr>
<tr>
<td><?php _e( 'Is Child Theme', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current theme is a child theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current theme is a child theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
echo is_child_theme() ? '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>' : '<mark class="no">' . __( 'No', 'woocommerce' ) . '</mark> &ndash; <mark class="error">' . sprintf( __( 'We recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'woocommerce' ), 'http://codex.wordpress.org/Child_Themes' ) . '</mark>';
?></td>
@ -578,23 +571,23 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?>
<tr>
<td><?php _e( 'Parent Theme Name', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The name of the parent theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The name of the parent theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo $parent_theme->Name; ?></td>
</tr>
<tr>
<td><?php _e( 'Parent Theme Version', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The installed version of the parent theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The installed version of the parent theme.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo $parent_theme->Version; ?></td>
</tr>
<tr>
<td><?php _e( 'Parent Theme Author URL', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The developer or plugi\'s URL', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The developer or plugi\'s URL', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php echo $parent_theme->{'Author URI'}; ?></td>
</tr>
<?php endif ?>
<tr>
<td><?php _e( 'WooCommerce Support', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current active theme declare WooCommerce support.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current active theme declare WooCommerce support.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
if ( ! current_theme_supports( 'woocommerce' ) && ! in_array( $active_theme->template, wc_get_core_supported_themes() ) ) {
echo '<mark class="error">' . __( 'Not Declared', 'woocommerce' ) . '</mark>';
@ -604,7 +597,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?></td>
</tr>
<td><?php _e( 'Has custom.css', 'woocommerce' ); ?>:</td>
<td><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current active theme has the file custom.css.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Displays whether or not the current active theme has the file custom.css.', 'woocommerce' ) . '">[?]</a>'; ?></td>
<td><?php
if ( file_exists( get_template_directory( $active_theme->template ) . '/custom.css' ) ) {
echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>';
@ -613,17 +606,14 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
}
?></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0" id="status">
<thead>
<tr>
<th colspan="3"><?php _e( 'Templates', 'woocommerce' ); ?><?php echo ' <a href="#" class="help_tip" data-tip="' . esc_attr__( 'This section shows any files that are overriding the default WooCommerce template pages.', 'woocommerce' ) . '">[?]</a>'; ?></th>
</tr>
</thead>
<tbody>
<?php
@ -671,7 +661,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?>
<tr>
<td><?php _e( 'Template Overrides', 'woocommerce' ); ?> (<?php echo $plugin_name; ?>):</td>
<td>&nbsp;</td>
<td class="help">&nbsp;</td>
<td><?php echo implode( ', <br/>', $found_plugin_files ); ?></td>
</tr>
<?php
@ -680,7 +670,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?>
<tr>
<td><?php _e( 'Template Overrides', 'woocommerce' ); ?>:</td>
<td>&nbsp;</td>
<td class="help">&nbsp;</td>
<td><?php _e( 'No overrides present in theme.', 'woocommerce' ); ?></td>
</tr>
<?php
@ -690,14 +680,13 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
?>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="help">&nbsp;</td>
<td><a href="http://speakinginbytes.com/2014/02/woocommerce-2-1-outdated-templates/" target="_blank"><?php _e( 'Learn how to update outdated templates', 'woocommerce' ) ?></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<script type="text/javascript">
@ -759,7 +748,7 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
the_value = temp_line;
}
report = report +''+ the_name + the_value + "\n";
report = report + '' + the_name + ' ' + the_value + "\n";
});
}

View File

@ -268,11 +268,16 @@ class WC_API_Products extends WC_API_Resource {
$data = apply_filters( 'woocommerce_api_edit_product_data', $data, $this );
// Product name.
// Product title.
if ( isset( $data['title'] ) ) {
wp_update_post( array( 'ID' => $id, 'post_title' => wc_clean( $data['title'] ) ) );
}
// Product name (slug).
if ( isset( $data['name'] ) ) {
wp_update_post( array( 'ID' => $id, 'post_name' => sanitize_title( $data['name'] ) ) );
}
// Product status.
if ( isset( $data['status'] ) ) {
wp_update_post( array( 'ID' => $id, 'post_status' => wc_clean( $data['status'] ) ) );
@ -561,7 +566,7 @@ class WC_API_Products extends WC_API_Resource {
'download_limit' => (int) $product->download_limit,
'download_expiry' => (int) $product->download_expiry,
'download_type' => $product->download_type,
'purchase_note' => wpautop( do_shortcode( $product->purchase_note ) ),
'purchase_note' => wpautop( do_shortcode( wp_kses_post( $product->purchase_note ) ) ),
'total_sales' => metadata_exists( 'post', $product->id, 'total_sales' ) ? (int) get_post_meta( $product->id, 'total_sales', true ) : 0,
'variations' => array(),
'parent' => array(),
@ -747,7 +752,7 @@ class WC_API_Products extends WC_API_Resource {
'name' => $taxonomy,
'value' => '',
'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0,
'is_visible' => ( isset( $attribute['position'] ) && $attribute['position'] ) ? 1 : 0,
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
);
@ -768,7 +773,7 @@ class WC_API_Products extends WC_API_Resource {
'name' => wc_clean( $attribute['name'] ),
'value' => $values,
'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0,
'is_visible' => ( isset( $attribute['position'] ) && $attribute['position'] ) ? 1 : 0,
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
);

View File

@ -338,7 +338,7 @@ class WC_AJAX {
delete_transient( 'wc_featured_products' );
wp_safe_redirect( remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), wp_get_referer() ) );
wp_safe_redirect( wp_get_referer() ? remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), wp_get_referer() ) : admin_url( 'edit.php?post_type=shop_order' ) );
die();
}
@ -363,7 +363,7 @@ class WC_AJAX {
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
wp_safe_redirect( wp_get_referer() );
wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'edit.php?post_type=shop_order' ) );
die();
}
@ -388,7 +388,7 @@ class WC_AJAX {
$order = wc_get_order( $order_id );
$order->update_status( 'processing' );
wp_safe_redirect( wp_get_referer() );
wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'edit.php?post_type=shop_order' ) );
die();
}

View File

@ -135,7 +135,7 @@ class WC_Cache_Helper {
$config = w3_instance('W3_Config');
$enabled = $config->get_integer( 'dbcache.enabled' );
$settings = $config->get_array( 'dbcache.reject.sql' );
$settings = array_map( 'trim', $config->get_array( 'dbcache.reject.sql' ) );
if ( $enabled && ! in_array( '_wc_session_', $settings ) ) {
?>

View File

@ -58,7 +58,7 @@ class WC_Form_Handler {
return;
}
$load_address = isset( $wp->query_vars['edit-address'] ) ? wc_edit_address_i18n( sanitize_key( $wp->query_vars['edit-address'] ), true ) : 'billing';
$load_address = isset( $wp->query_vars['edit-address'] ) ? wc_edit_address_i18n( sanitize_title( $wp->query_vars['edit-address'] ), true ) : 'billing';
$address = WC()->countries->get_address_fields( esc_attr( $_POST[ $load_address . '_country' ] ), $load_address . '_' );

View File

@ -779,7 +779,7 @@ class WC_Query {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_register_script( 'wc-jquery-ui-touchpunch', WC()->plugin_url() . '/assets/js/frontend/jquery.ui.touch-punch' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true );
wp_register_script( 'wc-jquery-ui-touchpunch', WC()->plugin_url() . '/assets/js/frontend/jquery-ui-touch-punch' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true );
wp_register_script( 'wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array( 'jquery-ui-slider', 'wc-jquery-ui-touchpunch' ), WC_VERSION, true );
wp_localize_script( 'wc-price-slider', 'woocommerce_price_slider_params', array(

View File

@ -21,9 +21,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Constructor for the gateway.
*
* @access public
* @return void
*/
public function __construct() {
$this->id = 'paypal';
@ -67,7 +64,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
// Actions
add_action( 'valid-paypal-standard-ipn-request', array( $this, 'successful_request' ) );
add_action( 'woocommerce_receipt_paypal', array( $this, 'receipt_page' ) );
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
add_action( 'woocommerce_thankyou_paypal', array( $this, 'pdt_return_handler' ) );
@ -168,7 +164,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Check if this gateway is enabled and available in the user's country
*
* @access public
* @return bool
*/
function is_valid_for_use() {
@ -197,9 +192,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Initialise Gateway Settings Form Fields
*
* @access public
* @return void
*/
public function init_form_fields() {
$this->form_fields = array(
@ -358,8 +350,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Get PayPal Args for passing to PP
*
* @access public
* @param mixed $order
* @param WC_Order $order
* @return array
*/
function get_paypal_args( $order ) {
@ -394,11 +385,11 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
'business' => $this->email,
'no_note' => 1,
'currency_code' => get_woocommerce_currency(),
'charset' => 'UTF-8',
'charset' => 'utf-8',
'rm' => is_ssl() ? 2 : 1,
'upload' => 1,
'return' => urlencode( esc_url( add_query_arg( 'utm_nooverride', '1', $this->get_return_url( $order ) ) ) ),
'cancel_return' => urlencode( esc_url( $order->get_cancel_order_url() ) ),
'return' => esc_url( add_query_arg( 'utm_nooverride', '1', $this->get_return_url( $order ) ) ),
'cancel_return' => esc_url( $order->get_cancel_order_url() ),
'page_style' => $this->page_style,
'paymentaction' => $this->paymentaction,
'bn' => 'WooThemes_Cart',
@ -565,70 +556,9 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
return $args;
}
/**
* Generate the paypal button link
*
* @access public
* @param mixed $order_id
* @return string
*/
public function generate_paypal_form( $order_id ) {
$order = wc_get_order( $order_id );
if ( 'yes' == $this->testmode ) {
$paypal_adr = $this->testurl . '?test_ipn=1&';
} else {
$paypal_adr = $this->liveurl . '?';
}
$paypal_args = $this->get_paypal_args( $order );
$paypal_args_array = array();
foreach ( $paypal_args as $key => $value ) {
$paypal_args_array[] = '<input type="hidden" name="'.esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
}
wc_enqueue_js( '
$.blockUI({
message: "' . esc_js( __( 'Thank you for your order. We are now redirecting you to PayPal to make payment.', 'woocommerce' ) ) . '",
baseZ: 99999,
overlayCSS:
{
background: "#fff",
opacity: 0.6
},
css: {
padding: "20px",
zindex: "9999999",
textAlign: "center",
color: "#555",
border: "3px solid #aaa",
backgroundColor:"#fff",
cursor: "wait",
lineHeight: "24px",
}
});
jQuery("#submit_paypal_payment_form").click();
' );
return '<form action="' . esc_url( $paypal_adr ) . '" method="post" id="paypal_payment_form" target="_top">
' . implode( '', $paypal_args_array ) . '
<!-- Button Fallback -->
<div class="payment_buttons">
<input type="submit" class="button alt" id="submit_paypal_payment_form" value="' . __( 'Pay via PayPal', 'woocommerce' ) . '" /> <a class="button cancel" href="' . esc_url( $order->get_cancel_order_url() ) . '">' . __( 'Cancel order &amp; restore cart', 'woocommerce' ) . '</a>
</div>
<script type="text/javascript">
jQuery(".payment_buttons").hide();
</script>
</form>';
}
/**
* Process the payment and return the result
*
* @access public
* @param int $order_id
* @return array
*/
@ -717,18 +647,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
return false;
}
/**
* Output for the order received page.
*
* @access public
* @return void
*/
public function receipt_page( $order ) {
echo '<p>' . __( 'Thank you - your order is now pending payment. You should be automatically redirected to PayPal to make payment.', 'woocommerce' ) . '</p>';
echo $this->generate_paypal_form( $order );
}
/**
* Check PayPal IPN validity
**/
@ -791,9 +709,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Check for PayPal IPN Response
*
* @access public
* @return void
*/
public function check_ipn_response() {
@ -818,9 +733,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
/**
* Successful Payment!
*
* @access public
* @param array $posted
* @return void
*/
public function successful_request( $posted ) {

View File

@ -407,7 +407,7 @@ function wc_get_image_size( $image_size ) {
$size = get_option( $image_size . '_image_size', array() );
$size['width'] = isset( $size['width'] ) ? $size['width'] : '300';
$size['height'] = isset( $size['height'] ) ? $size['height'] : '300';
$size['crop'] = isset( $size['crop'] ) ? 1 : 0;
$size['crop'] = isset( $size['crop'] ) ? $size['crop'] : 0;
} else {
$size = array(
'width' => '300',

View File

@ -582,7 +582,7 @@ function wc_create_refund( $args = array() ) {
$refund_data['post_type'] = 'shop_order_refund';
$refund_data['post_status'] = 'wc-completed';
$refund_data['ping_status'] = 'closed';
$refund_data['post_author'] = 1;
$refund_data['post_author'] = get_current_user_id() ? get_current_user_id() : 1;
$refund_data['post_password'] = uniqid( 'refund_' );
$refund_data['post_parent'] = absint( $args['order_id'] );
$refund_data['post_title'] = sprintf( __( 'Refund &ndash; %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'woocommerce' ) ) );

View File

@ -74,8 +74,8 @@ function wc_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) {
*/
function wc_edit_address_i18n( $id, $flip = false ) {
$slugs = apply_filters( 'woocommerce_edit_address_slugs', array(
'billing' => _x( 'billing', 'edit-address-slug', 'woocommerce' ),
'shipping' => _x( 'shipping', 'edit-address-slug', 'woocommerce' )
'billing' => sanitize_title( _x( 'billing', 'edit-address-slug', 'woocommerce' ) ),
'shipping' => sanitize_title( _x( 'shipping', 'edit-address-slug', 'woocommerce' ) )
) );
if ( $flip ) {

View File

@ -44,8 +44,8 @@ Some of our popular extensions include **[Product Addons](http://www.woothemes.c
Want to see more?
* [View Payment Gateways](http://www.woothemes.com/product-category/woocommerce-extensions/?prod_cat%5B%5D=1023&s=&post_type=product&min_price=0&max_price=129&prod_country=0 "Payment gateways for WooCommerce from WooThemes").
* [View Shipping Methods](http://www.woothemes.com/product-category/woocommerce-extensions/?prod_cat%5B%5D=1026&s=&post_type=product&min_price=0&max_price=129&post_type=product&prod_country=0 "Shipping methods for WooCommerce from WooThemes").
* [View Payment Gateways](http://www.woothemes.com/product-category/woocommerce-extensions/payment-gateways/ "Payment gateways for WooCommerce from WooThemes").
* [View Shipping Methods](http://www.woothemes.com/product-category/woocommerce-extensions/shipping-methods/ "Shipping methods for WooCommerce from WooThemes").
* [View all extensions](http://www.woothemes.com/product-category/woocommerce-extensions/ "View all WooCommerce extensions").
= Free Extensions =

View File

@ -68,7 +68,7 @@ foreach ( $items as $item_id => $item ) :
<?php if ( $show_purchase_note && is_object( $_product ) && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) : ?>
<tr>
<td colspan="3" style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo wpautop( do_shortcode( $purchase_note ) ); ?></td>
<td colspan="3" style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td>
</tr>
<?php endif; ?>

View File

@ -58,7 +58,7 @@ foreach ( $items as $item_id => $item ) :
// Note
if ( $show_purchase_note && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) {
echo "\n" . $purchase_note;
echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) );
}
echo "\n\n";