Skip to content

New: Added source of the request - #225

Open
KingYes wants to merge 3 commits into
masterfrom
new/request-source
Open

New: Added source of the request#225
KingYes wants to merge 3 commits into
masterfrom
new/request-source

Conversation

@KingYes

@KingYes KingYes commented Aug 13, 2026

Copy link
Copy Markdown
Member

✨ PR Description

1. Problem & Context

Plugin now tracks request source (REST API, WP-CLI, XML-RPC, cron, app passwords, etc.) alongside existing activity logs. Requires database schema upgrade from 1.0 → 1.1 with backward-compatibility handling.

2. What Changed (Where)

  • AAL_API: Added request source resolution logic (channel detection, app password tracking) with hooks for ability/auth tracking
  • AAL_Maintenance: Database migration to 1.1 (adds request_source column, version tracking, runtime upgrade with fallback notices)
  • AAL_Activity_Log_List_Table: Displays source badges, adds sourceshow filter, conditional rendering if schema not ready
  • AAL_Export, AAL_Privacy: Source data formatting for exports/privacy exports
  • Admin UI: Moved inline styles to separate CSS file, hooked enqueue handler

3. How It Works

Source resolution happens at log insertion: AAL_API::resolve_request_source() detects channel (ability depth > 0 → abilities, REST_REQUEST constant → rest, etc.) and app password auth state, encoding as {channel}|app:{name}. Table display parses this format via AAL_API::parse_request_source() to render clickable badges. Schema check AAL_Maintenance::is_schema_ready('1.1') guards UI/query elements; upgrade runs on admin_init with transient-based failure retry and admin notice fallback.

4. Risks

  • Silent upgrade silently fails: Transient-based retry can mask persistent DB issues; mitigation: notice clarifies user action. App password detection relies on internal WP APIs (rest_get_authenticated_app_password(), WP_Application_Passwords) that may shift in future WP versions.
  • Source column visibility: Hidden on mobile but no skip-logic for data collection; filtering may return empty if schema mismatched mid-request (unlikely but possible in race conditions).

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant