• EnglishEspañol日本語한국어Português
  • Log inStart now

WordPress Full Stack integration

Our WordPress integration monitors the performance of your WordPress web application, helping you diagnose issues in your application and optimize your code. Our WordPress integration makes use of our PHP, Apache, and MySQL integrations, and gives you a pre-built dashboard with your most important WordPress metrics like transactions, visitors, and call duration.

After setting up our WordPress integration, we give you a dashboard for your WordPress metrics.

Install

Install the infrastructure agent

You can install the infrastructure agent two different ways:

Install the PHP agent

  1. Check out our PHP agent requirements before installing the agent.
  2. Open the PHP quickstart installation.
  3. Click Install now to start the PHP agent installation.

Install the MySQL quickstart

  1. Check out our MySQL requirements.
  2. Open MySQL quickstart installation.
  3. Click Install now to start the MySQL agent installation.

Install the Apache quickstart

  1. Check out our Apache requirements.
  2. Open the Apache quickstart installation.
  3. Click Install now to start the Apache agent installation.

Configure NRI-Flex for WordPress

Flex comes bundled with the New Relic infrastructure agent. To create a flex configuration file follow these steps:

  1. Create a file named read-wordpress-files-config.yml in this path:

    bash
    $
    /etc/newrelic-infra/integrations.d
  2. Update the read-wordpress-files-config.yml with these details:

    • INSERT_EVENT_TYPE. An event_type is a New Relic database table that you can query using NRQL. An example of event_type would be WPDirectories
    • INSERT_WORDPRESS_PATH. Here, you need to enter the directory for your WordPress application, like: /srv/www/wordpress/*.
  3. Use this configuration file:

    integrations:
    - name: nri-flex
    interval: 180s
    config:
    name: linuxDirectorySize
    apis:
    - event_type: INSERT_EVENT_TYPE
    commands:
    - run: du INSERT_WORDPRESS_PATH
    split: horizontal
    set_header: [dirSizeKB, dirName]
    regex_match: true
    split_by: (\d+)\s+

Configure WordPress to expose debug logs

  1. Open your WordPress application and then open the wp-config.php file.

  2. Update the file with the values listed below:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );

Once you start your application, you will see a debug.log file in the wp-content directory.

Forward WordPress debug logs to New Relic

You can use our log forwarding to forward WordPress logs to New Relic.

On Linux machines, your log file named logging.yml should be present in this path:

bash
$
/etc/newrelic-infra/logging.d/

After creating the log file, add the following script to the logging.yml file:

logs:
- name: wordpress-debug.log
file: /src/www/wordpress/wp-content/debug.log
attributes:
logtype: wordpress_debug

Restart the infrastructure agent

Before you can start reading your data, use the instructions in our infrastructure agent docs to restart your infrastructure agent.

bash
$
sudo systemctl restart newrelic-infra.service

In a couple of minutes, your application will send metrics to one.newrelic.com.

Find your data

You can choose our pre-built dashboard template named WordPress Full Stack to monitor your WordPress application metrics. Follow these steps to use our pre-built dashboard template:

  1. From one.newrelic.com, go to the + Add data page.
  2. Click on Dashboards.
  3. In the search bar, type WordPress Full Stack.
  4. The WordPress dashboard should appear. Click on it to install it.

Your WordPress dashboard is considered a custom dashboard and can be found in the Dashboards UI. For docs on using and editing dashboards, see our dashboard docs.

Here's an example NRQL query to check the delay for interaction to next paint (INP):

SELECT percentage(count(*),
WHERE interactionToNextPaint < 200)
AS 'Good (<100ms)', percentage(count(*),
WHERE interactionToNextPaint >= 200 and interactionToNextPaint < 500)
AS 'Needs improvement (>=100 <300ms)', percentage(count(*),
WHERE interactionToNextPaint >= 500)
AS 'Poor (> 300ms)'
FROM PageViewTiming
WHERE interactionToNextPaint IS NOT NULL
TIMESERIES AUTO

What's next?

To learn more about querying your data and creating custom dashboards, check out these docs:

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.