Fix missing thumbnails by resolving Google News redirect URLs before OG scraping
The OG image scraper was using Google News redirect URLs (source_url) directly, which don't serve og:image tags. Added resolve_scrape_url() to follow redirects (including meta-refresh and JS redirects) to reach the actual publisher page before scraping. Also added a backfill AJAX endpoint and admin button to re-scrape thumbnails for existing articles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,7 @@ class Peptide_News {
|
||||
$this->loader->add_action( 'peptide_news_cron_fetch', $fetcher, 'fetch_all_sources' );
|
||||
$this->loader->add_filter( 'cron_schedules', $fetcher, 'add_custom_cron_schedules' );
|
||||
$this->loader->add_action( 'wp_ajax_peptide_news_backfill_sources', $fetcher, 'ajax_backfill_sources' );
|
||||
$this->loader->add_action( 'wp_ajax_peptide_news_backfill_thumbnails', $fetcher, 'ajax_backfill_thumbnails' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user