• This plugin is just what I need, and I found setup to be pretty painless, but I am having one issue. I am unable to get the subscribe form to work – when I check the “Subscribe to this page” checkbox nothing happens.

    I looked in the Web Dev console to see if any errors were being reported, and behold, in alertme.js on line 6, I am seeing this error: jQuery is not defined

    How can I resolve this? Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dbacksbst

    (@dbacksbst)

    I was able to get rid of the error in alertme.js by replacing jQuery(document).ready() with this:

    var callback = function() {...}
    
    if (
      document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) {
      callback(); 
    } else {
      document.addEventListener("DOMContentLoaded", callback);
    }

    Now when I check the subscribe box, I get a success message on the page, and my Subscriptions on the “Manage Subscriptions” page are properly updated.

    HOWEVER, when I check the subscribe box, I do not receive a confirmation email. Also, when the page is updated (with the “Send Update Notification box checked), I do not receive an update notification email.

    • This reply was modified 3 years, 9 months ago by dbacksbst.
    Thread Starter dbacksbst

    (@dbacksbst)

    UPDATE: I actually DO receive update notification emails after subscribing! It turns out another plugin I was using was intercepting them before they got to my inbox. So my fix above appears to be working.

    I still think an initial “subscription confirmation” email should be sent when a user first subscribes, even if they are already logged into WordPress.

    Also found an unrelated bug on alertme-admin.php line 167:

    $html .= '<select name="alert_me_position">';

    should be changed to

    $html = '<select name="alert_me_position">';

    because $html has not been defined yet. This was causing an error message to appear next to the “Placement of Alert Me Box” field in the AlertMe Subscribe Box Settings form.

    Thread Starter dbacksbst

    (@dbacksbst)

    There is probably a better place to report this, but just wanted to let you know about one more bug I found. The subscribe form for logged in users always uses the default header instead of the one defined in the AlertMe Settings. The offending code is on line 114 in alertme-frontend.php:

    <?php echo ((isset($options['alert_me_form_heading_text']) && $options['alert_me_form_heading_text'] = '') ? $options['alert_me_form_heading_text'] : $alert_me_form_heading_text ); ?>

    The second condition in the if-statement should use != (or even !==), like so:

    <?php echo ((isset($options['alert_me_form_heading_text']) && $options['alert_me_form_heading_text'] != '') ? $options['alert_me_form_heading_text'] : $alert_me_form_heading_text ); ?>

    Plugin Author Christopher Raymond

    (@chrisbloomwp)

    Hi @dbacksbst
    Thanks for sharing this! Will take a look and test.

    Plugin Author Christopher Raymond

    (@chrisbloomwp)

    Hi @dbacksbst,
    Looked into this issue further.

    Regarding “jQuery is not defined”, this kind of error comes when DOM does not have jQuery library loaded. Generally every theme of WordPress loads the JS library by default. I suspect your theme is not?

    We do not include JQuery because we find most WP themes already have included this.

    Thank you for sharing this information, as we are actively working on the next release, and this kind of input is very valuable to us.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘jQuery is not defined’ is closed to new replies.