Refactored domain check

TODO: make the same for BuddyPress and WooCommerce