Hello, PremiumPetware,
Thank you for the details you provided! We really appreciate your work and the time spent for searching such a solution you’ve found!
Our XStore AMP plugin does not add extra endpoints in URL such as http://yourwebsite.com?amp but leave only The Craziest & Most Affordable Hosting Deal Ever! with all conditions for checking if it is mobile device left from code side. We use wp_is_mobile() wordpress function for detecting if customer comes from mobile device. So it means that your solution is not best for making it fixed in common with XStore AMP plugin. But we can suggest you try next one (a bit modified) code but we cannot guarantee it 100% helps you:
if (function_exists('wp_is_mobile') && wp_is_mobile()) {
header('HTTP/1.0 301 Moved Permanently');
// Name transaction "redirect" in New Relic for improved reporting (optional).
if (extension_loaded('newrelic')) {
newrelic_name_transaction("redirect");
}
exit();
}
Kind Regards,
8theme team