GenArt Featured Images
A WordPress plugin creating Generative Art Featured Images.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/drhdev/genart-featured-images/archive/refs/heads/main.zipWordPress plugin that generates abstract WebP featured images for posts and applies SEO-friendly media metadata automatically.
Highlights
- Generates a featured image when a post has no thumbnail.
- Supports bulk generation for existing posts.
- Includes a dry-run workflow before batch execution.
- Uses customizable SEO template placeholders:
%title%%sitename%
- Supports per-post style/scheme selectors in the editor.
- Includes
Tangled sinusart style with intertwined sine-wave rendering. - Loads art styles automatically from
includes/styles/for easier extension. - Loads color schemes automatically from
includes/schemes/for easier extension. - Randomizes defaults for new posts and pages.
- Supports category/tag generation rules with deterministic priority.
- Marks generated media clearly and includes safe cleanup for unused generated images.
- Implements capability checks, nonce validation, and sanitized settings.
Requirements
- WordPress
6.0+ - PHP
7.4+ - PHP GD extension with WebP support enabled
Installation
- Copy this plugin folder into
wp-content/plugins/genart-featured-images. - Activate GenArt Featured Images in the WordPress admin.
- Open the
GenArt Featured Imagesmenu in the WordPress admin sidebar. - Configure design and SEO template settings.
Usage
Automatic generation on save
When a post or page is saved and has no featured image, the plugin generates one automatically.
Bulk generation
- Go to the
GenArt Featured Imagesadmin menu. - Run Dry Run to inspect pending posts and batch profile.
- Start Bulk Generation.
The plugin processes posts in memory-aware batches.
Generation Decision Logic
For each generation event, the plugin resolves style and color scheme in this strict order:
- Manual editor action payload (highest priority)
- Saved per-post/per-page preferences
- Matching taxonomy rule
- Global defaults
Rule resolution details:
- Tag rules are checked first.
- Category rules are checked second.
- Inside each group, rules are evaluated from top to bottom.
- Each category/tag can be configured only once to avoid direct conflicts.
Default behavior for new content:
- Auto-generation runs for posts and pages (if enabled).
- If random defaults are enabled, algorithm and scheme are randomly selected from available options when no stronger source provides a value.
- If random defaults are disabled, configured fixed defaults are used.
Configuration Guide
Plugin settings
- Set global default style and scheme.
- Optionally enable random default mode (recommended if you want variety).
- Add or edit style files and scheme files directly in
includes/. - Define tag/category rules only where needed.
- Keep rule count manageable and easy to audit.
Adding new art styles
Use starter template: includes/styles/template-style.php
- Place one style per file in
includes/styles/. - Filename must match exactly:
class-genart-style-your-style.php. - Class name must match filename slug exactly:
Genart_Style_Your_Style. - Extend
Genart_Style_Baseand implement:get_id()get_label()render( $image, $colors, $width, $height )
get_id()must returnyour_style(snake_case and equal to filename slug).get_label()must return a non-empty string.- Save the file; the plugin auto-discovers styles from that folder.
- The new style appears automatically in settings, rules, and editor dropdowns.
Adding new color schemes
Use starter template: includes/schemes/template-scheme.php
- Place one scheme per file in
includes/schemes/. - Filename must match exactly:
class-genart-scheme-your-scheme.php. - Class name must match filename slug exactly:
Genart_Scheme_Your_Scheme. - Extend
Genart_Scheme_Baseand implement:get_id()get_label()get_colors()
get_id()must returnyour_scheme(snake_case and equal to filename slug).get_label()must return a non-empty string.get_colors()must return an array with at least 2 colors in strict#rrggbbformat.- Save the file; the plugin auto-discovers schemes from that folder.
- The new scheme appears automatically in settings, rules, and editor dropdowns.
Validation and rejection rules
The plugin validates every discovered style and scheme file. Invalid files are rejected and do not appear in dropdowns/rules.
Validation checks:
- Correct folder and filename pattern.
- Expected class exists and extends the correct base class.
get_id()format is valid snake_case and matches the filename slug.get_label()is not empty.- For schemes,
get_colors()returns at least two valid#rrggbbvalues.
If validation fails:
- The module is ignored.
- A clear admin error notice is displayed on plugin Settings and Help pages.
For strict AI-ready generation instructions and templates, use:
.notes/art-styles-color-schemes-instructions.md
Editor overrides
- In post/page editor, choose style and scheme in the plugin metabox.
- Click
Generate Featured Image Nowto force manual generation. - Manual selection always has priority over rules/defaults.
Cleanup behavior
- Cleanup only targets attachments marked as plugin-generated.
- Cleanup keeps any plugin-generated attachment still used as featured image by any post type.
- Cleanup never targets unrelated/manual media.
- Deletion is permanent and also removes WordPress-generated image sub-sizes.
- Cleanup requires explicit confirmation in the admin popup before execution.
In-Plugin Help
The plugin includes a dedicated Help page in the WordPress admin menu (GenArt Featured Images > Help) that explains:
- Priority and rule resolution
- Recommended rule design
- Cleanup scope, limitations, and safety notes
- Suggested operational workflow
WordPress.org Assets
Repository includes production PNG assets in assets/:
banner-772x250.pngbanner-1544x500.pngicon-128x128.pngicon-256x256.pngscreenshot-1.pngscreenshot-2.png
For WordPress.org SVN, these must be committed to the root-level /assets directory (outside /trunk).
Project Structure
.
├── assets/
│ ├── banner-772x250.png
│ ├── banner-1544x500.png
│ ├── icon-128x128.png
│ ├── icon-256x256.png
│ ├── screenshot-1.png
│ ├── screenshot-2.png
│ └── js/admin.js
├── genart-featured-images.php
├── includes/
│ ├── schemes/
│ │ ├── class-genart-scheme-base.php
│ │ ├── class-genart-scheme-modern-blue.php
│ │ ├── class-genart-scheme-sunset.php
│ │ ├── class-genart-scheme-nordic.php
│ │ └── class-genart-scheme-cyber.php
│ └── styles/
│ ├── class-genart-style-base.php
│ ├── class-genart-style-mesh-gradient.php
│ ├── class-genart-style-bauhaus-shapes.php
│ ├── class-genart-style-digital-stream.php
│ └── class-genart-style-tangled-sinus.php
├── readme.txt
├── todo.txt
└── uninstall.php
Security Notes
- AJAX endpoints require valid nonces and
manage_optionscapability. - Settings are sanitized via
register_settingcallback. - File handling uses WordPress media APIs and error checks.
Development
Quick checks
php -l genart-featured-images.php
php -l uninstall.php
License
GPL-2.0-or-later. See plugin headers and readme.txt for details.