You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,6 +18,21 @@ WordPress.com compatibility is limited to Business tier users only. [How to add
18
18
19
19

20
20
21
+
## Access Token Encryption
22
+
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.
24
+
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.
26
+
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:
28
+
29
+
```php
30
+
define( 'MAILCHIMP_SF_ENCRYPTION_KEY', 'put your unique phrase here' );
31
+
define( 'MAILCHIMP_SF_ENCRYPTION_SALT', 'put your unique phrase here' );
32
+
```
33
+
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.
35
+
21
36
## Frequently Asked Questions
22
37
23
38
### Can I have multiple forms on one page?
@@ -41,9 +56,9 @@ This section describes how to install the plugin and get started using it.
41
56
42
57
### Advanced
43
58
44
-
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.
45
60
46
-
WordPress v2.8 or higher:
61
+
WordPress v2.8 or higher:
47
62
` [mailchimpsf_form] `
48
63
49
64
If you are adding it inside a php code block, pop this in:
@@ -89,6 +104,23 @@ Currently we have the plugin configured so it can be translated and the followin
89
104
* sv_SE - Swedish in Sweden (thanks to [Sebastian Johnsson](http://www.agiley.se/) for contributing)
90
105
* tr_TR - Turkish in Turkey (thanks to [Hakan E.](http://kazancexpert.com/) for contributing)
91
106
107
+
## E2E tests
108
+
The `tests` directory contains end-to-end tests for the project, utilizing Cypress to run tests in an environment created using wp-env.
109
+
110
+
### Pre-requisites
111
+
- Node.js v20
112
+
- Docker
113
+
- Create an account in [Mailchimp](https://mailchimp.com/)
114
+
115
+
### Run E2E tests in local
116
+
1. Run `npm install`.
117
+
2. Run `npm run build`.
118
+
3. Run `npm run env:start`.
119
+
4. Set Mailchimp credentials as environment variables:
120
+
- run `export CYPRESS_MAILCHIMP_USERNAME="your mailchimp username"`
121
+
- run `export CYPRESS_MAILCHIMP_PASSWORD="your mailchimp password"`
122
+
5. Run `npm run cypress:run`. You can also run `npm run cypress:open` to run tests in UI mode.
123
+
92
124
## Support Level
93
125
94
126
**Active:** Mailchimp is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.
0 commit comments