featured-from-source is a WordPress plugin for sites that write about other pages: digests, link blogs, curated round-ups and imported drafts. For a post that stores the URL of the page it is based on and a credit line, it finds a picture on that page, checks it, copies it into the media library with the credit and provenance, and sets it as the featured image. The code is at https://github.com/IndianOpinion/featured-from-source, licensed MIT. Version v0.1.0 was released on 15 November 2026.
We wrote it from scratch from an idea, not from any third-party plugin. It has not run on a live site. The 47 utilities in this series were specified, built, reviewed and released between 11 and 19 November 2026 by language-model coding agents under the editor’s direction, in five roles: a spec writer, a spec reviewer, a builder that saw only the spec, an independent code reviewer and a releaser. The editor made the rulings on every open question.
A “take the first image” rule goes wrong in predictable ways. The PRD lists them:
src and the real picture in a data attribute or srcset.og:image, then twitter:image, then images in the article body. The first candidate that passes every check wins. It does not download everything and pick the biggest.media_handle_sideload() with the credit as caption, and writes provenance to the attachment.Saving a post of an enabled type that has a source URL and a credit queues it. Nothing runs on save or on a front-end request. One recurring WP-Cron event works through the queue in batches. The main classes are Scheduler, Queue, Lock and Runner, with Http and AddressGuard for requests, CandidateFinder for the page, and ImageProbe and Sideloader for the file.
The page is parsed with a tolerant DOM parser. In the body it reads lazy-load attributes and srcset before src, and skips header, nav, footer, aside, share, related, promo, ad, sponsor, comments and author blocks. Name checks match whole tokens, so phone-pixel-10.jpg and logistics-hub.jpg pass. A social image that turns up on three or more pages of one domain is treated as that outlet’s default card.
After download, the Content-Type and the file’s magic bytes must agree, and SVG is never accepted. Dimensions are read from the file header without decoding the image, with a small WebP header reader.
An importer can hand a post over at insert time through meta:
wp_insert_post([
'post_title' => 'Harbour reopens after storm',
'post_status' => 'draft',
'meta_input' => [
'_ffs_source_url' => 'https://news.example.com/2026/11/harbour-reopens',
'_ffs_source_credit' => 'Example Daily',
],
]);
rights_not_acknowledged.robots.txt is fetched once per host per day and honoured. A 5xx or network error means disallow for that host until the next check.--force.FEATURED_FROM_SOURCE_DISABLED, or the ffs_enabled filter. Queue entries are kept while it is off.The independent code review changed these before the merge:
AddressGuard resolves every hop’s host (A and AAAA), refuses any non-public address, and pins the cURL connection to the checked address so a rebinding DNS answer cannot move the request. On a non-cURL transport only the check applies.avif: coder, so untrusted bytes cannot pick a decoder.robots.txt matcher collapses runs of * before building its pattern, to cut backtracking.ffs_public_suffixes.Test status: this is v0.1.0. There are 104 PHPUnit tests, one per PRD case plus extras, run on a stub layer with a fake HTTP transport and a fake DNS resolver, so no test touches the network. Static analysis and code style checks passed. The GitHub CI workflow has not run: the commit adding it stayed local because the token lacked the workflow scope.
It needs PHP 8.1 or later (tested on 8.1, 8.2 and 8.3), WordPress 6.4 or later and the PHP dom extension. intl, mbstring and, on PHP 8.1, imagick are used when present.
composer require indianopinion/featured-from-source
The package is not on Packagist yet, so add a Composer vcs repository entry for https://github.com/IndianOpinion/featured-from-source first.
Or copy the folder to wp-content/plugins/featured-from-source/ and activate it. A must-use loader is in examples/.