Skip to content

Add public plugin_report_get_data() API#88

Open
apermo wants to merge 4 commits intoZodiac1978:developfrom
apermo:feature/public-api
Open

Add public plugin_report_get_data() API#88
apermo wants to merge 4 commits intoZodiac1978:developfrom
apermo:feature/public-api

Conversation

@apermo
Copy link
Copy Markdown
Contributor

@apermo apermo commented Apr 13, 2026

Summary

  • Adds RT_Plugin_Report::get_report( $slug ) static method as the canonical way to read report data
  • Adds global plugin_report_get_data( $slug ) convenience wrapper for use by other plugins
  • Both return cached data or assemble a fresh report on demand
  • Report page rendering updated to use self::get_report() internally

Fixes #87

Test in WordPress Playground

Before (develop — baseline): Open in WordPress Playground

After (this branch — public API added): Open in WordPress Playground

Pre-installed test plugins: Apermo Admin Bar (outdated), giWeather (closed/removed)

Test plan

  • Open both links — verify identical report page behavior (no regression)
  • In the After link, verify function_exists( 'plugin_report_get_data' ) returns true when plugin is active
  • Verify plugin_report_get_data('akismet') returns report data

@apermo apermo marked this pull request as ready for review April 13, 2026 20:33
apermo added 4 commits April 14, 2026 15:42
Add RT_Plugin_Report::get_report() static method
and a global plugin_report_get_data() wrapper as
public API for other plugins to access report data
without touching transients directly. Populates
cache on demand if not yet available.
isset() on null already returns false, no need
for the redundant truthy check.
Use a static local instance in the global wrapper
instead of instantiating inside the class method.
@apermo apermo force-pushed the feature/public-api branch from 4694942 to e60cab4 Compare April 14, 2026 13:42
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.

Public API: plugin_report_get_data() function

1 participant