Skip to content

Commit

Permalink
Do not use hardcoded domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Feb 12, 2024
1 parent 70b394f commit dc83600
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function wp_sitemaps_enabled( $is_enabled ): bool {
if ( $is_enabled && ! empty( $_SERVER['HTTP_HOST'] ) && is_string( $_SERVER['HTTP_HOST'] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$host = strtolower( $_SERVER['HTTP_HOST'] );
$is_enabled = 'myrotvorets.center' === $host || is_user_logged_in();
$domain = defined( 'MYROTVORETS_PRIMARY_DOMAIN' ) ? (string) MYROTVORETS_PRIMARY_DOMAIN : 'myrotvorets.center';
$is_enabled = $domain === $host || is_user_logged_in();
}

return (bool) $is_enabled;
Expand Down

0 comments on commit dc83600

Please sign in to comment.