feat: remove AI thumbnails, rewrite frontend with React (v1.3.0)
Remove all AI thumbnail generation infrastructure (too expensive, poor results) and rewrite the public-facing article feed as a React SPA mounted via WordPress shortcode. Changes: - Remove thumbnail generation, OG scraping, and image download code from fetcher, LLM, and admin classes - Replace server-rendered PHP templates with React component (PeptideNewsFeed.jsx) using WordPress-bundled React/ReactDOM - Add Babel build pipeline for JSX transpilation - Update REST API to serve ai_summary instead of thumbnail fields - Redesign public CSS: clean card layout, loading skeletons, dark mode, responsive, no thumbnail imagery - Remove dead admin settings (llm_image_model, thumbnail_fallback) - Fix call_openrouter() visibility for Content Filter cross-class use - Bump version to 1.3.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,19 +33,18 @@ $total_pages = ceil( $total / $per_page );
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:4%">ID</th>
|
||||
<th style="width:20%"><?php esc_html_e( 'Title', 'peptide-news' ); ?></th>
|
||||
<th style="width:8%"><?php esc_html_e( 'Source', 'peptide-news' ); ?></th>
|
||||
<th style="width:28%"><?php esc_html_e( 'Title', 'peptide-news' ); ?></th>
|
||||
<th style="width:10%"><?php esc_html_e( 'Source', 'peptide-news' ); ?></th>
|
||||
<th style="width:15%"><?php esc_html_e( 'AI Keywords', 'peptide-news' ); ?></th>
|
||||
<th style="width:20%"><?php esc_html_e( 'AI Summary', 'peptide-news' ); ?></th>
|
||||
<th style="width:23%"><?php esc_html_e( 'AI Summary', 'peptide-news' ); ?></th>
|
||||
<th style="width:8%"><?php esc_html_e( 'Published', 'peptide-news' ); ?></th>
|
||||
<th style="width:8%"><?php esc_html_e( 'Fetched', 'peptide-news' ); ?></th>
|
||||
<th style="width:5%"><?php esc_html_e( 'Thumb', 'peptide-news' ); ?></th>
|
||||
<th style="width:4%"><?php esc_html_e( 'Active', 'peptide-news' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ( empty( $articles ) ) : ?>
|
||||
<tr><td colspan="9"><?php esc_html_e( 'No articles found. Run a fetch first.', 'peptide-news' ); ?></td></tr>
|
||||
<tr><td colspan="8"><?php esc_html_e( 'No articles found. Run a fetch first.', 'peptide-news' ); ?></td></tr>
|
||||
<?php else : ?>
|
||||
<?php foreach ( $articles as $article ) : ?>
|
||||
<tr>
|
||||
@@ -72,21 +71,6 @@ $total_pages = ceil( $total / $per_page );
|
||||
</td>
|
||||
<td><?php echo esc_html( wp_date( 'M j, Y', strtotime( $article->published_at ) ) ); ?></td>
|
||||
<td><?php echo esc_html( wp_date( 'M j, Y', strtotime( $article->fetched_at ) ) ); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$thumb_src = '';
|
||||
if ( ! empty( $article->thumbnail_url ) && '_no_image' !== $article->thumbnail_url ) {
|
||||
$thumb_src = $article->thumbnail_url;
|
||||
} elseif ( ! empty( $article->thumbnail_local ) ) {
|
||||
$upload_dir = wp_upload_dir();
|
||||
$thumb_src = $upload_dir['baseurl'] . '/' . $article->thumbnail_local;
|
||||
}
|
||||
if ( $thumb_src ) : ?>
|
||||
<img src="<?php echo esc_url( $thumb_src ); ?>" alt="" style="width:50px;height:50px;object-fit:cover;border-radius:4px;" />
|
||||
<?php else : ?>
|
||||
<span class="dashicons dashicons-format-image" style="color:#ccc;font-size:24px;"></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo $article->is_active ? '<span style="color:green;">✓</span>' : '<span style="color:#ccc;">✗</span>'; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user