Skip to content

feat(collector): add plugin, hook, and DB table metrics#10

Open
Ajay-Singh-Adhikari wants to merge 4 commits into
mainfrom
feat/extend-collectors
Open

feat(collector): add plugin, hook, and DB table metrics#10
Ajay-Singh-Adhikari wants to merge 4 commits into
mainfrom
feat/extend-collectors

Conversation

@Ajay-Singh-Adhikari
Copy link
Copy Markdown
Collaborator

@Ajay-Singh-Adhikari Ajay-Singh-Adhikari commented May 5, 2026

Extends ProPerf_Data_Collector to collect server-side metrics that GTmetrix cannot see, closing audit checklist gaps for sections 2, 3, and 4.

What this PR adds

  • Plugin layer — active, inactive, and total plugin count via get_plugins()
  • Hook count — total registered WordPress hooks via wp_filter count
  • Database — total DB size via information_schema
  • Top 10 tables by size — visible in the Admin Panel dashboard
  • WooCommerce order metrics — visible in the Admin Panel dashboard with the following columns and inferences:
    • Order items table size and order itemmeta table size
    • Oldest order age — shows how long the oldest order has been sitting in the database
    • Archival trigger — displays a target of "No"; shown in red with "Yes — orders older than 1 year detected" if orders older than 365 days exist, or green "No" if all orders are within range

Technical changes

  • New collector methods in ProPerf_Data_Collector: plugin metrics, hook metrics, DB table metrics, and WooCommerce order metrics
  • format_for_bigquery() updated with new fields for all of the above
  • BigQuery schema updated with corresponding column definitions
  • Admin dashboard updated to display all new metrics with targets alongside values; WooCommerce section is only shown when WooCommerce is active

Extends ProPerf_Data_Collector to collect server-side metrics that
GTmetrix cannot see, closing audit checklist gaps for sections 2, 3, and 4:

- Plugin layer: active/inactive/total plugin count via get_plugins()
- Hook count: registered hooks via wp_filter count
- Database: total DB size + top 10 tables by size via information_schema

Updates format_for_bigquery() with 5 new fields sent to BigQuery.
Updates BigQuery schema and admin dashboard with targets alongside values.
@Ajay-Singh-Adhikari Ajay-Singh-Adhikari self-assigned this May 5, 2026
MySQL returns TABLE_NAME (uppercase) from information_schema on some
platforms (macOS). Switching to ARRAY_A mode with case fallback ensures
top tables map is populated correctly on all environments.
Extends ProPerf_Data_Collector with collect_woo_order_metrics():

- order_items table size (bytes)
- order_itemmeta table size (bytes)
- Oldest order age in days
- Archival trigger flag (true when oldest order > 365 days)

Gracefully returns zeros + woo_active=false when WooCommerce is not
installed. Updates BigQuery schema with 4 new INTEGER fields and adds
a WooCommerce Order Metrics section to the admin dashboard with
red/green archival trigger status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant