承接 soderlind/ai-alt-text 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

soderlind/ai-alt-text

Composer 安装命令:

composer require soderlind/ai-alt-text

包简介

AI Alt Text – Automatically generate alt text for images using AI. Supports OpenAI, Claude, Gemini, Ollama, and Grok.

README 文档

README

Generate alt text for images using AI. Supports multiple AI providers including OpenAI, Claude, Gemini, Ollama, Azure OpenAI, and Grok.

AI Alt Text Plugin Screenshot

Features

  • Bulk Update: Update alt text for multiple images at once from the media library
  • Block Editor Integration: Generate alt text directly from the image block in the editor
  • Multiple AI Providers: Choose from OpenAI (GPT-4o), Anthropic Claude, Google Gemini, Azure OpenAI, Ollama (local), or Grok
  • Language Detection: Automatically uses WordPress language settings for generated alt text
  • Flexible Configuration: Configure via constants, environment variables, or the admin settings page

Requirements

  • WordPress 6.8 or higher
  • PHP 8.3 or higher
  • API key for your chosen AI provider (except Ollama which runs locally)

Installation

  • Quick Install

    • Download ai-alt-text.zip
    • Upload via Plugins > Add New > Upload Plugin
    • Activate the plugin.
    • Go to Settings → AI Alt Text to configure your AI provider
  • Composer Install

    composer require soderlind/ai-alt-text
  • Updates

Configuration

Via Admin Settings

Navigate to Settings → AI Alt Text and configure:

  1. Select your AI provider
  2. Enter your API key
  3. Optionally customize the model and other settings

Via Constants (wp-config.php)

// AI Provider: 'openai', 'anthropic', 'gemini', 'azure', 'ollama', 'grok'
define( 'AI_ALT_TEXT_PROVIDER', 'openai' );

// API Key
define( 'AI_ALT_TEXT_API_KEY', 'your-api-key-here' );

// Optional: Custom model
define( 'AI_ALT_TEXT_MODEL', 'gpt-4o' );

// Azure-specific settings
define( 'AI_ALT_TEXT_AZURE_ENDPOINT', 'https://your-resource.openai.azure.com' );
define( 'AI_ALT_TEXT_AZURE_DEPLOYMENT', 'your-deployment-name' );

// Ollama-specific settings
define( 'AI_ALT_TEXT_OLLAMA_HOST', 'http://localhost:11434' );

Via Environment Variables

AI_ALT_TEXT_PROVIDER=openai
AI_ALT_TEXT_API_KEY=your-api-key-here
AI_ALT_TEXT_MODEL=gpt-4o

Usage

Bulk Update

  1. Go to Media → Library (list view)
  2. Select images you want to update
  3. Choose "Generate AI Alt Text" from the bulk actions dropdown
  4. Click "Apply"

From the Block Editor

  1. Add or select an image block
  2. In the sidebar, find the "AI Alt Text" panel
  3. Click "Generate Alt Text with AI"

AI Providers

Provider Model Notes
OpenAI gpt-4o Requires API key from OpenAI
Anthropic claude-sonnet-4-20250514 Requires API key from Anthropic
Google Gemini gemini-2.0-flash Requires API key from Google AI Studio
Azure OpenAI gpt-4o Requires Azure subscription and deployment
Ollama llava Free, runs locally. Install from ollama.ai
Grok grok-2-vision-1212 Requires API key from xAI

For detailed configuration instructions, see AI Provider Documentation.

Hooks & Filters

Modify Generated Alt Text

add_filter( 'ai_alt_text_generated', function( $alt_text, $attachment_id ) {
    // Modify the generated alt text
    return $alt_text;
}, 10, 2 );

Customize the AI Prompt

add_filter( 'ai_alt_text_prompt', function( $prompt, $language ) {
    // Customize the prompt sent to the AI
    return $prompt;
}, 10, 2 );

Skip Auto-generation for Specific Images

add_filter( 'ai_alt_text_should_generate', function( $should_generate, $attachment_id ) {
    // Return false to skip auto-generation
    return $should_generate;
}, 10, 2 );

Translations

The plugin is translation-ready. Translation files are located in the languages/ directory.

Creating a Translation

  1. Copy languages/ai-alt-text.pot to languages/ai-alt-text-{locale}.po
    • Example: ai-alt-text-nb_NO.po for Norwegian Bokmål
    • Example: ai-alt-text-de_DE.po for German
  2. Translate the strings using Poedit or similar tool
  3. Save to generate the .mo file
  4. For JavaScript translations, run:
    wp i18n make-json languages/

Available Locales

Contributions welcome! Submit your translation via a pull request.

Development

Building Assets

npm install
npm run build

Running Tests

# JavaScript tests
npm test

# PHP tests
./vendor/bin/phpunit

Code Standards

# Check PHP code standards
./vendor/bin/phpcs

# Fix PHP code standards
./vendor/bin/phpcbf

License

GPL v2 or later. See LICENSE for details.

Credits

Developed by Per Soderlind.

Support

soderlind/ai-alt-text 适用场景与选型建议

soderlind/ai-alt-text 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「media」 「plugin」 「wordpress」 「seo」 「images」 「accessibility」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 soderlind/ai-alt-text 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 soderlind/ai-alt-text 我们能提供哪些服务?
定制开发 / 二次开发

基于 soderlind/ai-alt-text 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 41
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-11-27