Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions rt-plugin-report.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ private function assemble_plugin_report( $slug ) {
// Add the repo info to the report.
if ( isset( $returned_object ) ) {
if ( ! is_wp_error( $returned_object ) ) {
$report['repo_info'] = $returned_object;
// Cache the report.
set_site_transient( $cache_key, $report, self::CACHE_LIFETIME );
if ( isset( $returned_object->version ) ) {
$report['repo_info'] = $returned_object;
// Cache the report.
set_site_transient( $cache_key, $report, self::CACHE_LIFETIME );
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zodiac1978 Maybe we could add an else branch here to log the error? Your thoughts?

} else {
// Store the error code and message in the report.
$report['repo_error_code'] = $returned_object->get_error_code();
Expand Down Expand Up @@ -493,7 +495,7 @@ private function render_table_row( $report ) {
}

// Installed / available version.
if ( isset( $report['repo_info'] ) ) {
if ( isset( $report['repo_info'] ) && isset( $report['repo_info']->version ) ) {
$css_class = $this->get_version_risk_classname( $report['local_info']['Version'], $report['repo_info']->version );
$html .= '<td class="' . $css_class . '">';
$html .= esc_html( $report['local_info']['Version'] );
Expand Down
Loading