=== Tugak Slider ===
Contributors: amarantine04
Donate link: https://ko-fi.com/E5E82AYNUK
Tags: slider, carousel, posts, divi, elementor
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.1.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Clean two-pane split slider for posts, pages, or custom selections—with zero frontend bloat and full shortcode control. Shortcode: [tugak_slider]

== Description ==

I originally built this slider for an independent film magazine because I wanted a clean, editorial split layout—photo on one side, story and film credits on the other—without loading heavy slider libraries or fighting my page builder. Now I'm sharing it in case your site needs the same calm, lightweight touch. — *Amarantine*

Tugak Slider displays your content in a two-pane layout: the featured image on the left, and your text on the right. Drop it anywhere shortcodes work using `[tugak_slider]`—in a Divi 5 Shortcode or Code module, Elementor, the Gutenberg shortcode block, or even a narrow sidebar column.

Everything is adjustable in the admin settings, and any shortcode attribute can override those defaults on the fly.

= Two distinct slide styles =

- **Card (default):** A clean, rounded card layout with the photo on the left and text on the right.
- **Magazine:** An editorial layout featuring a large serif title, an automatic `FIG. 01 —` caption line under the photo, a quote-style excerpt with an accent border, and an optional color accent rectangle behind or overlapping the image.

You have full control over the accent rectangle—toggle it on or off, adjust its size, position, color, opacity, and aspect ratio (including a `1:1` square), or let it stick out past the photo edge.

= Optional slide elements =

Turn individual details on or off depending on what your layout needs:

- Category badge and publish date in the meta line
- Photo caption pulled automatically from the image description
- Author name below the title
- **Film metadata (Director, Country, Year):** A dedicated box right inside the post editor. Fill in what you need per slide—any empty fields stay neatly hidden.

= Arrows, touch gestures, and navigation =

- **Five built-in arrow styles:** Classic, thin lines, art, blinking, and an artistic variant—all with live previews in the admin—or upload your own arrow image from the media library.
- **Flexible placement:** Position arrows across nine grid spots, split them onto the outer sides of the slider, show them only on hover, hide them on touch screens (letting finger swiping take over), or hide them completely in favor of dots or slide numbers.
- **Custom slide button:** Adjust button text, size (S / M / L), corner radius (`0`, `10`, `14 px`, or pill), pick from six shadow presets, or replace the button text with a custom image.

= Lightweight and works everywhere =

The frontend (`assets/slider.css` and `assets/slider.js`) has zero WordPress or third-party library dependencies. It works inside any page builder that renders shortcodes or raw HTML, and you can even copy both files onto a plain static HTML site. If you load slider markup dynamically via AJAX or accordions, simply call `bootTugakSliders()` after injection.

= Accessibility, themes, and privacy =

- **Accessible out of the box:** Full keyboard navigation (arrow keys), proper ARIA carousel roles, visible focus states, and automatic support for `prefers-reduced-motion`.
- **Visual themes:** Includes Light, Rosé, Dark, and System auto themes.
- **Zero tracking:** The public slider makes zero external requests.
- **Translations:** Available in English, Slovak, and neutral Latin American Spanish.

= Shortcode examples =

- Latest 3 posts: `[tugak_slider]`
- Latest 3 pages: `[tugak_slider type="page"]`
- Filter by category: `[tugak_slider category="news" count="3"]`
- Specific posts or pages in your exact order: `[tugak_slider ids="12,45,89"]`
- Magazine editorial style: `[tugak_slider style="magazine"]`
- Magazine style with a square accent rectangle: `[tugak_slider style="magazine" fig_ratio="1:1"]`
- Custom button text and autoplay (in ms): `[tugak_slider button_text="Read the review" autoplay="5000"]`
- Force a color theme: `[tugak_slider theme="dark"]` *(light, rose, dark, or auto)*
- Disable touch swiping: `[tugak_slider swipe="off"]`

= Free and independent =

Tugak Slider is completely free, with no accounts, tracking, or locked pro features. If it gave your site a cleaner look and saved you some setup time, you can support its ongoing development with a coffee on Ko-fi.

== Installation ==

1. In your WordPress dashboard, go to **Plugins → Add New**, search for "Tugak Slider", and click **Install Now**—or upload the plugin ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin. You'll find its settings under the **Tugak** menu in your admin dashboard.
3. Configure your default style, colors, and arrows, then place `[tugak_slider]` wherever you want the slider to appear.

== Frequently Asked Questions ==

= Does this plugin connect to any external servers? =

Never on your live site. The public slider loads everything locally from your own server with zero external requests. In the WordPress admin, opening the **About** tab loads the Ko-fi support button graphic directly from `storage.ko-fi.com` in your browser—no tracking scripts are loaded and no data is sent by the plugin.

= How do I add the film metadata (Director, Country, Year) to a slide? =

Open any post or page in the WordPress editor and scroll down to the **Tugak Slider — film data** box below the content area. Fill in the Director, Country, and Year fields—anything you leave blank stays hidden, and the field labels translate automatically to match your site language.

= Will it work inside a narrow sidebar or page builder column? =

Yes. The slider checks the actual width of its container rather than just the browser window, so placing it inside a narrow sidebar or column automatically switches it to a clean single-column layout.

= Where do I report bugs or security issues? =

Please send bug and security reports directly to `bichos@amarantine.dev`. For general setup questions, feel free to post in the WordPress.org support forum.

== Changelog ==

= 1.1.10 =
- The slider no longer shows posts that an SEO plugin marks as noindex (Tugak SEO, Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework). Hidden posts are replaced by the next ones, so the list keeps its length. Other SEO plugins can use the `tugak_slider_is_post_noindex` filter.

= 1.1.9 =
- Fixed a fatal error that broke the slider on the public site and in page builders: the film data line (Director / Country / Year) is now read correctly.

= 1.1.8 =
- After switching the language, a note appears in the administration reminding you to purge the site cache (caching plugin, server cache or CDN) so the change shows on the public slider. The note shows once and can be dismissed.

= 1.1.7 =
- The language choice applies on the spot: saving the settings reloads the screen in the chosen language right after the green confirmation. No logout or re-login is needed anywhere — the choice is a site setting, so every visitor and every admin gets it on the next page load.
- The language override is now applied on every translation load path, so edge cases in newer WordPress versions cannot bring back the old language. On the public slider the labels change with the next page render; with a caching plugin or server cache they appear after its next purge.

= 1.1.6 =
- Manual language choice in Theme → Language: Automatic / English / Slovak / Spanish. Automatic keeps following the site language; a fixed choice applies to all plugin texts in the administration and on the slider (film metadata labels, fallback button text, screen-reader labels).
- Arrow visibility gained a "none" option (Appearance → Arrows, or arrows_show="none"): the arrows disappear and only the slide indicator (dots or slide number) navigates.
- Film metadata labels are no longer settings of their own — Director, Country and Year are always labeled in the chosen language automatically.

= 1.1.5 =
- Film metadata can be switched off completely (Settings → Content defaults → "Show film metadata", or film_meta="off"). Even when on, slides without values render nothing.
- The film data box in the post editor has example placeholders (A. Rojas / México / 1966) — any text you type is shown as-is: numbers as numbers, words as words.

= 1.1.4 =
- Film data moved into the post editor: a "Tugak Slider — film data" box with Director, Country and Year fields on every post and page. Per-slide, optional, no custom-field typing needed.
- The accent rectangle can now stick out of the photo and of the slider (no more clipping); card corners stay rounded.

= 1.1.3 =
- Accent rectangle now works in both slide styles (in the card style it is cropped to the rounded photo).
- Arrow opacity setting (Appearance → Arrows → Opacity) and arrows_opacity attribute.
- Arrow position with dots: the dots stack below the arrow pair so they never fight for the same row.
- Film metadata simplified to three fixed fields — Director, Country and Year (editable labels, values come from each post's custom fields).
- Saving is more visible (green confirmation) and you get a warning when leaving the settings with unsaved changes.
- Theme picker shows mini previews of the Light / Rosé / Dark / System slider themes.
- Shortcode parameters are paginated (1 / 4) instead of one long table.

= 1.1.2 =
- Security: the shortcode `fig_ratio` value is now checked against the allowed list like every other attribute.
- Security: custom-field rows with protected keys (starting with an underscore) are no longer saved or shown.
- Password-protected posts never appear in a slider, even when listed in `ids`; the `ids` list is limited to 20 items, like `count`.
- The settings save handler ignores crafted array input instead of raising PHP warnings.
- Faster pages: slide photos now use the media library's responsive sizes (srcset), carry width and height so the page does not jump while loading, and hidden slides load at low priority.
- The script loads deferred; when the page itself contains the shortcode the stylesheet loads in the head, so the slider no longer flashes unstyled.
- Autoplay pauses while the slider is off-screen or the browser tab is in the background; a vertical scroll on a touch screen is no longer mistaken for a swipe.
- Fixed an error in Safari 13 and older that stopped the slider script.
- The shortcode builder removes quotes and square brackets from values so the generated shortcode always works.
- Uninstall removes the settings from every site of a multisite network.
- The admin menu now shows the shared Tugak icon.
- A slider placed in a narrow column (a sidebar, a page-builder column) now uses the single-column layout even on a wide screen; before, the layout followed only the screen width.
- On the plugin's own screen only the notices of other plugins and themes are hidden; WordPress notices (updates, security, site health) stay visible.

= 1.1.1 =
- Swipe gesture on touch devices is now a setting (Settings → Content defaults) and a swipe shortcode attribute; on by default.
- Arrows are hidden on touch screens by default (Visibility → "desktop only") so finger swiping takes over — swipe and arrows work independently, and you can turn the arrows back on at any time.
- Slide indicator: slide number, clickable dots, or nothing (Settings → Appearance → Arrows).
- Help tooltips (the small ⓘ next to every option) in the administration, translated to Slovak and Spanish.
- The hero logo is vertically centered in its band; small-screen polish for the admin header.

= 1.1.0 =
- New magazine slide style with an editorial layout: large serif title, category badge, author line, quote-style excerpt and outline button.
- Accent rectangle behind the photo with its own settings: on/off, layer (on or under the photo), size, position, aspect ratio including 1:1, color, opacity and blending. Full shortcode support via fig and fig_* attributes.
- Optional slide elements: photo caption with automatic "FIG. NN —" numbering, author, date, and up to three custom film metadata fields.
- Five arrow styles (classic, lines, art, blinking, artistic) with nine position combinations, an on-the-sides mode, hover-only visibility, custom color, and media library image support.
- Button styling: corner radius, shadow presets, size, and an icon that replaces the text — also from the media library.
- Redesigned administration in five tabs (Shortcode, Settings, Appearance, Theme, About) with the shared Tugak look, help tooltips on every option, live theme switching (light / rosé / dark / system) and a sticky save bar.
- Excerpt length setting (excerpt_words).
- The "Tugak Suite" menu label is now translatable.

= 1.0.3 =
- Fixed the admin menu icon: the embedded SVG had no width/height, so browsers rendered it oversized and pushed the menu label to the right edge. The label now sits next to the icon like every other menu item.

= 1.0.2 =
- Family menu: the shared "Tugak" entry now opens the plugin's own screen when Tugak Slider is the only active Tugak plugin, and the family overview when other Tugak plugins are active.
- Registered the overview card with an explicit priority so the family overview lists plugins in one fixed order across all family plugins.

= 1.0.1 =
- Added compiled translation files for Slovak and Spanish.
- Restricted the shortcode `type` attribute to publicly viewable post types.
- Respected `prefers-reduced-motion` when autoplay is enabled.
- Exposed `bootTugakSliders()` in `assets/slider.js` for dynamically injected sliders (page builders, accordions, AJAX content).
- Moved the capability check before the nonce check in the settings AJAX handler.
- Removed the unused `icon.svg` asset.

= 1.0.0 =
- Initial release.
