Support » Plugin: WP Popups - WordPress Popup builder » Plugin seems not to be loading correctly PLUS trying to open programatically

  • Hello. I am trying to open a popup programatically.

    Does the popup need to be active? I would like to use it only programatically but there is no option for “no trigger at all”.

    Also, when I try to call it I get the following error:

    “Uncaught TypeError: Cannot read property ‘showPopup’ of undefined
    at (index):1”

    I am calling it by adding this on functions.php (inside some function):

    echo “<script>”
    . “console.log(‘Test started’);”
    . “window.wppopups.showPopup(32655);”
    . “</script>”;

    It’s been registered with an add_action(‘init’, ‘functionName’); and I’m getting the “Test started” on console.

    I do get the “Test started” but it seems wppopups is not loading.
    Even after the page is completely loaded, if I try to “window.wppopups.showPopup(32655);” on my console, I still get a “undefined” as a response.

    On the other hand, if I activate the popup I get the following error (which breaks my site):

    “Uncaught TypeError: Cannot read property ‘charAt’ of undefined
    at Object.bindPopupTriggers (wppopups.js?ver=2.1.2:317)
    at Object.initPopup (wppopups.js?ver=2.1.2:147)
    at HTMLDivElement.<anonymous> (wppopups.js?ver=2.1.2:106)
    at Function.each (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    at jQuery.fn.init.each (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    at HTMLDocument.ready (wppopups.js?ver=2.1.2:98)
    at i (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    at Function.ready (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
    bindPopupTriggers @ wppopups.js?ver=2.1.2:317
    initPopup @ wppopups.js?ver=2.1.2:147
    (anonymous) @ wppopups.js?ver=2.1.2:106
    each @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
    each @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
    ready @ wppopups.js?ver=2.1.2:98
    i @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
    fireWith @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
    ready @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
    J @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2”

    Please any ideas on how to fix this?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Damian

    (@timersys)

    Hi @fillipemontenegro,

    If you are going to open the popup programmatically first the popup needs to exist on the page. If you are opening the popup on every page leave display rules to every page and trigger method to manual triggering or trigger class (si it won’t automatically trigger)

    Not sure what you mean by popup activated and where the error is coming from. Could you show me the url where I should be able to open it? And the popup ID if different than 32655

    Thread Starter fillipemontenegro

    (@fillipemontenegro)

    Hey, thanks for the reply.

    I’m using the free version, not sure if possible nor how to use “manual triggering”?

    By popup activated I mean the “Off/On” switch on the list of popups.

    I’m doing it programatically so it would only show to administrator. Also I have added a display rule to “User Role” is administrator.

    If I use the timer trigger it pops up but even then if I try and run

    window.wppopups.showPopup(32665);
    or
    window.wppopups.showPopup(32665, true);

    on console, it says “undefined”.

    Plugin Author Damian

    (@timersys)

    Are you using autooptimize or some plugin that is concatenating/minifying javascript ?
    Could you share the url?

    Thread Starter fillipemontenegro

    (@fillipemontenegro)

    This is the URL www .feynlab .com/technology/ceramic-protection/
    I removed the role (admin) restriction

    Thread Starter fillipemontenegro

    (@fillipemontenegro)

    No minifying/concat plugin.

    Plugin Author Damian

    (@timersys)

    The popups it’s opening for me with window.wppopups.showPopup(32655);
    The undefined response it’s normal

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.