Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Theme Author WP Engine

    (@wpengine)

    We really appreciate the review and support!

    Theme Author WP Engine

    (@wpengine)

    Appreciate the review, GhostMaster!

    Theme Author WP Engine

    (@wpengine)

    Thanks for the kind words, Syed. Much appreciated!

    Plugin Author WP Engine

    (@wpengine)

    Could you provide your WP Engine install name so I can take a look at your site to troubleshoot.

    Plugin Author WP Engine

    (@wpengine)

    Happy to help! Glad we got you taken care of! I’m marking this as resolved. Thanks for using WP Engine!

    Plugin Author WP Engine

    (@wpengine)

    Hi smattiza,

    I’m not quite sure what exclusions you are requesting. I think that’s the disconnect here.

    GeoIP is built with caching buckets to serve pages with geographic specificity, you want these even if you implement the cookie solution you mentioned here. So the only caching exclusion you need is the cookie caching exclusion. You can only setup caching buckets for one variable, I recommend having city caching buckets, as you want to cache at the smallest unit of measure you use.

    Ask support to add a cookie caching exclusion for the specific name of the cookie you are setting. You only want to serve the uncached page if the cookie is set, and you only want to set that cookie if a user explicitly sets a preferred location. Otherwise you are essentially never caching a page, which won’t be good for page performance.

    Plugin Author WP Engine

    (@wpengine)

    Howdy Smattiza,

    There should be nothing preventing you from storing a users location in a cookie and keying off of that going forward. Do note that custom code is outside the scope of support for WP Engine.

    Assuming you stored location data in a cookie, you would need to update your GeoIP implementation to first check the cookie and do something and then skip the GeoIP data. You may need to contact support to have a cache exclusion put in place for that cookie, so asking for a “cookie based caching exclusion”

    Here’s some sudo code:

    if (user sets preferred location) {
    set cookie with that value
    };
    if (cookie present) {
    Read cookie value and do something
    } else {
     read value from geoip and do something
    };
    Plugin Author WP Engine

    (@wpengine)

    Howdy Erumite!

    Thanks for checking out the plugin. As listed on Other Notes section, we do support WPCLI.

    We do have an open bug where WPCLI doesn’t work for some CLI versions. We are still investigating that issue.

    Plugin Author WP Engine

    (@wpengine)

    Realistically there won’t be any real noticeable performance difference between these, the method we recommended is slightly safer as it ensures that GeoIP is properly instantiated and the plugin is running. Because GeoIP runs server side and works with our caching layer, there should not be any real performance degradation when using GeoIP.

    Plugin Author WP Engine

    (@wpengine)

    Oops, one change to to ensure your function doesn’t throw an error if GeoIP gets disabled:

    $country = null;
    
    if ( class_exists( 'WPEngine\GeoIp' ) ) {
    ??$geo = WPEngine\GeoIp::instance();
    ??$country = $geo->country();
    }
    
    switch ($country) {
    ??case 'CA':
    ????# code...
    ????break;
    ??
    ??default:
    ????# code...
    ????break;
    }
    Plugin Author WP Engine

    (@wpengine)

    Howdy Waqas!

    We use GeoIP on our marketing site, here’s how we call GeoIP directly in our theme code:

    if ( class_exists( 'WPEngine\GeoIp' ) ) {
    ??$geo = WPEngine\GeoIp::instance();
    ??$country = $geo->country();
    }
    
    switch ($country) {
    ??case 'CA':
    ????# code...
    ????break;
    ??
    ??default:
    ????# code...
    ????break;
    }

    We do recommend having a default case to catch any cases where GeoIP couldn’t determine a country, or otherwise gives back unexpected content. You can of course define this in a custom function in your theme to make calling it inline more semantic.

    Plugin Contributor WP Engine

    (@wpengine)

    I’m sorry to hear you had trouble, I’m emailing you direction to find out details about your multisite so we can try replicating the issue. We definitely want our migration tool to work with multisites. I’ll leave this issue open until we have investigated this issue.

    Plugin Contributor WP Engine

    (@wpengine)

    Apologies for the delay. Yes, our testing has shown that our Automated Migration tool does indeed work for both subdirectory and subdomain multisites.

    If you find that this is not the case, please reach out and we will investigate, but it should work.

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