--- a/mailchimp/includes/admin/class-mailchimp-user-sync.php
+++ b/mailchimp/includes/admin/class-mailchimp-user-sync.php
@@ -325,7 +325,8 @@
_n(
'You will need %1$sa Mailchimp plan%2$s that includes %3$d contact.',
'You will need %1$sa Mailchimp plan%2$s that includes %3$d contacts.',
- absint( $users_count )
+ absint( $users_count ),
+ 'mailchimp'
),
'<a href="https://mailchimp.com/help/about-mailchimp-pricing-plans/" target="_blank" rel="noopener noreferrer">',
'</a>',
--- a/mailchimp/includes/admin/templates/settings.php
+++ b/mailchimp/includes/admin/templates/settings.php
@@ -94,6 +94,7 @@
</div>
<div class="mailchimp-sf-settings-list-select-button">
<input type="hidden" name="mcsf_action" value="update_mc_list_id" />
+ <?php wp_nonce_field( 'update_mc_list_id_action', 'update_mc_list_id_nonce' ); ?>
<input type="submit" name="submit" value="<?php esc_attr_e( 'Fetch list settings', 'mailchimp' ); ?>" class="mailchimp-sf-button btn-secondary" />
</div>
</div>
--- a/mailchimp/includes/admin/templates/setup-page.php
+++ b/mailchimp/includes/admin/templates/setup-page.php
@@ -224,7 +224,7 @@
<tr>
<th class="mailchimp-sf-option-header">
<label for="mc_nuke_all_styles">
- <?php esc_html_e( 'Remove CSS' ); ?>
+ <?php esc_html_e( 'Remove CSS', 'mailchimp' ); ?>
</label>
</th>
<td>
@@ -234,7 +234,7 @@
<input type="checkbox" name="mc_nuke_all_styles" id="mc_nuke_all_styles" class="mailchimp-sf-checkbox" <?php checked( get_option( 'mc_nuke_all_styles' ), true ); ?> onclick="showMe('mc-custom-styling')"/>
</div>
<label for="mc_nuke_all_styles">
- <?php esc_html_e( 'This will disable all Mailchimp CSS, so it's recommended for WordPress experts only.' ); ?>
+ <?php esc_html_e( 'This will disable all Mailchimp CSS, so it's recommended for WordPress experts only.', 'mailchimp' ); ?>
</label>
</div>
</td>
@@ -265,7 +265,7 @@
<input type="checkbox" name="mc_custom_style" id="mc_custom_style" class="mailchimp-sf-checkbox"<?php checked( get_option( 'mc_custom_style' ), 'on' ); ?> />
</div>
<label for="mc_custom_style">
- <?php esc_html_e( 'Edit the default Mailchimp CSS style.' ); ?>
+ <?php esc_html_e( 'Edit the default Mailchimp CSS style.', 'mailchimp' ); ?>
</label>
</div>
</td>
--- a/mailchimp/includes/class-mailchimp-form-submission.php
+++ b/mailchimp/includes/class-mailchimp-form-submission.php
@@ -99,6 +99,7 @@
$merge_fields = get_option( 'mc_merge_vars', array() );
$interest_groups = get_option( 'mc_interest_groups', array() );
+ // phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the request_handler() function.
// Check if request from latest block.
if ( isset( $_POST['mailchimp_sf_list_id'] ) ) {
$list_id = isset( $_POST['mailchimp_sf_list_id'] ) ? sanitize_text_field( wp_unslash( $_POST['mailchimp_sf_list_id'] ) ) : '';
@@ -148,6 +149,7 @@
} else {
$email_type = 'html';
}
+ // phpcs:enable WordPress.Security.NonceVerification.Missing
$response = $this->subscribe_to_list(
$list_id,
@@ -251,10 +253,11 @@
$opt = 'mc_mv_' . $tag;
// Skip if the field is not required and not submitted.
- if ( ( true !== (bool) $merge_field['required'] && ! isset( $_POST[ $opt ] ) ) || $skip_merge_validation ) {
+ if ( ( true !== (bool) $merge_field['required'] && ! isset( $_POST[ $opt ] ) ) || $skip_merge_validation ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the request_handler() function.
continue;
}
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the request_handler() function.
$opt_val = isset( $_POST[ $opt ] ) ? map_deep( stripslashes_deep( $_POST[ $opt ] ), 'sanitize_text_field' ) : '';
switch ( $merge_field['type'] ) {
@@ -339,6 +342,7 @@
foreach ( $interest_groups as $interest_group ) {
$ig_id = $interest_group['id'];
+ // phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the request_handler() function.
if ( isset( $_POST['group'][ $ig_id ] ) && 'hidden' !== $interest_group['type'] ) {
switch ( $interest_group['type'] ) {
case 'dropdown':
@@ -367,6 +371,7 @@
break;
}
}
+ // phpcs:enable WordPress.Security.NonceVerification.Missing
}
return $groups;
}
@@ -544,6 +549,7 @@
* @return bool|WP_Error True if valid, WP_Error if invalid.
*/
protected function validate_form_submission() {
+ // phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the request_handler() function.
$spam_message = esc_html__( "We couldn't process your submission as it was flagged as potential spam. Please try again.", 'mailchimp' );
// Make sure the honeypot field is set, but not filled (if it is, then it's a spam).
if ( ! isset( $_POST['mailchimp_sf_alt_email'] ) || ! empty( $_POST['mailchimp_sf_alt_email'] ) ) {
@@ -579,5 +585,6 @@
* @param array $post_data The $_POST data.
*/
return apply_filters( 'mailchimp_sf_form_submission_validation', true, $_POST );
+ // phpcs:enable WordPress.Security.NonceVerification.Missing
}
}
--- a/mailchimp/mailchimp.php
+++ b/mailchimp/mailchimp.php
@@ -4,7 +4,7 @@
* Plugin URI: https://mailchimp.com/help/connect-or-disconnect-list-subscribe-for-wordpress/
* Description: Add a Mailchimp signup form block, widget or shortcode to your WordPress site.
* Text Domain: mailchimp
- * Version: 2.0.0
+ * Version: 2.0.1
* Requires at least: 6.4
* Requires PHP: 7.0
* PHP tested up to: 8.3
@@ -67,7 +67,7 @@
use function MailchimpWordPressIncludesAdmin{admin_notice_error, admin_notice_success};
// Version constant for easy CSS refreshes
-define( 'MCSF_VER', '2.0.0' );
+define( 'MCSF_VER', '2.0.1' );
// What's our permission (capability) threshold
define( 'MCSF_CAP_THRESHOLD', 'manage_options' );
@@ -421,7 +421,7 @@
* @return void
**/
function mailchimp_sf_save_general_form_settings() {
-
+ // phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce check is already done in the mailchimp_sf_request_handler() function.
/*Enable double optin toggle*/
if ( isset( $_POST['mc_double_optin'] ) ) {
update_option( 'mc_double_optin', true );
@@ -447,11 +447,11 @@
/* Update existing */
if ( isset( $_POST['mc_update_existing'] ) ) {
update_option( 'mc_update_existing', true );
- $msg = esc_html__( 'Update existing subscribers turned On!' );
+ $msg = esc_html__( 'Update existing subscribers turned On!', 'mailchimp' );
admin_notice_success( $msg );
} elseif ( get_option( 'mc_update_existing' ) !== false ) {
update_option( 'mc_update_existing', false );
- $msg = esc_html__( 'Update existing subscribers turned Off!' );
+ $msg = esc_html__( 'Update existing subscribers turned Off!', 'mailchimp' );
admin_notice_success( $msg );
}
@@ -521,6 +521,7 @@
$msg = esc_html__( 'Successfully Updated your List Subscribe Form Settings!', 'mailchimp' );
admin_notice_success( $msg );
+ // phpcs:enable WordPress.Security.NonceVerification.Missing
}
/**
@@ -531,15 +532,20 @@
return;
}
+ if (
+ ! current_user_can( MCSF_CAP_THRESHOLD ) ||
+ ! isset( $_POST['update_mc_list_id_nonce'] ) ||
+ ! wp_verify_nonce( sanitize_key( $_POST['update_mc_list_id_nonce'] ), 'update_mc_list_id_action' )
+ ) {
+ wp_die( 'Security check failed.' );
+ }
+
if ( empty( $_POST['mc_list_id'] ) ) {
$msg = esc_html__( 'Please choose a valid list', 'mailchimp' );
admin_notice_error( $msg );
return;
}
- // Simple permission check before going through all this
- if ( ! current_user_can( MCSF_CAP_THRESHOLD ) ) { return; }
-
$api = mailchimp_sf_get_api();
if ( ! $api ) { return; }
@@ -605,7 +611,7 @@
__( '<b>Success!</b> Loaded and saved the info for %d Merge Variables', 'mailchimp' ) . $igs_text,
count( $mv )
) . ' ' .
- esc_html__( 'from your list' ) . ' "' . $list_name . '"<br/><br/>' .
+ esc_html__( 'from your list', 'mailchimp' ) . ' "' . $list_name . '"<br/><br/>' .
esc_html__( 'Now you should either Turn On the Mailchimp Widget or change your options below, then turn it on.', 'mailchimp' );
admin_notice_success( $msg );
--- a/mailchimp/vendor/composer/autoload_static.php
+++ b/mailchimp/vendor/composer/autoload_static.php
@@ -11,14 +11,14 @@
);
public static $prefixLengthsPsr4 = array (
- 'M' =>
+ 'M' =>
array (
'Mailchimp\WordPress\' => 20,
),
);
public static $prefixDirsPsr4 = array (
- 'Mailchimp\WordPress\' =>
+ 'Mailchimp\WordPress\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
--- a/mailchimp/vendor/composer/installed.php
+++ b/mailchimp/vendor/composer/installed.php
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'mailchimp/wordpress',
- 'pretty_version' => '2.0.0',
- 'version' => '2.0.0.0',
- 'reference' => 'f75618e4495ce73463a28d46ef80406839598c45',
+ 'pretty_version' => '2.0.1',
+ 'version' => '2.0.1.0',
+ 'reference' => 'cd230223528aa8c17041aa2e7e492caeda37e26d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -11,9 +11,9 @@
),
'versions' => array(
'mailchimp/wordpress' => array(
- 'pretty_version' => '2.0.0',
- 'version' => '2.0.0.0',
- 'reference' => 'f75618e4495ce73463a28d46ef80406839598c45',
+ 'pretty_version' => '2.0.1',
+ 'version' => '2.0.1.0',
+ 'reference' => 'cd230223528aa8c17041aa2e7e492caeda37e26d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),