=== AboutBuzz Stories Embed ===
Contributors: ftpwebdesign.com
Tags: video, stories, embed, reviews, testimonials
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 2.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed AboutBuzz video stories on your WordPress site with a single shortcode.

== Description ==

AboutBuzz Stories Embed renders a responsive, lazy-loading carousel of verified video reviews from AboutBuzz.com. Add the shortcode `[aboutbuzz_reviews code="ABZ-XXXX-XXXX-XXXX-XXXX"]` anywhere in your content and the plugin handles fetching, caching, and rendering.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/aboutbuzz-stories-embed`, or install it via the Plugins screen in WordPress.
2. Activate the plugin.
3. Add `[aboutbuzz_reviews code="YOUR_CODE"]` to any post or page. Get your code from your AboutBuzz dashboard.

== External Services ==

This plugin connects to AboutBuzz.com to fetch video stories and record likes. All requests are over HTTPS.

* Endpoint `https://aboutbuzz.com/wp-json/aboutbuzz/v1/stories/by-code` — fetches stories for a given activation code (sent: code, plugin version).
* Endpoint `https://aboutbuzz.com/wp-json/aboutbuzz/v1/like/` — records a like (sent: post ID, plugin version).

Successful story responses are cached for 5 minutes per activation code in a WordPress transient. No personal visitor data is collected by the plugin.

* Terms of Service: https://aboutbuzz.com/terms-of-service/
* Privacy Policy: https://aboutbuzz.com/privacy-policy/

== Frequently Asked Questions ==

= How do I get an activation code? =

Sign in to your AboutBuzz dashboard at https://aboutbuzz.com or contact support.

= Is the widget mobile-friendly? =

Yes — it renders as a single-row, scroll-snapping carousel that adapts to viewport width.

== Screenshots ==

1. Plugin installed, reviews visible on the site.
2. Reviews on mobile in a carousel with play/pause and like integration.
3. Settings screen — AboutBuzz Activation.
4. Entering your secret key from aboutbuzz.com.
5. Embedding reviews via shortcode.

== Changelog ==

= 2.0.2 =

**Branding refresh, mobile layout fix, and per-review language labels.** Updates the widget palette to the new AboutBuzz brand colors, resolves a mobile-only layout bug where the rating stars wrapped onto a second line on narrow cards, and renders the "Verified product review" label in the language of each individual review.

* **Per-review "Verified product review" label.** The label under each video is now selected from the review's `acf.jezik` field (returned by `/wp-json/aboutbuzz/v1/stories/by-code`), so a Slovenian review shows "Ocena testiranega izdelka" while an English review on the same page shows "Verified product review". Six languages are supported out-of-the-box, with both Slovene-language and English-language native names accepted as input values:
    * Slovenian (`Slovenščina` / `Slovenian`) → "Ocena testiranega izdelka"
    * English (`Angleščina` / `English`) → "Verified product review"
    * Russian (`Ruščina` / `Russian`) → "Проверенный отзыв о товаре"
    * German (`Nemščina` / `German`) → "Verifizierte Produktbewertung"
    * Latvian (`Latviščina` / `Latvian`) → "Apstiprināta produkta atsauksme"
    * Turkish (`Turščina` / `Turkish`) → "Doğrulanmış ürün yorumu"
    * Unknown / missing values fall back to the WordPress site locale via the existing `__('Verified product review', …)` translation, so behavior on existing sites is unchanged when the API has no language data.
* **`language` added to the sanitized story array.** A new `language` key (canonical 2-letter code) is now stored in the per-story sanitized array and the 5-minute response cache. A migration guard discards any 2.0.1 transient entry that's missing this key on first read after upgrade, so the new label kicks in immediately on the next render — no manual cache flush required.
* **Brand palette updated.** `--aboutbuzz-text` changed from `#545454` to `#404040`, and `--aboutbuzz-accent` changed from `#007cba` to `#01798C` (new AboutBuzz teal). Affects body text and any element bound to the accent variable (logo text, etc.).
* **Loading spinner restyled.** Spinner border thickness increased from `2px` to `3px`, and the active arc color now uses the new accent `#01798C` instead of the previous `#3498db`.
* **Mobile card width increased from 58% to 80%** of the viewport (`@media (max-width: 600px)`). The narrower card was causing the rating row to overflow and the star icons to wrap onto a new line on small screens. `scroll-padding-inline` was updated in lockstep so scroll-snap centering still works.
* **Rating row hardened against overflow.** `.row-0` / `.ab-info-row` now declares `flex-wrap: nowrap` with `gap: 8px`. The rating-stars container is `inline-flex` with `flex-shrink: 0` and `white-space: nowrap`, and `.aboutbutzz_like_wrapper` is also `flex-shrink: 0`. Stars and the like button stay on a single row regardless of card width.

= 2.0.1 =

**Privacy hardening.** Reduces the surface area for personal data from the AboutBuzz API to land on the client site.

* **Response caching now holds a sanitized array instead of the raw API body.** The `aboutbuzz_stories_bycode_<md5>` transient previously stored the full JSON response body as a string, meaning any fields the server returned (including ones this plugin does not render) would sit in `wp_options` for up to 5 minutes per activation code. The transient now stores only the allowlisted `$sanitized_posts` array (ID, rating, vote_count, watermark_video, product_source, brand, and the video URL) that the template actually consumes. Extra server-returned fields are dropped before caching.
* **Removed the unused `post_title` field** from the sanitized story array. It was being copied from the API response but never rendered anywhere in the template. Since `post_title` on the AboutBuzz side can contain reviewer names, stripping it here removes that field from the client's in-memory and cached representation of each story.
* **Migration guard for the legacy cache format.** Existing transient entries (stored as JSON strings by earlier builds) are discarded on first read after upgrade; the next render repopulates the cache in the new array format. No manual cache flush required.
* 5-minute cache TTL and the `?abz_nocache=1` admin bypass are unchanged.
* Removed per-review title interpolation from video `aria-label` and `alt` strings; accessibility labels are now generic ("Predvajaj video oceno" / "Predogled video ocene"). Translations (`.pot`, `sl_SI`, `en_US`) updated to match the new msgids.

= 2.0.0 =

**Major release.** Card design redesigned to match aboutbuzz.com homepage, CSS architecture moved to `@scope` for isolation, response caching added, new Product Source badges, admin diagnostics for error paths.

* "Verified Purchase" / "Verified Tester" overlay badges driven by the `product_source` ACF field; assets bundled locally.
* Rating row always renders 5 inline-SVG stars (filled `#FFB600`, empty outlined `#C7C7C7`).
* Always-on single-row scroll-snap carousel; mobile cards at 58% of viewport so neighbours peek.
* All widget styles wrapped in `@scope (.aboutbuzz-reviews-host) { ... }`; CSS custom properties exposed for theming (`--aboutbuzz-card-bg`, `--aboutbuzz-text`, `--aboutbuzz-muted`, `--aboutbuzz-accent`, `--aboutbuzz-star-filled`, `--aboutbuzz-star-empty`, `--aboutbuzz-radius`, `--aboutbuzz-video-height`).
* 5-minute response cache per activation code; errors never cached. Per-visitor rate limit counts cache misses only (60/hour). Admin `?abz_nocache=1` bypass.
* Admin-only yellow info boxes for rate-limit / HTTP error / network error / invalid-JSON paths; public visitors see nothing.
* New `ABOUTBUZZ_EMBED_VERSION` constant drives enqueue cache-busting and API `User-Agent`.
* Star row carries an `aria-label` with the numeric rating; individual SVGs are `aria-hidden`. Decorative check `alt` emptied.
* `.pot`, `en_US.po`, `sl_SI.po` updated; `.mo` files recompiled.

**Breaking changes:**

* The legacy "wrap as a row at 1–3 videos, carousel at 4+" layout is gone — every count renders as a carousel.
* Brand-site CSS targeting class names the plugin never emits (`.playbutton`, `.heart-icon`, `.vote-button-overlay`, `.vote-count`, `.voting`, `.video-preview`) will continue to do nothing.
* If a brand theme forces `.ab-info-row { display: grid }`, the flex-based layout will break — remove the conflicting rule.

= 1.9.x =
* 1.9.3 — Fixed first thumbnail not loading on sites using third-party lazy-loaders (WP Rocket, LiteSpeed). Added `data-no-lazy`, `data-skip-lazy`, `skip-lazy`, `no-lazyload` to the first image.
* 1.9.2 — Updated plugin logo.
* 1.9.1 — Full i18n support: translatable strings, `.pot` template, `sl_SI` and `en_US` catalogs, translatable ARIA labels.
* 1.9.0 — Shortcode renamed `[aboutbuzz_smart_stories]` → `[aboutbuzz_reviews]`. Auto-detects brand from the activation code; `code` is the only parameter.

= 1.8.x =
* 1.8.2 — Removed problematic `all: unset` reset.
* 1.8.1 — Assets fix.
* 1.8.0 — Visual redesign: modern layout, refreshed colors, improved spacing, better like-button feedback, custom Nunito Sans font, new SVG carousel arrows.

= 1.7.x =
* 1.7.9 — Heart icon styling fix (red, proper opacity states).
* 1.7.8 — Added "Oddaj video mnenje" upload link.
* 1.7.7 — Major WordPress.org compliance pass: external CSS/JS, AJAX likes, CORS + nonces, no inline styles.
* Earlier 1.7.x — Initial release, carousel, like button, mobile centering, caching.

== Upgrade Notice ==

= 2.0.2 =
Brand refresh + per-review language labels + mobile layout fix.

= 1.9.3 =
Fixes first thumbnail not loading on sites with lazy-loading plugins. Recommended for all users.

= 1.7.7 =
Major WordPress.org compliance update — please install for security and UX fixes.
