Plugin Directory

Changeset 1933357


Ignore:
Timestamp:
08/30/2018 07:08:50 PM (7 years ago)
Author:
collinsinternet
Message:

Version 1.3

Location:
wp-newrelic/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-newrelic/trunk/classes/class-wp-nr-apm.php

    r1867767 r1933357  
    2828            add_action( 'admin_init', array( $this, 'set_admin_transaction' ) );
    2929        } else {
     30            add_action( 'pre_get_posts', array( $this, 'sitemap_check' ), 1 );
    3031            add_action( 'wp', array( $this, 'set_wp_transaction' ) );
    3132            add_action( 'rest_api_init', array( $this, 'set_wp_transaction' ) );
     
    8687            if ( is_user_logged_in() ) {
    8788                $user = wp_get_current_user();
    88                 newrelic_set_user_attributes( $user->ID, '', array_shift( $user->roles ) );
     89                if ( isset( $user->roles[0] ) ) {
     90                    newrelic_set_user_attributes( $user->ID, '', $user->roles[0] );
     91                } else {
     92                    newrelic_set_user_attributes( $user->ID, '', 'no-role' );
     93                }
    8994            } else {
    9095                newrelic_set_user_attributes( 'not-logged-in', '', 'no-role' );
     
    137142        } elseif ( is_front_page() ) {
    138143            $transaction = 'Front Page';
    139         } elseif ( is_home() ) {
     144        } elseif ( is_home() && false === get_query_var( 'sitemap', false ) ) {
    140145            $transaction = 'Blog Page';
    141146        } elseif ( is_single() ) {
     
    179184
    180185        $transaction = apply_filters( 'wp_nr_transaction_name', $transaction );
     186
    181187        if ( ! empty( $transaction ) ) {
    182188            newrelic_name_transaction( $transaction );
     189        }
     190    }
     191
     192    /**
     193     * Set current transaction name to Sitemap if it is a sitemap.
     194     *
     195     * @access public
     196     * @action pre_get_posts
     197     *
     198     * @param WP_Query $query The main query.
     199     */
     200    public function sitemap_check( $query ) {
     201        // do nothing if function doesn't exist.
     202        if ( ! function_exists( 'newrelic_name_transaction' ) ) {
     203            return;
     204        }
     205
     206        if ( get_query_var( 'sitemap', false ) ) {
     207            newrelic_name_transaction( 'Sitemap' );
    183208        }
    184209    }
  • wp-newrelic/trunk/newrelic-reporting-for-wordpress.php

    r1868221 r1933357  
    44 * Plugin Name: New Relic Reporting for WordPress
    55 * Description: New Relic APM reports for WordPress
    6  * Version:     1.2
     6 * Version:     1.3
    77 * Author:      10up
    88 * Author URI:  https://10up.com
  • wp-newrelic/trunk/readme.txt

    r1867767 r1933357  
    11=== New Relic Reporting for WordPress ===
    2 Contributors: rittesh.patel, tott, 10up
     2Contributors: rittesh.patel, tott, 10up, oscarssanchez
    33Tags: New Relic, New Relic Reporting, New Relic APM Reporting, APM Reporting
    44Requires at least: 4.0
    5 Tested up to: 4.9.5
    6 Stable tag: 1.2
     5Tested up to: 4.9.8
     6Stable tag: 1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    106106== Changelog ==
    107107
     108= 1.3 =
     109* Bug fixes with Beaver Builder (props oscarssanchez)
     110* Support for Yoast SEO Sitemaps.
     111
     112
    108113= 1.2 =
    109114* Add support for REST API requests (props Rahe)
Note: See TracChangeset for help on using the changeset viewer.