Automatically generate alt text for your WordPress images using X.AI's (formerly Twitter) image understanding API.
- 🤖 Automatic alt text generation using X.AI
- 🔒 Secure API key storage with encryption
- 🖼️ Support for JPEG and PNG images
- 🔄 Bulk processing of existing images
- ⚡ Auto-generation for new uploads
- 📝 Customizable prefix and suffix text
- 🎯 Option to update image title, caption, and description
- Download the latest release zip file
- Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the zip file and click "Install Now"
- Click "Activate" to enable the plugin
- Clone the repository:
git clone https://github.com/yourusername/smart-alt-text.git
cd smart-alt-text
- Create a zip file for testing:
zip -r smart-alt-text.zip . -x ".*" -x "__MACOSX" -x "*.git*"
- Visit X.AI's platform
- Sign up or log in to your account
- Go to API section
- Generate a new API key
- Copy the API key for use in the plugin
-
Go to WordPress Admin → Smart Alt Text → Settings
-
API Settings:
- Enter your X.AI API key
- The key will be securely encrypted in the database
-
Generation Settings:
- Auto Generation: Enable to automatically generate alt text for new image uploads
- Update Fields: Choose which fields to update:
- Image title
- Image caption
- Image description
- Text Modifications:
- Prefix: Text to add before the generated alt text
- Suffix: Text to add after the generated alt text
- Go to Media Library
- Click on an image
- Click the "Analyze" button to generate alt text
- Go to Smart Alt Text → Images
- Select images you want to process
- Click "Generate Alt Text" to process multiple images
- JPEG/JPG
- PNG
Note: Other formats like AVIF, WebP, GIF are not currently supported by the X.AI API.
smart-alt-text/
├── assets/
│ ├── css/
│ │ └── admin.css
│ └── js/
│ └── admin.js
├── includes/
│ ├── class-admin.php
│ ├── class-image-analyzer.php
│ ├── class-activator.php
│ └── class-deactivator.php
├── templates/
│ ├── settings-page.php
│ ├── bulk-page.php
│ └── stats-page.php
├── smart-alt-text.php
└── README.md
-
Update version number in:
smart-alt-text.php
readme.md
-
Create release zip:
zip -r smart-alt-text.zip . -x ".*" -x "__MACOSX" -x "*.git*" -x "node_modules/*" -x "tests/*"
- API keys are stored securely in WordPress database
- All API requests are made server-side
- Input is sanitized and validated
- AJAX requests are nonce-protected
- Database queries are prepared statements
For issues and feature requests, please create an issue on GitHub.
This project is licensed under the GPL v2 or later - see the LICENSE file for details.