Hi @robertskiba
Thanks for your kind words and the offer to translate the plugin.
I’ve had a look into offering FQDN functionality, but I’m afraid that I don’t think it’s going to be possible to add it to the plugin.
The reason is that this information is not always part of the $_SERVER
global. The documentation does say that there is a 'REMOTE_HOST'
variable, but that it is not on by default and the server must be configured to provide it.
There is the gethostbyaddr()
PHP function to fetch that information via the IP address, but my reading on the subject has found that it can put quite a heavy load on a site, especially if the DNS for the hosting environment is not properly configured. This could cause long page loads and even timeout failures. This is probably why 'REMOTE_HOST'
is turned off by default.
My own testing has also shown that gethostbyaddr()
doesn’t always work – for my own (hosted) server, it only ever gave me back the IP address that I had given it!!
So, sorry to disappoint, but I think it would add too much possibility for causing problems for the end user of the plugin.
However, that’s not to say that you couldn’t do it yourself by using the wpjf3_matches
hook and writing your own function to test for it. If your server is configured to supply it you can test $_SERVER['REMOTE_HOST']
or, if not, you could use gethostbyaddr(
$_SERVER['REMOTE_ADDR']
)
For example (I haven’t tested this):
function my_wpjf3_fqdn_matches( $wpjf3_matches ) {
$remote_fqdn = isset( $_SERVER[ 'REMOTE_HOST' ] ) ? $_SERVER[ 'REMOTE_HOST' ] : gethostbyaddr( $_SERVER[ 'REMOTE_ADDR' ] );
$my_fqdn = "mydomain.dyndns.org";
if ( !empty( $remote_fqdn ) ) {
if ( stristr( $remote_fqdn, $my_fqdn ) )
$wpjf3_matches[] = "<!-- FQDN -->";
}
return $wpjf3_matches;
}
add_filter( "wpjf3_matches", "my_wpjf3_fqdn_matches" );