Skip to content

Commit f76aa28

Browse files
committed
Merge branch 'develop'
2 parents 89e5cca + b7f7e3b commit f76aa28

35 files changed

+2863
-830
lines changed

.wordpress-org/screenshot-6.jpg

-79.8 KB
Loading

.wordpress-org/screenshot-7.jpg

37.9 KB
Loading

.wordpress-org/screenshot-8.jpg

-509 KB
Loading

.wordpress-org/screenshot-9.jpg

-507 KB
Binary file not shown.

.wp-env.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
},
1111
"lifecycleScripts": {
1212
"afterStart": "bash ./tests/bin/initialize.sh"
13+
},
14+
"config": {
15+
"ALTERNATE_WP_CRON": true,
16+
"WP_AUTO_UPDATE_CORE": false
1317
}
1418
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
## [1.9.0] - 2025-06-04
8+
9+
### Added
10+
11+
- New user synchronization feature that allows syncing WordPress users to Mailchimp (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#156](https://github.com/mailchimp/wordpress/pull/156)).
12+
13+
### Changed
14+
15+
- Improved the enqueueing of JavaScript scripts and styles (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#161](https://github.com/mailchimp/wordpress/pull/161)).
16+
717
## [1.8.0] - 2025-05-08
818

919
**Note that this release bumps the WordPress minimum version from 6.3 to 6.4.**
@@ -313,6 +323,7 @@ All notable changes to this project will be documented in this file, per [the Ke
313323
- Security and various other improvements
314324

315325
[Unreleased]: https://github.com/mailchimp/wordpress/compare/main...develop
326+
[1.9.0]: https://github.com/mailchimp/wordpress/compare/1.8.0...1.9.0
316327
[1.8.0]: https://github.com/mailchimp/wordpress/compare/1.7.0...1.8.0
317328
[1.7.0]: https://github.com/mailchimp/wordpress/compare/1.6.3...1.7.0
318329
[1.6.3]: https://github.com/mailchimp/wordpress/compare/1.6.2...1.6.3

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Starting in version 1.6.0, authentication has changed to use OAuth. As part of t
2828

2929
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.
3030

31-
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:
31+
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 the [WordPress Secret Key Generator](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:
3232

3333
```php
3434
define( 'MAILCHIMP_SF_ENCRYPTION_KEY', 'put your unique phrase here' );
@@ -49,23 +49,21 @@ This section describes how to install the plugin and get started using it.
4949

5050
![Connecting your Mailchimp account to WordPress via OAuth.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-4.jpg?raw=true)
5151

52-
![Creating a new Mailchimp account.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-9.jpg?raw=true)
52+
![Creating a new Mailchimp account.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-7.jpg?raw=true)
5353

5454
4. Click the Log in button and proceed through the OAuth flow, logging in to your Mailchimp account and authorizing the application. If you don't have an acccount, instead click the "Create an account" button to create one.
5555

5656
![Logged in to your Mailchimp account and selecting a list to connect to.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-5.jpg?raw=true)
5757

5858
5. Select the list where you want to send new Mailchimp subscribers.
5959

60-
![Configuring your Signup Form display format (optional).](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-6.jpg?raw=true)
61-
6260
6. Optional: Turn **Merge Fields** and **Groups** on or off. Navigate to **Appearance**, and click **Widgets**. Drag the Mailchimp Widget into one of your Widget Areas.
6361

64-
![Configuring extra fields on your Signup Form (optional).](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-7.jpg?raw=true)
62+
![Configuring extra fields on your Signup Form (optional).](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-6.jpg?raw=true)
6563

66-
7. Optional: adjust frontend site display with available CSS options.
64+
7. Optional: turn on user synchronization to sync WordPress users to Mailchimp.
6765

68-
![CSS options for styling your Signup Form.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-8.jpg?raw=true)
66+
![Configuring user synchronization settings.](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-8.jpg?raw=true)
6967

7068
## Upgrading
7169

@@ -88,23 +86,25 @@ You need to ensure that the fields are enabled both in your Mailchimp account (A
8886
Internationalization (i18n) is available on GlotPress at [https://translate.wordpress.org/projects/wp-plugins/mailchimp/](https://translate.wordpress.org/projects/wp-plugins/mailchimp/). Any assistance [translating the plugin](https://translate.wordpress.org/projects/wp-plugins/mailchimp/) is greatly appreciated!
8987

9088
## E2E tests
89+
9190
The `tests` directory contains end-to-end tests for the project, utilizing Cypress to run tests in an environment created using wp-env.
9291

9392
### Pre-requisites
93+
9494
- Node.js v20
9595
- Docker
9696
- Create an account in [Mailchimp](https://mailchimp.com/)
9797

9898
### Run E2E tests in local
99+
99100
1. Run `npm install`.
100101
2. Run `npm run build`.
101102
3. Run `npm run env:start`.
102103
4. Duplicate the `.env.test.sample` file and rename `.env.test`. Populate this file with your own Mailchimp account credentials.
103104
- **NOTE:** Use a test account that does not require 2FA. 2FA will fail some of the tests.
104105
5. Set your Mailchimp account up
105-
- Name the audience in your Mailchimp test account "10up". Required for `settings.test.js`.
106-
- Enable all merge fields. From your Mailchimp account home page -> `/audience/settings/` -> Edit merge fields/tags -> Set all merge fields to "visible". Required for `settings.test.js`.
107-
106+
- Name the audience in your Mailchimp test account "10up". Required for `settings.test.js`.
107+
- Enable all merge fields. From your Mailchimp account home page -> `/audience/settings/` -> Edit merge fields/tags -> Set all merge fields to "visible". Required for `settings.test.js`.
108108
6. Run `npm run cypress:run`. You can also run `npm run cypress:open` to run tests in UI mode.
109109

110110
## Support Level

assets/css/admin.css

Lines changed: 146 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
table.mc-user,
2020
.mc-list-row,
2121
.mc-list-note,
22-
.mc-section {
22+
.mc-section,
23+
.mailchimp-sf-nav-tab-wrapper {
2324
max-width: 900px;
2425
width: 100%;
2526
}
@@ -38,17 +39,24 @@ table.mc-user,
3839
}
3940

4041
/* Sections */
41-
table.mc-widefat {
42+
table.mc-widefat, .mailchimp-sf-user-sync-page table.form-table {
4243
background: var(--mailchimp-color-white);
4344
border: 2px solid var(--mailchimp-color-header-bg) !important;
4445
border-radius: 6px;
4546
margin: 2.75rem 0 2.25rem;
4647
}
4748

49+
.mailchimp-sf-user-sync-page table.form-table {
50+
border-collapse: separate;
51+
border-spacing: 0px;
52+
}
53+
54+
.mailchimp-sf-user-sync-page table.form-table tr:first-child,
4855
table.mc-widefat tr:first-child {
4956
background: var(--mailchimp-color-header-bg);
5057
}
5158

59+
.mailchimp-sf-user-sync-page table.form-table tr:first-child th,
5260
table.mc-widefat tr:first-child th {
5361
color: var(--mailchimp-color-text);
5462
font-weight: 500;
@@ -181,13 +189,17 @@ table.mc-list-select {
181189
}
182190

183191
/* Table */
192+
.mailchimp-sf-user-sync-page table.form-table td,
193+
.mailchimp-sf-user-sync-page table.form-table th,
184194
table.mc-widefat td,
185195
table.mc-widefat th {
186196
padding: 18px;
187197
text-align: left;
188198
text-shadow: none;
189199
}
190200

201+
.mailchimp-sf-user-sync-page table.form-table .last-row td,
202+
.mailchimp-sf-user-sync-page table.form-table .last-row th,
191203
table.mc-widefat .last-row td,
192204
table.mc-widefat .last-row th {
193205
border-bottom: none !important;
@@ -199,6 +211,11 @@ table.mc-widefat th {
199211
width: 130px;
200212
}
201213

214+
.mailchimp-sf-user-sync-page table.form-table th {
215+
color: var(--mailchimp-color-text-light);
216+
font-weight: 500;
217+
}
218+
202219
table.mc-widefat td label {
203220
display: block;
204221
font-size: 0.75rem;
@@ -213,6 +230,7 @@ table.mc-widefat td {
213230
line-height: 1.125 !important;
214231
}
215232

233+
.mailchimp-sf-user-sync-page table.form-table td input,
216234
table.mc-widefat td input {
217235
display: inline-block;
218236
font-style: normal;
@@ -261,6 +279,31 @@ th.mailchimp-connect {
261279
margin-top: 26px;
262280
}
263281

282+
/**
283+
* Navigation
284+
*/
285+
.mailchimp-sf-nav-tab-wrapper {
286+
margin-top: 1em;
287+
}
288+
289+
.mailchimp-sf-nav-tab-wrapper a.nav-tab {
290+
border: 0px;
291+
background: transparent;
292+
color: #000;
293+
margin-left: 0;
294+
font-weight: 500;
295+
padding: 5px 12px;
296+
}
297+
298+
.mailchimp-sf-nav-tab-wrapper a.nav-tab:hover {
299+
color: var(--mailchimp-color-link);
300+
}
301+
302+
.mailchimp-sf-nav-tab-wrapper a.nav-tab.nav-tab-active {
303+
border-bottom: 2px solid var(--mailchimp-color-link);
304+
color: var(--mailchimp-color-link);
305+
}
306+
264307
/**
265308
* Mailchimp OAuth CSS
266309
*/
@@ -390,6 +433,11 @@ body.toplevel_page_mailchimp_sf_options a {
390433
color: var(--mailchimp-color-link);
391434
}
392435

436+
body.admin_page_mailchimp_sf_create_account a:hover,
437+
body.toplevel_page_mailchimp_sf_options a:hover {
438+
color: #006570;
439+
}
440+
393441
body.admin_page_mailchimp_sf_create_account #footer-upgrade,
394442
body.toplevel_page_mailchimp_sf_options #footer-upgrade {
395443
display: none;
@@ -516,7 +564,8 @@ body.toplevel_page_mailchimp_sf_options #footer-upgrade {
516564
cursor: not-allowed;
517565
}
518566

519-
.button.mailchimp-sf-button.small {
567+
.button.mailchimp-sf-button.small,
568+
.button.mailchimp-sf-button.user-sync-settings-submit {
520569
padding: 8px 16px;
521570
line-height: 14px;
522571
float: right;
@@ -749,3 +798,97 @@ body.toplevel_page_mailchimp_sf_options #footer-upgrade {
749798
column-gap: 16px;
750799
}
751800
}
801+
802+
.mailchimp-sf-user-sync-page {
803+
max-width: 900px;
804+
}
805+
806+
.mailchimp-sf-user-sync-page .subscribe_status_label {
807+
font-weight: 500;
808+
}
809+
810+
.mailchimp-sf-user-sync-page p.description_small {
811+
font-size: 0.9em;
812+
margin-bottom: 10px;
813+
}
814+
815+
.mailchimp-sf-user-sync-status {
816+
margin: 15px 0;
817+
padding: 10px;
818+
background: #fff;
819+
border: 1px solid #ccd0d4;
820+
border-radius: 4px;
821+
}
822+
.mailchimp-sf-user-sync-status .mailchimp-sf-sync-progress {
823+
display: flex;
824+
align-items: center;
825+
flex-direction: row;
826+
}
827+
.mailchimp-sf-user-sync-status .sync-status-text {
828+
font-size: 14px;
829+
line-height: 1.4;
830+
}
831+
832+
.button.mailchimp-cancel-user-sync-button {
833+
margin-left: auto;
834+
}
835+
836+
@media screen and (max-width: 480px) {
837+
.mailchimp-sf-user-sync-status .mailchimp-sf-sync-progress {
838+
flex-direction: column;
839+
align-items: flex-start;
840+
}
841+
842+
.button.mailchimp-cancel-user-sync-button {
843+
margin-left: 0px;
844+
margin-top: 10px;
845+
}
846+
}
847+
848+
.mailchimp-sf-user-sync-errors {
849+
margin-top: 2rem;
850+
}
851+
852+
.mailchimp-sf-user-sync-errors-header {
853+
display: flex;
854+
justify-content: space-between;
855+
align-items: center;
856+
}
857+
858+
.mailchimp-sf-user-sync-error-action {
859+
min-width: 120px;
860+
text-align: right;
861+
}
862+
863+
.mailchimp-sf-start-user-sync-wrapper {
864+
width: 100%;
865+
margin-top: 2em;
866+
background-color: #ffffff;
867+
border: 1px solid #ccd0d4;
868+
border-radius: 6px;
869+
}
870+
871+
.mailchimp-sf-start-user-sync-box {
872+
display: flex;
873+
justify-content: space-between;
874+
align-items: center;
875+
padding: 1rem;
876+
}
877+
878+
.mailchimp-sf-start-user-sync-box h2 {
879+
margin: 0;
880+
}
881+
882+
.mailchimp-sf-start-user-sync-box p {
883+
margin-top: 0.5rem;
884+
}
885+
886+
.mailchimp-sf-start-user-sync-box .mailchimp-sf-button {
887+
float: none;
888+
margin-right: 8px;
889+
}
890+
891+
.mailchimp-sf-start-user-sync-box a {
892+
text-decoration: none;
893+
}
894+

0 commit comments

Comments
 (0)