=== Snapium Latest Offer ===
Contributors: yac
Tags: real estate, property, widget, sidebar, listings
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sidebar widget and shortcode displaying the latest real estate offer from snapium.pl – image, title, price, short description and a link.

== Description ==

Snapium Latest Offer adds a widget to your sidebar that always shows the most recent real estate offer published on [snapium.pl](https://snapium.pl) – a Polish real estate buying service.

The widget card shows:

* the main photo of the property,
* the offer title,
* the price,
* a short description (configurable length),
* a "View offer" button linking to the full offer on snapium.pl.

When a new offer is published on snapium.pl, the widget picks it up automatically – no configuration needed.

**Features**

* Classic widget, also available in the block-based widget editor (Legacy Widget block).
* Shortcode `[snapium_najnowsza_oferta]` for posts, pages and block themes without a sidebar.
* Each element (image, price, description, button) can be turned on or off.
* Results are cached for one hour, so your site stays fast and snapium.pl is not queried on every page view.
* If snapium.pl is temporarily unavailable, the last successfully loaded offer is shown.
* Lightweight: no JavaScript, one small stylesheet loaded only where the widget is displayed.
* Translation ready (Polish translation available).

== External services ==

This plugin connects to snapium.pl, the website whose offers it displays. Without this connection the plugin cannot work.

* **What is requested:** the public RSS feed of offers (`https://snapium.pl/property/feed/`) and the public page of the latest offer (e.g. `https://snapium.pl/property/...`), to read its title, description, price and main image.
* **When:** on the server side, when a page containing the widget or shortcode is displayed and the cached data is older than one hour (or 10 minutes after a failed request).
* **What data is sent:** no personal data and no data about your site or visitors is sent. These are ordinary HTTP GET requests made by your server, containing only the standard WordPress user agent (which includes your site URL).
* **Images:** the offer photo is loaded by the visitor's browser directly from snapium.pl, so snapium.pl receives the visitor's IP address and browser information, as with any embedded image. You can disable the image in the widget settings or with `show_image="0"` in the shortcode.

The service is provided by Snapium (snapium.pl). [Privacy policy](https://snapium.pl/polityka-prywatnosci/).

== Installation ==

1. Upload the `snapium-latest-offer` folder to `/wp-content/plugins/`, or install the plugin from the Plugins → Add New screen.
2. Activate the plugin.
3. Go to Appearance → Widgets and add the "Snapium – latest offer" widget to your sidebar.
4. Optionally adjust the title, visible elements, description length and button text.

To display the offer inside a post or page, use the shortcode:

`[snapium_najnowsza_oferta]`

Available attributes (all optional):

`[snapium_najnowsza_oferta show_image="1" show_price="1" show_excerpt="1" excerpt_words="20" button_text="View offer" new_tab="1"]`

== Frequently Asked Questions ==

= How often is the offer refreshed? =

Every hour. You can change this with the `snapium_lo_cache_ttl` filter (value in seconds):

`add_filter( 'snapium_lo_cache_ttl', function () { return 15 * MINUTE_IN_SECONDS; } );`

= My theme has no sidebar. Can I still use the plugin? =

Yes – use the `[snapium_najnowsza_oferta]` shortcode, e.g. in a Shortcode block.

= How do I change the colors? =

The card uses simple CSS classes (`.snapium-lo`, `.snapium-lo__price`, `.snapium-lo__button`, …). Override them in Appearance → Customize → Additional CSS.

= Can I display offers from another website? =

No. The plugin is built specifically for snapium.pl.

== Screenshots ==

1. The widget in a theme sidebar.
2. Widget settings.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
