Skip to content

Register Abilities API for site diagnostics and activity log #215

@claytoncollie

Description

@claytoncollie

Problem

The Support Monitor collects rich telemetry (hosting provider, PHP/WP versions, plugin list, object cache status, activity log) but it's only accessible via the admin UI or the monitor.10up.com API. There is no way for AI assistants to query this diagnostic data.

Dependencies

Proposal

Register read-only abilities to expose diagnostic data and activity logs.

Abilities to register

Category: tenup-experience-diagnostics

Ability Name Type Description
tenup/get-environment-info readonly Hosting provider, PHP/WP/DB versions, object cache, multisite flag, environment type
tenup/get-active-plugins readonly List of active plugins with versions
tenup/get-active-theme readonly Current active theme with version
tenup/get-activity-log readonly Recent activity log entries (filterable by date range, user, action type)
tenup/get-tenup-users readonly 10up user accounts on the site with roles and profile URLs

Key data sources (already implemented)

These existing methods provide the data — no new data collection needed:

  • SupportMonitor/Monitor.php::get_hosting_provider() (line 797)
  • SupportMonitor/Monitor.php::get_is_using_object_cache() (line 829)
  • SupportMonitor/Monitor.php::format_plugins() (line 583)
  • SupportMonitor/ActivityLog.php::get_logs() (line 277)

Input schema example for activity log

{
    "type": "object",
    "properties": {
        "days": { "type": "integer", "default": 7 },
        "action": {
            "type": "string",
            "enum": [
                "login",
                "plugin_activated",
                "plugin_deactivated",
                "theme_switch",
                "option_updated",
                "user_registered",
                "user_deleted"
            ]
        },
        "user_id": { "type": "integer" }
    }
}

Files

  • New: includes/classes/Abilities/Diagnostics.php
  • Modified: 10up-experience.php (instantiate new class)

Verification

  1. Confirm abilities appear: GET /wp-json/wp-abilities/v1/abilities?category=tenup-experience-diagnostics
  2. Test: ask AI "What hosting provider is this site on?"
  3. Test: ask AI "Show me the activity log for the last 7 days"
  4. Test: ask AI "What plugins are active on this site?"
  5. Confirm all abilities are strictly read-only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions