11<?php
22/*
33Plugin Name: WP Engine GeoIP
4- Version: 1.1.0
4+ Version: 1.1.1
55Description: Create a personalized user experienced based on location.
66Author: WP Engine
77Author URI: http://wpengine.com
@@ -94,16 +94,16 @@ public function setup() {
9494
9595 $ this ->geoip_path = plugin_dir_path ( __FILE__ );
9696
97+ // Get our array of countries and continents
98+ require_once ( $ this ->geoip_path . '/inc/country-list.php ' );
99+
100+ $ this ->countries = apply_filters ( 'geoip_country_list ' , geoip_country_list () );
101+
97102 $ this ->geos = $ this ->get_actuals ();
98103
99104 $ this ->geos = $ this ->get_test_parameters ( $ this ->geos );
100105
101106 $ this ->geos = apply_filters ( 'geoip_location_values ' , $ this ->geos );
102-
103- // Get our array of countries and continents
104- require_once ( $ this ->geoip_path . '/inc/country-list.php ' );
105-
106- $ this ->countries = apply_filters ( 'geoip_country_list ' , geoip_country_list () );
107107 }
108108
109109 /**
@@ -449,6 +449,11 @@ function do_shortcode_content( $atts, $content = null ) {
449449 // find out if the value is comma delimited
450450 $ test_values = (array ) explode ( ', ' , $ value );
451451
452+ // If we're checking for a negative, we need to start with TRUE
453+ if ( $ negate ) {
454+ $ keep = TRUE ;
455+ }
456+
452457 // Let's run through the test values and see if we get a match
453458 foreach ( $ test_values as $ test_value ) {
454459
@@ -459,8 +464,8 @@ function do_shortcode_content( $atts, $content = null ) {
459464 $ keep = TRUE ;
460465 }
461466
462- if ( $ negate && $ match_value ! = $ test_value ) {
463- $ keep = TRUE ;
467+ if ( $ negate && $ match_value = = $ test_value ) {
468+ $ keep = FALSE ;
464469 }
465470 }
466471 }
@@ -477,9 +482,11 @@ function do_shortcode_content( $atts, $content = null ) {
477482 * @since 0.5.0
478483 */
479484 public function action_admin_init_check_plugin_dependencies () {
480- // Check to see if the environment variables are present
485+ // Check to see if we're in a development environment or the environment variables are present
481486 $ is_wpe = getenv ( 'HTTP_GEOIP_COUNTRY_CODE ' );
482- if ( ! isset ( $ is_wpe ) || empty ( $ is_wpe ) ) {
487+ $ is_dev = preg_match ( '/^(.*)(\.dev)$|^(.*)(staging.wpengine.com)$/ ' , get_site_url () );
488+
489+ if ( 1 != $ is_dev && ( ! isset ( $ is_wpe ) || empty ( $ is_wpe ) ) ) {
483490 $ this ->admin_notices [] = __ ( 'Please note - this plugin will only function on your <a href="http://wpengine.com/plans/?utm_source= ' . self ::TEXT_DOMAIN . '">WP Engine account</a>. This will not function outside of the WP Engine environment. Plugin <b>deactivated.</b> ' , self ::TEXT_DOMAIN );
484491 }
485492 unset( $ is_wpe );
0 commit comments