Skip to content

Instantly share code, notes, and snippets.

@peterchester
Created August 4, 2013 20:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterchester/6151924 to your computer and use it in GitHub Desktop.
Save peterchester/6151924 to your computer and use it in GitHub Desktop.
<?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