soderlind / vmfa-rules-engine
Rule-based automatic folder assignment for media uploads
Package info
github.com/soderlind/vmfa-rules-engine
Type:wordpress-plugin
pkg:composer/soderlind/vmfa-rules-engine
Fund package maintenance!
Requires
- php: >=8.3
- composer/installers: ^1.0 || ^2.0
- yahnis-elsts/plugin-update-checker: ^5.6
Requires (Dev)
- brain/monkey: ^2.6
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- mockery/mockery: ^1.6
- phpcompatibility/php-compatibility: ^9.0
- phpunit/phpunit: ^11.0
- wp-coding-standards/wpcs: ^3.0
- dev-main
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 0.4.1
- 0.4.0
- 0.3.3
- 0.3.2
- 0.3.0
- dev-ux/fix
- dev-exit/iptc
- dev-dependabot/npm_and_yarn/axios-1.15.1
- dev-dependabot/composer/phpunit/phpunit-12.5.22
- dev-dependabot/npm_and_yarn/follow-redirects-1.16.0
- dev-dependabot/npm_and_yarn/basic-ftp-5.2.2
- dev-dependabot/npm_and_yarn/lodash-4.18.1
- dev-dependabot/npm_and_yarn/vite-7.3.2
- dev-dependabot/npm_and_yarn/lodash-es-4.18.1
- dev-dependabot/npm_and_yarn/node-forge-1.4.0
- dev-dependabot/npm_and_yarn/multi-c136cad177
- dev-dependabot/npm_and_yarn/multi-bf05dc1ecf
- dev-dependabot/npm_and_yarn/flatted-3.4.2
- dev-feature/use-vmf-addon-base
- dev-feature/wp7-ui
- dev-dependabot/npm_and_yarn/svgo-3.3.3
- dev-dependabot/npm_and_yarn/rollup-4.59.0
- dev-dependabot/npm_and_yarn/immutable-5.1.5
- dev-fix/dependabot-updates
- dev-update/wp-7.0
- dev-feature/vmfo-upload-folder-hook
- dev-fix/workflow-build-step
- dev-refactor/plugin-updater
- dev-fix/best-practices-audit
- dev-feature/addon-shell-ui
- dev-update/dependencies
- dev-protect/rule-folder
- dev-add/folders
- dev-upload/events
- dev-chage/icons
- dev-scan/more
- dev-scan/rule
- dev-requires/plugin
- dev-feature/settings-tab
- dev-exif/regexp
This package is auto-updated.
Last update: 2026-05-04 11:17:50 UTC
README
Rule-based automatic folder assignment for media uploads. Add-on plugin for Virtual Media Folders.
vmfa-rules-engine.mp4
Requirements | Installation | Usage | Organizing a Photo Library
Description
Turn "Default folder for uploads" into a powerful rule system. Automatically assign media to folders based on:
- Filename patterns — Match filenames using regular expressions (e.g.,
^IMG_,^DSC,screenshot.*) - MIME type — Sort by file type (images, videos, PDFs, etc.)
- Image dimensions — Organize by resolution (HD, 4K, thumbnails)
- File size — Separate large files from small ones
- EXIF camera model — Group photos by device (iPhone, Canon, etc.)
- EXIF date taken — Organize by capture date
- EXIF aperture, focal length, ISO, shutter speed, orientation — Fine-grained camera settings
- IPTC keywords, credit, caption, copyright, title — Match any embedded metadata field
- Upload author — Assign based on who uploaded the file
Features
- Multiple rules with priority — Create as many rules as needed, drag to reorder
- Stop after first match — Control whether to continue evaluating rules
- AND logic — All conditions in a rule must match
- Automatic on upload — New uploads are processed instantly
- Scan existing media — Apply rules to your existing library with preview
- WP-CLI compatible — Rules apply to imports via
wp media import - Modern React UI — Consistent with WordPress admin design
Requirements
- WordPress 6.8+
- PHP 8.3+
- Virtual Media Folders plugin (parent plugin)
Installation
- Download
vmfa-rules-engine.zip - Upload via
Plugins → Add New → Upload Plugin - Activate via
WordPress Admin → Plugins
Plugin updates are handled automatically via GitHub. No need to manually download and install updates.
Usage
- Go to Media → Rules Engine in the WordPress admin
- Click Add Rule to create your first rule
- Configure conditions and select a target folder
- Enable the rule and save
- New uploads will automatically be assigned to folders based on your rules
Scanning Existing Media
- Click Scan Existing Media to preview what changes would be made
- Review the preview and select items to process
- Click Apply Changes to assign folders
Organizing a Photo Library
The condition type selector groups conditions into General, EXIF, and IPTC / XMP, making it straightforward to build rules around embedded photo metadata.
EXIF conditions
| Condition | Field | Example use |
|---|---|---|
| Camera model | exif_camera |
Separate iPhone shots from DSLR shots |
| Date taken | exif_date |
Archive by year or shoot date |
| Aperture (f-number) | exif_aperture |
Isolate wide-open portraits (f/1.4 – f/2.8) |
| Focal length | exif_focal_length |
Group wide-angle vs telephoto shots |
| ISO sensitivity | exif_iso |
Flag high-ISO / low-light images for review |
| Shutter speed | exif_shutter_speed |
Find motion-frozen or long-exposure shots |
| Orientation | exif_orientation |
Separate portrait vs landscape images |
Aperture, focal length, ISO, and shutter speed all support comparison operators (>, >=, <, <=, =, Between), so you can create ranges like "ISO between 1600 and 12800". Shutter speed accepts standard photographic fraction notation (1/1000, 1/60) as well as decimal seconds (0.5).
IPTC / XMP conditions
| Condition | Field | Example use |
|---|---|---|
| Keywords | iptc_keywords |
Route images tagged product to a product folder |
| Credit | iptc_credit |
Separate agency photos (Reuters, AFP, Getty) |
| Caption | iptc_caption |
Match photos with specific caption text |
| Copyright | iptc_copyright |
Group images by rights holder or year |
| Title | iptc_title |
Route by object name or headline |
All IPTC conditions use case-insensitive partial matching, so "Reuters" matches "Reuters Photography".
Example: organize a news photo workflow
Rule: Agency Photos
Conditions:
IPTC Credit contains "Reuters"
→ Folder: Agency / Reuters
Rule: High-ISO Night Shots
Conditions:
EXIF ISO >= 3200
→ Folder: Review / High-ISO
Rule: Product Images
Conditions:
IPTC Keywords contains "product"
MIME type is image/jpeg
→ Folder: Products
Development
See docs/DEVELOPMENT.md.
License
GPL-2.0-or-later. See LICENSE.
Copyright 2026 Per Soderlind