| @@ -12,9 +12,9 @@ | ||
| 12 | 12 | |
| 13 | 13 | foreach ( $issues as $item ) { |
| 14 | 14 | $detail = $item->to_array(); |
| 15 | 15 | $full_path = ''; |
| 16 | - if ( ! empty( $detail['full_path'] ) ) { | |
| 16 | + if ( isset( $detail['full_path'] ) && is_string( $detail['full_path'] ) && '' !== trim( $detail['full_path'] ) ) { | |
| 17 | 17 | $full_path = esc_html( $detail['full_path'] ); |
| 18 | 18 | if ( 0 === strpos( $full_path, $abs_path ) ) { |
| 19 | 19 | $full_path = $abs_path . '<span>' . substr( $full_path, strlen( $abs_path ) ) . '</span>'; |
| 20 | 20 | } |
| @@ -19,11 +19,13 @@ | ||
| 19 | 19 | $full_path = $abs_path . '<span>' . substr( $full_path, strlen( $abs_path ) ) . '</span>'; |
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if ( in_array( $item->type, $abandoned_types, true ) ) { | |
| 24 | - $file_name = esc_html( $detail['file_name'] ); | |
| 25 | - $short_desc = esc_html( $detail['short_desc'] ); | |
| 23 | + $item_type = isset( $item->type ) ? $item->type : ( $detail['type'] ?? '' ); | |
| 24 | + $file_name = $detail['file_name'] ?? ''; | |
| 25 | + $short_desc = $detail['short_desc'] ?? ''; | |
| 26 | + | |
| 27 | + if ( in_array( $item_type, $abandoned_types, true ) ) { | |
| 26 | 28 | $abandoned_plugins_html .= '<tr class="report-list-item" style="border: 1px solid #F2F2F2;padding: 0;text-align: left;vertical-align: top"> |
| 27 | 29 | <td class="report-list-item-info" style="border-collapse: collapse !important;color: #1A1A1A;font-family: Roboto, Arial, sans-serif;font-size: 12px;line-height: 22px;font-weight: 500;letter-spacing: -0.23px;margin: 0;padding: 18px 0;text-align: left;vertical-align: top"> |
| 28 | 30 | <span style="color: inherit;display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;line-height: inherit;vertical-align: middle;letter-spacing: -0.25px;padding-left: 20px;"> |
| 29 | 31 | ' . esc_html( $file_name ) . ' |
| @@ -38,20 +40,20 @@ | ||
| 38 | 40 | } else { |
| 39 | 41 | $other_issues_html .= '<tr class="report-list-item" style="border: 1px solid #F2F2F2;padding: 0;text-align: left;vertical-align: top"> |
| 40 | 42 | <td class="report-list-item-info" style="border-collapse: collapse !important;color: #1A1A1A;font-family: Roboto, Arial, sans-serif;font-size: 12px;line-height: 22px;font-weight: 500;letter-spacing: -0.23px;margin: 0;padding: 18px 0;text-align: left;vertical-align: top"> |
| 41 | 43 | <span style="color: inherit;display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;line-height: inherit;vertical-align: middle;letter-spacing: -0.25px;padding-left: 20px;"> |
| 42 | - ' . esc_html( $detail['file_name'] ) . ' | |
| 44 | + ' . esc_html( $file_name ) . ' | |
| 43 | 45 | <span class="report-list-item-path" style="display: inline-block; width: 100%;">' . wp_kses( $full_path, array( 'span' => array() ) ) . '</span> |
| 44 | 46 | </span> |
| 45 | 47 | </td> |
| 46 | - <td class="report-list-item-info" style="border-collapse: collapse !important;color: #1A1A1A;font-family: Roboto, Arial, sans-serif;font-size: 12px;line-height: 22px;font-weight: 500;letter-spacing: -0.25px;margin: 0;padding: 18px 0;text-align: left;vertical-align: top"> | |
| 47 | - <span style="color: inherit;display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;line-height: inherit;vertical-align: middle;letter-spacing: -0.25px;padding-right: 20px;">' . esc_html( $detail['short_desc'] ) . '</span> | |
| 48 | + <td class="report-list-item-info" style="border-collapse: collapse !important;color: #1A1A1A;font-family: Roboto, Arial, sans-serif;font-size: 12px;line-height: 22px;font-weight: 500;letter-spacing: -0.23px;margin: 0;padding: 18px 0;text-align: left;vertical-align: top"> | |
| 49 | + <span style="color: inherit;display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;line-height: inherit;vertical-align: middle;letter-spacing: -0.25px;padding-right: 20px;">' . esc_html( $short_desc ) . '</span> | |
| 48 | 50 | </td> |
| 49 | 51 | </tr>'; |
| 50 | 52 | } |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | -if ( ! empty( $other_issues_html ) ) : ?> | |
| 55 | +if ( '' !== $other_issues_html ) : ?> | |
| 54 | 56 | <table class="reports-list" align="center" |
| 55 | 57 | style="border-collapse: collapse;border-spacing: 0;margin: 0 0 30px;padding: 0;text-align: left;vertical-align: top;width: 100%"> |
| 56 | 58 | <thead> |
| 57 | 59 | <tr> |
| @@ -84,9 +86,9 @@ | ||
| 84 | 86 | ); |
| 85 | 87 | ?> |
| 86 | 88 | </tbody> |
| 87 | 89 | </table> |
| 88 | -<?php endif; if ( ! empty( $abandoned_plugins_html ) ) : ?> | |
| 90 | +<?php endif; if ( '' !== $abandoned_plugins_html ) : ?> | |
| 89 | 91 | <div style="margin-top: 30px;"> |
| 90 | 92 | <table class="abandoned-plugins-list" align="center" |
| 91 | 93 | style="border-collapse: collapse;border-spacing: 0;margin: 0 0 20px;padding: 0;text-align: left;vertical-align: top;width: 100%"> |
| 92 | 94 | <thead> |