=== DWD Gallery ===
Contributors: dizwebdesign
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.17.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Photo galleries and albums with a reusable photo pool and plugin-owned image files.

== Description ==

DWD Gallery is a first-party gallery plugin. Some features are forked from Imagely NextGEN Gallery (GPLv2 or later).

* Galleries contain albums; albums contain photos; photos can belong to many albums
* Gallery and album records live in plugin tables with sequential IDs (not `wp_posts`)
* Images live under `uploads/diz-gallery/photos/{year}/{month}/` (not the Media Library as source of truth)
* Desktop and mobile display files (default 1920 / 800 long edge) via Imagick then GD
* Blocks and shortcodes: `[dwd_gallery]`, `[dwd_album]`, `[dwd_image]` (legacy `[diz_gallery]`, `[diz_album]`, `[diz_image]` still work)
* Setup wizard, Media Library import, NextGEN Gallery import, optional watermark, private galleries, cover focal point

On first activation, leftover **DWD Gallery 2** (`dwg2_*`) options and tables are removed. Imagely NextGEN `ngg_*` tables are not dropped.

== Installation ==

1. Upload the `dwd-gallery` folder to `wp-content/plugins/`
2. Deactivate and delete **DWD Gallery 2** if it is still installed
3. If you previously used **Diz Gallery**, deactivate it and install this folder (your photos and galleries stay in place)
4. Activate DWD Gallery and complete the setup wizard

== Changelog ==

= 1.17.5 =
* Multisite: network activation/deactivation and new-site bootstrap run per-blog upgrades, pages sync, and rewrites; uninstall loops all sites.

= 1.17.4 =
* Security: [diz_image] / [dwd_image] respect private albums for non-editors; ignore unsigned heartbeat site_token.

= 1.17.3 =
* Performance: batch-load photo tags for front-end grids (removes N+1 tag queries).

= 1.17.2 =
* Security: library REST mutations require manage_options (or Hub menu capability); editors keep read + as-featured.

= 1.17.1 =
* Security: ignore unsigned remote wipe banned/blocked; wipe only via verified signed commands.

= 1.17.0 =
* Album block: after choosing an album, select specific photos (or leave none checked for the whole album). Shortcode: [dwd_album id="…" ids="1,2,3"].

= 1.16.17 =
* Restore the DWD Gallery tab on Add Media / tagDiv Composer (1.16.16 hid it). Clicking a photo in an album or gallery edit modal opens alt, description, and tags.

= 1.16.16 =
* DWD Gallery tab in Add Media / tagDiv Composer: selecting a photo fills the WordPress details sidebar (same fields as Media Library) and enables Insert into page.

= 1.16.15 =
* Public ingest helpers `dizg_store_image_file()` and `dizg_store_image_from_url()` so other DWD plugins can store photos in the gallery pool first (Media Library stub for featured images and attachments). Inactive gallery or a failed ingest still lets those plugins fall back to WordPress Media.

= 1.16.14 =
* Add Media / Insert File includes a DWD Gallery tab to pick photos from the pool (they stay hidden in the Media Library list).

= 1.16.13 =
* First-run setup wizard continues through optional NextGEN import, Media rewrite, featured images, and Media delete. The same actions remain on Tools. Rewrite failures list Media IDs and reasons under the job.

= 1.16.12 =
* Help documents shortcode display types (masonry, filmstrip, and the rest) for pages and Composer.

= 1.16.11 =
* Tools can copy WordPress Media images used in posts into DWD Gallery (old-domain URLs and sized files included) and reset a wrong DWD featured image to the first photo in the story. Featured remap no longer matches files by short filename.

= 1.16.10 =
* Tools can permanently delete WordPress Media Library images while leaving DWD Gallery files alone.

= 1.16.9 =
* Media Library hides attachments that point at DWD Gallery files (WebP under uploads/diz-gallery/). Do not bulk-delete those from Media.

= 1.16.8 =
* Featured-image remap no longer retargets WordPress Media files to DWD WebP. The Media Library modal shows original files again.

= 1.16.7 =
* Featured image panel can pick a photo from DWD Gallery (album filter and search).

= 1.16.6 =
* Tools lists each featured-image remap that failed, with the Media/photo ID, reason, and post titles.

= 1.16.5 =
* Upload fields combine pick-or-create in one box. Insert window height follows the form so the bottom is not clipped.

= 1.16.4 =
* Upload Images in the insert window can create a gallery and album in the same step.

= 1.16.3 =
* Lightbox and slideshow work better on phones: swipe between photos, larger tap targets, and safe-area spacing.

= 1.16.2 =
* Album embeds show photos only (no album title). Lightbox close is an X in the top right; previous and next are side arrows.

= 1.16.1 =
* Display type choices show a small layout icon so each option is easy to tell apart.

= 1.16.0 =
* Insert window can create a gallery or album and upload images, then insert them into the post.

= 1.15.0 =
* Display types in the insert window and block sidebar: Thumbnails, Masonry, Justified, Slideshow, Filmstrip, and Album covers.

= 1.14.0 =
* Gutenberg blocks match NextGEN Gallery Block (Legacy): placeholder, Add button, Insert window (gallery / album / image), Edit and Delete.

= 1.13.1 =
* Remove thumbnails from the dashboard gallery and album list.

= 1.13.0 =
* Point featured images at DWD Gallery also covers WordPress Media Library featured images (imports unmatched files into a Featured images album).

= 1.12.3 =
* Featured-image remap shows a counter and progress bar instead of a list of every photo.

= 1.12.2 =
* Dashboard section links sit in a centered header nav instead of a left sidebar.

= 1.12.1 =
* Point NextGEN featured images at imported DWD Gallery files (in-article URLs were already rewritten).

= 1.12.0 =
* Edit album (and edit gallery) can set a parent gallery. Galleries may nest in other galleries; albums nest only under galleries, not under other albums.

= 1.11.1 =
* Fix dashboard drag-and-drop so dropping a gallery or album saves the new order and nesting.

= 1.11.0 =
* Galleries and albums use plugin tables with sequential IDs (not WordPress posts). Dashboard edit, drag-and-drop nesting, and embed-only display.

= 1.10.0 =
* Galleries dashboard matches an Imagely-style manage table (DWD branding), with albums nested under galleries, thumbnails, and copyable shortcodes.

= 1.9.0 =
* Combine galleries and combine albums (Galleries tab). Posts that used the old IDs still show the kept item.

= 1.8.0 =
* Galleries display like NextGEN: embed in posts/blocks with lightbox. Plugin no longer creates WordPress pages for galleries or albums.
* Help Credits section: some features forked from Imagely NextGEN Gallery (license attribution)

= 1.7.1 =
* NextGEN import dialog shows a total progress bar beside the title

= 1.7.0 =
* Front-end compatibility for NextGEN Gallery Block (Legacy): imported albums render in place of [ngg src="galleries"] after Tools → Import from NextGEN

= 1.6.2 =
* NextGEN import runs in a dialog: scrolling file list, completion message, Close button, auto-close after 5 seconds when nothing failed

= 1.6.1 =
* NextGEN importer: Select all checkbox for the gallery list

= 1.6.0 =
* Import from Imagely NextGEN Gallery (Tools): NextGEN galleries become DWD albums, NextGEN albums become DWD galleries. Copies files into the photo pool; does not delete NextGEN data.

= 1.5.0 =
* Product name is DWD Gallery (install folder `dwd-gallery`). Existing Diz Gallery data, shortcodes, and upload paths are unchanged.

= 1.4.0 =
* Optional DWD Immich bridge (Settings, off by default): import Immich photos into albums when both plugins are active

= 1.3.0 =
* Photo descriptions, alt text, and tags (Photos tab; click a thumbnail to edit)
* Optional description and tags on the upload dialog apply to that batch

= 1.2.3 =
* Fix upload 500: upload_dir filter no longer calls wp_upload_dir() (infinite recursion)

= 1.2.2 =
* Show gallery and album IDs next to names in the library and dropdowns
* Harden photo ingest (PHP 8 filesize crash, WebP fallback to JPEG, catch fatals) and stop showing WordPress error-page CSS as the upload message

= 1.2.1 =
* Upload dialog shows the real error message instead of a generic Error
* Tools includes an error log of recent upload/processing failures (clearable)

= 1.2.0 =
* Private WordPress pages for gallery/album views (not public archives); photos are meant for stories via [diz_image]
* Delete gallery or album from the Galleries tab: move photos to another album or delete orphan photos
* Fix upload dialog staying on Queued after Start uploads (drop zone script error)

= 1.1.9 =
* Galleries and albums share one tab; albums nest under their parent gallery
* Overview no longer has Add gallery / album / photos buttons

= 1.1.8 =
* Restore REST POST /albums so Create album works (route was missing)

= 1.1.7 =
* Add gallery/album/photos dialogs open immediately (admin script fix)
* Help opens in a dialog; Statistics tab; Settings tooltips and re-run setup wizard

= 1.1.6 =
* Setup is a one-time dashboard dialog (not a left-tab page); Save and continue closes it via REST
* Setup tab removed from the dashboard menu

= 1.1.5 =
* Add gallery and Add album open dialogs (name, optional parent gallery) instead of the post editor
* Upload dialog: choose or create an album, select multiple images

= 1.1.4 =
* Setup no longer traps every admin screen: Plugins Hub and left dashboard tabs work before the wizard is saved
* One-time redirect after activation only; Setup includes Skip for now

= 1.1.3 =
* Help tab: how-tos, shortcodes, import/upload, settings, tools, and uninstall notes

= 1.1.2 =
* Hub fly-out is dashboard only; left tabs for galleries/albums/settings/tools/setup; Help compares server mins

= 1.1.1 =
* Queue drag-and-drop, Media dry-run, regenerate/optimize tools, cover focal point, private noindex

= 1.1.0 =
* Photo pool, albums, custom upload directory, conversion settings, blocks, wizard, import tools

= 1.0.0 =
* Initial greenfield stub (replaced by 1.1.0)

== Credits ==

Some features forked from: NextGEN Gallery.

NextGEN Gallery is a product of Imagely. Derived work is used under the GNU General Public License, version 2 or later.

https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
