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 5 years, 3 months ago by
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.
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 ); ?>
Hi @dbacksbst
Thanks for sharing this! Will take a look and test.
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.