Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP: Add connection button on admin settings page #40

Open
r-a-y opened this issue Jul 20, 2013 · 0 comments
Open

IMAP: Add connection button on admin settings page #40

r-a-y opened this issue Jul 20, 2013 · 0 comments

Comments

@r-a-y
Copy link
Owner

r-a-y commented Jul 20, 2013

A connection button on the admin settings page would help in invoking the IMAP connection instead of relying on a pageload to trigger the IMAP connection.

@r-a-y r-a-y changed the title Add test connection button on admin settings page IMAP: Add test connection button on admin settings page May 31, 2016
r-a-y added a commit that referenced this issue Mar 8, 2017
If auto-connect is off, we'll rely on the old "page load to spawn inbox
check" method.

If auto-connect is on, we're going to be using the auto-connect admin option
to manually ping the IMAP inbox from the admin settings page.  This will
prevent duplicate IMAP connections from occurring and will also workaround
using wp_remote_post() to spawn the inbox check.  This logic will be
added in subsequent commits.

See #40.
r-a-y added a commit that referenced this issue Mar 8, 2017
… enabled.

If IMAP mode is selected and if "Automatically reconnect?" is checked and
if we are not connected to the inbox, a "Connect" button will appear in
the "Connection Info" block.

Clicking on this button will connect to the IMAP inbox.

See #40.
@r-a-y r-a-y changed the title IMAP: Add test connection button on admin settings page IMAP: Add connection button on admin settings page Mar 11, 2017
r-a-y added a commit that referenced this issue Mar 11, 2017
Previously, commit 2b54149 didn't add a timeout, so the AJAX request would
hang forever.  Since we do not need to wait for a response, this commit
adds a timeout to stop the AJAX request from continuing.

See #40.
r-a-y added a commit that referenced this issue Mar 11, 2017
… fetch the error.

In order to fetch the error, we need to revoke the IMAP connection to
grab the error for output.

See #40.
r-a-y added a commit that referenced this issue Mar 11, 2017
…l we've finished connecting.

In cases where the IMAP connection check is taking awhile, this commit
ensures that we keep checking the connection status until the connection
check is completed.

See #40.
r-a-y added a commit that referenced this issue Mar 11, 2017
r-a-y added a commit that referenced this issue Mar 14, 2017
…ession.

This only occurs if a 3rd-party plugin is opening a PHP session with
session_start() without closing the session properly.  What happens if the
session isn't closed is all subsequent AJAX responses and browser requests
will hang since our IMAP inbox check is still running in the background.

Thanks to this Stack Overflow article for helping me out:
http:https://stackoverflow.com/a/9906646

If you wrote a plugin that does this, you are forever on my naughty list.
Thanks for wasting my precious time!

See #40.
r-a-y added a commit that referenced this issue Mar 20, 2017
…connection is down.

When auto-connect is enabled, there are occasions where the IMAP connection
can be disconnected such as if GMail is acting up or if the server that
WordPress is hosted on is down.  When this happens, the IMAP connection
needs to be reinitiated from the RBE admin settings page since IMAP
connections can only be initiated from the admin area when the auto-connect
option is on.

To counteract this, this commit adds an hourly check to see if the IMAP
connection is active.  If not connected, an email is sent to the site admin
by default to prompt the person to re-enable the IMAP connection on the RBE
admin settings page.  A filter exists to change the email recipients.

See #40.
r-a-y added a commit that referenced this issue Jun 13, 2017
Previously, our cron event was only scheduled when connecting to the IMAP
inbox on the initial connection.  However, if our IMAP connection ever
dies, our cron event is never rescheduled, so admins would never know if
the IMAP connection needs to be restarted or not.

This commit always checks to register our cron event to ensure admins can
restart the IMAP connection when needed.

See #40.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant