dashed-slug.net › Forums › Faucet extension support › Claim not working › Reply To: Claim not working
June 8, 2020 at 12:01 pm
#8544
alexg
Keymaster
In addition to the above, it is possible that the issue has something to do with CloudFlare. I’ve never used it and the code is not tested for it.
After trying all of the above, please edit the file wp-content/plugins/wallets-faucet/includes/claim.php
. Try changing this function:
private static function get_remote_ip() {
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
return $_SERVER['HTTP_X_FORWARDED'];
} elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
return $_SERVER['HTTP_FORWARDED_FOR'];
} elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
return $_SERVER['HTTP_FORWARDED'];
} elseif ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) {
return $_SERVER['HTTP_X_REAL_IP'];
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $_SERVER['REMOTE_ADDR'];
}
to the following:
private static function get_remote_ip() {
return $_SERVER['REMOTE_ADDR'];
}
And try another claim.
This will use CloudFlare’s IP rather than the host IP in the captcha request. If this works, let me know and I will fix this in the next patch release for the faucet.
Hope this helps. Please let me know what you found.
with regards