MediaCG
MediaCG / Plugins / Herocraft

Herocraft

Featured images in one exact size: crop, collages and circle details with theme and social safe zones, SEO file names, alt text and the image caption.

Description

Herocraft adds «Prepare featured image» to the Featured image panel of the block editor. Authors build the picture right there; the server composes one JPEG in the configured size (1600×900 by default) and sets it as the featured image.

  • Layouts: one photo, a whole photo on its own blurred background, two (equal, big left, big right), three (equal, big left, big right), a photo with one or two round details on top.
  • Whole photo on blurred background: for vertical or nearly square photos — the photo is shown whole and the empty sides are filled with the same photo, blurred and darkened (strength, brightness and an optional shadow in the settings). Zooming in narrows the visible part until it fills the frame.
  • Crop by dragging, zoom with the wheel or a slider; a badge warns when a small photo has to be enlarged.
  • Safe zones: outlines show where the active theme (its cropped image sizes, detected automatically), social previews (1.91:1) and Google (4:3, 1:1) will cut the picture.
  • Photos from anywhere: the Media Library, drag and drop from the computer, or paste from the clipboard (a button or Ctrl+V).
  • Careful scaling: Imagick with Lanczos resampling and sharpening (GD fallback).
  • SEO file name from the post title (Cyrillic transliterated by the Ukrainian national standard), alt text and the image caption («Photo: City Council», «Illustrative photo») saved as the image Caption and Description, so the theme shows it under the featured image and the Image block in the text carries it too. When left empty, the caption of the chosen photo is used.
  • Put into the text (per site, off by default): the image is also added to the post as an Image block after paragraph N — for themes that hide the featured image on single posts; regenerating replaces that block. Turn it on in the settings: «Image in the text».
  • Edit composition: the layout, photos and crops are saved, so the image can be reopened and changed later.
  • Works with offloading/optimisation plugins: the result is added through the standard media upload.
  • AI label survives Imagify: Imagify drops all metadata when it converts images to WebP, so its «file.jpg.webp» copies lose the IPTC AI label. Herocraft writes the label back into every such WebP of a labelled image (original, -scaled and all sizes) by adding a VP8X header and an XMP chunk — the picture itself is not re-encoded, the file grows by about 0.5 KB. It runs after Imagify optimises the image, daily as a safety net (re-optimisation, restore, older images) and with WP-CLI: wp herocraft webp-xmp [--id=<attachment>] [--dry-run]. Each new file is checked (structure, size, read by Imagick/GD) before it replaces the old one; problems are listed on the settings page.

REST API

POST /wp-json/herocraft/v1/compose builds the image, adds it to the Media Library and returns it. Works from the block editor and from scripts with Application Passwords (Basic auth, no nonce); the user needs upload_files and edit_post on the post.

Request (JSON):

  • post_id (required), layout (required): single, fit_blur, two-equal, two-big-left, two-big-right, three-equal, three-big-left, three-big-right, circle-right, circle-left, circles-right (only layouts enabled in the settings).
  • cells (required): one item per part of the layout, { "id": 123, "zoom": 1, "cx": 0.5, "cy": 0.5, "crop": { "x": 0, "y": 0, "w": 1, "h": 1 } }. crop is the visible part of the source in fractions (0–1). For fit_blur it may be left out: the whole photo is used.
  • title, alt (optional): title for the file name, alt text.
  • caption (optional): the image caption exactly as it should appear, e.g. «Photo: City Council» or «Illustrative photo». Saved as the image Caption and Description and used under the image in the text. An empty string means no caption.
  • source (optional, older integrations): used only when caption is not sent — the caption becomes «<credit label> <source>», e.g. «Photo: City Council» (the label in the site language: «Фото:» on a Ukrainian site).
  • When neither caption nor source is sent, the caption of the first chosen photo in the Media Library is used.
  • digital_source_type (optional): the IPTC AI label written into the image file as XMP Iptc4xmpExt:DigitalSourceType — trainedAlgorithmicMedia (fully created by generative AI) or compositeWithTrainedAlgorithmicMedia (a real photo edited/enhanced with generative AI). The full IPTC URI (http://cv.iptc.org/newscodes/digitalsourcetype/…) is stored in the file and in every size WordPress makes from it (JPEG and WordPress' WebP copies); also saved in the attachment meta _herocraft_digital_source_type. Empty or left out: no label. Any other value: HTTP 400.
  • featured (optional, default true): set the image as the post's featured image.
  • insert (optional): put the image into the text as an Image block after paragraph N of the settings (true) or not (false); when left out, the site setting «Image in the text» decides (off by default). A block Herocraft inserted before is replaced.

Response: attachment_id (also as id), url (full size), width, height, alt, caption, caption_from (caption, source, photo or empty), digital_source_type, file, upscale (enlargement per part), featured (bool), placed (inserted, replaced, present, noplace or empty when not asked).

Example: curl -u editor:APP_PASSWORD -H "Content-Type: application/json" -d '{"post_id":42,"layout":"fit_blur","cells":[{"id":123}],"insert":false}' https://example.com/wp-json/herocraft/v1/compose

Installation

  1. Upload the plugin and activate it.
  2. Open MCG Plugins → Herocraft to set the size, layouts, safe zones, file name and alt templates.
  3. In the post editor open the Featured image panel and click «Prepare featured image».

FAQ

Does it change existing images?

No. Every result is a new image in the Media Library.

Which image library is used?

Imagick when available, otherwise GD.

Changelog

1.7.0 (2026-10-19)

  • «Image in the text» is now an explicit per-site switch, off by default: the created image goes into the post text (after paragraph N) only on sites where it is turned on in the settings. Until 1.7.0 every site inserted it after paragraph 1 unless it was set to 0 — after the update turn it on again where it is needed.

1.6.0 (2026-10-15)

  • The AI label (XMP Iptc4xmpExt:DigitalSourceType) is kept in the WebP copies Imagify creates without metadata: after Imagify optimises a labelled image, daily for all labelled images, and with wp herocraft webp-xmp. Only RIFF chunks are rearranged (VP8X + XMP), the image is not re-encoded; every file is verified before replacement and problems are shown on the settings page.
  • WebP copies made by WordPress go through the same checked writer.

1.5.1 (2026-10-15)

  • The «MCG Plugins» menu is now at the top of the admin menu, right under the Dashboard.
Older versions (7)

1.5.0 (2026-10-15)

  • AI label: the IPTC Digital Source Type (trainedAlgorithmicMedia or compositeWithTrainedAlgorithmicMedia) is written into the image as XMP, so Google and other services recognise AI images. Set it in the editor («AI label (IPTC)») or with the new REST parameter digital_source_type; it is kept in every size WordPress makes (JPEG and WordPress' WebP copies, also after regenerating thumbnails), saved in _herocraft_digital_source_type and in the composition, so «Edit composition» keeps it.

1.4.0 (2026-10-15)

  • One field for the caption: «Photo source» in the editor is now «Image caption» — authors type the whole caption («Photo: City Council», «Illustrative photo»). It is saved as the image Caption and Description, so it shows under the featured image (theme) and under the Image block in the text.
  • The caption is filled from the chosen photo's own caption when empty — in the editor and in REST calls without caption/source.
  • REST: caption is the main parameter; source still works for older callers; the response tells where the caption came from (caption_from).
  • «Edit composition» reopens with the saved caption (older compositions: «<credit label> <source>»).

1.3.1 (2026-10-14)

  • Fix: the photo credit label is translated — a Ukrainian site gets «Фото: …» instead of «Photo: …», also for REST calls without the editor (the site language is used, not the user's). Settings saved with the old untranslated default follow the site language too.
  • REST compose: new optional caption — the exact caption («Illustrative photo»), overriding the «<label> <source>» template; an empty string means no caption.

1.3.0 (2026-10-14)

  • New layout «Whole photo on blurred background» (fit_blur): the photo is shown whole (contain) over the same photo blurred and darkened; zoom narrows the visible part up to a full-frame crop. Blur strength, background brightness and an optional soft shadow in MCG Plugins → Herocraft; enabled by default (also on sites with saved settings).
  • REST compose: the response has attachment_id, url, width, height; without the editor the server now sets the featured image (featured, default true) and puts the image into the text per the settings, overridable per call with insert (true/false). Works with Application Passwords. Documented in the readme.
  • The editor itself still sets the featured image and the block in the text, so nothing changes for authors.

1.2.0 (2026-10-12)

  • Updates now come from the MEDIA CONTENT GROUP update server (mediacg.org): new versions show up in Plugins → Updates like any other plugin, with «View details» and auto-updates.
  • Plugin URI and Author URI point to mediacg.org.

1.1.0 (2026-10-06)

  • Layouts with one or two round detail photos (ring and soft shadow, inside the safe zones).
  • Photos can be dropped from the computer or pasted from the clipboard (button in every empty part and in the sidebar, or Ctrl+V).
  • The created image can be inserted into the post as an Image block after paragraph N; regenerating replaces it.
  • All safe zones shown by default; clearer labels (Theme, Facebook / social, Google 4:3, Google 1:1); near-identical theme ratios merged into the stricter one.
  • The photo credit caption always uses the site language.
  • One reused media frame instead of a new one per pick; visible separators in layout thumbnails.
  • Settings moved under the shared «MCG Plugins» menu; new icon.

1.0.0

  • First release.

Versions

Version
1.7.0 (current)
1.6.0
1.5.1
1.5.0
1.4.0
1.3.1
1.3.0
1.2.0

The plugins update themselves on every site: a new version shows up in Dashboard → Updates within ~12 hours, or right after «Check again».

For now the plugins run only on MediaCG and partner websites and are not distributed publicly. Interested in a plugin? Write to [email protected].