PHPackages                             madebybramble/craft-openai-alt-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. madebybramble/craft-openai-alt-generator

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

madebybramble/craft-openai-alt-generator
========================================

Automatically generate WCAG-compliant alternative text for images using OpenAI Vision API

1.0.2(2w ago)04proprietaryPHPCI passing

Since Aug 23Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/Made-By-Bramble/openai-alt-generator)[ Packagist](https://packagist.org/packages/madebybramble/craft-openai-alt-generator)[ RSS](/packages/madebybramble-craft-openai-alt-generator/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

OpenAI Alternative Text Generator for Craft CMS
===============================================

[](#openai-alternative-text-generator-for-craft-cms)

**Automatically generate WCAG-compliant alternative text for your images using OpenAI's Vision API**

Transform your website's accessibility with AI-powered alternative text generation. This plugin automatically creates descriptive, WCAG-compliant alt text for your images, making your content accessible to everyone while saving you countless hours of manual work.

[![Plugin Version](https://camo.githubusercontent.com/4f7e0d0b2eb3de8c977c19f21c7250bee9dcbaef07d742736035565ed3a1f2e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c7565)](https://camo.githubusercontent.com/4f7e0d0b2eb3de8c977c19f21c7250bee9dcbaef07d742736035565ed3a1f2e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c7565)[![Craft CMS](https://camo.githubusercontent.com/4c9440bb80c588420cf990475b43d43768a4a5f98f7c959441a27ec168c0736b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4372616674253230434d532d352e332532422d6f72616e6765)](https://camo.githubusercontent.com/4c9440bb80c588420cf990475b43d43768a4a5f98f7c959441a27ec168c0736b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4372616674253230434d532d352e332532422d6f72616e6765)[![License](https://camo.githubusercontent.com/e91e0590d1e5579db3793e4dccd5a6d6372939eaf3244bc784a2832e6d5ced24/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d50726f70726965746172792d726564)](https://camo.githubusercontent.com/e91e0590d1e5579db3793e4dccd5a6d6372939eaf3244bc784a2832e6d5ced24/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d50726f70726965746172792d726564)

🌟 Why This Plugin?
------------------

[](#-why-this-plugin)

**The Problem:** Writing quality alternative text for images is time-consuming and often neglected, leading to poor website accessibility and potential legal issues.

**The Solution:** This plugin uses OpenAI's advanced Vision API to automatically generate professional-quality, WCAG-compliant alternative text that:

- ✅ Describes image content accurately and concisely
- ✅ Follows accessibility best practices
- ✅ Integrates seamlessly into your Craft CMS workflow
- ✅ Processes images automatically on upload or in bulk operations

🚀 Key Features
--------------

[](#-key-features)

### **🤖 Automatic AI Generation**

[](#-automatic-ai-generation)

- Generates alt text automatically when images are uploaded
- Uses OpenAI's latest vision models (GPT-5, GPT-4o, etc.)
- WCAG 2.1 AA compliant output
- Smart content analysis and description

### **⚙️ Flexible Configuration**

[](#️-flexible-configuration)

- Configure settings per asset volume
- Choose which field stores your alt text
- Customize image resolution for analysis
- Override system prompts for specific needs

### **📊 Bulk Operations**

[](#-bulk-operations)

- **Generate Missing**: Process only images without alt text
- **Replace ALL**: Update all images with fresh alt text
- Background processing with progress tracking
- Volume-specific or site-wide operations

### **🎯 Smart Integration**

[](#-smart-integration)

- Asset Manager toolbar buttons
- Dashboard widget for status monitoring
- Real-time statistics and completion tracking
- Seamless Craft CMS integration

### **🔧 Advanced Controls**

[](#-advanced-controls)

- Multiple OpenAI model options
- Configurable retry logic and timeouts
- Environment variable support
- Comprehensive error handling and logging

📋 Requirements
--------------

[](#-requirements)

- **Craft CMS**: Version 5.3.0 or higher
- **PHP**: Version 8.1 or higher
- **OpenAI API Key**: Required for all functionality
- **Internet Connection**: For OpenAI API communication
- **Asset Volumes**: At least one configured asset volume

🔧 Installation
--------------

[](#-installation)

### Via Craft Plugin Store (Recommended)

[](#via-craft-plugin-store-recommended)

1. **Open the Plugin Store**

    - In your Craft CMS admin panel, go to **Settings → Plugin Store**
    - Search for "OpenAI Alternative Text Generator"
    - Click **Install** on the plugin
2. **Install the Plugin**

    - Click **Try** for a free trial or **Buy Now** to purchase
    - The plugin will be automatically downloaded and installed
    - No additional configuration needed

### Via Composer

[](#via-composer)

1. **Install via Composer**

    ```
    composer require madebybramble/craft-openai-alt-generator
    ```
2. **Install in Craft CMS**

    - Go to **Settings → Plugins**
    - Find "OpenAI Alternative Text Generator"
    - Click **Install**

⚡ Quick Start Guide
-------------------

[](#-quick-start-guide)

### 1. **Get Your OpenAI API Key**

[](#1-get-your-openai-api-key)

- Visit [OpenAI Platform](https://platform.openai.com/)
- Create account or sign in
- Navigate to **API Keys** section
- Create a new API key and copy it

### 2. **Configure the Plugin**

[](#2-configure-the-plugin)

- Go to **Settings → Plugins → OpenAI Alternative Text Generator**
- Enter your OpenAI API Key
- Click **Test Connection** to verify setup
- Choose your preferred image resolution (Medium recommended)

### 3. **Set Up Volumes**

[](#3-set-up-volumes)

- In the **Volume Configuration** section
- Enable auto-generation for desired volumes
- Choose which field stores the alt text (usually "Title" or custom field)
- View real-time statistics for each volume

### 4. **Test the Setup**

[](#4-test-the-setup)

- Upload a new image to a configured volume
- Check that alt text is automatically generated
- View the generated text in your chosen field

📖 Detailed Configuration
------------------------

[](#-detailed-configuration)

### **🔑 API Configuration**

[](#-api-configuration)

#### OpenAI API Key

[](#openai-api-key)

- **Required**: Yes
- **Format**: Your OpenAI API key or environment variable (`$OPENAI_API_KEY`)
- **Security**: Store in environment variables for production

#### Model Selection

[](#model-selection)

Choose from available OpenAI vision models:

- **GPT-5** (Latest): Best quality, higher cost
- **GPT-4o**: Excellent balance of speed and quality ⭐ *Recommended*
- **GPT-4o-mini**: Faster and more economical
- **Other models**: Additional options based on availability

### **🖼️ Image Processing Settings**

[](#️-image-processing-settings)

#### Resolution Options

[](#resolution-options)

- **Low (512×512)**: Fastest, most economical, basic detail
- **Medium (768×768)**: Balanced performance and quality ⭐ *Recommended*
- **High (1024×1024)**: Best detail, higher cost and processing time

#### Custom System Prompt

[](#custom-system-prompt)

- **Default**: WCAG-compliant prompt for accessibility
- **Custom**: Override for specific brand voice or requirements
- **Important**: Maintain accessibility compliance when customizing

### **📁 Volume Configuration**

[](#-volume-configuration)

#### Per-Volume Settings

[](#per-volume-settings)

Configure each asset volume independently:

- **Auto Generate**: Enable/disable automatic generation on upload
- **Alt Text Field**: Choose field to store generated text:
    - Default fields (Title, etc.)
    - Custom Plain Text fields
    - Asset volume-specific fields

#### Field Requirements

[](#field-requirements)

Alt text fields must be:

- Plain Text or Single-line Text field types
- Attached to the asset volume
- Accessible for editing by the plugin

### **🔧 Advanced Settings**

[](#-advanced-settings)

#### Retry Configuration

[](#retry-configuration)

- **Max Retries**: 1-10 attempts for failed requests (default: 3)
- **API Timeout**: 10-120 seconds per request (default: 30)

#### Performance Tuning

[](#performance-tuning)

- Higher retries = better reliability, slower failure detection
- Longer timeouts = handle complex images, delayed error notification

🔄 Using Bulk Operations
-----------------------

[](#-using-bulk-operations)

### **From Settings Page**

[](#from-settings-page)

#### Generate Missing Alt Text

[](#generate-missing-alt-text)

- Processes only images without existing alt text
- Safe operation - won't overwrite existing content
- Background processing with progress notifications
- Can be applied globally or per volume

#### Replace ALL Alt Text ⚠️

[](#replace-all-alt-text-️)

- **DESTRUCTIVE**: Replaces all existing alt text
- Requires double confirmation
- Use when updating alt text standards
- Creates audit log entries

### **From Asset Manager**

[](#from-asset-manager)

#### Context-Aware Operations

[](#context-aware-operations)

- Buttons appear in Asset Manager toolbar
- **Volume-specific**: When viewing single volume
- **Global**: When viewing all assets
- Real-time status feedback

#### Mobile &amp; Responsive

[](#mobile--responsive)

- Full labels on desktop
- Icon-only on tablets
- Hidden on mobile phones to save space

📊 Dashboard Widget
------------------

[](#-dashboard-widget)

### **Alternative Text Status Widget**

[](#alternative-text-status-widget)

Add to your dashboard for quick monitoring:

- **Volume Overview**: See all volumes at a glance
- **Completion Percentages**: Color-coded progress indicators
    - 🟢 Green: 90%+ complete
    - 🟡 Yellow: 50-89% complete
    - 🔴 Red: Under 50% complete
- **Image Counts**: Total, completed, and missing statistics
- **Configuration Status**: Identify unconfigured volumes

### Adding the Widget

[](#adding-the-widget)

1. Go to **Dashboard**
2. Click **+ New Widget**
3. Select **Alternative Text Status**
4. Configure size and position

🎯 Best Practices
----------------

[](#-best-practices)

### **📝 Alt Text Quality**

[](#-alt-text-quality)

- Generated text follows WCAG guidelines
- Under 125 characters when possible
- Focuses on image purpose and essential content
- Avoids redundant phrases like "image of"

### **🔧 Configuration Tips**

[](#-configuration-tips)

- Start with **Medium resolution** for best balance
- Enable auto-generation on frequently used volumes
- Use custom Plain Text fields for better organization
- Test with representative images before bulk operations

### **⚡ Performance Optimization**

[](#-performance-optimization)

- Process bulk operations during off-peak hours
- Monitor API usage and costs
- Use appropriate retry settings for your network
- Enable only needed volumes to reduce processing

### **🔒 Security &amp; Compliance**

[](#-security--compliance)

- Store API keys in environment variables
- Regularly rotate API keys
- Monitor usage for unexpected costs
- Maintain audit logs for compliance

🔍 Troubleshooting
-----------------

[](#-troubleshooting)

### **Common Issues**

[](#common-issues)

#### "API Key Not Configured"

[](#api-key-not-configured)

- ✅ Verify API key is entered correctly
- ✅ Check environment variable syntax if using
- ✅ Ensure API key has proper permissions
- ✅ Test connection in settings

#### "Connection Test Failed"

[](#connection-test-failed)

- ✅ Check internet connectivity
- ✅ Verify OpenAI service status
- ✅ Confirm API key validity
- ✅ Check firewall settings

#### "No Alt Text Generated"

[](#no-alt-text-generated)

- ✅ Verify volume is configured and enabled
- ✅ Check image is supported format (JPEG, PNG, etc.)
- ✅ Confirm field mapping is correct
- ✅ Review error logs for details

#### "Field Not Found" Errors

[](#field-not-found-errors)

- ✅ Ensure target field exists on volume
- ✅ Verify field type is Plain Text compatible
- ✅ Check field handle spelling
- ✅ Confirm user permissions

### **Performance Issues**

[](#performance-issues)

#### Slow Processing

[](#slow-processing)

- Reduce image resolution setting
- Decrease retry attempts
- Check network connectivity
- Monitor OpenAI API status

#### High Costs

[](#high-costs)

- Use lower resolution setting
- Choose more economical models
- Optimize bulk operation timing
- Review usage patterns

📈 Understanding Statistics
--------------------------

[](#-understanding-statistics)

### **Volume Statistics Display**

[](#volume-statistics-display)

- **Total Images**: All images in volume
- **Has Alt Text**: Images with existing alt text
- **Missing**: Images needing alt text
- **Complete %**: Completion percentage

🔐 Environment Variables
-----------------------

[](#-environment-variables)

For production deployments, use environment variables:

```
# .env file
OPENAI_API_KEY=sk-your-api-key-here
```

Then in settings, use:

- API Key: `$OPENAI_API_KEY`

📞 Support &amp; Resources
-------------------------

[](#-support--resources)

### **Getting Help**

[](#getting-help)

- **Documentation**: This README file
- **Issues**: [GitHub Issues](https://github.com/Made-By-Bramble/openai-alt-generator/issues)
- **Email Support**:

### **Useful Resources**

[](#useful-resources)

- [OpenAI API Documentation](https://platform.openai.com/docs)
- [WCAG Guidelines](https://www.w3.org/WAI/WCAG21/Understanding/)
- [Craft CMS Documentation](https://craftcms.com/docs/)

### **Developer Info**

[](#developer-info)

- **Developer**: [Made By Bramble](https://www.madebybramble.co.uk)
- **Author**: Phill Morgan
- **License**: Proprietary

🎉 You're All Set!
-----------------

[](#-youre-all-set)

Your Craft CMS site is now equipped with AI-powered alternative text generation. Your images will automatically become more accessible, improving user experience for everyone.

**Next Steps:**

1. Monitor the dashboard widget for completion progress
2. Run bulk operations on existing images
3. Customize settings based on your needs
4. Enjoy automatic alt text generation on new uploads!

---

*Made with ❤️ by [Made By Bramble](https://www.madebybramble.co.uk)*

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Total

3

Last Release

16d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9eea4d444e125a5e92d5ab0a0562d3391a0da767df354f4a6c6ed32ed9fc584d?d=identicon)[madebybramble](/maintainers/madebybramble)

---

Top Contributors

[![phill-bramble](https://avatars.githubusercontent.com/u/191970248?v=4)](https://github.com/phill-bramble "phill-bramble (21 commits)")

---

Tags

openaiimagescmsaccessibilityCraftcraftcmswcagalt text

### Embed Badge

![Health badge](/badges/madebybramble-craft-openai-alt-generator/health.svg)

```
[![Health](https://phpackages.com/badges/madebybramble-craft-openai-alt-generator/health.svg)](https://phpackages.com/packages/madebybramble-craft-openai-alt-generator)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
