Hi,
I think the code for this form has been updated since I first found the solution a year ago, so the fix is a little different now. First you will probably need to restore the section that you edited:
$this->meta = array(
‘remote_ip’ => $this->get_remote_ip_addr(),
‘user_agent’ => isset( $_SERVER[‘HTTP_USER_AGENT’] )
? substr( $_SERVER[‘HTTP_USER_AGENT’], 0, 254 ) : ”,
‘url’ => preg_replace( ‘%(?<!:|/)/.*$%’, ”,
untrailingslashit( home_url() ) ) . wpcf7_get_request_uri(),
‘timestamp’ => current_time( ‘timestamp’ ),
‘unit_tag’ =>
isset( $_POST[‘_wpcf7_unit_tag’] ) ? $_POST[‘_wpcf7_unit_tag’] : ”,
);
Next, go to this section below, and make sure it looks like this (changes are in bold):
private function get_remote_ip_addr() {
if ( isset( $_SERVER[‘HTTP_X_FORWARDED_FOR‘] )
&& WP_Http::is_ip_address( $_SERVER[‘HTTP_X_FORWARDED_FOR‘] ) ) {
return $_SERVER[‘HTTP_X_FORWARDED_FOR‘];
}
That should work. Let me know if you want more help.