diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 4cb519b9..b68a1ee4 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -17421,23 +17421,22 @@ function get_opt_in_params( $override_with = array(), $network_level_or_blog_id $versions = $this->get_versions(); $params = array_merge( $versions, array( - 'user_firstname' => $current_user->user_firstname, - 'user_lastname' => $current_user->user_lastname, - 'user_nickname' => $current_user->user_nicename, - 'user_email' => $current_user->user_email, - 'user_ip' => WP_FS__REMOTE_ADDR, - 'plugin_slug' => $this->_slug, - 'plugin_id' => $this->get_id(), - 'plugin_public_key' => $this->get_public_key(), - 'plugin_version' => $this->get_plugin_version(), - 'return_url' => fs_nonce_url( $return_url, $activation_action ), - 'account_url' => fs_nonce_url( $this->_get_admin_page_url( + 'user_firstname' => $current_user->user_firstname, + 'user_lastname' => $current_user->user_lastname, + 'user_email' => $current_user->user_email, + 'plugin_slug' => $this->_slug, + 'plugin_id' => $this->get_id(), + 'plugin_public_key' => $this->get_public_key(), + 'plugin_version' => $this->get_plugin_version(), + 'return_url' => fs_nonce_url( $return_url, $activation_action ), + 'account_url' => fs_nonce_url( $this->_get_admin_page_url( 'account', array( 'fs_action' => 'sync_user' ) ), 'sync_user' ), - 'is_premium' => $this->is_premium(), - 'is_active' => true, - 'is_uninstalled' => false, + 'is_premium' => $this->is_premium(), + 'is_active' => true, + 'is_uninstalled' => false, + 'is_localhost' => WP_FS__IS_LOCALHOST, ) ); if ( $this->is_addon() ) { diff --git a/includes/fs-essential-functions.php b/includes/fs-essential-functions.php index 69466a8b..0c466256 100644 --- a/includes/fs-essential-functions.php +++ b/includes/fs-essential-functions.php @@ -151,31 +151,19 @@ function fs_kses_no_null( $string ) { if ( ! function_exists( 'fs_get_ip' ) ) { /** - * Get client IP. - * + * Get server IP. + * + * @since 2.5.1 This method returns the server IP. + * * @author Vova Feldman (@svovaf) * @since 1.1.2 * * @return string|null */ function fs_get_ip() { - $fields = array( - 'HTTP_CF_CONNECTING_IP', - 'HTTP_CLIENT_IP', - 'HTTP_X_FORWARDED_FOR', - 'HTTP_X_FORWARDED', - 'HTTP_FORWARDED_FOR', - 'HTTP_FORWARDED', - 'REMOTE_ADDR', - ); - - foreach ( $fields as $ip_field ) { - if ( ! empty( $_SERVER[ $ip_field ] ) ) { - return $_SERVER[ $ip_field ]; - } - } - - return null; + return empty( $_SERVER[ 'SERVER_ADDR' ] ) ? + null : + $_SERVER[ 'SERVER_ADDR' ]; } }