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

Open iamdharmesh opened 2 days ago

iamdharmesh commented 2 days 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: