This commit is contained in:
Javier Casares 2026-10-12 15:30:04 +00:00
commit 1ef08bd731
27 changed files with 4854 additions and 0 deletions

95
readme.txt Normal file
View file

@ -0,0 +1,95 @@
=== Font del Bosc — Trànsit ===
Contributors: javiercasares
Tags: traffic, incidents, zbe, low emission zones, mediona
Requires at least: 6.4
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 8.2
Version: 1.0.0
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
Traffic incidents (C-15 and all Catalunya) and Low Emission Zones for Font del Bosc residents.
== Description ==
Shows current road incidents from the Servei Català de Trànsit and the rules of the Catalan Low Emission Zones (ZBE), for residents of Font del Bosc (Mediona, Alt Penedès) who commute via the C-15 (Eix Garraf-Anoia).
* Incidents for the whole of Catalunya, with C-15 incidents highlighted (card grid, no map in this version).
* Incident text comes from the SCT public RSS feed merged into the DATEX2 structure by reference; coordinates and machine data come from DATEX2.
* Low Emission Zone cards: restricted vehicle labels, operating hours and a link to the municipal regulations, from the DGT national access point (DATEX2 v3).
* Persistent notice about the January 2026 etiqueta B restriction in Catalan ZBEs.
* Cached with short TTLs and a stale-on-error fallback, so a source outage never breaks the page.
Attribution (mandatory): Incidències: Servei Català de Trànsit (SCT) — CIVICAT. ZBE: DGT / Punt d'Accés Nacional.
== Using the plugin ==
= Shortcode =
`[fontdelbosc_transit]` renders the incidents view. Attributes:
* `view`: `c15` (default), `all` or `zbe`.
* `max`: maximum incidents to show (1-50), overriding the settings.
* `comarca`: restrict incidents to the comarques around Font del Bosc: `altpenedes`, `anoia`, `baixllobregat`, `garraf` — one value or a comma-separated list.
Examples:
`[fontdelbosc_transit view="c15"]`
`[fontdelbosc_transit view="all" max="10"]`
`[fontdelbosc_transit view="zbe"]`
`[fontdelbosc_transit view="all" comarca="anoia"]`
`[fontdelbosc_transit comarca="anoia,garraf"]`
= Widget =
A sidebar widget with an editable title offers the five latest C-15 incidents or a ZBE summary.
= Settings =
Settings → Font del Bosc Trànsit: cache lifetimes, maximum incidents, default view, zone selection (the 19 Catalan zones are pre-selected and new DGT zones appear automatically), 2026 notice toggle, fetch status, cache flush, and a documentation section.
== Installation ==
= Automatic download =
Visit the plugin section in your WordPress, search for "Font del Bosc — Trànsit"; download and install the plugin.
= Manual download =
Extract the contents of the ZIP and upload the contents to the `/wp-content/plugins/fontdelbosc-transit/` directory. Once uploaded, it will appear in your plugin list.
== Frequently Asked Questions ==
= Why is there no severity level on the incidents? =
The SCT DATEX2 and RSS feeds do not publish a severity field. Incidents are classified by type and, when available, by their impact on traffic.
= How fresh is the data? =
Incidents are cached for 5 minutes by default; the source updates in near real time. ZBE rules change rarely and are cached for 24 hours.
== Compatibility ==
* WordPress: 6.4 - 7.1
* PHP: 8.2 - 8.5
== Changelog ==
= 1.0.0 =
* Initial release: C-15 and all-Catalunya incident cards, ZBE cards with the 19 Catalan zones, 2026 etiqueta B notice, widget, stale-while-error caching, es_ES/ca translations.
= Previous versions =
If you want to see the full changelog, visit the [changelog.txt](https://git.robotstxt.es/ROBOTSTXT/fontdelbosc-transit/raw/branch/main/changelog.txt) file.
== Compliance ==
This plugin adheres to the following security measures and review protocols for each version:
* [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
* [WordPress Plugin Security](https://developer.wordpress.org/plugins/wordpress-org/plugin-security/)
* [WordPress APIs Security](https://developer.wordpress.org/apis/security/)
* [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)
* [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/)