Skip to content

Commit b433be3

Browse files
committed
Merge branch 'enhancement/9' of github.com:mailchimp/wordpress into enhancement/9
2 parents 3afeb88 + ed0edf0 commit b433be3

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ WordPress.com compatibility is limited to Business tier users only. [How to add
1818

1919
![Configuring extra fields on your Signup Form (optional)](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-4.jpg?raw=true)
2020

21-
## Access token Encryption
21+
## Access Token Encryption
2222

23-
The plugin stores the OAuth access token in the WordPress database and encrypts it for security. To ensure encryption and decryption work properly, the plugin needs access to certain security constants that should remain unchanged.
23+
Starting in version 1.6.0, authentication has changed to use OAuth. As part of this process, we retrieve an access token that can be used to make API requests. To provide a high-level of security, this access token is encrypted before being stored in the WordPress database. In order to ensure this access token can be decrypted when used, the plugin relies on certain security constants that should remain unchanged.
2424

25-
By default, the plugin uses the `LOGGED_IN_KEY` and `LOGGED_IN_SALT` constants from the wp-config.php file. These usually work well. However, if another plugin or mechanism regularly updates these constants, the plugin will have trouble decrypting the access token and you’ll need to reconnect your Mailchimp account.
25+
With no additional configuration, we use the standard `LOGGED_IN_KEY` and `LOGGED_IN_SALT` constants that are normally set in your site's `wp-config.php` file. Some sites make use of security plugins that rotate these constants on a periodic basis. When this happens, we won't be able to decrypt the access token and you’ll need to reconnect your Mailchimp account to generate a new access token.
2626

27-
To prevent such issues, it is recommended to define two additional constants in your wp-config.php file: `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. These constants should consist of a combination of characters, preferably at least 32 characters long. Once set, these values should not be changed. For strong values, you can copy some of the values from https://api.wordpress.org/secret-key/1.1/salt/ and use them. You should have additional code like the following in your wp-config.php file:
27+
To prevent such issues, it is recommended to define two additional constants in your site's `wp-config.php` file: `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. These constants should consist of a combination of characters, preferably at least 32 characters long. Once set, these values should not be changed. For strong values, you can copy some of the values from [here](https://api.wordpress.org/secret-key/1.1/salt/) and use them. You'll end up with additional code like the following in your `wp-config.php` file:
2828

2929
```php
3030
define( 'MAILCHIMP_SF_ENCRYPTION_KEY', 'put your unique phrase here' );
3131
define( 'MAILCHIMP_SF_ENCRYPTION_SALT', 'put your unique phrase here' );
3232
```
3333

34-
If you add these constants after the plugin is already configured, the plugin will use the new constants, which may cause issues. To avoid this, you can copy the values from `LOGGED_IN_KEY` and `LOGGED_IN_SALT` to `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. If you prefer new values, you will need to reconnect your Mailchimp account.
34+
If these constants are added after you've already authenticated with Mailchimp, you will need to reconnect your account. To avoid this, you can copy the values from `LOGGED_IN_KEY` and `LOGGED_IN_SALT` (if they exist) to `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT` respectively.
3535

3636
## Frequently Asked Questions
3737

@@ -56,7 +56,7 @@ This section describes how to install the plugin and get started using it.
5656

5757
### Advanced
5858

59-
If you have a custom coded sidebar or bells and whistles that prevent enabling widgets through the WordPress GUI, complete these steps instead.
59+
If you have a custom coded sidebar or bells and whistles that prevent enabling widgets through the WordPress GUI, complete these steps instead.
6060

6161
WordPress v2.8 or higher:
6262
` [mailchimpsf_form] `

includes/class-mailchimp-admin.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Class responsible for Admin side functionalities.
3+
* Class responsible for admin side functionalities.
44
*
55
* @package Mailchimp
66
*/
@@ -36,12 +36,13 @@ public function init() {
3636
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_page_scripts' ) );
3737
}
3838

39-
4039
/**
4140
* Start the OAuth process.
4241
*
4342
* This function is called via AJAX.
44-
* It starts the OAuth process by the calling the OAuth middleware server and sending the response to the front-end.
43+
*
44+
* It starts the OAuth process by the calling the OAuth middleware
45+
* server and sending the response to the front-end.
4546
*/
4647
public function start_oauth_process() {
4748
// Validate the nonce and permissions.
@@ -91,7 +92,9 @@ public function start_oauth_process() {
9192
* Finish the OAuth process.
9293
*
9394
* This function is called via AJAX.
94-
* This function finishes the OAuth process by the sending a temporary token back to the OAuth server.
95+
*
96+
* This function finishes the OAuth process by the sending
97+
* a temporary token back to the OAuth server.
9598
*/
9699
public function finish_oauth_process() {
97100
// Validate the nonce and permissions.
@@ -201,7 +204,7 @@ public function admin_notices() {
201204
return;
202205
}
203206

204-
// display a notice if the access token is invalid/revoked.
207+
// Display a notice if the access token is invalid/revoked.
205208
?>
206209
<div class="notice notice-warning is-dismissible">
207210
<p>
@@ -223,7 +226,7 @@ public function admin_notices() {
223226
/**
224227
* Sanitize variables using sanitize_text_field.
225228
*
226-
* Arrays are sanitized recursively, Non-scalar values are ignored.
229+
* Arrays are sanitized recursively, non-scalar values are ignored.
227230
*
228231
* @param string|array $data Data to sanitize.
229232
* @return string|array

includes/class-mailchimp-data-encryption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct() {
4646
/**
4747
* Encrypts a value.
4848
*
49-
* If a user-based key is set, that key is used. Otherwise the default key is used.
49+
* If a user-based key is set, that is used. Otherwise the default key is used.
5050
*
5151
* @since x.x.x
5252
*
@@ -73,7 +73,7 @@ public function encrypt( $value ) {
7373
/**
7474
* Decrypts a value.
7575
*
76-
* If a user-based key is set, that key is used. Otherwise the default key is used.
76+
* If a user-based key is set, that is used. Otherwise the default key is used.
7777
*
7878
* @since x.x.x
7979
*

readme.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ After installation, you’ll log in with your API key, select your Mailchimp lis
1616

1717
WordPress.com compatibility is limited to Business tier users only. [How to add a signup form if you have a WordPress.com site](https://mailchimp.com/help/ways-to-add-a-signup-form-in-wordpress/).
1818

19-
=== Access token Encryption ===
19+
=== Access Token Encryption ===
2020

21-
The plugin stores the OAuth access token in the WordPress database and encrypts it for security. To ensure encryption and decryption work properly, the plugin needs access to certain security constants that should remain unchanged.
21+
Starting in version 1.6.0, authentication has changed to use OAuth. As part of this process, we retrieve an access token that can be used to make API requests. To provide a high-level of security, this access token is encrypted before being stored in the WordPress database. In order to ensure this access token can be decrypted when used, the plugin relies on certain security constants that should remain unchanged.
2222

23-
By default, the plugin uses the `LOGGED_IN_KEY` and `LOGGED_IN_SALT` constants from the wp-config.php file. These usually work well. However, if another plugin or mechanism regularly updates these constants, the plugin will have trouble decrypting the access token and you’ll need to reconnect your Mailchimp account.
23+
With no additional configuration, we use the standard `LOGGED_IN_KEY` and `LOGGED_IN_SALT` constants that are normally set in your site's `wp-config.php` file. Some sites make use of security plugins that rotate these constants on a periodic basis. When this happens, we won't be able to decrypt the access token and you’ll need to reconnect your Mailchimp account to generate a new access token.
2424

25-
To prevent such issues, it is recommended to define two additional constants in your wp-config.php file: `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. These constants should consist of a combination of characters, preferably at least 32 characters long. Once set, these values should not be changed. For strong values, you can copy some of the values from https://api.wordpress.org/secret-key/1.1/salt/ and use them. You should have additional code like the following in your wp-config.php file:
25+
To prevent such issues, it is recommended to define two additional constants in your site's `wp-config.php` file: `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. These constants should consist of a combination of characters, preferably at least 32 characters long. Once set, these values should not be changed. For strong values, you can copy some of the values from [here](https://api.wordpress.org/secret-key/1.1/salt/) and use them. You'll end up with additional code like the following in your `wp-config.php` file:
2626

2727
`
2828
define( 'MAILCHIMP_SF_ENCRYPTION_KEY', 'put your unique phrase here' );
2929
define( 'MAILCHIMP_SF_ENCRYPTION_SALT', 'put your unique phrase here' );
3030
`
3131

32-
If you add these constants after the plugin is already configured, the plugin will use the new constants, which may cause issues. To avoid this, you can copy the values from `LOGGED_IN_KEY` and `LOGGED_IN_SALT` to `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT`. If you prefer new values, you will need to reconnect your Mailchimp account.
32+
If these constants are added after you've already authenticated with Mailchimp, you will need to reconnect your account. To avoid this, you can copy the values from `LOGGED_IN_KEY` and `LOGGED_IN_SALT` (if they exist) to `MAILCHIMP_SF_ENCRYPTION_KEY` and `MAILCHIMP_SF_ENCRYPTION_SALT` respectively.
3333

3434
== Frequently Asked Questions ==
3535

@@ -52,7 +52,7 @@ This section describes how to install the plugin and get started using it.
5252

5353
= Advanced =
5454

55-
If you have a custom coded sidebar or bells and whistles that prevent enabling widgets through the WordPress GUI, complete these steps instead.
55+
If you have a custom coded sidebar or bells and whistles that prevent enabling widgets through the WordPress GUI, complete these steps instead.
5656

5757
WordPress v2.8 or higher:
5858
` [mailchimpsf_form] `

0 commit comments

Comments
 (0)