{"action":"created","issue":{"url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/28","labels_url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/28/comments","events_url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/28/events","html_url":"https://github.com/boonebgorges/buddypress-group-email-subscription/issues/28","id":5860969,"number":28,"title":"Consider moving email sending to the 'shutdown' hook","user":{"login":"r-a-y","id":505921,"avatar_url":"https://avatars.githubusercontent.com/u/505921?v=3","gravatar_id":"","url":"https://api.github.com/users/r-a-y","html_url":"https://github.com/r-a-y","followers_url":"https://api.github.com/users/r-a-y/followers","following_url":"https://api.github.com/users/r-a-y/following{/other_user}","gists_url":"https://api.github.com/users/r-a-y/gists{/gist_id}","starred_url":"https://api.github.com/users/r-a-y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-a-y/subscriptions","organizations_url":"https://api.github.com/users/r-a-y/orgs","repos_url":"https://api.github.com/users/r-a-y/repos","events_url":"https://api.github.com/users/r-a-y/events{/privacy}","received_events_url":"https://api.github.com/users/r-a-y/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2012-07-26T18:42:14Z","updated_at":"2015-03-10T02:57:50Z","closed_at":null,"body":"For members who are subscribed to anything but a digest, GES currently sends emails as soon as the forum post is recorded.\n\nThis can slow down the performance of the server when posting especially when there are a lot of members subscribed to a topic or group.\n\nPerhaps we should look at moving this to the 'shutdown' hook or use wp_remote_post() to spawn a new process to send the emails?"},"comment":{"url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/comments/77987500","html_url":"https://github.com/boonebgorges/buddypress-group-email-subscription/issues/28#issuecomment-77987500","issue_url":"https://api.github.com/repos/boonebgorges/buddypress-group-email-subscription/issues/28","id":77987500,"user":{"login":"r-a-y","id":505921,"avatar_url":"https://avatars.githubusercontent.com/u/505921?v=3","gravatar_id":"","url":"https://api.github.com/users/r-a-y","html_url":"https://github.com/r-a-y","followers_url":"https://api.github.com/users/r-a-y/followers","following_url":"https://api.github.com/users/r-a-y/following{/other_user}","gists_url":"https://api.github.com/users/r-a-y/gists{/gist_id}","starred_url":"https://api.github.com/users/r-a-y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-a-y/subscriptions","organizations_url":"https://api.github.com/users/r-a-y/orgs","repos_url":"https://api.github.com/users/r-a-y/repos","events_url":"https://api.github.com/users/r-a-y/events{/privacy}","received_events_url":"https://api.github.com/users/r-a-y/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T02:57:50Z","updated_at":"2015-03-10T02:57:50Z","body":"Let's remove the cURL / stream transport filters in the meantime.\r\n\r\n> By \"group activity update\" do you mean an announcement via \"bp-group-announcements\"? \r\n\r\nThey are kind of the same thing.  I'm guessing your theme has removed the post form entirely from the group homepage.  Not a big deal.\r\n\r\n> New group announcement: no delay in page load, e-mails sent after 10s.\r\n> Comment on group activity update: no delay in page load, e-mails sent after 10s.\r\n\r\nIt's odd that you are experiencing a 10-second delay when posting a forum post, but not during group activity updates.  We need to figure out where the discrepancy lies.\r\n\r\nFor activity posting, you should be experiencing a 10-second delay before the AJAX response shows up in the browser.  Try reverting back to the GES master branch and add in the `sleep( 10 )` line and make a group activity update, then check your browser's inspector during the AJAX call.\r\n\r\nFor forum posts, can you verify that the delay is actually 10 seconds?  The delay might be unrelated to GES.  It could be that bbPress is attempting to send its own topic subscriptions to users.  GES doesn't interfere with people who are manually subscribed to a bbPress forum topic.  To test, create a new group with a forum and add some group members subscribed to \"All Mail\" and attempt the forum posting again.\r\n\r\nCan you also list the plugins you are using?\r\n\r\nYou can also potentially track where the delay lies with the [Query Monitor](https://wordpress.org/plugins/query-monitor/) plugin.\r\n\r\nThanks for the additional debugging, Chris!"}}