=== LemonPortal ===
Contributors: lemongallery
Tags: photography, galleries, proofing, booking, analytics
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.7.0
License: GPLv2 or later

Connects this WordPress site to your lemon.gallery studio.

== Description ==

One plugin, nine jobs — each switchable:

* **Client galleries & proofing on your own domain.** A Galleries post type that renders your client galleries natively at yoursite.com/galleries/... (Pro plan), or as a responsive embed on any plan. Private galleries show a client email gate — your clients view their photos on your domain; downloads and orders stay secured on lemon.gallery.
* **Blog posts from Lemon Growth.** Your content engine plans and writes SEO articles from your real work; this plugin publishes them here as drafts or live, with a featured image from your own photos, structured data, and titles/descriptions that stand down automatically when Yoast/Rank Math/SEOPress/AIOSEO is active.
* **On-site forms.** `[lemon_contact_form]` and `[lemon_booking_form]` render natively. Booking has a month calendar, live availability and add-ons. Enquiries land in your CRM; deposits check out through your normal Stripe flow. A dropped enquiry is never lost — failed sends queue and retry.
* **Reviews, portfolio & services blocks.** `[lemon_reviews]` (with rich-snippet schema), `[lemon_portfolio]` and `[lemon_services]` — first-party HTML fed from your studio.
* **First-party analytics.** A small, cookie-free script measures pageviews, scroll depth, clicks, rage/dead clicks and form drop-off, with an optional GDPR consent mode. Events also push to window.dataLayer for GTM/GA4.
* **Conversion nudges.** An optional brand-styled sticky "Book" bar and a gentle exit-intent enquiry prompt.
* **Image optimization.** Every upload is compressed and converted to AVIF/WebP on your own hosting (lossless/lossish/lossy), served via a safe .htaccess rule. Optionally, AI writes real alt text, a description and a proper filename — a lightweight, efficient model handles most uploads at no extra cost, falling back to your account's AI credits automatically if it's busy. Processes right away, in the same request.
* **Blocks & WP-CLI.** Every shortcode is also a block with a picker and live preview. `wp lemonportal sync|optimize|status|retry` for staging and power users.
* **Self-updating.** New versions appear on your Plugins screen with the normal "Update now" button.

== Installation ==

1. Upload and activate the plugin.
2. In lemon.gallery go to Account → Integrations and create a **LemonPortal site key**.
3. Paste the key into WordPress → LemonPortal and press "Save & connect".

Agencies: define `LEMONPORTAL_SITE_KEY` in wp-config.php to manage many sites from one deploy.

== Changelog ==

= 1.7.0 =
* Restyled the admin screen: card-based layout, real toggle switches, a health/status panel — same settings, easier to scan.
* AI image processing no longer waits on your desktop worker being online — it now runs right away, in the same request, on lemon.gallery's own AI. A lightweight, efficient model handles most uploads at no extra cost; anything busy falls back to your account's AI credits automatically.
* New: "Process existing library" for AI alt text, with a live cost check before a bulk run — process everything, process what you can afford, or top up credits, right from the panel.

= 1.6.3 =
* New: front-end lead bridge — enquiry forms the builder hooks and post-store mirror don't cover (a custom or theme-built form that POSTs to its own handler and keeps its own store) are now mirrored to lemon.gallery too. The bridge binds to enquiry-shaped forms on the page and relays each submission through the existing lead relay alongside the form's own handler, so the site's enquiry store and the studio's CRM stay in sync no matter how the form is built. Supports builder forms (`wpcf7`, `wpforms`, `gform`, `fluentform`, `forminator`, `elementor`) are deliberately skipped here to avoid duplicating leads already caught by their submit hooks.

= 1.6.2 =
* New: storage-layer enquiry mirror — any form that stores its submissions as posts (Jetpack Forms, Flamingo, a custom Enquiries post type) is mirrored to lemon.gallery on insert, so the site's enquiry store and the studio's CRM stay in sync on a stock WordPress install with any common form system, no per-form setup. Works alongside the existing submit hooks for table-storing builders; a transient dedups the overlap.
* Filter: `lemonportal_enquiry_post_types` to register a custom Enquiries post type.

= 1.6.0 =
* New: client proofing — private galleries render an email gate on your own domain, then the photos natively.
* New: booking month calendar + service add-ons; conversion nudges (sticky book bar, exit-intent); reviews, portfolio & services blocks; Gutenberg blocks for every shortcode; WP-CLI (`wp lemonportal ...`); analytics consent mode; agency `LEMONPORTAL_SITE_KEY`.
* Hardened: server-enforced honeypot + time-trap on both forms; XSS-safe lightbox with prev/next & swipe; SEO-plugin-aware meta & schema (no duplicates); failed-lead retry queue; content-pull lock; Core Web Vitals (srcset, fetchpriority, preconnect, eager LCP); uninstall cleanup; admin health panel.

= 1.5.0 =
* Form conversion tracking now charts inside lemon.gallery Insights.

= 1.4.0 =
* Image optimization — local AVIF/WebP compression delivered via a safe .htaccess rule, plus optional AI alt text, description and filename.

= 1.3.0 =
* Analytics: tracks form_view as its own funnel step.

= 1.2.0 =
* Full blog publishing from Lemon Growth: categories, tags, author byline, scheduled posts and edit sync-back.

= 1.1.0 =
* Captures enquiries from your existing forms (Contact Form 7, WPForms, Gravity, Ninja, Elementor, Fluent, Forminator).

= 1.0.0 =
* First release.
