=== SnapTapGo Gallery ===
Contributors: snaptapgo
Tags: gallery, photo gallery, image gallery, photos, portfolio
Requires at least: 5.6
Tested up to: 7.0
Stable tag: 1.8.6
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display a live photo gallery from your SnapTapGo project on any WordPress page. Photos update automatically as you manage them from your phone.

== Description ==

**SnapTapGo Gallery** connects your WordPress site to your [SnapTapGo](https://snaptapgo.com) account in two powerful ways:

**1. Live gallery shortcodes** — Add one shortcode to any page or post. Manage every photo from your phone. The gallery on your site updates within about 30 seconds when you add, remove, approve, or reorganize photos — no WordPress login needed.

**2. Upload to WordPress from your phone** — Send photos directly from your phone to your WordPress media library. Requires a SnapTapGo Business plan. No desktop, no FTP, no logging into WordPress. Just tap and upload.

= How live galleries work =

1. Create a project in the SnapTapGo app and upload your photos
2. Organize photos into named groups (e.g. "Before", "After", "Events", "Stallions")
3. Copy your **Gallery ID** from the WordPress section of the project (separate from the guest share link)
4. Paste the shortcode on any WordPress page — done

The gallery pulls approved photos live from SnapTapGo and caches them for performance. Groups appear as clearly labeled sections automatically.

On **Business** plans, contributor uploads can go to a pending queue first — approve photos in the app before they appear on your public WordPress gallery. Invite up to 5 **gallery co-owners** per project to upload and approve from their phones.

Setup guide: [How to update WordPress galleries without logging in](https://snaptapgo.com/guides/how-to-update-wordpress-photo-galleries-without-logging-in/)

= How to upload photos from your phone =

1. Go to **Settings** in the SnapTapGo app
2. Copy your connection token and paste it into **Settings → SnapTapGo** in WordPress
3. Enter your site URL in the SnapTapGo app to connect
4. Open any project and tap **Upload to Site** — photos go straight to your media library (Business plan)

= Gallery layouts =

* **Grid** — equal-sized square tiles, responsive columns
* **Masonry** — natural photo heights, Pinterest-style flow
* **Carousel** — one photo at a time, swipe-friendly with optional autoplay
* **Strip** — portrait photos side by side, perfect for project sequences with optional autoplay

All layouts include a full-screen lightbox with navigation arrows, keyboard support, swipe gestures, and a download button.

= Great for =

* **Contractors** — show before/after photos on your website. Update from the job site.
* **Landscapers & home service pros** — build a live portfolio that never goes stale.
* **Interior designers** — display project rooms as organized, labeled gallery sections.
* **Real estate agents** — embed property photo galleries without touching the media library.
* **Web designers & agencies** — hand clients a gallery they can update without wp-admin after launch.
* **Teams with photographers + marketing** — photographer uploads, social downloads, owner approves what goes live.
* **Anyone** — if you take photos on your phone and want them on your website, this is the simplest way.

= Shortcode examples =

Basic grid:
`[snaptapgo project="YOUR_GALLERY_ID"]`

Masonry with 4 columns:
`[snaptapgo project="YOUR_GALLERY_ID" layout="masonry" columns="4"]`

Carousel with autoplay (4-second interval):
`[snaptapgo project="YOUR_GALLERY_ID" layout="carousel" autoplay="4"]`

Strip layout, no gaps, no lightbox (for hero use):
`[snaptapgo project="YOUR_GALLERY_ID" layout="strip" columns="4" gap="0" lightbox="false"]`

Strip with rounded corners and autoplay:
`[snaptapgo project="YOUR_GALLERY_ID" layout="strip" columns="4" radius="12px" autoplay="4"]`

Homepage hero from a named app section:
`[snaptapgo project="YOUR_GALLERY_ID" group="Website Hero" hero="cover" overlay="dark" lightbox="false"]`

Hero carousel from a section:
`[snaptapgo project="YOUR_GALLERY_ID" group="Website Hero" hero="carousel" autoplay="5" lightbox="false"]`

One section only (grid):
`[snaptapgo project="YOUR_GALLERY_ID" group="Services" layout="grid" columns="3"]`

= All shortcode attributes =

* `project` *(required)* — your WordPress Gallery ID from the SnapTapGo app (not the guest share link)
* `group` — show only photos from this app section (group name, case-insensitive). Omit to show all photos with section labels.
* `hero` — hero display mode: `cover`, `banner`, `contained`, `exact`, or `carousel`. Use with `group` to pull photos from one section. Loads lightweight hero CSS only (no gallery lightbox). (`exact` = a specific height in px/rem — not sticky/fixed navigation.)
* `overlay` — `dark` or `light` gradient overlay for text readability. Headline and button text stay in WordPress or your page builder.
* `height` — min height for `cover`, `exact`, or `carousel` heroes (e.g. `100vh`, `400px`). When set, overrides the default 70vh / 900px cap on cover.
* `layout` — `grid` (default), `masonry`, `carousel`, `strip`
* `columns` — 1–6 columns (default: `3`; applies to grid, masonry, strip)
* `gap` — spacing between photos in pixels (default: `8`; use `0` for no gap)
* `radius` — border radius on photos, e.g. `8px`, `12px`, `50%` (default: `0`)
* `limit` — maximum number of photos to display (default: `24`)
* `show_names` — show uploader name on each photo: `true` or `false` (default: `false`)
* `autoplay` — seconds between auto-advances for carousel and strip (default: `0` = off)
* `lightbox` — set to `false` to disable click-to-open; useful for hero/display-only use (default: `true`)

= Appearance settings =

Go to **Settings → SnapTapGo** to:

* Set a default layout for all galleries
* Customize group label font, size, weight, and color
* Override per-gallery with shortcode attributes

Group labels inherit your theme's heading font by default — no custom CSS needed.

= SnapTapGo plans & WordPress =

* **Free** — 1 live WordPress gallery embed
* **Pro** ($11.99/mo or $119/yr) — unlimited projects and share-link features; still 1 live WordPress gallery embed
* **Business** ($24.99/mo or $249/yr) — unlimited WordPress galleries, contributor photo moderation queue, gallery co-owners (up to 5 per project), and upload from your phone into the WordPress media library

Plan details at [snaptapgo.com](https://snaptapgo.com/wordpress/).

= External Services =

This plugin connects to **app.snaptapgo.com**, a third-party service operated by SnapTapGo.

* **Gallery display:** The plugin fetches photo data from `https://app.snaptapgo.com/api/public/` using your Gallery ID and connection token. This request is made from your WordPress server and results are cached for 30 seconds.
* **Photo uploads:** When the upload feature is used, photos are sent from the SnapTapGo app to your WordPress site via a secure REST endpoint. No visitor data is transmitted.
* **Privacy policy:** https://snaptapgo.com/privacy
* **Terms of service:** https://snaptapgo.com/terms

No visitor or user data from your WordPress site is ever sent to SnapTapGo.

== Installation ==

1. In your WordPress dashboard, go to **Plugins → Add New Plugin**
2. Search for **SnapTapGo Gallery** and click **Install Now**
3. Click **Activate Plugin**
4. Go to **Settings → SnapTapGo** and paste your connection token from the SnapTapGo app
5. Add `[snaptapgo project="YOUR_GALLERY_ID"]` to any page or post

To get your connection token and Gallery ID:

1. Open [app.snaptapgo.com](https://app.snaptapgo.com) and go to **Settings**
2. Copy the **Connection Token** and paste it into the plugin settings
3. Open a project → copy the **Gallery ID** from the WordPress section (not the guest share link)

Full walkthrough: [snaptapgo.com/guides/how-to-update-wordpress-photo-galleries-without-logging-in/](https://snaptapgo.com/guides/how-to-update-wordpress-photo-galleries-without-logging-in/)

== Frequently Asked Questions ==

= Do I need a SnapTapGo account? =

Yes. You need a free account at [snaptapgo.com](https://snaptapgo.com) to create projects and get a Gallery ID for your shortcode. Free accounts include 1 live WordPress gallery. Business unlocks unlimited WordPress galleries, photo moderation, and co-owners — see [snaptapgo.com](https://snaptapgo.com/wordpress/) for details. The plugin itself is free and open source.

= What is the Gallery ID? Is it the same as the share link? =

No. Your **Gallery ID** is a stable token for the WordPress shortcode. It stays the same even if you refresh the guest share link for contributors. Copy it from the WordPress section of your project in the SnapTapGo app.

= Where are my photos stored? =

Photos are stored in SnapTapGo, not in your WordPress media library (unless you use the Upload to Site feature on Business). This keeps your WordPress installation lean and means you can manage everything from the SnapTapGo app without touching WordPress at all.

= What is the connection token for? =

The connection token links your SnapTapGo account to this WordPress plugin. It does two things: (1) activates the gallery shortcodes, and (2) authorizes the SnapTapGo app to upload photos directly to your media library (Business plan). You'll find your token in the SnapTapGo app under Settings.

= How do I update the photos on my site? =

Add, remove, approve, or reorganize photos in the SnapTapGo app. The gallery on your site refreshes automatically. Cached results update within about 30 seconds.

= Can I approve contributor photos before they go live on WordPress? =

Yes, on Business plans. When your gallery is live on WordPress, photos uploaded by guests or contributors go to a pending queue first. You or a co-owner approve them in the app — only approved photos appear on your public WordPress gallery.

= Can I invite co-owners to help manage a gallery? =

Yes, on Business plans. Invite up to 5 co-owners per project — staff, photographers, marketing, assistants. They can upload and approve photos from their phones without WordPress logins.

= Can I show photos organized into sections? =

Yes. Create named groups in your SnapTapGo project (e.g. "Before", "After", "Kitchen"). These groups appear as labeled sections in the full gallery automatically. Use the `group` shortcode option to embed one section on its own page — for example a homepage hero from a section named "Website Hero".

= Can I use a SnapTapGo photo as a homepage hero? =

Yes. Create a section in your app (e.g. "Website Hero"), add your photo, then use `[snaptapgo project="ID" group="Website Hero" hero="cover" lightbox="false"]`. Choose `hero="cover"`, `banner`, `contained`, `fixed`, or `carousel`. Add `overlay="dark"` if your theme or page builder places text on top. Hero styles are scoped to SnapTapGo and only load on pages that use a hero shortcode.

= Can I use multiple galleries on the same site? =

Yes. Each shortcode is independent. The same Gallery ID can appear on as many pages as you want (still 1 live gallery slot). A second **project** embedded on the site requires Business for unlimited WordPress galleries. Free and Pro include 1 live gallery embed.

= My gallery shows "Could not load gallery" or a connection message — what's wrong? =

Make sure a connection token is saved in **Settings → SnapTapGo**. Galleries will not display without it. Also check that your Gallery ID is correct and that the project belongs to the same SnapTapGo account.

= Does this work with page builders like Elementor or Divi? =

Yes. Use the shortcode widget in any page builder that supports shortcodes.

= Can visitors download photos? =

Yes. Clicking any photo opens a full-screen lightbox with a download button. Set `lightbox="false"` to disable the lightbox entirely (useful for hero banners or display-only galleries).

= Is there a limit on how many photos I can display? =

The `limit` shortcode attribute controls how many photos are shown (default: 24, max: your project's photo count). Your SnapTapGo plan may have its own photo limits per project.

= Does the plugin slow down my site? =

Photo data is cached in WordPress for 30 seconds using transients, so external API requests are minimal. Photos are loaded lazily and served from SnapTapGo's CDN, not from your server.

= Can I remove the rounded corners from photos? =

Yes. Set `radius="0"` in your shortcode. You can also add any CSS border-radius value like `radius="8px"` or `radius="50%"`.

= Can galleries auto-advance? =

Yes, for carousel and strip layouts. Add `autoplay="4"` (or any number of seconds) to enable automatic sliding.

== Screenshots ==

1. Grid layout with labeled group sections on a live WordPress page
2. Masonry layout showing natural photo heights
3. Carousel layout — one photo at a time with navigation arrows and dot indicators
4. Strip layout — portrait photos displayed side by side
5. Full-screen lightbox with navigation, swipe support, and download button
6. WordPress admin settings panel — connection token, layout and group label customization
7. Shortcode reference table in the admin panel

== Changelog ==

= 1.8.6 =
* Hero carousel: fix top gap — overlay and slides now stack edge-to-edge inside the hero box

= 1.8.5 =
* Hero carousel: fixed height so tall photos stay cropped inside the slide (defaults ~70vh, use height="100vh" for full viewport)
* Hero contained: new width="1140px" option to match theme container width (default 1200px)

= 1.8.4 =
* Hero banner: shorter page-header proportions (4:1 aspect ratio, max ~50vh) — was 21:9 which could fill most of the screen on wide layouts

= 1.8.3 =
* Admin settings: shortcode examples wrap inside their containers instead of overflowing

= 1.8.2 =
* Admin settings: hero options grouped in a card — clarifies hero vs gallery mode, which presets accept height, and that overlay/hero do not apply to grid/masonry/strip layouts

= 1.8.1 =
* `height="100vh"` (and other explicit heights) now apply exactly — no 900px cap when height is set
* Renamed hero preset `fixed` to `exact` (exact pixel/rem height slot; `fixed` still works as an alias)

= 1.8.0 =
* **Group-filtered shortcodes** — `group="Section Name"` shows only photos from that app section on any page
* **Hero embeds** — `hero="cover"`, `banner`, `contained`, `fixed`, or `carousel` for homepage heroes and featured images
* **`overlay="dark"` or `light`** — optional readability gradient (text stays in WordPress)
* **`height`** — set min height on cover, fixed, and carousel heroes
* Hero pages load dedicated scoped CSS only — gallery and lightbox assets are skipped for faster hero-only embeds

= 1.7.4 =
* Gallery feed refreshes every 30 seconds so newly approved contributor photos appear on your site sooner
* Settings docs updated for stable WordPress Gallery ID (separate from the share link)

= 1.7.3 =
* Gallery shortcodes now require a valid connection token — the plugin will not display photos without it
* Connection token is sent with gallery requests so only that SnapTapGo account's projects can be embedded
* Free SnapTapGo accounts include 1 live gallery; a second project shows an upgrade message

= 1.7.2 =
* Fix carousel and strip layouts failing with "Splide is not defined"
* Strip and carousel photos now fade in correctly (they were left invisible after 1.7.1)

= 1.7.1 =
* First row of grid and masonry galleries now loads immediately instead of lazy-loading
* Photos fade in when ready; uploader names no longer appear on empty placeholder tiles

= 1.7.0 =
* First WordPress.org directory release
* Live gallery shortcode with grid, masonry, carousel, and strip layouts
* Connection token authentication and phone-to-media-library uploads
* Full-screen lightbox, named group sections, and admin appearance settings

= 1.6.2 =
* Strip: initialize Splide only after all images are loaded and decoded — eliminates flash on first loop

= 1.6.1 =
* Fix arrow positioning by loading full Splide CSS
* Fix gray flash on loop by adding dark slide background and preloadPages

= 1.6.0 =
* Strip and carousel layouts now powered by Splide.js (bundled, no CDN) for rock-solid infinite looping and smooth animation
* Removed custom slider code in favour of battle-tested library
* All shortcode attributes (columns, gap, radius, autoplay) fully supported

= 1.5.3 =
* Strip layout: all images now preloaded and decoded before autoplay starts, eliminating choppiness on the first pass

= 1.5.2 =
* Strip layout: seamless infinite loop — reaching the last photo now wraps smoothly to the first with no backwards slide
* Strip layout: hover zoom is now smooth on first interaction (GPU layer promoted at page load)

= 1.5.1 =
* Added full internationalization (i18n) to all admin-facing strings for translation-readiness
* Minor code quality improvements

= 1.5.0 =
* Added connection token authentication — replaces WordPress Application Passwords for a simpler, safer setup
* Added REST endpoint for direct photo uploads from the SnapTapGo app to your media library
* Added `GET /wp-json/snaptapgo/v1/ping` endpoint for connection verification
* Gallery shortcodes now require a saved connection token to display (cleaner all-or-nothing behavior)
* Improved token mismatch error messages with actionable instructions
* Updated admin settings panel with prominent connection token section

= 1.4.4 =
* Added GPU layer promotion (`will-change: transform`) to strip slides and track for smoother autoplay animation

= 1.4.3 =
* Strip layout: pre-decode image bitmaps using `img.decode()` before starting autoplay to eliminate first-slide flash

= 1.4.2 =
* Strip layout: added `<link rel="preload">` tags for first visible images to initiate fetch as early as possible
* Strip layout: kept preloader Image objects in a hard reference array to prevent garbage collection during loading

= 1.4.1 =
* Added `radius` shortcode attribute — set border radius on photos (e.g. `radius="8px"`, `radius="50%"`, default `0`)

= 1.4.0 =
* Strip layout: fixed partial image bleed by calculating slide widths precisely from `columns` and `gap` values
* Strip layout: changed image loading to `eager` for faster initial render

= 1.3.0 =
* Added `autoplay` shortcode attribute for carousel and strip layouts (seconds between advances; `0` = off)
* Added `lightbox` shortcode attribute — set to `false` for hero/display-only galleries
* Added `columns` support for strip layout

= 1.2.1 =
* Added strip layout: portrait photos displayed side by side with scroll navigation
* Added carousel layout: one photo at a time with swipe and dot navigation
* Added masonry layout: natural photo heights without cropping
* Added WordPress admin settings for default layout and group label styling (color, size, weight, font family)
* Improved lightbox: keyboard navigation, swipe gestures, download button, photo counter
* Shortcode now accepts full share URLs in addition to bare tokens
* Inline styles applied to grid elements for reliable rendering across all themes

= 1.1.0 =
* Added support for project groups — photos organized into named sections display as labeled gallery sections
* Improved cache key to prevent stale data after plugin updates
* Improved error messages for missing tokens and API failures
* Added responsive column breakpoints for mobile devices

= 1.0.0 =
* Initial release
* Grid layout with lightbox
* Shortcode: `[snaptapgo project="TOKEN"]`
* Attributes: `columns`, `limit`, `show_names`, `gap`

== Upgrade Notice ==

= 1.7.4 =
Approved contributor photos now appear on your site within 30 seconds. Use your Gallery ID in the shortcode (from the WordPress section of your project). Clear any full-page cache if the gallery still looks stale.

= 1.7.3 =
Galleries now require a connection token. If photos disappear, paste your token from app.snaptapgo.com → Settings into Settings → SnapTapGo.

= 1.5.0 =
Important update: replaces WordPress Application Passwords with a simpler connection token. Go to Settings → SnapTapGo, copy your token from app.snaptapgo.com/settings, and save it. Galleries will not display until the token is saved.
