Image Mockup Maker
π WordPress plugin for generating customizable image placeholders locally. Features REST API, shortcodes, and professional architecture. No external dependencies.
by Michael Ignacio Β· github.com/michaelignacio/image-mockup-maker Β· website
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/michaelignacio/image-mockup-maker/archive/refs/heads/main.zipA powerful WordPress plugin for generating image placeholders locally without relying on external services. Perfect for development workflows, design mockups, and rapid prototyping.
π Features
- π Local Generation - No external dependencies or API calls
- π¨ Customizable - Control size, colors, text, and format
- π± Multiple Interfaces - WordPress shortcodes, REST API, and admin interface
- πΌοΈ Multiple Formats - Support for PNG, JPEG, and GIF
π¦ Installation
Via WordPress Admin
- Download the plugin ZIP file
- Go to Plugins β Add New in your WordPress admin
- Click Upload Plugin and select the ZIP file
- Click Install Now and then Activate
Via FTP/Manual Installation
- Extract the plugin files to
/wp-content/plugins/image-mockup-maker/ - Go to Plugins in your WordPress admin
- Activate Image Mockup Maker
Via WP-CLI
wp plugin install image-mockup-maker --activate
π§ Requirements
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- GD Extension: Required for image generation
- Memory: Recommend 128MB+ for large images
π Quick Start
Using Shortcodes
// Basic placeholder
[imgmkp_placeholder size="400x300"]
// Custom colors and text
[imgmkp_placeholder width="500" height="200" bg="ff0000" color="ffffff" text="Custom Text"]
// Different format
[imgmkp_placeholder size="300x200" format="jpg" alt="My placeholder"]
Using REST API
# Basic placeholder
GET /wp-json/imgmkp/v1/generate/400x300
# With custom parameters
GET /wp-json/imgmkp/v1/generate/500x200?bg=ff0000&color=ffffff&text=Hello%20World
π Documentation
Shortcode Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
size |
string | - | Dimensions as "WIDTHxHEIGHT" (e.g., "400x300") |
width |
integer | 300 | Image width in pixels |
height |
integer | 200 | Image height in pixels |
bg |
string | cccccc | Background color (hex without #) |
color |
string | 333333 | Text color (hex without #) |
text |
string | "{width} x {height}" | Custom text to display |
format |
string | png | Image format (png, jpg, jpeg, gif) |
alt |
string | "Placeholder image" | Alt text for accessibility |
class |
string | - | CSS class for the img element |
REST API Endpoints
Generate Placeholder Image
Endpoint: GET /wp-json/imgmkp/v1/generate/{dimensions}
Parameters:
dimensions(required): Format "WIDTHxHEIGHT" (e.g., "400x300")bg(optional): Background color hex (without #)color(optional): Text color hex (without #)text(optional): Custom text to displayformat(optional): Image format (png, jpg, jpeg, gif)
Example Requests:
# Basic 400x300 PNG
curl "https://yoursite.com/wp-json/imgmkp/v1/generate/400x300"
# Red background with white text
curl "https://yoursite.com/wp-json/imgmkp/v1/generate/500x200?bg=ff0000&color=ffffff"
# Custom text and JPEG format
curl "https://yoursite.com/wp-json/imgmkp/v1/generate/300x200?text=Hello%20World&format=jpg"
Admin Settings
Navigate to Settings β Image Mockup Maker to configure:
- Default Dimensions - Fallback width and height
- Default Colors - Background and text colors
- Size Limits - Maximum allowed dimensions
- Display Options - Show/hide dimension text
π Troubleshooting
Common Issues
Images not generating:
- Check that GD extension is installed:
php -m | grep -i gd - Verify memory limits for large images
- Check file permissions on
/assets/fonts/
Text not rendering:
- Font files may be missing or corrupted
- Plugin falls back to built-in PHP fonts automatically
Size limits:
- Default maximum is 8000x8000 pixels
- Adjust in Settings β Image Mockup Maker
π License
This project is licensed under the GPL v2 or later - see the LICENSE file for details.