From dc83600743237336af45a2737da937ff6a2bbfea Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Mon, 12 Feb 2024 13:39:12 +0200 Subject: [PATCH] Do not use hardcoded domain name --- inc/class-plugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/class-plugin.php b/inc/class-plugin.php index e71efbe..79e0897 100644 --- a/inc/class-plugin.php +++ b/inc/class-plugin.php @@ -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;