Problem
Other plugins that want to read Plugin Report data currently have to access transients directly, which is fragile (cache key format is an implementation detail) and doesn't trigger data population if the cache is empty.
Proposed changes
Add a public API for external plugins to access report data:
RT_Plugin_Report::get_report( $slug ) — static method on the class
plugin_report_get_data( $slug ) — global convenience wrapper
Both return cached data when available, or assemble a fresh report (populating the cache) on demand. Other plugins can safely call the global function with a function_exists() guard:
if ( function_exists( 'plugin_report_get_data' ) ) {
$report = plugin_report_get_data( 'akismet' );
if ( isset( $report['repo_info'] ) ) {
echo $report['repo_info']->tested;
}
}
Internally, the report page's own rendering is updated to use self::get_report() instead of reading the transient directly.
Problem
Other plugins that want to read Plugin Report data currently have to access transients directly, which is fragile (cache key format is an implementation detail) and doesn't trigger data population if the cache is empty.
Proposed changes
Add a public API for external plugins to access report data:
RT_Plugin_Report::get_report( $slug )— static method on the classplugin_report_get_data( $slug )— global convenience wrapperBoth return cached data when available, or assemble a fresh report (populating the cache) on demand. Other plugins can safely call the global function with a
function_exists()guard:Internally, the report page's own rendering is updated to use
self::get_report()instead of reading the transient directly.