+
From 76df079332601e0063147c2f60fe90d1a14a3d19 Mon Sep 17 00:00:00 2001
From: Dharmesh Patel
Date: Fri, 4 Oct 2024 16:07:01 +0530
Subject: [PATCH 08/14] Add notice with migrate button on settings page to
migrate to oAuth authentiacation.
---
assets/css/admin.css | 18 ++++++++++
includes/class-mailchimp-admin.php | 54 ++++++++++++++++++++----------
2 files changed, 55 insertions(+), 17 deletions(-)
diff --git a/assets/css/admin.css b/assets/css/admin.css
index 04403c2..5e05be8 100644
--- a/assets/css/admin.css
+++ b/assets/css/admin.css
@@ -523,6 +523,24 @@ body.toplevel_page_mailchimp_sf_options #footer-upgrade {
clear: both;
}
+.migrate-to-oauth-wrapper {
+ margin: 1em 0;
+}
+
+.migrate-to-oauth-wrapper .button.mailchimp-sf-button {
+ padding: 9px 16px;
+ line-height: 14px;
+}
+
+.migrate-to-oauth-wrapper button.button.mailchimp-sf-button:disabled {
+ padding: 6px 16px;
+}
+
+.migrate-to-oauth-wrapper button.button.mailchimp-sf-button svg {
+ width: 20px;
+ height: 20px;
+}
+
.button.mailchimp-sf-button.button-secondary.small {
background-color: transparent;
}
diff --git a/includes/class-mailchimp-admin.php b/includes/class-mailchimp-admin.php
index 0a70f5d..6b1e0f8 100644
--- a/includes/class-mailchimp-admin.php
+++ b/includes/class-mailchimp-admin.php
@@ -338,29 +338,49 @@ public function admin_notices() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
+ $current_screen = get_current_screen();
// Display a deprecation notice if the user is using an API key to connect with Mailchimp.
if ( get_option( 'mc_api_key', '' ) && ! get_option( 'mailchimp_sf_access_token', '' ) && mailchimp_sf_should_display_form() ) {
- ?>
-
-
- tag, %2$s - tag */
- __( 'Heads up! It looks like you\'re using an API key to connect with Mailchimp, which is now deprecated. Please log out and reconnect your Mailchimp account using the new OAuth authentication by clicking the "Log in" button on the %1$splugin settings%2$s page.', 'mailchimp' ),
- '',
- ''
- );
-
- echo wp_kses( $message, array( 'a' => array( 'href' => array() ) ) );
- ?>
-
-
- id ) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+ tag, %2$s - tag */
+ __( 'Heads up! It looks like you\'re using an API key to connect with Mailchimp, which is now deprecated. Please migrate to new OAuth authentication by clicking the "Migrate to OAuth authentication" button on the %1$splugin settings%2$s page.', 'mailchimp' ),
+ '',
+ ''
+ );
+
+ echo wp_kses( $message, array( 'a' => array( 'href' => array() ) ) );
+ ?>
+
+
+ id ) {
$api = mailchimp_sf_get_api();
if ( $api && 'waiting' === get_option( 'mailchimp_sf_waiting_for_login' ) ) {
From 50dc80264152f232641ab89d8516714b73a0c595 Mon Sep 17 00:00:00 2001
From: Dharmesh Patel
Date: Fri, 4 Oct 2024 16:13:51 +0530
Subject: [PATCH 09/14] remove `mc_api_key` during new login, as we are
directly migrating to without logout.
---
includes/class-mailchimp-admin.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/includes/class-mailchimp-admin.php b/includes/class-mailchimp-admin.php
index 6b1e0f8..fe0f2fd 100644
--- a/includes/class-mailchimp-admin.php
+++ b/includes/class-mailchimp-admin.php
@@ -299,6 +299,7 @@ public function verify_and_save_oauth_token( $access_token, $data_center ) {
$data_encryption = new Mailchimp_Data_Encryption();
// Clean up the old data.
+ delete_option( 'mc_api_key' ); // Deprecated API key, need to remove as part of the migration.
delete_option( 'mailchimp_sf_access_token' );
delete_option( 'mailchimp_sf_auth_error' );
delete_option( 'mc_datacenter' );
From 9311a71709bdd5fd985daaca059b77ef91b30f1a Mon Sep 17 00:00:00 2001
From: Dharmesh Patel
Date: Fri, 4 Oct 2024 19:12:12 +0530
Subject: [PATCH 10/14] Wording updates to migrate notice on settings page.
---
includes/class-mailchimp-admin.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/includes/class-mailchimp-admin.php b/includes/class-mailchimp-admin.php
index fe0f2fd..f92ea51 100644
--- a/includes/class-mailchimp-admin.php
+++ b/includes/class-mailchimp-admin.php
@@ -349,7 +349,7 @@ public function admin_notices() {
From 9135ab082054a1fb75b79248630e02adcd5b1007 Mon Sep 17 00:00:00 2001
From: Dharmesh Patel
Date: Fri, 4 Oct 2024 19:21:53 +0530
Subject: [PATCH 11/14] Wording updates to migration notice.
---
includes/class-mailchimp-admin.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/includes/class-mailchimp-admin.php b/includes/class-mailchimp-admin.php
index f92ea51..e5b77b2 100644
--- a/includes/class-mailchimp-admin.php
+++ b/includes/class-mailchimp-admin.php
@@ -368,7 +368,7 @@ public function admin_notices() {
tag, %2$s - tag */
- __( 'Heads up! It looks like you\'re using an API key to connect with Mailchimp, which is now deprecated. Please migrate to new OAuth authentication by clicking the "Migrate to OAuth authentication" button on the %1$splugin settings%2$s page.', 'mailchimp' ),
+ __( 'You are using an outdated API Key connection to Mailchimp, please migrate to the new OAuth authentication method to continue accessing your Mailchimp account by clicking the "Migrate to OAuth authentication" button on the %1$sMailchimp settings%2$s page.', 'mailchimp' ),
'',
''
);
From c899a80bd44e8952136b80086b3bd7a298972900 Mon Sep 17 00:00:00 2001
From: Darin Kotter
Date: Fri, 11 Oct 2024 09:35:21 -0600
Subject: [PATCH 12/14] Version bump to 1.6.1
---
mailchimp.php | 4 ++--
package-lock.json | 4 ++--
package.json | 2 +-
readme.txt | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/mailchimp.php b/mailchimp.php
index ca9ffca..d19e900 100644
--- a/mailchimp.php
+++ b/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: 1.6.0
+ * Version: 1.6.1
* Requires at least: 6.1
* Requires PHP: 7.0
* PHP tested up to: 8.3
@@ -35,7 +35,7 @@
*/
// Version constant for easy CSS refreshes
-define( 'MCSF_VER', '1.6.0' );
+define( 'MCSF_VER', '1.6.1' );
// What's our permission (capability) threshold
define( 'MCSF_CAP_THRESHOLD', 'manage_options' );
diff --git a/package-lock.json b/package-lock.json
index 4dd2869..6593c4d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@mailchimp/wordpress",
- "version": "1.6.0",
+ "version": "1.6.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mailchimp/wordpress",
- "version": "1.6.0",
+ "version": "1.6.1",
"license": "GPL-2.0-or-later",
"dependencies": {
"@wordpress/block-editor": "^13.2.0",
diff --git a/package.json b/package.json
index 865d02a..e481711 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@mailchimp/wordpress",
- "version": "1.6.0",
+ "version": "1.6.1",
"description": "Add a Mailchimp signup form widget to your WordPress site.",
"homepage": "https://github.com/mailchimp/wordpress",
"bugs": {
diff --git a/readme.txt b/readme.txt
index f4d8c7b..f0638ab 100644
--- a/readme.txt
+++ b/readme.txt
@@ -2,7 +2,7 @@
Contributors: Mailchimp
Tags: mailchimp, email, newsletter, signup, marketing
Tested up to: 6.6
-Stable tag: 1.6.0
+Stable tag: 1.6.1
License: GPL-2.0-or-later
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
From 5501170e591461462213b5d76a13f6fe34fa6fe8 Mon Sep 17 00:00:00 2001
From: Darin Kotter
Date: Fri, 11 Oct 2024 09:43:15 -0600
Subject: [PATCH 13/14] Update changelogs
---
CHANGELOG.md | 12 ++++++++++++
readme.txt | 7 +++++++
2 files changed, 19 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74286ca..344d346 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file, per [the Ke
## [Unreleased] - TBD
+## [1.6.1] - 2024-10-14
+### Changed
+- Improved migration flow from API Key to OAuth authentication for a better user experience (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#67](https://github.com/mailchimp/wordpress/pull/67)).
+- Updated the menu SVG icon (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#65](https://github.com/mailchimp/wordpress/pull/65)).
+
+### Fixed
+- Ensure that the settings remain persistent between logging out of the account and logging in again (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#66](https://github.com/mailchimp/wordpress/pull/66)).
+
+### Security
+- Bump `serve-static` from 1.15.0 to 1.16.2 and `express` from 4.19.2 to 4.21.0 (props [@dependabot](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#55](https://github.com/mailchimp/wordpress/pull/55)).
+- Bump `webpack` from 5.91.0 to 5.94.0 (props [@dependabot](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#59](https://github.com/mailchimp/wordpress/pull/59)).
+
## [1.6.0] - 2024-09-24
**Note this version increased the WordPress minimum version to 6.1 and the PHP minimum version to 7.0.**
diff --git a/readme.txt b/readme.txt
index f0638ab..18e8343 100644
--- a/readme.txt
+++ b/readme.txt
@@ -98,6 +98,13 @@ Where ever you want it to show up.
== Changelog ==
+= 1.6.1 - 2024-10-14 =
+* **Changed:** Improved migration flow from API Key to OAuth authentication for a better user experience (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#67](https://github.com/mailchimp/wordpress/pull/67)).
+* **Changed:** Updated the menu SVG icon (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#65](https://github.com/mailchimp/wordpress/pull/65)).
+* **Fixed:** Ensure that the settings remain persistent between logging out of the account and logging in again (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#66](https://github.com/mailchimp/wordpress/pull/66)).
+* **Security:** Bump `serve-static` from 1.15.0 to 1.16.2 and `express` from 4.19.2 to 4.21.0 (props [@dependabot](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#55](https://github.com/mailchimp/wordpress/pull/55)).
+* **Security:** Bump `webpack` from 5.91.0 to 5.94.0 (props [@dependabot](https://github.com/apps/dependabot), [@dkotter](https://github.com/dkotter) via [#59](https://github.com/mailchimp/wordpress/pull/59)).
+
= 1.6.0 - 2024-09-24 =
**Note this version increased the WordPress minimum version to 6.1 and the PHP minimum version to 7.0.**
From 6304b0e6b0bb1a0123c969726b7fe72e3456dbae Mon Sep 17 00:00:00 2001
From: Darin Kotter
Date: Fri, 11 Oct 2024 09:44:22 -0600
Subject: [PATCH 14/14] Update CREDITS.md
---
CREDITS.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CREDITS.md b/CREDITS.md
index b307165..f7be5be 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -12,7 +12,7 @@ The following individuals are responsible for curating the list of issues, respo
Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.
-[Mailchimp (@mailchimp)](https://github.com/mailchimp), [Crowd Favorite (@crowdfavorite)](https://github.com/crowdfavorite), [Matthew Richmond (@bigdawggi)](https://github.com/bigdawggi), [Devin Reams (@devinreams)](https://github.com/devinreams), [Alex King (@alexkingorg)](https://github.com/alexkingorg), [Jesse (@jessedp)](https://github.com/jessedp), [Andrew Ellis](awellis@me.com), [Evan Anderson (@ejdanderson)](https://github.com/ejdanderson), [Webb Henderson (@emerywebster)](https://github.com/emerywebster), [Steven Mathias (@ssmathias)](https://github.com/ssmathias), [Jonathan D. Johnson (@jondavidjohn)](https://github.com/jondavidjohn), [Ross Tweedie (@digitales)](https://github.com/digitales), [(@mcwill)](https://github.com/mcwill), [Andrew Austin (@andrewjaustin)](https://github.com/andrewjaustin), [Marc Queralt i Bassa (@MarcQueralt)](https://github.com/MarcQueralt), [Chris Mospaw (@mospaw)](https://github.com/mospaw), [Jonas Stensved (@jstensved)](https://github.com/jstensved), [netboy](netboy@netboy.pl), [Lenin](lenin@tasawr.com), [Bauke Zwaan (@baukezwaan)](https://github.com/baukezwaan), [Jascha Ehrenreich (@jaeh)](https://github.com/jaeh), [Chris Wilcoxson (@slushman)](https://github.com/slushman), [Luke Watts (@thisislawatts)](https://github.com/thisislawatts), [Glenn Ansley (@glennansley)](https://github.com/glennansley), [SiteGround](http://www.siteground.com/wordpress-hosting.htm), [Peter Kahoun](http://kahi.cz/), [Jan Lund](), [Michael Jaekel](), [Ιωάννης Δημοφέρλιας (John Dimoferlias)](), [Tomás Nader](), [Claudia Mansilla](http://cricava.com/), [Helen Urbanik](http://www.motomaania.ee/), [Maxime Toulliou](http://www.maximetoulliou.com/), [שגיב בית](http://www.sagive.co.il), [Okostobi](), [Stefan Des](http://www.stefandes.com), [백선기 (SK Baek)](), [Alexander Roterud aka Defrag](http://www.tigerpews.com), [Filip Stas](http://suddenelfilio.net/), [Maria Manoela Porto](), [Tiago Faria](http://xroot.org), [Alexandru Armin Roșu](), [Илья](http://fatcow.com), [Sebastian Johnsson](http://www.agiley.se/), [Hakan E.](http://kazancexpert.com/), [Josh Grosser (@jgrosser-intuit)](https://github.com/jgrosser-intuit), [10up (@10up)](https://github.com/10up), [Nate Conley (@nateconley)](https://github.com/nateconley), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Eddie Shrake (@eddieshrake)](https://github.com/eddieshrake), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh).
+[Mailchimp (@mailchimp)](https://github.com/mailchimp), [Crowd Favorite (@crowdfavorite)](https://github.com/crowdfavorite), [Matthew Richmond (@bigdawggi)](https://github.com/bigdawggi), [Devin Reams (@devinreams)](https://github.com/devinreams), [Alex King (@alexkingorg)](https://github.com/alexkingorg), [Jesse (@jessedp)](https://github.com/jessedp), [Andrew Ellis](awellis@me.com), [Evan Anderson (@ejdanderson)](https://github.com/ejdanderson), [Webb Henderson (@emerywebster)](https://github.com/emerywebster), [Steven Mathias (@ssmathias)](https://github.com/ssmathias), [Jonathan D. Johnson (@jondavidjohn)](https://github.com/jondavidjohn), [Ross Tweedie (@digitales)](https://github.com/digitales), [(@mcwill)](https://github.com/mcwill), [Andrew Austin (@andrewjaustin)](https://github.com/andrewjaustin), [Marc Queralt i Bassa (@MarcQueralt)](https://github.com/MarcQueralt), [Chris Mospaw (@mospaw)](https://github.com/mospaw), [Jonas Stensved (@jstensved)](https://github.com/jstensved), [netboy](netboy@netboy.pl), [Lenin](lenin@tasawr.com), [Bauke Zwaan (@baukezwaan)](https://github.com/baukezwaan), [Jascha Ehrenreich (@jaeh)](https://github.com/jaeh), [Chris Wilcoxson (@slushman)](https://github.com/slushman), [Luke Watts (@thisislawatts)](https://github.com/thisislawatts), [Glenn Ansley (@glennansley)](https://github.com/glennansley), [SiteGround](http://www.siteground.com/wordpress-hosting.htm), [Peter Kahoun](http://kahi.cz/), [Jan Lund](), [Michael Jaekel](), [Ιωάννης Δημοφέρλιας (John Dimoferlias)](), [Tomás Nader](), [Claudia Mansilla](http://cricava.com/), [Helen Urbanik](http://www.motomaania.ee/), [Maxime Toulliou](http://www.maximetoulliou.com/), [שגיב בית](http://www.sagive.co.il), [Okostobi](), [Stefan Des](http://www.stefandes.com), [백선기 (SK Baek)](), [Alexander Roterud aka Defrag](http://www.tigerpews.com), [Filip Stas](http://suddenelfilio.net/), [Maria Manoela Porto](), [Tiago Faria](http://xroot.org), [Alexandru Armin Roșu](), [Илья](http://fatcow.com), [Sebastian Johnsson](http://www.agiley.se/), [Hakan E.](http://kazancexpert.com/), [Josh Grosser (@jgrosser-intuit)](https://github.com/jgrosser-intuit), [10up (@10up)](https://github.com/10up), [Nate Conley (@nateconley)](https://github.com/nateconley), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Eddie Shrake (@eddieshrake)](https://github.com/eddieshrake), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot).
## Libraries