post_type ) { wp_die( esc_html__( 'Invalid attachment ID.', 'robotstxt-mediaaudit' ) ); } $filename = esc_html( '' !== $post->post_title ? $post->post_title : sprintf( '#%d', $attachment_id ) ); $back_url = admin_url( 'admin.php?page=robotstxt-mediaaudit' ); $index_row = $this->get_index_row( $attachment_id ); echo '
| %s | %s |
|---|---|
| %s | %s |
| %s | %s |
| %s | %s |
| %s | %s |
| %s | %s |
| %s | %s |
' . $thumb . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_get_attachment_image is safe. } // ----------------------------------------------------------------------- // Internal Usage // ----------------------------------------------------------------------- echo '' . esc_html__( 'Not used in any post.', 'robotstxt-mediaaudit' ) . '
'; } else { echo '| ' . esc_html__( 'Post', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Type', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Context', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Status', 'robotstxt-mediaaudit' ) . ' | '; echo '
|---|---|---|---|
| ' . $post_cell . ' | '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $post_cell already escaped above. echo '' . esc_html( $post_type ) . ' | '; echo '' . $ctx_label . ' | '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $ctx_label already escaped above. echo '' . esc_html( $status ) . ' | '; echo '
' . esc_html__( 'No external scan data available.', 'robotstxt-mediaaudit' ) . '
'; return; } $provider_names = array( 'google_vision' => 'Google Cloud Vision', 'tineye' => 'TinEye', 'picdefense' => 'PicDefense', ); foreach ( $rows as $row ) { if ( ! is_array( $row ) ) { continue; } $slug_val = $row['provider'] ?? null; $slug = is_string( $slug_val ) ? $slug_val : ''; $name = isset( $provider_names[ $slug ] ) ? $provider_names[ $slug ] : ucwords( str_replace( '_', ' ', $slug ) ); $mc_val = $row['match_count'] ?? null; $match_count = is_numeric( $mc_val ) ? (int) $mc_val : 0; $at_val = $row['created_at'] ?? null; $scanned_at = is_string( $at_val ) ? $at_val : ''; $rr_val = $row['raw_response'] ?? null; $raw = null; if ( is_string( $rr_val ) && '' !== $rr_val ) { $decoded = json_decode( $rr_val, true ); $raw = is_array( $decoded ) ? $decoded : null; } echo '| ' . esc_html__( 'Page URL', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Page Title', 'robotstxt-mediaaudit' ) . ' | '; echo '
|---|---|
| ' . esc_html( $page_url ) . ' | '; echo '' . esc_html( $page_title ) . ' | '; echo '
| ' . esc_html__( 'Image URL', 'robotstxt-mediaaudit' ) . ' |
|---|
| ' . esc_html( $img_url ) . ' |
| ' . esc_html__( 'Image URL', 'robotstxt-mediaaudit' ) . ' |
|---|
| ' . esc_html( $img_url ) . ' |
| ' . esc_html__( 'Page URL', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Image URL', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Crawl date', 'robotstxt-mediaaudit' ) . ' | '; echo '
|---|---|---|
| ' . esc_html( $page_url ) . ' | '; echo '' . esc_html( $img_url ) . ' | '; echo '' . esc_html( $bl_date ) . ' | '; echo '
' . esc_html( ucfirst( $picrisk ) ) . '
'; } // Risk flags. $flags = array(); if ( true === ( $data['face'] ?? null ) ) { $flags[] = esc_html__( 'Face detected', 'robotstxt-mediaaudit' ); } if ( true === ( $data['logo'] ?? null ) ) { $flags[] = esc_html__( 'Logo detected', 'robotstxt-mediaaudit' ); } if ( true === ( $data['landmark'] ?? null ) ) { $flags[] = esc_html__( 'Landmark detected', 'robotstxt-mediaaudit' ); } if ( true === ( $data['stock'] ?? null ) ) { $flags[] = esc_html__( 'Stock image', 'robotstxt-mediaaudit' ); } if ( true === ( $data['exif_copyrighted'] ?? null ) ) { $holder_val = $data['exif_copyrightHolder'] ?? ''; $holder = is_string( $holder_val ) ? $holder_val : ''; $flags[] = sprintf( /* translators: %s: copyright holder name */ esc_html__( 'EXIF copyright: %s', 'robotstxt-mediaaudit' ), esc_html( $holder ) ); } echo '' . esc_html__( 'No risk flags detected.', 'robotstxt-mediaaudit' ) . '
'; } else { echo '| ' . esc_html__( 'Page URL', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Image URL', 'robotstxt-mediaaudit' ) . ' | '; echo '' . esc_html__( 'Similarity', 'robotstxt-mediaaudit' ) . ' | '; echo '
|---|---|---|
| ' . esc_html( $page_url ) . ' | '; echo '' . esc_html( $img_url ) . ' | '; echo '' . esc_html( $score ) . ' | '; echo '
' . esc_html( $label_str ) . '
'; } } } } }