=== Prism News Bias Bar ===
Contributors: prismnews
Tags: news, media bias, embed, journalism, fact checking
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Add a Left/Center/Right media-bias bar to any post. Free, no signup, no API key.

== Description ==

Prism News splits every news story into Left, Center, and Right perspectives. This plugin lets you drop the same bias bar — the kind that's normally paywalled elsewhere — into any WordPress post for free.

This plugin connects to the Prism News service (https://prismnews.io) to look up news stories and render an embedded bias-distribution widget. By using this plugin you agree to load an iframe from prismnews.io on the page where the shortcode/block is used. See Privacy Policy section below.

**How it works:**

1. Add a "Prism Bias Bar" block (Gutenberg) or use the `[prism-bias]` shortcode.
2. Paste a news article URL — Prism fuzzy-matches it against its cached stories.
3. The matching bias bar appears in your post, with a link back to Prism for "all perspectives."

**Three ways to embed:**

`[prism-bias url="https://www.cnn.com/2026/02/.../article.html"]`
`[prism-bias keyword="ebola outbreak"]`
`[prism-bias id="ebola-outbreak-99c3f4e8"]`

**Features:**

* No signup, no API key, no rate limits
* Pure server-side block — no JS bundle, no slowdown
* 6-hour transient cache so lookups stay snappy
* Light + dark theme auto-switching in the embedded widget
* Works with Gutenberg, Classic Editor, Elementor, etc. (anywhere shortcodes work)

== Installation ==

1. Upload the `prism-news-bias-bar` folder to `/wp-content/plugins/`
2. Activate the plugin via the Plugins menu in WordPress
3. Search for "Prism Bias Bar" in the block inserter, or use the `[prism-bias]` shortcode

== Frequently Asked Questions ==

= Is this really free? =
Yes. Prism News is free forever. The widget is free to embed on any commercial or non-commercial site.

= What happens if the URL doesn't match? =
Editors see a friendly fallback message with a link to the Prism builder. Public visitors see nothing.

= Does it slow down my site? =
No. The embed uses lazy-loaded iframes (~3KB HTML, zero JS). Lookups are cached for 6 hours.

= Where's the data from? =
Prism aggregates from 11+ outlets (CNN, Fox, BBC, NYT, WSJ, Reuters, Politico, Guardian, NY Post, Washington Examiner, CSM) and uses AllSides + Ad Fontes Media for source bias ratings. See https://prismnews.io/methodology

== External services ==

This plugin connects to **prismnews.io** for two purposes:

1. **Looking up stories**: when you save a post containing a `[prism-bias]` shortcode or block, the plugin makes a request to `https://prismnews.io/api/embed/lookup` (URL mode) or `https://prismnews.io/api/embed/builder` (keyword mode) with the URL or keyword you provided. The response is cached for 6 hours via WordPress transients to minimize requests.

2. **Rendering the widget**: the public-facing post embeds an iframe from `https://prismnews.io/api/embed/story/{id}` which displays the bias breakdown. The iframe is lazy-loaded, contains no JavaScript, and sets no cookies.

By installing this plugin you accept that the configured URLs/keywords will be sent to prismnews.io and that visitors loading your post will load an iframe from prismnews.io.

* Service: Prism News
* Service URL: https://prismnews.io
* Privacy policy: https://prismnews.io/about
* Methodology: https://prismnews.io/methodology

== Privacy ==

The plugin itself does not collect or store any personal data on your visitors.

== Changelog ==

= 1.0.0 =
* Initial release
* Shortcode `[prism-bias]` + Gutenberg block "Prism Bias Bar"
* URL / keyword / story-ID lookup modes
* 6h transient caching to minimize external API calls
