Skip to content

Popup Maker Plugin does not display random popups due to String-Integer comparison Issue #13

@shien

Description

@shien

Hi, contributors

I have encountered an issue with the Popup Maker plugin where popups intended to display randomly are not appearing as expected. Upon investigation, we identified that the root cause of this issue is a comparison operation between string and integer values, which prevents the code from entering the necessary conditional branch to execute the random popup display logic.

I checked below document.
https://docs.wppopupmaker.com/article/313-a-b-test-or-randomly-display-popups

Steps to Reproduce:

  1. Configure the Popup Maker plugin to display popups randomly in "Simple Custom CSS and JS".
  2. I create three popups I want to show randomly.
  3. Trigger the condition that should display each popups.
  4. Observe that the popup does not appear.

Expected Behavior:
Randomly configured popups should appear when their specified conditions are met.

Actual Behavior:
Popups configured to display randomly do not appear due to the failure of a conditional check caused by comparing a string to an integer.

Below ID value is string.

ID = $this.popmake('getSettings').id;

Proposed Solution:
The issue can be resolved by converting the string value to an integer before performing the comparison.

e.g.

ID = parseInt($this.popmake('getSettings').id);

Additional Information:

Popup maker Version: 1.18.2
Browser(s) Tested: Chrome
WordPress Version: 6.4.3
Simple Custom CSS and JS: 3.46

May I create pull request above issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions