Skip to content

Commit 79cc1b9

Browse files
authored
Merge pull request #1216 from agafonec/4.4.1
4.4.1
2 parents 3433a65 + 40c5af1 commit 79cc1b9

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

admin/v2/templates/confirmation/tabs/store-info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$opt_in_settings = apply_filters('mailchimp_checkout_opt_in_options', $default_opt_in_settings);;
3030
?>
3131
<input type="hidden" name="mailchimp_active_settings_tab" value="<?php echo MC_WC_STORE_INFO_TAB; ?>"/>
32-
<input type="hidden" value="<?php echo ( esc_html( isset( $current_currency_data ) ? $current_currency . ' | ' . $current_currency_data['name'] : $current_currency ) ); ?>" disabled/>
32+
<input type="hidden" value="<?php echo ( esc_attr( isset( $current_currency_data ) ? $current_currency . ' | ' . $current_currency_data['name'] : $current_currency ) ); ?>" disabled/>
3333
<input type="hidden" value="<?php echo esc_attr( mailchimp_get_timezone( true ) ); ?>" disabled/>
3434
<div class="mc-wc-tab-content-wrapper store-info">
3535
<div class="mc-wc-tab-content-box">

admin/v2/templates/connect-accounts/button-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<?php endif; ?>
2121
</div>
2222

23-
<input type="hidden" id="<?php echo esc_attr( $this->plugin_name ); ?>-mailchimp-api-key" name="<?php echo esc_attr( $this->plugin_name ); ?>[mailchimp_api_key]" value="<?php echo isset( $options['mailchimp_api_key'] ) ? esc_html( $options['mailchimp_api_key'] ) : ''; ?>" required/>
23+
<input type="hidden" id="<?php echo esc_attr( $this->plugin_name ); ?>-mailchimp-api-key" name="<?php echo esc_attr( $this->plugin_name ); ?>[mailchimp_api_key]" value="<?php echo isset( $options['mailchimp_api_key'] ) ? esc_attr( $options['mailchimp_api_key'] ) : ''; ?>" required/>
2424
<?php if ($show_connection_messages) : ?>
2525
<p id="mailchimp-oauth-waiting" class="oauth-description"><?php esc_html_e( 'Connecting. A new window will open with Mailchimp\'s OAuth service. Please log-in and we will take care of the rest.', 'mailchimp-for-woocommerce' ); ?></p>
2626
<p id="mailchimp-oauth-error" class="oauth-description"><?php esc_html_e( 'Error, can\'t login.', 'mailchimp-for-woocommerce' ); ?></p>

admin/v2/templates/connect-accounts/create-account-popup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
<div id="mc-woocommerce-create-account-step-1" class="mc-woocommerce-create-account-step mc-woocommerce-form-wrapper">
2828
<fieldset>
2929
<?php $user_id = get_current_user_id(); ?>
30-
<input id="org" name="org" type="hidden" value="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>">
30+
<input id="org" name="org" type="hidden" value="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">
3131
<div class="box">
3232
<label for="first_name">
3333
<span> <?php esc_html_e( 'First name', 'mailchimp-for-woocommerce' ); ?></span>
3434
</label>
35-
<input required type="text" id="first_name" name="first_name" value="<?php echo esc_html( get_user_meta( $user_id, 'first_name', true ) ); ?>"/>
35+
<input required type="text" id="first_name" name="first_name" value="<?php echo esc_attr( get_user_meta( $user_id, 'first_name', true ) ); ?>"/>
3636
</div>
3737
<div class="box">
3838
<label for="last_name">
3939
<span> <?php esc_html_e( 'Last name', 'mailchimp-for-woocommerce' ); ?></span>
4040
</label>
41-
<input required type="text" id="last_name" name="last_name" value="<?php echo esc_html( get_user_meta( $user_id, 'last_name', true ) ); ?>"/>
41+
<input required type="text" id="last_name" name="last_name" value="<?php echo esc_attr( get_user_meta( $user_id, 'last_name', true ) ); ?>"/>
4242
</div>
4343
<div class="box">
4444
<label for="email">

includes/api/class-mailchimp-woocommerce-transform-products.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,26 @@ public function transform( $woo, $fallback_title = null ) {
7777

7878
$variants = $variant_posts ? array_merge( array( $woo ), $variant_posts ) : array( $woo );
7979

80-
$is_variant = count( $variants ) > 1;
81-
8280
$product = new MailChimp_WooCommerce_Product();
8381

8482
if ( class_exists( 'SitePress' ) && function_exists( 'wpml_switch_language_action' ) ) {
8583
$get_language_args = array( 'element_id' => $woo->get_id(), 'element_type' => 'product' );
8684
$post_language_info = apply_filters( 'wpml_element_language_details', null, $get_language_args );
87-
wpml_switch_language_action( $post_language_info->language_code );
85+
86+
if (!empty($post_language_info->language_code)) {
87+
wpml_switch_language_action( $post_language_info->language_code );
88+
}
8889
}
8990

9091
$product->setId( $woo->get_id() );
9192
$product->setHandle( urldecode($woo->get_slug() ) );
9293
$product->setImageUrl( $this->getProductImage( $woo ) );
9394
$product->setDescription( $woo->get_description() );
94-
$product->setPublishedAtForeign( mailchimp_date_utc( $woo->get_date_created() ) );
95+
if ($woo->get_date_created()) {
96+
$product->setPublishedAtForeign( mailchimp_date_utc( $woo->get_date_created() ) );
97+
} else {
98+
mailchimp_debug('product.transform', 'failed to get created date', ['product' => $woo]);
99+
}
95100
$product->setTitle( $woo->get_title() );
96101
$product->setUrl( urldecode( $woo->get_permalink() ) );
97102

includes/processes/class-mailchimp-woocommerce-single-product.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ public function process()
135135
if( !($product_post = MailChimp_WooCommerce_HPOS::get_product($this->id)) ){
136136
return false;
137137
}
138-
/*if (!($product_post = get_post($this->id))) {
139-
return false;
140-
}*/
141138

142139
try {
143140
// pull the product from Mailchimp first to see what method we need to call next.

public/js/mailchimp-woocommerce-public.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var mailchimp,
44
mailchimp_username_email,
55
mailchimp_registration_email,
66
mailchimp_submitted_email = false,
7-
mailchimpReady = function (a) { /in/.test(document.readyState) ? setTimeout("mailchimpReady(" + a + ")", 9) : a(); };
7+
mailchimpReady = function (a) { /in/.test(document.readyState) ? setTimeout(()=>{mailchimpReady(a)}, 9) : a(); };
88

99
function mailchimpGetCurrentUserByHash(a) {
1010
try {

0 commit comments

Comments
 (0)