=== Zotero Notes ===
Contributors: janiko
Tags: zotero, footnotes, references, citation
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add footnote citations from a Zotero library, with a secure API connection and resilient caching.

== Description ==

Zotero Notes inserts numbered citations and a references list on individual posts or pages. It uses the Zotero API over verified HTTPS and stores a fresh cache and a last-known-good fallback for temporary outages.

Usage (the shortcode can be changed in Settings):

* `[zref]VP5PKI56[/zref]`
* `[zref name="source"]VP5PKI56[/zref]`
* `[zref name="source" /]` (reuse an earlier named citation)

Configure the Zotero user ID and private API key under Settings > Zotero Notes. The API key is kept server-side; a blank key field during editing retains the saved key. The cache freshness interval defaults to 12 hours, and can be set between 1 and 168 hours. Temporary HTTP/network failures use the last valid response, if one exists; missing items and unauthorized access do not use a stale fallback. The cache may be purged manually from the settings page.

The plugin does not edit article content in the database and keeps the historical shortcode and option keys.

**Français**

Zotero Notes ajoute des appels de notes et une bibliographie à la fin des articles et pages consultés individuellement. Les références proviennent de l'API Zotero en HTTPS avec validation TLS. Le cache conserve les données fraîches (12 heures par défaut, durée configurable) ainsi que la dernière version valide en cas d'indisponibilité temporaire de Zotero. Une purge manuelle est disponible dans Réglages > Zotero Notes. La clé API reste côté serveur, et laisser le champ vide conserve la clé actuelle.

Syntaxe : `[zref]VP5PKI56[/zref]`, `[zref name="source"]VP5PKI56[/zref]`, puis `[zref name="source" /]` pour réutiliser la référence.

== Installation ==

Install and activate the plugin. Under Settings > Zotero Notes, enter your Zotero user ID and API key. Insert the shortcodes into posts and pages. Do not rename a shortcode already used in published content.

**Français :** Activez l'extension et renseignez l'identifiant Zotero et la clé API dans Réglages > Zotero Notes. Insérez les shortcodes dans vos articles. Ne changez pas le nom du shortcode s'il est déjà utilisé.

== Frequently Asked Questions ==

= Does the plugin use JavaScript? =

No. Rendering, HTTP requests, and cache management are implemented in PHP.

= How long are references cached? =

Fresh responses default to 12 hours. The last valid response is retained as a fallback during temporary failures, until the cache is purged. Zotero API changes are not pushed automatically.

= Le cache peut-il être vidé ? =

Oui, depuis Réglages > Zotero Notes. Cette action supprime aussi les copies de secours.

== Changelog ==

= 1.3.0 =
* Secure WordPress HTTP API requests with TLS certificate verification.
* Resilient cache with configurable freshness, manual purge and last-valid fallback.
* Safer HTML output, compatibility with PHP 8 and singular-only rendering.
* Kept existing shortcodes and the `zotero_notes_option_name` setting.
* Français : refonte du cache, sécurisation des appels HTTP et de l'affichage.

= 1.2.3 =
* Earlier security and escaping changes.

= 1.1.1 =
* Display rules modified.

= 1.0.3 =
* Language parameter updated.

= 1.0.2 =
* Added support for pages.

= 1.0.1 =
* Initial caching.

= 1.0.0 =
* First public release.
