=== SaveElectro ===
Contributors: ghenek
Tags: electricity, nord pool, spot price, energy prices, price tracker
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 2.1.9
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://www.saveelectro.com

Live Nord Pool electricity prices for Finland, Sweden, Norway, Denmark, Estonia, Latvia and Lithuania.

== Description ==

SaveElectro displays a live Nord Pool electricity spot-price widget on any WordPress page, post, or sidebar.

The widget shows the current price, a 24-hour bar chart, today/tomorrow toggle, the cheapest 2-hour window, and min/avg/max statistics for your chosen country.

**Features**

* Live spot prices, updated every 15 minutes (hourly in Norway & Denmark, pending their data providers)
* 7 countries: Finland, Sweden, Norway, Denmark, Estonia, Latvia, Lithuania
* 24-hour colour-coded bar chart with current-hour marker
* Today / Tomorrow toggle
* Cheapest 2-hour window highlight
* Min / Avg / Max / Unit statistics
* Dark and light themes
* Shortcode, Gutenberg block, and Classic sidebar widget
* Alignment options: left, center, right, float-left, float-right
* Margin top and bottom controls
* Works behind Cloudflare, WP Rocket, LiteSpeed and other page caches
* No account or API key required
* Optional "Electricity prices by SaveElectro" credit link (off by default)
* Translation-ready via WordPress.org's own translation system (translate.wordpress.org)

**Usage**

Add the shortcode to any page or post:

`[saveelectro]`

With options:

`[saveelectro country="SE" theme="light" align="center"]`

== External services ==

This plugin displays an electricity-price widget that is loaded from SaveElectro.com, an external service operated by SaveElectro.

**What the service is and what it is used for**

The widget itself (the price chart and figures) is served from `https://www.saveelectro.com/widget/embed.html` and embedded on your page in an iframe. The widget reads live Nord Pool electricity prices from the SaveElectro API at `https://www.saveelectro.com/wp-json/saveelectro/v1/summary`.

**What data is sent and when**

When a visitor views a page containing the widget, their browser loads the widget from saveelectro.com. As with any embedded web content, the visitor's browser makes a request to saveelectro.com, which means their IP address and standard browser request headers are visible to that server for the purpose of delivering the widget. The plugin does not collect, store, or transmit any personal data itself, and no account or login is required.

The widget records anonymous, aggregated usage events (for example: that a widget was viewed, that a country was switched, or that the SaveElectro link was clicked) so we can understand how the widget is used. These events contain no personal data, set no cookies, and store no IP addresses. The country of the viewer is recorded only at a coarse country level derived from network information, never an IP address.

The selected country and theme are passed in the widget URL (for example `?country=FI&theme=dark`) so the correct prices are shown. No personal information is included.

**Service provider**

* Website: https://www.saveelectro.com
* Terms of Service: https://www.saveelectro.com/terms
* Privacy Policy: https://www.saveelectro.com/privacy

== Translations ==

SaveElectro is fully translation-ready (all admin and front-end text uses standard WordPress i18n functions with the text domain `saveelectro`).

By default the plugin follows your site's own language (Settings -> General -> Site Language in wp-admin), the same as every other WordPress plugin. If you need the plugin's own settings page in a specific language regardless of the site's language, use the **Plugin Language** dropdown at the top of the SaveElectro settings page.

Note: the plugin's translated text covers its own admin settings page and the small widget wrapper (title attribute, optional credit link). It does not yet cover the price widget's own content -- the live numbers, chart and labels inside the box -- which is served from saveelectro.com and is still English-only for all languages.

Available languages:

* English (default)

Finnish and other languages (Estonian, Swedish, Norwegian, Danish, Latvian, Lithuanian) are planned. Translations are handled entirely through the plugin's own project on translate.wordpress.org once published -- WordPress automatically downloads and applies any language with an available translation there, with no action needed from site owners. Community translators are welcome to contribute directly on that platform.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/saveelectro` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the Plugins screen in WordPress.
3. Go to "SaveElectro" in your admin sidebar to set the default country, theme, and alignment.
4. Add `[saveelectro]` to any page or post, or use the SaveElectro block or sidebar widget.

== Frequently Asked Questions ==

= Which countries are supported? =

Finland (FI), Sweden (SE), Norway (NO), Denmark (DK), Estonia (EE), Latvia (LV) and Lithuania (LT).

= Do I need an API key or account? =

No. The widget works without any account or key.

= Does it work with page builders and caching plugins? =

Yes. The widget loads in the visitor's browser inside an iframe, so it works with Elementor, Divi, Gutenberg, and any page-cache or CDN including Cloudflare.

= How often are prices updated? =

The widget refreshes every 15 minutes in Finland, Sweden, Estonia, Latvia and Lithuania (hourly in Norway and Denmark, until their data providers publish quarter-hour prices). Tomorrow's prices are published by Nord Pool after 13:00 CET.

== Screenshots ==

1. The SaveElectro widget embedded on a page - live spot price, today's hourly chart, cheapest window, and a prompt to upgrade to Premium alerts.
2. SaveElectro.com - the full web app the free widget connects to, where users can sign up to unlock alerts, scheduling, and multi-household control.

== Changelog ==

= 2.1.9 =
* Renamed internal prefix from "sew_" to "saveel_" throughout (functions, constants, CSS classes, script/style handles)
* Removed the Domain Path header (pointed to a languages folder that no longer exists now that bundled translation files have been removed -- flagged by Plugin Check)
* Removed bundled Finnish translation files -- WordPress.org manages translations automatically via translate.wordpress.org once the plugin is approved
* Admin settings page no longer auto-loads an iframe for the live preview -- replaced with a plain link that opens the preview on saveelectro.com in a new tab
* Front-end CSS/JS now properly registered and enqueued via wp_enqueue_style()/wp_enqueue_script() with wp_add_inline_style()/wp_add_inline_script(), instead of being echoed directly as inline <style>/<script> tags

= 2.1.8 =
* Fixed Plugin URI and Author URI being identical (WordPress.org submission requirement) -- Author URI now points to the developer's WordPress.org profile

= 2.1.7 =
* Removed the manual load_plugin_textdomain() call (discouraged since WP 4.6) -- translations now load automatically via the Text Domain / Domain Path headers, per WordPress.org Plugin Check
* Confirmed compatible with WordPress 7.0

= 2.1.6 =
* Added a manual "Plugin Language" switcher to the settings page (overrides site language for the plugin's own admin text)
* Widget iframe URL now passes a lang parameter, ready for future widget-side localisation

= 2.1.5 =
* Full i18n pass: every admin and front-end string now uses standard WordPress translation functions
* Added bundled Finnish (fi) translation
* Plugin is now translation-ready for future languages via the /languages folder

= 2.1.4 =
* Primary shortcode is now [saveelectro]; [saveelectro_prices] still works as an alias

= 2.1.3 =
* Unified display name to "SaveElectro" across plugin, menu, block and widget

= 2.1.2 =
* Added anonymous, cookieless usage analytics (no personal data, no IP stored)

= 2.1.1 =
* Credit link now aligns flush under the widget

= 2.1.0 =
* Added optional, off-by-default credit link below the widget

= 2.0.3 =
* Aligned plugin slug and text domain to the SaveElectro brand

= 2.0.2 =
* Replaced admin menu icon with a standard dashicon
* Added external-services disclosure to readme
* Added index.php protection file

= 2.0.1 =
* Fixed activation error caused by uninstall hook

= 2.0.0 =
* Initial public release

== Upgrade Notice ==

= 2.1.0 =
Adds an optional support link. Recommended for all users.
