=== AI Today News ===
Contributors: aitoday
Tags: news, ai, ticker, feed, shortcode
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Shows the latest posts of AI Today or All Today as a list or ticker. Block, shortcode and widget. Every item links to its post on the source.

== Description ==

**AI Today News** puts the news of [AI Today](https://ai-today.com/) (artificial intelligence) or [All Today](https://all-today.com/) (the world) on your WordPress site. You choose the edition, language, topics and content kinds. Every item shows the headline, a short text and a visible, clickable link "Source: AI Today" (or "Source: All Today") to the post itself.

* **Block** "AI Today News" for the block editor, with a live preview.
* **Shortcode** `[ai_today_news]` for any page, post or template.
* **Widget** for classic widget areas.
* **List or ticker.** The ticker can be paused and stands still for visitors who prefer reduced motion.
* **Light, dark or automatic** colours, headings and links that follow accessibility good practice.
* **Fast.** Your server fetches the posts, keeps them for 5 to 1440 minutes (WordPress transients), renews an expired copy in the background (WP-Cron) and shows the last copy if the news server cannot be reached.
* **Private.** Visitors' browsers load nothing from AI Today or All Today: no scripts, fonts, pictures or cookies, no tracker. Only your server contacts the news server.
* **Translated.** English and German are included. The news itself is available in 84 languages.

= The one condition: the link to the post =

The plugin and the news are free. In return every item is shown with the attribution of the news server: a visible link "Source: AI Today" (or "Source: All Today", in the language of the post) to the post itself, never marked nofollow. The plugin has no setting that switches this link off; please do not remove it with code or style sheets. You accept this condition and the privacy policy of the source in Settings > AI Today News **before anything is shown**. Until then the plugin shows nothing to visitors and does not contact the news server. Terms: https://ai-today.com/partner/

The texts are written by AI and can contain mistakes. The plugin shows the original sources of a post (switchable) and a short note under the list (switchable).

= Shortcode =

`[ai_today_news edition="all" language="de" categories="technology,health" kinds="news,opinion" count="5" sort="newest" style="list" theme="auto"]`

* `edition` - `ai` (AI Today) or `all` (All Today).
* `language` - `auto` (language of the site) or a code such as `de`, `en`, `fr`.
* `categories` - comma separated topics of the edition, empty means all. AI Today: modelle, forschung, tools, robotik, gesellschaft, kreativ, markt, politik, unterhaltung, gefahren (English names such as models, research, robotics also work). All Today: welt, politik, markt, technologie, forschung, bildung, gesundheit, umwelt, gesellschaft, kultur, sport, unterhaltung.
* `kinds` - `news`, `opinion`, `discussion`, `product`, `creative`, `community`.
* `count` - 1 to 20.
* `sort` - `newest`, `oldest`, `weighted` (editorial mix) or `ratings`.
* `style` - `list` or `ticker`.
* `theme` - `light`, `dark` or `auto`.
* `text` - `1` or `0`: short text under the headline. `text_length` - characters.
* `sources` - `1` or `0`: the original sources of a post.
* `new_tab` - `1` opens links in a new tab.
* `heading` - heading level 2 to 6 for the headlines of a list.
* `region` - reserved for a future regional filter, has no effect yet.
* `class` - extra CSS class.

= Privacy =

Only your web server contacts the news server (AI Today: admin.ai-today.com, All Today: all-today.com), over HTTPS, to load the list, and only after you have accepted the terms of use in the settings. The request contains the domain name of your website in the user agent (like WordPress itself does when it contacts wordpress.org) and the IP address of your server. It follows no redirects and asks for no compression. It contains no data about your visitors. The loaded list is cached in your database as a transient.

Visitors' browsers do not contact AI Today or All Today while they read your page. When a visitor clicks a link they leave your site and the privacy policy of AI Today or All Today applies.

The plugin stores its settings in one option (`aitn_settings`) and the cache in transients. Both are removed when you delete the plugin. A suggested text for your privacy policy is added to Settings > Privacy > Policy Guide.

An optional partner key can be saved for later features for verified partners. It is not sent anywhere at the moment.

= External services =

This plugin connects to the public news interface of the site you choose:

* AI Today: `https://admin.ai-today.com/api/news` - [terms and conditions](https://ai-today.com/partner/), [privacy policy](https://ai-today.com/privacy/)
* All Today: `https://all-today.com/api/news` - [terms and conditions](https://all-today.com/partner/), [privacy policy](https://all-today.com/privacy/)

It is called by your server when a list is shown and the cached copy is older than the cache time, and when you press "Test connection". It sends the parameters of the list (language, topics, kinds, number, order), your server's IP address and the domain name of your website in the user agent.

== Installation ==

1. Upload the folder `ai-today-news` to `/wp-content/plugins/` or install the zip in Plugins > Add New > Upload.
2. Activate the plugin.
3. Open Settings > AI Today News, read and accept the terms of use (nothing is shown before that) and choose the defaults.
4. Add the block "AI Today News", use the widget, or write `[ai_today_news]` in a page.

== Frequently Asked Questions ==

= Can I remove the link "Source: AI Today"? =

No. It is the condition of the free offer, and you accept it in the settings before the plugin shows anything. Every item links to its post, without nofollow. The wording comes from the news server and follows the language of the post.

= Does the plugin need a key or an account? =

No. Reading the news needs no registration and no key. You only tick the box for the terms of use.

= Does it slow down my site? =

No. The list comes from a copy in your database. An expired copy is shown at once and renewed in the background (WP-Cron). Only the very first view, before there is any copy, waits for the news server, with a timeout of 8 seconds. If the news server is down, the last copy stays on the page.

= Which pictures does it use? =

None. Version 1.0 shows text only, so that no visitor's browser contacts another server.

= The headlines start with an emoji. Does that load pictures? =

Not from the plugin. WordPress itself replaces emoji by small pictures from s.w.org on browsers that have no emoji font (WordPress core behaviour, the same for every post of your site). If you do not want that, switch WordPress emoji support off with a plugin or a filter.

= Can I use it with a strict Content Security Policy? =

Yes. The plugin loads one style sheet and, for tickers, one script from your own site. It uses no inline script or style.

= Where can I get help? =

On https://ai-today.com/partner/ or in the support forum of this plugin.

== Screenshots ==

1. The list with light colours.
2. The ticker with dark colours.
3. The block settings in the editor.
4. The settings page.

== Changelog ==

= 1.0.1 =
* Security hardening after an independent review (no change to what visitors see):
* The block editor no longer receives the partner key and the terms data (only display defaults).
* Limits against floods of requests: the reserved region is no longer part of the request or the cache key; at most 3 blocking requests per page view, 5 planned background renewals per page view and 30 requests per minute for the whole site; the rest shows the last copy or the plain link and is renewed in the background.
* The user agent carries only the domain name of your site (no scheme, no path); no redirects are followed; compressed answers are not requested.
* Addresses of original sources must be absolute http or https addresses with a host, without credentials, at most 2048 characters.
* The first save of the settings keeps the accepted terms (they were cleared once, you had to save twice).
* The background renewal checks the stored query again.
* A translation with a wrong placeholder can no longer break the page (the English sentence is used).
* Uninstall also removes the saved widget instances.

= 1.0.0 =
* First release: block, shortcode, widget, list and ticker, cache, German and English.

== Upgrade Notice ==

= 1.0.1 =
Security hardening (block editor data, request limits, address checks) and a fix for the first save of the settings. Recommended for everyone.

= 1.0.0 =
First release.
