I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Claim not working

dashed-slug.net Forums Faucet extension support Claim not working Reply To: Claim not working

#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