diff --git a/composer.lock b/composer.lock index 84cc1c4..30d6c69 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/afragen/autoloader.git", - "reference": "ec56498d42f0694d3ad1207a496bf69cbb0ebc2f" + "reference": "ab30ab542c48fe3ecd26c3bda28fef544f04b401" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/afragen/autoloader/zipball/ec56498d42f0694d3ad1207a496bf69cbb0ebc2f", - "reference": "ec56498d42f0694d3ad1207a496bf69cbb0ebc2f", + "url": "https://api.github.com/repos/afragen/autoloader/zipball/ab30ab542c48fe3ecd26c3bda28fef544f04b401", + "reference": "ab30ab542c48fe3ecd26c3bda28fef544f04b401", "shasum": "" }, "require": { @@ -43,9 +43,9 @@ ], "support": { "issues": "https://github.com/afragen/autoloader/issues", - "source": "https://github.com/afragen/autoloader/tree/master" + "source": "https://github.com/afragen/autoloader/tree/3.0.0" }, - "time": "2024-11-10T22:55:51+00:00" + "time": "2024-11-27T02:42:42+00:00" }, { "name": "afragen/translations-updater", diff --git a/includes/class-admin-settings.php b/includes/class-admin-settings.php index c82a113..4158eb6 100644 --- a/includes/class-admin-settings.php +++ b/includes/class-admin-settings.php @@ -324,7 +324,7 @@ public function admin_enqueue_scripts( $hook ) { [ 'ajax_url' => network_admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'aspireupdate-ajax' ), - 'domain' => Utilities::get_top_level_domain(), + 'domain' => Utilities::get_site_domain(), 'line_ending' => PHP_EOL, 'unexpected_error' => esc_html__( 'Unexpected Error', 'aspireupdate' ), ] diff --git a/includes/class-utilities.php b/includes/class-utilities.php index 4fe4bdf..e152c68 100644 --- a/includes/class-utilities.php +++ b/includes/class-utilities.php @@ -11,17 +11,14 @@ * The Class for Admin Settings Page and functions to access Settings Values. */ class Utilities { - /** - * Get the top level domain name from the site URL. + * Get the domain name from the site URL. * - * @return string the top level domain name. + * @return string The domain name. */ - public static function get_top_level_domain() { - $site_url = get_site_url(); - $domain_name = wp_parse_url( $site_url, PHP_URL_HOST ); - $domain_parts = explode( '.', $domain_name ); - return sanitize_text_field( implode( '.', array_slice( $domain_parts, -2 ) ) ); + public static function get_site_domain() { + $site_url = network_site_url(); + return wp_parse_url( $site_url, PHP_URL_HOST ); } /**