mailchimp / wordpress

Add a Mailchimp signup form widget to your WordPress site.
https://wordpress.org/plugins/mailchimp/
GNU General Public License v2.0
1 stars 0 forks source link

Ensure that the settings remain persistent between logging out of the account and logging in again. #66

Closed iamdharmesh closed 1 month ago

iamdharmesh commented 1 month ago

Description of the Change

As reported internally in Slack, when logging out of the Mailchimp account, the settings do not remain persistent between logging out and logging in again. Although we are not clearing the settings, the saved list ID is cleared upon logout (added in #54), which requires re-selection after login. Additionally, updating the list sets default values for the settings, overwriting the saved ones.

This PR resolves the issue by preventing the saved Mailchimp list ID from being cleared on logout. The list ID will only be cleared on login if it is not available under the account. Therefore, if we log in with a different user account, the ID will be cleared. otherwise, it will remain unchanged

How to test the Change

  1. Log in with Mailchimp and save the settings.
  2. Log out.
  3. Log in again with the same account and verify that all settings and the list remain selected as they were.
  4. Log out again.
  5. Log in with a different account and verify that the list in the Mailchimp settings is not selected.
  6. Verify that the signup form on the front end does not render until the list is selected and saved in the settings.

Changelog Entry

Fixed - Ensure that the settings remain persistent between logging out of the account and logging in again.

Credits

Props @jeffpaul @iamdharmesh

Checklist:

qasumitbagthariya commented 1 month ago

QA Update ✅


I have verified this PR in the fix/persist-list branch which has been fixed and is functioning as intended.

I tested the following on this branch:

https://github.com/user-attachments/assets/848a485c-35fd-44e2-8bf3-36eca3388a11

https://github.com/user-attachments/assets/c3775270-8999-42be-aaed-28510d445856

Testing Environment

- WordPress: 6.6.2 - Theme: Twenty Twenty-Four 1.2 - PHP: 8.0.30 - Web Server: Nginx 1.20.2 - Browser: Chrome - OS: macOS Ventura 13.3 - Branch: fix/persist-list

Steps to Test- As mentioned in the PR description. Test Results - It is working as expected. Functional Demo / Screencast - Special Notes - Ready for code review (Woo) Testing Document status: Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

qasumitbagthariya commented 1 month ago

Regression / Smoke Test Report ✅

I have verified this PR in the smoke-test branch and it is working as expected.

Testing Environment

- WordPress: 6.6.2 - Theme: Twenty Twenty-Four 1.2 - WooCommerce - 9.3.3 - PHP: 8.0.30 - Web Server: Nginx 1.20.2 - Browser: Chrome - OS: macOS Ventura 13.3 - Branch: smoke-testing

Next Step- Ready to Merge 🚀