Disable New Relic at AMP in wp-ffpc-acache.php

Prevent New Relic from inserting JS code into an Accelerated Mobile Pages (AMP). This is required to get valid AMP code.

References:
https://www.ampproject.org with https://wordpress.org/plugins/amp/
http://newrelic.com
This commit is contained in:
Lars Schenk 2016-03-20 14:48:00 +01:00
parent d09fa5828b
commit aad6ebbed1

View file

@ -41,6 +41,13 @@ if (!isset($wp_ffpc_config)) {
/* request uri */
$wp_ffpc_uri = $_SERVER['REQUEST_URI'];
/* disable New Relic at AMP */
if (stripos($wp_ffpc_uri, '/amp/')) {
if (extension_loaded('newrelic')) {
newrelic_disable_autorum();
}
}
/* no cache for robots.txt */
if ( stripos($wp_ffpc_uri, 'robots.txt') ) {
__wp_ffpc_debug__ ( 'Skippings robots.txt hit');