feed-item-brief: attributed summary drafts from feed items

A WordPress plugin that turns one feed item into a short summary draft for an editor, with an attribution block the plugin renders itself. Written from scratch from an idea, v0.1.0, tested on stubs and a throwaway database.

feed-item-brief is a WordPress plugin that turns one feed item into a short summary draft for an editor. The source link, byline and publish time sit in an attribution block that the plugin renders itself. It is for sites that follow other publishers and want a summary in their own words that sends the reader to the original. Licence MIT. Version v0.1.0, released 19 November 2026.

It was written from scratch from an idea, as one of the utilities described on the engineering blog. It has not run on a live site.

The problem

Summarising other publishers’ items with a language model and a feed importer goes wrong in predictable ways.

  • The credit gets lost. The model is asked to credit the source and sometimes names the wrong outlet or drops the link. An editor later deletes the line by accident, and the post presents another newsroom’s reporting as its own.
  • The outlet name is wrong, because the importer stored a host taken from a feed service or a mirror.
  • Paywalled items arrive as a two-line teaser. Asked for a long summary, the model invents the rest. Items with a title and no body get the same treatment.
  • Feeds lie about dates. Some stamp every item with the build time, send future dates, omit the time zone, or bump the date when an old article is edited.
  • The model narrates its own working into the copy, such as a word count line, or implies several sources when there was one.

The PRD adds a lesson about length. A model given only a range can run past the ceiling, and an instruction to count words can be printed back into the copy. Cutting long text is worse, because the last sentence often carries the attribution or the key date.

What it does

  • Accepts an item from any importer through its own hook, from WordPress core feeds through a reference adapter, or from no importer: a URL typed by an editor or a WP-CLI command.
  • Classifies each item before any model call: full text, teaser, paywalled stub, no body, not an article, sponsored, duplicate or stale. It summarises only what is there.
  • Resolves a publish time from the feed date, the page metadata, the URL and the time first seen, and stores why it chose that one.
  • Writes a draft (or pending) post with the summary as paragraph blocks and the attribution block last.
  • Shows a review panel on each draft with the source, byline, date, the reason for the date, and flags.

How it works

An item enters through feed_item_brief_submit or the batch hook. Intake validates it, cleans it and builds an article key, so mobile, AMP and tracking variants of one URL share a key. A second copy becomes a duplicate row. A changed body becomes an update note on the draft.

The item then waits in a table. WP-Cron runs every five minutes, newest first, five items and twenty seconds per run, and each item is leased so overlapping runs never take it twice. Classifier decides what the item is. Gate then checks the switch, an auth pause and the daily cap before a call. Summariser makes one call with a JSON schema through llm-json-php, or through a filter you supply. OutputChecker examines the result. Drafter inserts the post.

The output checks run in code. Self-narration lines are removed. Every number, and every quote of four words or more, must appear in the source. Phrases that imply several sources fail. Over-length text fails and is never cut. The wrong language fails. A failure gets one retry with the reasons named, and a second failure ends as check_failed. Relative time words are flagged for the editor, not rejected.

The attribution block is dynamic: readers see it rendered from post meta, and its saved markup is a static fallback that survives if the plugin is removed. Data lives in two tables, {prefix}feed_item_brief_items and {prefix}feed_item_brief_daily, plus post meta.

A call from your own importer looks like this:

do_action('feed_item_brief_submit', [
    'url' => $link,
    'title' => $title,
    'body' => $html,
    'source_name' => 'Example News',
    'byline' => ['Jane Roe'],
    'published' => '2026-11-14T09:00:00Z',
    'guid' => $id,
], 'my-importer');

The call records the item and returns at once. No model call, page fetch or post insert happens in the importer’s request.

Guard rails

  • It cannot publish. Any status other than draft or pending is forced back, and a filter that tries gets a _doing_it_wrong() notice.
  • The kill switch is off by default. A constant, FEED_ITEM_BRIEF_DISABLED, wins over the setting, and the switch is read at the moment of every model call.
  • The daily cap defaults to 25 calls per site-local day, retries included, with an atomic conditional increment. A cap of 0 means no calls. Link-only drafts do not count.
  • Paywalled items default to a link-only draft. Page fetching is off by default, so the plugin sends no traffic to publishers unless you opt in. Pages that ask for nosnippet or noarchive become link-only drafts.
  • An editor cannot remove the credit by editing. The block is locked in the editor, re-rendered on output if deleted, and checked at publish. A brief with no attribution at publish time goes back to draft.

What review changed

An independent review of the build PR found and fixed these before the merge.

  • The optional spend-meter integration called a function with the wrong arguments. It now uses the spend_meter_pre_spend filter with a full intent array, allows a call only on an explicit yes, and reports the outcome through an action.
  • The optional gen-queue integration registered its handler through a function that does not exist, so jobs had no handler. It now registers a job type on the right hook.
  • Records that a finished job left queued, such as after a back-off or a cap, were never processed again. Single runs of the plugin’s own queue are now scheduled for them.
  • The attribution guard skipped the block whenever the wrapper class appeared, so a wrapper with its link edited out removed the credit. It now needs the source link inside the wrapper.

Limits and what is next

  • The host check has no public suffix list, so news.example.co.uk and example.co.uk count as different sites.
  • Only English number words ship. For other languages an unmatched number is flagged, not rejected.
  • The page parser reads the head, JSON-LD and the first time element in the first article. It is not an extraction engine.
  • Source changes after publish are logged only. A one-click redraft is a roadmap item.

No issues are open on the repo. Test status: this is v0.1.0. There are 136 PHPUnit tests with 698 assertions, and they pass, including six database tests on a throwaway MySQL 8.0, and PHPStan level 8 and phpcs are clean. The tests use stubs and mocks. The CI workflow has not run on GitHub, and there is no production mileage.

Install

It needs WordPress 6.4 or later and PHP 8.1 or later, with the dom, json and mbstring extensions. Neither package is on Packagist yet, so both are VCS repositories.

composer config repositories.feed-item-brief vcs https://github.com/IndianOpinion/feed-item-brief
composer config repositories.llm-json-php vcs https://github.com/IndianOpinion/llm-json-php
composer require indianopinion/feed-item-brief

All 47 utilities · feed-item-brief on GitHub

Search Trending
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...

All fields are required.