Skip to content

Conversation

@carstingaxion
Copy link

This PR removes the dependency for the WP default constant DOMAIN_CURRENT_SITE and introduce an new one called NSDU_URL, that everybody can use safely.

The most easy way would be to define( 'NSDU_URL', DOMAIN_CURRENT_SITE ); in the wp-config.php

This has 2 benefits:

  1. The default constant could be used different from default, what could cause Problems, while using it for the DB updates. In example if it was set dynamically like this:
if ( isset( $_SERVER['X_FORWARDED_HOST'] ) && !empty( $_SERVER['X_FORWARDED_HOST'] ) ) {
	$hostname = $_SERVER['X_FORWARDED_HOST'];
} else {
	$hostname = $_SERVER['HTTP_HOST'];
}
define( 'DOMAIN_CURRENT_SITE', rtrim($hostname, '/') );
  1. By not defining the new constant, e.g. on production sites, the Plugin would stop its work earlier and so be faster at all, while not doing its first DB hit.

btw

Thank you very much, for your nice work and also for publishing it.

Carsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant