Skip to main content
The MainWP Lighthouse Add-on registers two read-only abilities in the mainwp-lighthouse category. Both use the mainwp/ namespace on your MainWP Dashboard. Use them to check Lighthouse configuration and audit freshness, or to pull stored scores into reports, scripts, and AI tools. They return data that Lighthouse has already stored. They do not run audits or change settings.

What You’ll Learn

  • Read the Lighthouse overview: API key presence, schedule settings, and latest audit times
  • List stored desktop and mobile scores for accessible sites
  • Page through results and filter by site
  • Handle permission and input errors

Prerequisites

  • WordPress 6.9 or later on the MainWP Dashboard site
  • MainWP Dashboard with Abilities API support; use version 6.2 or later for the input_json examples below
  • A Lighthouse Add-on release with Abilities support, active in MainWP Dashboard
  • An authenticated user with manage_options and access to the Lighthouse Add-on
  • Dashboard access to each site you want to read
Use an Application Password or the authentication methods in the Abilities API overview. The examples use an Application Password. Both abilities check permissions again when they run. Results include only sites that the Dashboard site list returns and that the current user is allowed to access. Sites the user cannot access are left out of the overview totals and the results list.

Available Abilities

Discover the full input and output schemas:
Both abilities are marked readonly: true, destructive: false, and idempotent: true. Inputs and outputs reject extra properties.

Read the Lighthouse Overview

Ability: mainwp/get-lighthouse-overview-v1
Method: GET
Input: None
Example response:
api_key_configured reports only that a key is stored. It does not validate the key, and the response never includes the key itself. cron_working describes the current request context only. It is not a cron health check, so it is normally false for API calls.

List Site Results

Ability: mainwp/list-lighthouse-site-results-v1
Method: GET
All inputs must be positive JSON integers.
Read the results for one site:
Example response:
The response envelope contains sites, total, page, and per_page. total counts every accessible site with stored Lighthouse records, not only the current page. Sites are ordered by site ID. Request the next page until you have read total results. Each site contains: A null score or audit time means Lighthouse has no stored value for that strategy. For example, the strategy may not be configured, or the site has not been audited yet. If no results are stored, the ability returns an empty sites array with total: 0. The response does not include site URLs, API keys, notification emails, or raw audit data. To run a new audit, use the Lighthouse Dashboard, WP-CLI, or the Lighthouse REST API, then read the results again.

Handle Errors

MainWP Dashboard returns HTTP 401 for unauthenticated requests. WordPress can also reject invalid input against the public schema before the Add-on callback runs.