=== Smart Fields Pro ===
Contributors: appstrdesign
Tags: custom fields, schema, reviews, forms, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Industry-ready custom field templates with schema.org JSON-LD, ratings & reviews, forms, multi-currency prices, media gallery and WooCommerce support.

== Description ==

**Pick a template and the right fields appear.**

Classic custom field builders give you an empty canvas. Smart Fields Pro gives you finished field sets for real industries. Open a post and choose **Real Estate** to get price, area, rooms, floor, heating and location. Choose **Recipe** to get ingredients, illustrated steps, prep time, servings and scores. Every field is mapped to **schema.org JSON-LD**, included in search and styled for every screen size.

Need something custom? Add your own fields with the drag-and-drop builder or start from a blank group.

= Templates and fields =

* **22 ready-made templates:** Real Estate, Recipe, Product, Movie, TV Series, Event, Job Posting, Vehicle, Book, Hotel, Restaurant, Course, Software, WordPress Plugin / Theme, Program Download, Video Game, Music Album, Local Business, Beauty Center / Spa, Hairdresser / Barber, Product Review and Doctor / Clinic, plus a Blank group.
* **60 field types** with an ACF-style picker (tabs, search and live preview): price (multi-currency), ratings, address + map, steps with image or video, media gallery, downloads, **repeater, group, flexible content, relationship, post object, page link, taxonomy, user, link, oEmbed, icon picker, button group, consent checkboxes, tab, accordion and message**.
* **Per-post customizing:** rename fields and sections, drag fields into another section, edit choice options and add extra fields while writing – the template stays untouched.
* **Rich text Short Description** in every template. When a post has no content it is used as the excerpt, the search text, the WooCommerce short description and the JSON-LD description.
* **Drag-and-drop field builder** with icons, widths, units, defaults, options and required fields.
* Works in **Gutenberg and the Classic Editor**. Required fields lock publishing.

= Ratings and reviews =

* One-click **visitor star rating** with a summary card: distribution bars and a big average score.
* **Advanced review section** that replaces the theme comments in block and classic themes. It has its own form designer, **photo reviews**, likes, highlighted owner replies, and AJAX sorting and paging.
* Switches for **members-only reviews and likes**, plus photo reviews for members only or everyone.
* **Site-wide Reviews page**, created automatically, with template, star and photo filters and a top-rated list.
* Ratings and reviews are added to JSON-LD as `aggregateRating`, `Review` and `reviewAspect`.

= Forms and inbox =

* Form builder with **contact, quote, appointment and survey** presets.
* Email notifications and an optional auto-reply, sent with **WordPress mail or SMTP**. A test email button checks the setup.
* An **admin inbox** that shows which form each message came from. Read, reply, delete and use bulk actions, with AJAX paging and an unread badge.
* Spam protection without a captcha: honeypot, signed time token and rate limit.

= Media =

* Optional **media gallery** in every template: uploads plus YouTube (including Shorts), TikTok, Instagram posts and Reels, Vimeo, Facebook, Dailymotion, Twitch, Spotify and SoundCloud links.
* **Instagram-style lightbox** with swipe, swipe-down to close, pinch and double-tap zoom. Videos play inside it.
* **Automatic featured image:** the first gallery image becomes the featured image when none is set.

= Search, prices and SEO =

* Field values and WooCommerce SKUs are added to the native WordPress search without replacing it.
* **AJAX search section** with filters, chips, grid or list views, a mobile filter sheet, and page numbers or load more. An optional search page replaces the theme's search results.
* **Multi-currency prices:** each post sets its own currency, exchange rates are entered manually or updated automatically, and visitors get a currency switcher. Filters and sorting compare prices in the base currency.
* **Automatic schema.org JSON-LD** for Product, Accommodation, Recipe (HowToStep with images), Movie, TVSeries, Event, JobPosting, Car, Book, Hotel, Restaurant, Course, SoftwareApplication, VideoGame, MusicAlbum, LocalBusiness, Review and Physician.

= WooCommerce and admin =

* Fields appear in a product tab or the summary. The schema is merged into the WooCommerce Product markup without duplicates. HPOS compatible.
* Modern admin where every action runs over AJAX, with custom modals and toasts. It works fully on mobile.
* Front-end styles are isolated: themes cannot break them and they never leak into your theme.
* Translation ready. Includes a full Turkish translation.

= Shortcodes =

* `[sfp_fields]` – all fields of the current post. Attributes: `fields`, `exclude`, `layout` (cards|table|list|minimal), `title`, `show_title`, `id`.
* `[sfp_field key="price"]` – a single formatted value.
* `[sfp_gallery]` – media gallery of the current post.
* `[sfp_search group="GROUP_ID"]` – filterable AJAX search section. Attributes: `per_page`, `columns`, `pagination` (numbers|loadmore), `view` (grid|list).
* `[sfp_search]` – search across all content with template tabs.
* `[sfp_form id="FORM_ID"]` – a form built under Smart Fields → Forms.
* `[sfp_reviews]`, `[sfp_rating]`, `[sfp_reviews_page]` – review section, rating card and site-wide reviews.
* `[sfp_currency]` – visitor currency switcher.

Gutenberg blocks: **Smart Fields** and **Smart Fields Search**.

= PHP API =

`sfp_get_field( $key, $post_id = null, $format = 'raw' )` (raw|plain|html), `sfp_the_field( $key )`, `sfp_get_fields( $post_id )`, `sfp_fields_box( $post_id, $args )`.

ACF-style helpers: `sfp_get_field_object()`, `sfp_update_field()`, `sfp_delete_field()` and row loops `sfp_have_rows()` / `sfp_the_row()` / `sfp_get_sub_field()` / `sfp_get_row_layout()` for repeater, flexible content, group and list fields. Groups can be defined in code with `sfp_add_local_group()` and kept in the theme's `sfp-json` folder. More: `sfp_api()`, REST routes under `sfp/v1` and the full developer guide with theme examples in **Smart Fields → Usage → Developer guide**.

= Modules =

Switch off what you do not use under **Settings → Modules**: Shop, Appointments, Forms & inbox, Reviews & ratings, Video player, Video ads, Currencies, Search section and the WooCommerce integration. A switched-off module loads no code on your site; its data is kept.

Filters: `sfp_templates`, `sfp_field_types`, `sfp_schema_data`, `sfp_render_box`, `sfp_format_value`, `sfp_search_query_args`, `sfp_schema_reviews_max`, `sfp_reviews_active`, `sfp_reviews_on_products`.

= External service =

When **automatic exchange rates** are enabled under Smart Fields → Settings → Currencies, the plugin downloads the daily rates file from the Central Bank of the Republic of Türkiye (https://www.tcmb.gov.tr/kurlar/today.xml) twice a day. No personal data is sent. This option is off by default. Terms and privacy: https://www.tcmb.gov.tr

== Installation ==

1. Install the plugin from **Plugins → Add New**, or upload the `smart-fields-pro` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to **Smart Fields → Template Gallery**, pick a template and choose the post types it applies to.
4. Edit any post and select the template in the **Smart Fields** box.
5. Optional: enable Reviews & Ratings, Mail / SMTP, Currencies and the search page under **Smart Fields → Settings**.

== Frequently Asked Questions ==

= Does it conflict with other plugins or my theme? =

No. Every class, option, meta key and CSS selector is prefixed with `sfp`, assets only load where they are needed and front-end styles are fully scoped.

= Will the review section work with my block theme? =

Yes. The review section replaces the Comments block in block themes and the comments template in classic themes. It is off by default; enable it in Smart Fields → Settings → Reviews & Ratings.

= Are reviews and ratings added to the structured data? =

Yes. The average rating, the review count, up to 200 reviews and multi-criteria scores are added to the post's JSON-LD.

= Where are form messages stored? =

In a private post type that only administrators can see. You can turn storing off per form and only receive emails.

= Is it compatible with Yoast SEO / Rank Math? =

Yes. Smart Fields outputs its own JSON-LD block. For WooCommerce products it extends the WooCommerce Product markup instead of adding a second one.

= Where are field values stored? =

As regular post meta with the `_sfp_` prefix, so they are portable and queryable.

== Screenshots ==

1. Fields box on the front end: media gallery, short description and the rating summary card with multi-criteria scores.
2. Field cards, amenity chips and the automatic map for an address field.
3. Advanced review section: photo reviews, criteria chips, likes and highlighted owner replies.
4. Review form built from a review template (stars, guest scores, trip type, photos).
5. Instagram-style lightbox with thumbnails, zoom and video support.
6. Steps field with an image or video per step.
7. AJAX search section with filters, sorting, currency switcher and result cards.
8. Site-wide Reviews page with template, star and photo filters.
9. Fully responsive on phones: fields, reviews, search and lightbox.
10. Template Gallery with 20 ready-made templates.
11. Drag-and-drop field builder with review forms, schema and display options.
12. Post editor: pick a template and its fields open, with a rich text short description.
13. Review templates: design review forms and assign them to field templates.
14. Create a review template from a ready-made preset.
15. Form inbox: read, reply, mark as unread or delete messages.
16. Settings: reviews & ratings, likes, photo reviews and members-only options.

== Changelog ==

= 1.4.1 =
* New: Modules (Settings → Modules) – switch off Shop, Appointments, Forms & inbox, Reviews & ratings, Video player, Video ads, Currencies, Search section or the WooCommerce integration. A switched-off module loads no code: no hooks, scripts, shortcodes or admin screens; its data is kept.
* New: ACF-style developer API – sfp_get_field_object(), sfp_update_field(), sfp_delete_field(), row loops sfp_have_rows() / sfp_the_row() / sfp_get_sub_field() / sfp_get_row_layout() for repeater, flexible content, group and list fields (nested loops too).
* New: field groups in code with sfp_add_local_group() and JSON sync – groups are written to the theme's sfp-json folder and newer files are imported (git-friendly, like ACF Local JSON).
* New: Developer guide inside Usage with colour-highlighted code, contents, search and copy buttons (English and Turkish), plus ready-made theme examples and an ACF migration table.
* New: Settings have one Save button for every section with an "Unsaved changes" warning; Orders and Appointments tabs appear or hide at once with their switch.
* New: switching the shop or appointments off deletes their pages and removes their menu items; switching on brings them back. Deleting an ad also deletes its statistics.
* Improved: front-end box follows the template order exactly (gallery, short description and every field), older groups get Short Description and Media Gallery fields once.
* Improved: Smart Social Pro forms use the same layout as the editor box (tabs, accordions, order); the gallery shows only when the template has a Media Gallery field.
* Fixed: VideoObject uploadDate now has time and time zone; date-time fields keep the site time zone in JSON-LD.
* Fixed: accessibility – grouped list markup, heading order (h2 box title), muted text contrast.
* New: "Security check (image)" field for forms – a self-hosted security image (no Google), single use, bound to the visitor and rate limited. Added to every ready-made form and once to existing forms.
* New: every form gets a Personal Data Processing Notice (KVKK / GDPR) – in the consent group or as its own single consent. Consent texts and popups accept {site_name}, {site_url}, {site_email}, {privacy_url}, {date} and {year}. Single and grouped consents both stay available.
* New: forms are translatable with WPML and Polylang (title, labels, options, messages, consent texts and popups).
* New: "Social Links" field – members add any number of accounts; the admin chooses the networks and their icons (Instagram, X, LinkedIn, YouTube, GitHub and TikTok by default; Facebook, Pinterest, Telegram, WhatsApp, Discord, Twitch, Spotify, Behance, Dribbble, Threads, Medium and Reddit icons included). The Member Profile template uses it; saved links are moved over once. Output in JSON-LD sameAs.
* New: choose which templates appear as filters on the reviews page (Settings → Reviews).
* Improved: the form security check has the same design as the Smart Social Pro sign-in check.
* Fixed: with a currency chosen, the switcher opened only from its arrow (its label was redrawn in a loop and swallowed the click); member profile link chips touching the block below; the Member Profile group could not be saved in the editor ("Select at least one content type").
* Improved: currency switcher with a styled menu; front-end forms (Smart Social Pro) without the grey frame and with theme-proof inputs, price + currency and choice chips.

= 1.4.0 =
* New: Ads tab – several video or image pre-roll ads with dates, weights and placement (movies / episodes), random, weighted or in-turn rotation, click-through tracking and daily / monthly / yearly performance reports (impressions, clicks, click rate, skips, completed views).
* New: countries & provinces – every country (WooCommerce list or PHP intl names in the site language), all 81 provinces of Türkiye and lists for DE, NL, GB, US, editable per country; province select in checkout and account address forms with a "type it myself" option.
* New: seller information as label = value rows with document uploads, shown in the sales contract and with [sfp_seller].
* New: shipping profiles per product (cost, free above an amount, free from a quantity, or a custom rule); carts with several profiles add up or charge the highest shipping, with hints on what is missing for free shipping.
* New: public developer API – sfp_api() (groups, values, validated saving, front-end forms with a template picker, profile cards, account tabs), REST routes under sfp/v1, SFPFront.rest() and sfp:cart events, a developer reference in the Usage screen and docs/developer-api.md.
* New: Smart Social Pro bridge – its member dashboard shows orders, address and appointments, the member area replaces our My Account page, and a ready-made Member Profile template; a notice suggests installing it.
* Fixed: translations loaded too early on plugins_loaded.
* New: WPML and Polylang – group / field labels, help texts and options are translatable strings, text fields are translated and numbers / media / prices copied to translations, shop pages open in the visitor's language (wpml-config.xml included).
* New: Yoast SEO / Rank Math variables (%%sfp_key%% / %sfp_key%) and field texts in their content analysis; FacetWP data source; {sfp:key} tags for Gravity Forms and WPForms, {sfp_key} for Fluent Forms; Elementor dynamic tags and Bricks dynamic data; admin list columns with sorting (also readable by Admin Columns).
* New: restrict a group to logged-in users, Paid Memberships Pro levels or MemberPress memberships.
* New: distance sales contract opens in a popup (built-in template filled with buyer, items and total; seller details setting); ticking the box opens it, "I have read and accept" ticks it; the accepted text is saved with the order.
* New: tracking code per order (lookup by code or number + email), live customer–seller chat on the order page and in the admin order detail, carrier name and tracking card in a redesigned order page.
* New: My Account page (orders, saved address, appointments) added to the Online Services menu.
* New: several photos per variation with a swipeable slider, thumbnails and full-screen view.
* New: reviews on the wp-admin comments screen – review card, rating column, rating / photo filter and an editable grouped Review details box.
* New: TV series and movie player – named seasons, episode list with tabs or dropdown, previous / next and autoplay next episode, resume, audio languages, subtitles, speed, PiP, keyboard shortcuts, pre-roll video ads (also before YouTube / Vimeo) and TVSeason / TVEpisode / VideoObject JSON-LD.
* New: per-post "Add field" uses the grouped, searchable type picker with more field types; fields and sections can be collapsed while customizing for easy moving.
* New: product variations – a table with price, sale price, stock, SKU and image for every combination; sold items are deducted from the combination; sold-out combinations cannot be chosen.
* New: product options (color swatches, sizes…) with price differences, percentage discounts with end date, VAT rate setting and variable products when moving to WooCommerce.
* New: address field with Google / OpenStreetMap / CARTO / Yandex maps, size settings, address search, "find my location" and a draggable pin.
* New: appointment numbers, lookup by number + phone, live two-way messages; AJAX order tracking; shop pages grouped under one menu item.
* New: collapsible sections in the builder; clear drag handles when customizing a post.
* Fixed: prices were not saved when a currency selector was shown.
* New: appointment system – booking box with services, specialists and time slots, admin calendar list with replies, customer status page and emails; Beauty Center and Hairdresser templates; button field that opens any form.
* New: built-in shop without WooCommerce – template content types (Content, Shopping, Appointment), cart, checkout, orders with admin management, stock, SKU, shipping methods and tracking, bank transfer, cash on delivery, PayTR, Stripe and PayPal. One-click, HPOS-safe transfer of items and orders to WooCommerce.
* New: ACF-style field type picker with tabs, search and live previews.
* New: Repeater, Group, Flexible Content, Relationship, Post Object, Page Link, Taxonomy, User, Link, oEmbed, Password, Icon Picker, Button Group, Tab, Accordion and Message fields.
* New: Consent Checkbox and Consent Group fields with popup texts, "Accept all" and styles – in forms, review forms and templates.
* New: per-post customizing – rename fields and sections, drag-and-drop between sections, edit options and add extra fields in the editor.
* New: Short Description, Media Gallery and Featured Image are now regular fields you can place anywhere or remove.
* New: rich text fields use the full WordPress editor and run shortcodes and embeds.
* New: tabbed settings with search; choose the templates and content types included in search.
* New: SEO settings – meta description, Open Graph / Twitter Card, BreadcrumbList, Organization + WebSite schema, Yoast / Rank Math description fallback and noindex for filter URLs.
* Improved: grouped lists and key = value groups are added to JSON-LD as structured featureList values.

= 1.3.1 =
* New: visitor ratings with a summary card; all ratings and reviews are added to JSON-LD.
* New: advanced review section with photo reviews, likes, owner replies, members-only switches, and AJAX sorting and paging.
* New: site-wide Reviews page with filters and a top-rated list.
* New: form builder with presets, notifications, auto-reply, WordPress mail or SMTP, and an admin inbox.
* New: Steps field with an image or video per step, and a Multi Rating field.
* New: multi-currency prices with exchange rates and a visitor currency switcher.
* New: rich text Short Description in every template and an automatic featured image from the gallery.
* Improved: every new screen is fully responsive.

= 1.2.0 =
* New: Grouped List field, optional advanced search page and search across all content.

= 1.1.0 =
* New: media gallery, Instagram-style lightbox, Download field, plugin and program templates, and a redesigned AJAX search.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.4.1 =
Modules you can switch off, ACF-style row loops and field helpers, JSON sync and a developer guide in Usage. Everything stays on after the update.

= 1.4.0 =
New field types (repeater, relationship, consent and more), per-post customizing, tabbed settings and SEO options. Existing templates keep working unchanged.

= 1.3.1 =
Adds ratings and reviews, a form builder with inbox, multi-currency prices and a Short Description field. Reviews, quick ratings and the currency switcher stay off until you enable them.
