Check Your Envira Galleries for Problems with AI
Hidden, broken, empty and unused Envira galleries found in one read-only report.
Prerequisites
A site connected to WPVibe running Envira Gallery 1.17.0 or newer (free) on WordPress 6.9 or newer, with an administrator account.
My WordPress site uses Envira Gallery. Check my galleries for problems. Don't change anything. 1. Run discover_abilities with category envira-gallery. If the Envira Gallery abilities are not there, stop and tell me to install the free Envira Gallery plugin or update it to 1.17.0 or newer (it needs WordPress 6.9 or newer). 2. Run envira-gallery/list-galleries with status any and per_page 100. While page is below total_pages, run it again with page raised by 1. Galleries in the trash are not listed. Add up their image_count: if it is over 300, tell me and ask which galleries to check (up to 300 photos in one run), offering the published ones first, and name the ones not checked in the report. 3. Find every page and post that shows a gallery: run rest_api GET /wp/v2/pages and GET /wp/v2/posts, each with search envira-gallery, status publish,draft,private,pending,future, context edit, per_page 100 and _fields id,title,status,link,content.raw (if 100 come back, ask for page 2). If a response says it was cut (truncated), lower per_page and read the rest; a post still cut at per_page 1, read alone with rest_api GET /wp/v2/pages/ID (or posts) with context edit, _fields id,status,content.raw and max_length 4000000. In each, note every envira-gallery shortcode (Envira's own block saves one inside it) and its id, in double, single or no quotes, or its slug; for a slug, find its gallery in the list from step 2, and if none has it, flag it. 4. Read the galleries' photos 10 galleries at a time, not one call each: rest_api GET /wp/v2/envira-gallery with include set to 10 gallery ids, per_page 10, status publish,draft,private,pending,future, context edit and _fields id,status,gallery_data.gallery. If a response says it was cut (truncated), lower per_page and read the rest; a gallery that is still cut at per_page 1, read alone with rest_api GET /wp/v2/envira-gallery/GALLERY_ID with context edit, the same _fields and max_length 4000000, and if even that is cut, say its checks are incomplete. After each read, write down each gallery's results in a short list (its photo ids, how many have no alt text, whether it is empty) and work from that list, not the raw answers. For each gallery, flag: a status other than publish while it is on a published page (visitors see nothing there, with no message); no photos in gallery_data.gallery; photos whose alt is empty (give the count, and say the gallery keeps its own copy of alt text, so it is fixed in the gallery's edit screen, not the media library); not found on any page or post (it may be unused, or on content this check can't see, such as products, courses or synced patterns). 5. Collect every photo id from all galleries and run rest_api GET /wp/v2/media with include set to them (up to 100 at a time), per_page 100 and _fields id. Flag each gallery photo whose id did not come back: it was deleted from the media library and can show as a broken image; it is removed in the gallery's edit screen. 6. Flag every gallery id found on a page or post that is not in the list from step 2: that gallery was deleted or is in the trash, and the spot shows nothing to visitors; if I am not an administrator, it may instead be another user's gallery this account can't list. 7. Report each gallery with its title, status, photo count, where it is shown and its problems, then the pages that show a missing gallery, then the single most important thing to fix first. Offer, as a next step after my yes, to publish a gallery that is on a published page (envira-gallery/update-gallery with status publish, which needs Allow AI to edit galleries turned on).
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Check Your Envira Galleries for Problems with AI” recipe from the WPVibe cookbook on my connected site.
Gallery problems are quiet. A gallery left as a draft (which you still see while signed in) or moved to the trash shows nothing on a live page, a photo deleted from the media library can leave a broken image, and a gallery photo can have no alt text even after you fixed it in the media library. No message tells you.
The AI lists every Envira gallery, reads its photos, and finds every page and post that shows one. It reports galleries that are not published but sit on a published page, photos that no longer exist, empty galleries, gallery photos with no alt text, galleries that are not on any page, and pages that show a gallery that is gone. It changes nothing.
The check finds galleries placed with an Envira block or shortcode on pages and posts. A gallery on a product, a course or other content, or placed with a page builder widget, a theme template or a sidebar widget, isn’t seen, so a gallery listed as not on any page may still be in use. To place a gallery, use this recipe.
Outcome
A report of what is wrong with your galleries and where, with the first thing to fix, and nothing changed.