diff --git a/rt-plugin-report.php b/rt-plugin-report.php index 6b76f78..81977cf 100644 --- a/rt-plugin-report.php +++ b/rt-plugin-report.php @@ -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 ); + } } else { // Store the error code and message in the report. $report['repo_error_code'] = $returned_object->get_error_code(); @@ -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 .= ''; $html .= esc_html( $report['local_info']['Version'] );