Merge pull request #11056 from shivapoudel/some-tweaks

Minor tweaks and JSHint ignore for update notice script
This commit is contained in:
Mike Jolley 2016-06-06 18:23:25 +01:00
commit 394da46c63
8 changed files with 26 additions and 36 deletions

View File

@ -316,7 +316,7 @@ jQuery( function( $ ) {
}
// re-init methods
// Re-init methods
wc_checkout_form.init_payment_methods();
// Fire updated_checkout e
@ -359,7 +359,7 @@ jQuery( function( $ ) {
}
try {
// check for valid JSON
// Check for valid JSON
var data = $.parseJSON( raw_response );
if ( data && 'object' === typeof data ) {
@ -370,7 +370,7 @@ jQuery( function( $ ) {
} catch ( e ) {
// attempt to fix the malformed JSON
// Attempt to fix the malformed JSON
var valid_json = raw_response.match( /{"result.*"}/ );
if ( null === valid_json ) {
@ -528,13 +528,13 @@ jQuery( function( $ ) {
$( document.body ).trigger( 'update_checkout', { update_shipping_method: false } );
// remove coupon code from coupon field
// Remove coupon code from coupon field
$( 'form.checkout_coupon' ).find( 'input[name="coupon_code"]' ).val( '' );
}
},
error: function ( jqXHR ) {
if ( wc_checkout_params.debug_mode ) {
/*jshint devel: true */
/* jshint devel: true */
console.log( jqXHR.responseText );
}
},

View File

@ -226,7 +226,7 @@ abstract class WC_Settings_API {
*
* @param string $key
* @param mixed $empty_value
* @return string The value specified for the option or a default value for the option.
* @return string The value specified for the option or a default value for the option.
*/
public function get_option( $key, $empty_value = null ) {
if ( empty( $this->settings ) ) {

View File

@ -17,6 +17,12 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class WC_Admin_Notices {
/**
* Stores notices.
* @var array
*/
private static $notices = array();
/**
* Array of notices - name => callback.
* @var array
@ -32,12 +38,6 @@ class WC_Admin_Notices {
'simplify_commerce' => 'simplify_commerce_notice',
);
/**
* Stores notices.
* @var array
*/
private static $notices = array();
/**
* Constructor.
*/

View File

@ -14,6 +14,6 @@ if ( ! defined( 'ABSPATH' ) ) {
</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' ) ); ?>' );
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>

View File

@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
*
* @class WC_Autoloader
* @version 2.3.0
* @package WooCommerce/Classes/
* @package WooCommerce/Classes
* @category Class
* @author WooThemes
*/

View File

@ -1,14 +1,15 @@
<?php
/**
* background updater.
* Background Updater
*
* Uses https://github.com/A5hleyRich/wp-background-processing to handle DB
* updates in the background.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Classes
* @class WC_Background_Updater
* @version 2.6.0
* @package WooCommerce/Classes
* @category Class
* @author WooThemes
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Installation related functions and actions
* Installation related functions and actions.
*
* @author WooThemes
* @category Admin
@ -118,17 +118,6 @@ class WC_Install {
}
}
/**
* Show notice stating update was successful.
*/
public static function updated_notice() {
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p><?php _e( 'WooCommerce data update complete. Thank you for updating to the latest version!', 'woocommerce' ); ?></p>
</div>
<?php
}
/**
* Install WC.
*/
@ -189,8 +178,8 @@ class WC_Install {
delete_transient( 'wc_attribute_taxonomies' );
/*
* Deletes all expired transients. The multi-table delete syntax is used.
* to delete the transient record from table a, and the corresponding.
* Deletes all expired transients. The multi-table delete syntax is used
* to delete the transient record from table a, and the corresponding
* transient_timeout record from table b.
*
* Based on code inside core's upgrade_network() function.

View File

@ -4,10 +4,10 @@
*
* Functions for updating data, used by the background updater.
*
* @author WooThemes
* @category Core
* @package WooCommerce/Functions
* @version 2.6.0
* @author WooThemes
* @category Core
* @package WooCommerce/Functions
* @version 2.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {