PopupMaker / Popup-Maker

Popup Maker plugin for WordPress
https://wppopupmaker.com/
104 stars 38 forks source link

Creates an extra cookie #1046

Open marklchaves opened 1 year ago

marklchaves commented 1 year ago

Describe the bug

Popup Maker creates an extra cookie when you dismiss the default cookie name and a new one instead.

Site information

Popup Maker version: 1.18.1

WordPress version: 6.2

PHP version: 8

Expected behavior

I should only get my custom cookie name instead of both the default pum-nnn cookie and my custom cookie name.

Current behavior

See video https://share.wppopupmaker.com/9ZuKm0Zq

Steps to reproduce

  1. Create a trigger.
  2. Add a cookie.
  3. Dismiss the default cookie name (e.g., pum-123) and select "Add New Cookie" in the dropdown instead.
  4. Give your new cookie a custom name like pum-123-my-cookie.
  5. Both pum-123 and pum-123-my-cookie are created even though we wanted only the second one.

Errors

Additional context

danieliser commented 7 months ago

@marklchaves probably not fixing this before we move to react.

This is due to creating the cookie and saving it as part of the trigger before opening the cookie editor. This would require a 2 way connection without proper global state management.

danieliser commented 7 months ago

I should also add that this only happens if you do it via the trigger selector prompt initially. If you uncheck that box, then create the trigger and choose add new it doesn't happen.

Still the fix is likely more complicated than the problem, leaving it open though for now in case anybody else comes across it.