Markus Echterhoff
Forum Replies Created
-
You’re welcome. I’m glad you found a way to make it work. Personally, I prefer to use
DISABLE_WP_CRON
combined with periodic fetches via a real cron job anyway, because it separates maintenance/background stuff from visitors loading the site in the browser.I’m sure it’s possible to detect and fix why exactly emails are being sent twice. I’m sorry I’m not of more help in this regard. I have not been working on or even using this plugin in a while now. I keep it available online because it still seems useful, but it might eventually break with future updates, and if that happens, I probably won’t fix it. Just so you know. ??
If it is a problem related to WP Cron, you could try disabling it and use a real cron job instead, i.e. define
DISABLE_WP_CRON
instead ofALTERNATE_WP_CRON
, and then schedule a cron job on your system to fetchhttps://your.forum.example.com/wp-cron.php
every couple of minutes.Finding a proper solution depends on what code exactly is being run twice and why. You could use plugins to inspect the jobs scheduled and executed by WP Cron, you could also write your own code to that effect.
You can check the call stack by generating an exception and calling its
getTrace()
method. Code examples can be found on the Web. For a first quick check, you could also simply output a log message from insideabbps_inject()
to check whether it is indeed called twice in a row, and whether that behavior changes for some reason when definingALTERNATE_WP_CRON
.Hi,
Oddly I have not been notified about your first post earlier today. Maybe www.ads-software.com is having issues with notifications, too. ??
Your solution appears to have unwanted side effects because there are a bunch of actions hooked to those hooks that you might want (e.g. updating counters).
Perhaps in admin
abbps_inject()
is executed twice for some reason? This might happen ifbbp_after_setup_actions
were called twice and would result in abbps notification actions being hooked twice. It’s been a while since I’ve worked with this code, so I’m not sure, but it’s something you could check. It would explain why removing all filters works, as removing all filters also removes the previously added abbps notification actions when called the second time. However, looking at thebbpress.php
code, there’s a singleton pattern that should preventbbp_after_setup_actions
from being run multiple times. Since you seem comfortable editing abbps code, you could modifyabbps_inject()
to log the call stack and see how often it’s being called during post approval and where it’s being called from.Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] notifications when user opens a post?I’m assuming you mean receiving a notification email when a user creates a new topic. That works out of the box. You just have to subscribe to a forum. Then, when a user creates a new thread in that forum, you should receive a notification email.
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Notifications not being sentHi @agrolsy, I’m sorry to hear this plugin isn’t working for you. Do you have any idea what changed on November 29th other than that emails stopped being sent?
If it turns out that my plugin requires updating, I’d recommend looking for alternatives, as I am not actively developing it at this time (though I’ll apply a patch if you got one).
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Change “reply to” email addressAh yes, it would seem you have copied my code from before I fixed it (or perhaps from a notification email). I hadn’t written WordPress code in a while and made a mistake that I quickly remedied (about a minute or so after first posting it), but apparently not quickly enough.
Please use the code from my first reply as it appears now and everything should be working as expected. Let me know should anything go awry again.
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Change “reply to” email addressNo problem. I’m glad I could help. ??
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Change “reply to” email addressSure, try this:
add_filter( 'bbp_subscription_email_from', function( $s ) { return '[email protected]'; }, 10, 1 );
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Works with WP Mail SMTP and SendGrid?This plugin works well with WP Mail SMTP since it uses the WordPress internal mailing system. It would only solve your problem if your current notification emails are being rejected by the mail server because of an overly long BCC list. Could you check SendGrid’s limitations on BCC recipients per email and how many subscribers are notified per email? If that’s not the problem, then this plugin will likely not solve it.
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] include post author in notifications?And thank you! ??
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] include post author in notifications?Hey Matt,
sorry for the delayed response. When I got the notification mail about your post, the message didn’t show up on the forums. I wasn’t sure whether it was delayed or deleted, and then I kind of forgot to check back until today.
Since the workaround code I posted above doesn’t seem to work for you (I haven’t tested it myself, but it looked like it could maybe work), I’ve added a filter for your use case. I didn’t plan on doing any further development on this plugin, but I’d rather not have you edit files directly just in case I do have to patch something important in the future. Plus, adding a filter is a quick job. Please upgrade the plugin to version 3.7 and add the following to your theme’s functions.php:
add_filter( 'bbp_forum_subscription_notify_author', '__return_true' );
No donation necessary, but thanks for offering. I’m glad I could help. If you insist, you can find a donation link in the header of the included readme.txt file or at the bottom of the right sidebar of this plugin’s page here on www.ads-software.com.
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] include post author in notifications?Hello,
sure there is a way to do this, although it would seem the post author already knows that they posted a new topic before they even get the notification email, so it’s not clear to me why you’d want to do this.
Also note that editing the code of plugins directly (as you did by commenting out those lines) is recommended against because when you update the plugin your changes will be overwritten. Better to use hooks.
Anyway, I’ve looked through the code and it would seem you could try adding the following to your theme’s functions.php file:
add_filter( 'bbp_forum_subscription_user_ids', function( $user_ids ) { $user_ids[] = bbp_get_forum_last_topic_author_id(); return $user_ids; }, 10, 1 );
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Notification sent twiceHere’s some troubleshooting advice in order of perceived likelihood of success:
Try disabling any caching plugin, see if that helps. If it does, try using real cron rather than the default WP-Cron “on page load” method. See the FAQ on the ABBPS plugin page.
Any theme or plugin that changes anything about bbPress, WP-Cron or WP email sending might be a good place to look. If you want to be sure, test by switching to the default theme and deactivating all plugins except for ABBPS and bbPress. If the issue appears to be fixed, re-enable them one by one. Caching should be the last to enable again.
There are no database tables to check. You could monitor the number of WP-Cron tasks created upon posting, see if maybe there are two for some reason.
Other than that, if you have some coding knowledge (or maybe there’s a plugin too), you could monitor the number of actions hooked to the action hooks
bbp_new_topic
andbbp_new_reply
(or one of them depending on where you get your duplicates). After bbPress is loaded up (more precisely on actionbbp_after_setup_actions
), ABBPS removes the originalbbp_notify_forum_subscribers
andbbp_notify_topic_subscribers
functions from their respective hooks and replaces them with its own version (name starting with “abbps_” instead of “bbp_”). You can see the code for this in fileasynchronous_bbpress-subscriptions.php
, lines 248ff. Now, a duplicate email being sent would occur if there are more than one function hooked to each of these actions.Happy debugging! ??
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Notification sent twiceDo you have any other plugins that might change the sending behavior of those emails?
Forum: Plugins
In reply to: [AsynCRONous bbPress Subscriptions] Is this plugin still being supported?Thanks, @usestrict. Not having tested your plugin I cannot vouch for it, but going by what you said, it does seem to address the same problem as abbps and might therefore be an alternative.
@mindylll, if there are no reasons (anti-features such as tracking, intrusive advertisement or such like) to avoid this other plugin, it might be worth a try. At least it seems to be actively developed – unlike my plugin. ??