Created
August 4, 2013 20:59
-
-
Save peterchester/6151924 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: New Relic Config | |
Plugin URI: http://tri.be | |
Description: Configures New Relic | |
Author: Modern Tribe, Inc. | |
Author URI: http://tri.be | |
Version: 1.0 | |
*/ | |
/** | |
* See https://newrelic.com/docs/php/the-php-api | |
*/ | |
if ( extension_loaded('newrelic') ) { | |
if ( defined('DOING_CRON') && DOING_CRON ) { | |
tribe_newrelic_separate_cron(); | |
} | |
add_action('init', 'tribe_newrelic_separate_admin', 10, 0); | |
} | |
function tribe_newrelic_separate_cron() { | |
if ( function_exists('newrelic_set_appname') ) { | |
newrelic_set_appname('website cron'); | |
} | |
} | |
function tribe_newrelic_separate_admin() { | |
if ( function_exists('newrelic_set_appname') && is_user_logged_in() ) { | |
newrelic_set_appname('website admin'); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment