Changelog
⚠️ Action required after upgrading 1. Database migration — Matomo will prompt you to upgrade the schema on activation.
weather_pressureandweather_visibilitywidenINT → FLOAT;weather_wind_directionnarrowsVARCHAR(255) → VARCHAR(8). Existing data is preserved (the 16-point compass is ≤3 chars). 2. Republish your Matomo Tag Manager container. The bundledWeathertag template (WeatherTag.web.js) was rewritten — published containers keep serving the old JS until you publish a new version. 3. If you use the plain JS snippet (no MTM), copy the updated snippet fromdocs/index.mdso you also drop the third-partyipapi.cocall.
Privacy / data flow
- remove: third-party ipapi.co IP-lookup. The Matomo Tag Manager template now uses WeatherAPI's built-in q=auto:ip so visitor IPs are no longer shared with a second service.
- add: public WeatherReports&action=getUserIp Controller endpoint as a self-hosted IP-resolution fallback for CDN/proxy setups (uses Matomo's IP::getIpFromHeader(), honours proxy_client_headers).
- harden: tag JS now bails out cleanly on missing API key, HTTP errors, malformed responses, and unavailable sessionStorage.
Tracking & validation
- refactor: Columns/ now share a single Base class — ~1,500 lines of duplicated dimension boilerplate replaced by ~200 lines.
- fix: input is type-cast (int/float/string) at the tracker via Common::getRequestVar instead of being stored as raw strings.
- fix: out-of-range values are dropped at ingest:
- Cloud / Humidity: 0-100
- UV: 0-20
- Temperature / Felt temperature: -100..200
- Pressure: 0..2000 (covers both mb and inHg)
- Visibility / Precipitation / WindSpeed: 0..1000
- WindDirection: must match the 16-point compass (N, NNE, NE, ENE, …, NNW)
- fix: string columns (Condition, WindDirection) no longer write integer 0 when the request has no value — they store null.
Schema
- fix: weather_pressure is now FLOAT NULL (was INT(10)) so values in inHg keep precision.
- fix: weather_visibility is now FLOAT NULL (was INT(10)) so values in miles keep precision.
- fix: weather_wind_direction is now VARCHAR(8) NULL (was VARCHAR(255)) — the 16-point compass max is 3 chars.
- A standard Matomo schema migration prompts admins on next activation; existing data is preserved (INT→FLOAT widens losslessly).
Reports
- fix: scale reports (Temperature, Pressure, Humidity, …) sort numerically by label so chart x-axes read 1, 2, 10, 20 instead of 1, 10, 2, 20.
- fix: categorical reports (Condition, WindDirection) sort by visit count and no longer collapse all rows into a single 0 bucket from a stray (float) cast.
- add: categorical report tables show top 15 rows + "Others" by default (was Matomo's 5).
- chore: dedupe the rounding closure in API.php — six methods now share one getRoundedScaleDataTable() helper.
Visitor log
- ui: redesigned weather panel as a themed card with a header line (Weather · Condition + temperature with felt-temp suffix) and a 2-column metric grid below.
- ui: units (°C/°F, mm/in, mb/inHg, km/mi, km/h/mph) are rendered next to each value, read from the existing per-site MeasurableSettings (those settings are now actually wired in).
- ui: light/dark theme aware — colors and surfaces use Matomo's CSS variables (--theme-color-text, --theme-color-text-light, --theme-color-border, --theme-color-background-contrast) with hex fallbacks. DarkTheme, GoogleTheme and Morpheus all match automatically.
- ui: rows with no recorded value are hidden (no more bare °C / mb / % suffixes); the whole card is skipped if a visit has no weather data at all.
- harden: renderVisitorDetails is wrapped in try/catch and logs to tmp/logs/ instead of breaking the visitor log if rendering fails.
Other
- fix: removed broken Live\Model::getCRMData / getAdviews calls in WeatherReports.php (copy-paste leftovers from another plugin; methods don't exist).
- chore: deleted dead commented-out MeasurableSettings::makeWeatherLangSetting (~50 lines) and empty config/config.php / config/tracker.php.
- chore: dropped boilerplate example comments from every Columns/*.php file.
Tests
- add: 53 PHPUnit unit tests covering every column's bounds, type coercion, the 16-point compass validator, and Condition's UTF-8 truncation.
- add: phpunit.xml with Unit and Integration test suites.
Docs
- rewritten classic-snippet docs (no more ipapi.co), documented the optional getUserIp endpoint, refreshed the dimensions table to reflect the FLOAT migrations, added a privacy note.
fix: Archiving issues
fix: Sorting deprecated method replace with "label"
The great update you waited for!
support: Conversions reports update: translations for DE, ES, IT, NL and SV refactor: ReportsBuilders enhanced bar charts visualisation
add: Cover for marketplace
update: Documentation URL
update: MeasurableSettings
Support Matomo v5
Update documentation FAQ
Update tag language selector
Add screenshots
Add custom unit in Weather Tag from Tag Manager
Add screenshots and update documentation
Add Matomo Tag Manager Custom Tag
Support Matomo Tag Manager
Add FR translation
Change _paq.push(['WeatherReports.setWeather']) parameters order
Add fetch to IPApi to get rid of PHP global variable
Change request to PING=1
Rename screenshots
Add screenshots
Fix report Archiver.php class
Test #3 with methods in Archiver.php
Test #2 with abstract Class in Archiver.php
Test #2 with abstract method in Archiver.php
Remove abstract method from Archiver.php
Change blade view for VisitorDetails
Add abstract method to Archiver.php
Update IP Address
Update table in docs/index.md (Markdown tables are not supported by Matomo)
Plugin starting code base