=== Schema Gallery ===
Contributors: schemagallery
Tags: gallery, schema, seo, json-ld, block
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.7.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-friendly gallery plugin with automatic JSON-LD ImageObject schema markup for better SEO and search visibility.

== Description ==

**Schema Gallery** is a lightweight, AI-friendly WordPress gallery plugin that automatically adds valid **JSON-LD ImageObject schema markup** for every image in your gallery.

Perfect for photographers, agencies, and businesses who want their visual content to be properly recognized by Google, Bing, and AI-powered search results.

**Key Features (Free Version):**

* Schema Gallery block for the WordPress editor — pick a gallery, see a live preview.
* Add images straight from your Media Library — titles and alt text come along as schema data.
* "View Your Schema" panel — see the exact JSON-LD your gallery outputs and test it in Google Rich Results with one click.
* One connected ImageGallery schema node per gallery — cleaner, richer markup than loose per-image blocks.
* Captions toggle and 2/3/4 column layouts, per gallery.
* A ready-made sample gallery on first install, so you can see completed schema from minute one.
* Create unlimited galleries with unique shortcodes.
* Upload multiple images at once with drag & drop, then add schema details to each image afterwards.
* "Needs schema" status shows which images still need a description and keywords.
* Automatic JSON-LD ImageObject schema markup for each image.
* Schema fields include: name, description, keywords, author, license, datePublished, and more.
* Built-in pagination (18 images per page).
* Responsive grid and custom lightbox with next/previous navigation.
* Fully compatible with major themes and browsers.
* Removes Google's optional schema warnings when an author is set.
* Clean, lightweight code – no external library dependencies.

**Optimized for AI Search:**

Schema Gallery is built for the future of SEO — where AI systems look for structured, machine-readable metadata to reference your content. Each image is wrapped in a compliant JSON-LD block, making it easy for AI to understand, cite, and recommend.

== Installation ==

1. Download the `schema-gallery.zip` file.
2. In your WordPress dashboard, go to **Plugins → Add New → Upload Plugin**.
3. Upload the ZIP file and click **Install Now**.
4. Activate **Schema Gallery**.
5. Go to **Schema Gallery → Add New Gallery** to create your first gallery.
6. Use the shortcode `[schema_gallery id="X"]` to display your gallery on any page or post.

== Frequently Asked Questions ==

= How do I add a gallery to a page? =

In the block editor, add the **Schema Gallery** block and pick your gallery — you'll see a live preview. You can also use the shortcode `[schema_gallery id="X"]` anywhere shortcodes work, including page builders like Divi and Elementor.

= Does Schema Gallery slow down my site? =

No. It's built to be lightweight with optimized SQL queries and efficient pagination.

= Is it compatible with my theme? =

Yes. It uses WordPress's standard grid system and CSS variables, so it works well with Divi, Astra, Hello Elementor, and most custom themes.

= How do I add schema to my existing images? =

Simply add them to a Schema Gallery and the JSON-LD markup will be automatically generated when filled out.

= Will it work with caching plugins? =

Yes. It's fully compatible with W3 Total Cache, WP Super Cache, and similar tools.

== Screenshots ==

1. Gallery grid layout on the frontend.
2. Lightbox preview with navigation arrows.
3. Admin interface for managing gallery images.
4. Example of ImageObject schema markup validated in Google's Rich Results Test.

== Changelog ==

= 1.7.3 =
* Fixed: a fatal error (Class "SchemaGallery\Block" not found) after updating to 1.7.2. Files added in 1.4.0–1.6.0 were missing from the 1.7.2 package. Block loading is now also guarded so a missing file cannot take a site down.

= 1.7.2 =
* Requires PHP 8.1 or newer. Older PHP versions no longer receive security fixes.

= 1.7.1 =
* Security hardening: lightbox image URLs are escaped, structured data output is hardened against script-tag injection, and Media Library imports always save with an image file extension.

= 1.7.0 =
* New: Bulk delete — select any number of images with checkboxes (or Select All) and delete them in one click. Files, WebP copies and schema data are all cleaned up.

= 1.6.2 =
* Fixed: a Plugin Check warning caused by wording inside the sample gallery's description text.

= 1.6.1 =
* Fixed: the database upgrade that adds the new Captions and Gallery Columns settings did not run on sites that updated without re-activating the plugin, which made gallery settings fail to save. The upgrade now runs reliably on the first admin page load after updating.

= 1.6.0 =
* New: "View Your Schema" panel on the gallery edit screen — see the exact JSON-LD output, copy it, and test the live page in Google Rich Results with one click.
* New: Gallery schema is now one connected ImageGallery node (with each image as associatedMedia) instead of separate per-image blocks — richer markup and a smaller page.
* New: Captions — show each image's title under its thumbnail (per-gallery toggle).
* New: Gallery Columns — choose auto, 2, 3 or 4 columns per gallery.
* New: First-time installs get a sample gallery with completed schema, so the first screen is a working example.
* Improved: Pro panel now previews the Gallery Import feature (NextGEN and FooGallery, in Schema Gallery Pro).

= 1.5.0 =
* New: Choose from Media Library — add existing images to a gallery without re-uploading. Images are copied into the gallery; your Media Library is untouched.
* New: Imported images bring their title and alt text (or caption) along as the schema title and description, so there is less to fill in.

= 1.4.0 =
* New: Schema Gallery block — add a gallery in the block editor with a live preview. No shortcode needed (the shortcode still works everywhere).
* Improved: The LCP image preload now also works on pages that use the block.

= 1.3.1 =
* Improved: ImageObject `creator` is now typed as Organization to match `author`.

= 1.3.0 =
* New: Upload multiple images at once — drag & drop or multi-select, with a per-file progress list.
* New: Edit Image Schema window — add title, description, keywords, author and license details to each image after upload.
* New: "Needs schema" status on each image and a count of images still missing schema details.
* New: Images get a readable default title from their file name.
* Improved: Admin image list uses lightweight WebP thumbnails.
* Fixed: Deleting or replacing an image now also removes its WebP and responsive copies.
* Fixed: Images with the same name but different extensions no longer overwrite each other's WebP copies.
* Security: All database queries now use prepared identifiers; form input is unslashed and sanitized.
* Confirmed compatibility with WordPress 7.1. Minimum WordPress version is now 6.2.

= 1.2.5 =
* Confirmed compatibility with WordPress 7.0.
* Confirmed compatibility with PHP 8.4.
* Fixed: escaped <br> tags interfering with image sizing.

= 1.2.1 =
* Added internationalization support (i18n) for translations.
* Fixed security escaping issues.
* Updated WordPress compatibility to 6.7.

= 1.2.0 =
* Initial public version.
* Added ImageObject JSON-LD markup for each gallery image.
* Added pagination (18 images per page).
* Added author, license, and datePublished schema support.
* Added responsive grid and custom lightbox navigation.
* Fixed CSS and JS asset enqueue issues.
* Improved schema validation with optional fields for author and copyright.

== Upgrade Notice ==

= 1.7.3 =
Critical fix: resolves the fatal error some sites saw after updating to 1.7.2. Update immediately.

= 1.7.2 =
Now requires PHP 8.1 or newer. Check your PHP version (Tools > Site Health > Info > Server) before updating.

= 1.7.1 =
Security hardening release. Recommended for all users.

= 1.7.0 =
Adds bulk delete with checkboxes and Select All.

= 1.6.1 =
Fixes gallery settings not saving after updating from an earlier version. Update before using 1.6.0 features.

= 1.6.0 =
See and test your schema with one click, plus captions, column choices, and connected ImageGallery markup.

= 1.5.0 =
Add images from your Media Library without re-uploading — titles and alt text become schema data automatically.

= 1.4.0 =
New Schema Gallery block for the WordPress editor — insert galleries without shortcodes.

= 1.3.1 =
Schema refinement: image creator now marked as an Organization, matching author.

= 1.3.0 =
Upload many images at once, then add schema to each one afterwards. Also cleans up WebP copies when images are deleted.

= 1.2.1 =
Adds translation support and fixes security escaping issues for WordPress.org submission.

== License ==

This plugin is licensed under the GPLv2 or later license.

© 2025 Impact Web Solutions LLC