What are the potential risks of leaving phpMyAdmin accessible through both server URL and domain URL?

Leaving phpMyAdmin accessible through both the server URL and domain URL increases the attack surface and potential for unauthorized access to the database. To mitigate this risk, it is recommended to restrict access to phpMyAdmin to a specific IP address or range.

// Restrict access to phpMyAdmin to a specific IP address or range
if ($_SERVER['REMOTE_ADDR'] !== 'xxx.xxx.xxx.xxx') {
    die('Access denied');
}