Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress Ajax/Post Calls very slow when it sends emails


  • nikitagrimm
    Participant

    @nikitagrimm

    Hey there,

    So Buddypress seems to have an issue on my Server/Website in sending Emails. It always takes around 30 seconds or more for the Ajax Request, created when sending a message to another user or a user signing up, to return.

    What I’ve done is disable notifications from the user I’m sending the emails to and then sent him a message. This message went through instantly, so I’ve deduced it must have something to do with Buddypress sending emails. What also happens is that during this time, I’m unable to access the website from another browser tab either. So this might have something to do with server settings (Ubuntu 16.04, Apache2, Php 7.0, MySQL).

    I do use the WP-Mail-SMTP plugin to send the mail through gmail, but the issue persisted even when deactivating the plugin. The WP-Mail-SMTP plugin sends out its test emails instantly though.

    I hope you guys can help me fix it, because it currently really hurts the user experience and I would be really grateful if you do.

    Thanks in advance,
    Nikita Grimm

    Issue also occures with Twenty Seventeen
    http://www.redvaluegaming.com
    Wordpress 4.7.5
    Buddypress 2.8.2

Viewing 6 replies - 1 through 6 (of 6 total)

  • r-a-y
    Keymaster

    @r-a-y

    I’ve noticed similar things myself.

    Can you see if the following helps?

    Add this code-snippet to wp-content/plugins/bp-custom.php file?

    remove_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20, 4 );

    remove_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 );


    nikitagrimm
    Participant

    @nikitagrimm

    Thanks for the answer and I’m glad I’m not alone with the problem.
    Those snippets unfortunately didn’t help, it still took around 30 seconds for the system to send a message.


    r-a-y
    Keymaster

    @r-a-y

    If you are using SMTP, you might want to try changing the port from 25 to 587 or whatever the alternative port is if your email provider supports an alternative.

    Also, this is probably very relevant:
    https://stackoverflow.com/a/31480796


    nikitagrimm
    Participant

    @nikitagrimm

    Unfortunately that can’t be it, since it is also this slow if I set wordpress to use phpmail instead. I have already tried TLS over SSL and different ports too.

    Also, the WP-Mail-SMTP plugin has a function to send out test emails and those are sent instantly.

    I really hope we can find the error to this. Thanks for your answers though.


    nikitagrimm
    Participant

    @nikitagrimm

    Ok there, I finally figured out the problem. It turns out that the is_email() function built into WordPress is extremely slow and takes around 6 seconds to compute. Since Buddypress used the function quite leisurely, the amount of time it took to send emails ended up being quite long.

    Unfortunately a simple filter wasn’t enough, as WordPress was still processing the old function. I have removed the function and the problem is therefore “fixed”. Actually “applying a bandaid” is the more appropriate term here.

    I’m going to report a bug to WordPress asap now. Thanks for your attempts at helping me though! However, if you do have an idea why the function is so slow I would be very glad to hear it!


    Kpkna
    Participant

    @kpkna

    Hello,
    did somebody manange to fix this? I have the same problem.

    Thank you in advance for you answers.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Buddypress Ajax/Post Calls very slow when it sends emails’ is closed to new replies.
Skip to toolbar