Configuring WP Engine Hosting

WP Engine offers a cloud-based, fully managed solution built specifically for hosting WordPress sites. In order to accomplish this they configure their servers in a very specific way and sometimes these configurations can interfere with MemberMouse. In order to ensure that MemberMouse works on your WP Engine server we suggest working with their support team to address the items outlined in this article.

NOTE: The MemberMouse support team has no insight or control over how your WP Engine server is configured so the quickest way to address any issues is to work directly with WP Engine Support. They have an internal checklist to go through to ensure their environment is configured correctly to support MemberMouse.

Configuring Caching


WP Engine uses fairly aggressive caching techniques that, unless accounted for, will cause issues with MemberMouse. This is a result of the nature of caching itself which takes a snapshot of pages and other resources the first time they're loaded and then on future requests pulls them from the cache instead of grabbing them from the server. This works great for static pages and resources but if a page has any sort of dynamic functionality, like a lot of your pages will when you're using MemberMouse, you'll end up delivering an incorrect experience to your customers.

You can control exceptions to the cache somewhat within your WPE dashboard. However, even with that configured, you should still contact WPE support and ask them to add “exceptions” to the “page cache” on your site. Specifically, you should exclude:
  • All of the MemberMouse Core Pages (i.e. login, checkout, my account, confirmation, member homepage, etc)
  • Any URLs associated with the particular payment services you're integrating with which can be found on the MemberMouse Payment Settings page (i.e. IPN callback URLs, silent post URLs, etc)
  • Any page where you use MemberMouse SmartTags.
  • Any page that should only be viewed by logged in members. e.g. if you have a /members/ section and aren’t showing excerpts to non-members.

Note that by default, WP Engine will not serve cached pages for logged-in members. So you shouldn’t have to add all member content to the exception list, just pages that might show dynamic content to logged out users. In general, you don’t want to add an exception unless you notice an issue on that page.

Here is an example request you can send to WP Engine support to have the exceptions added. Make sure that you swap out these URLs for your actual URLs.

Hello,

I am using the MemberMouse membership plugin on my site ([insert your URL here]). In order to properly process checkouts and protect member content, can you please add the following URLs to the exception list for the page cache?

[insert links here]

Thanks!

Using Content Delivery Network (CDN)


Enabling the content delivery network (CDN) on WP Engine’s platform prematurely could impact/add to the cache issue mentioned above. The suggested workflow would be to hold off on adding a CDN until MemberMouse is functioning as intended. When everything is up and running, adding the CDN should perform correctly.

Social Login


Social login requires that hosting providers support sessions. Not by design; its the 3rd party library we use internally to authenticate with the social network platforms that requires sessions.

WP Engine intentionally disable sessions.  This message board for another social login plugin that was having the same issue, and perhaps WP Engine may be able to enable sessions:

http://wordpress.org/support/topic/has-anyone-managed-to-make-it-work-with-wpengine-from-php-sessions-to-cookies

You will also have to ensure that WP Engine has remove cache for paths and query arguments for the following folders and files

Paths:
/wp-content/plugins/membermouse/

Query Arguments:
hauth.start

Limit Login Attempts


WP Engine installs their own limit login plugin in the mu-plugins directory as opposed to the normal plugins directory. This cannot be deactivated or removed. As a result, after a few attempts to login incorrectly, the account will be locked out for a set amount of time.

If you are comfortable editing php files, you can look to get around this by using the following code in the 2 files indicated. PLEASE NOTE: take a backup of your site before updating these files:

//-----------------------------------------------------------------------------
// wp-content/plugins/membermouse/hooks/class.userhooks.php
// starting at line 267
$required_plugin = "limit-login-attempts/limit-login-attempts.php";
$pluginActive = false;
            
// detect by function, not file to support mu-plugins
// if(in_array($required_plugin, $plugins))
if(function_exists('limit_login_setup'))
{
    $pluginActive = true;
}


//-----------------------------------------------------------------------------
// wp-content/plugins/membermouse/modules/limit_login_attempts.php
// starting at line 10
$required_plugin = "limit-login-attempts/limit-login-attempts.php";
$pluginActive = false;
 
// detect by function, not file to support mu-plugins
// if(in_array($required_plugin, $plugins))
if(function_exists('limit_login_setup'))
{
     $pluginActive = true;
}

Feedback and Knowledge Base