| @@ -1,10 +1,11 @@ | ||
| 1 | 1 | === Auto Alt Text === |
| 2 | 2 | Contributors: valeriomonti |
| 3 | -Tags: alt text, alt tag, alt text generation, alt tag generation, alt text AI, alt tag AI | |
| 3 | +Donate link: https://ko-fi.com/valeriomonti | |
| 4 | +Tags: alt text, alt tag, accessibility, openai, seo | |
| 4 | 5 | Requires at least: 6.0 |
| 5 | -Tested up to: 6.5 | |
| 6 | -Stable tag: 1.3.2 | |
| 6 | +Tested up to: 6.8.3 | |
| 7 | +Stable tag: 2.5.2 | |
| 7 | 8 | Requires PHP: 7.4 |
| 8 | 9 | License: GPLv3 |
| 9 | 10 | License URI: http://www.gnu.org/licenses/gpl.html |
| 10 | 11 | |
| @@ -11,9 +12,9 @@ | ||
| 11 | 12 | This plugin allows you to automatically generate an Alt Text for images uploaded into the media library via AI. |
| 12 | 13 | |
| 13 | 14 | == Description == |
| 14 | 15 | |
| 15 | -This plugin implements the automatic creation of alt text for images uploaded to the media library directly at the time of upload. | |
| 16 | +This plugin implements the automatic creation of alt text for images uploaded to the media library. The alt text is generated at the time of uploading the image and it is also possible to generate the alt text for images already present in the media library. | |
| 16 | 17 | |
| 17 | 18 | To generate the alt text, you can choose to use the artificial intelligence of OpenAI or Azure, or decide if you simply want to copy the title of the article where the image is uploaded or the name of the image. |
| 18 | 19 | |
| 19 | 20 | Clearly, using artificial intelligence will allow for a more accurate and useful alt texts. |
| @@ -20,10 +21,11 @@ | ||
| 20 | 21 | |
| 21 | 22 | ## Features |
| 22 | 23 | ___ |
| 23 | 24 | This plugin allows you to generate alt texts in the following ways: |
| 25 | +- using Openai APIs (GPT-4o, GPT-4o Mini, o1 Mini) | |
| 26 | +- using Anthropic Claude API | |
| 24 | 27 | - using Azure APIs for computational vision; |
| 25 | -- using Openai APIs | |
| 26 | 28 | - recovering the title of the image |
| 27 | 29 | - recovering the title of the article in which the image is uploaded |
| 28 | 30 | |
| 29 | 31 | |
| @@ -36,18 +38,19 @@ | ||
| 36 | 38 | ### OpenAI's APIs |
| 37 | 39 | In your OpenAI account, retrieve the following data to enter on the options page: |
| 38 | 40 | - API Key |
| 39 | 41 | |
| 42 | +Choose the model you want to use for generating the alt text. | |
| 40 | 43 | Enter a prompt for generating the alt text according to your needs. |
| 41 | 44 | |
| 42 | -Select a Fallback OpenAI Model, useful in case the automatic generation of alt text does not work correctly. | |
| 45 | +### Claude Anthropic's APIs | |
| 46 | +In your Anthropic account, retrieve the following data to enter on the options page: | |
| 47 | +- API Key | |
| 43 | 48 | |
| 44 | -For generating alt text, the "gpt-4-vision-preview" model is used, which is currently in preview. Therefore, it might sometimes return an error. | |
| 49 | +Choose the model you want to use for generating the alt text. | |
| 50 | +Enter a prompt for generating the alt text according to your needs. | |
| 45 | 51 | |
| 46 | -When the model fails, a fallback model is used to create the alt text based on the name of the image. | |
| 47 | 52 | |
| 48 | -Enter the fallback prompt. | |
| 49 | - | |
| 50 | 53 | ### Azure's APIs |
| 51 | 54 | On your Azure account, create a Computer Vision instance and retrieve the following data to enter on the options page: |
| 52 | 55 | - Computer Vision API Key |
| 53 | 56 | - Computer Vision Endpoint |
| @@ -75,8 +78,10 @@ | ||
| 75 | 78 | Once the plugin is configured, each time an image is uploaded to the media library, an alt text will be automatically set based on the selected generation method. |
| 76 | 79 | |
| 77 | 80 | For images already in the media library, you can create bulk alt texts. Open the Media Library in the "list" view, select the images for which to generate the alt text, and choose the "Generate alt text" bulk action. (Depending on the number of images chosen and their weight, this may take some time.) |
| 78 | 81 | |
| 82 | +You can also generate the alt text of a single image directly from the media library. Open the Media Library in “grid” mode, choose the image for which to generate the alt text, and click the “Generate alt text” button. In no time the alt text field will be overwritten by the generated description. | |
| 83 | + | |
| 79 | 84 | **Notice**: If you choose one of the methods that involves the use of external APIs, the upload times for images in the media library might increase because it requires sending a request to the APIs, waiting for the external server to process, and waiting for a response. |
| 80 | 85 | |
| 81 | 86 | ### Logging |
| 82 | 87 | If the generation of the alt text via AI is set, in case of errors, to avoid blocking the editorial work, the image is loaded anyway but without the alt text being compiled. |
| @@ -93,8 +98,15 @@ | ||
| 93 | 98 | This plugin does not collect any information from your OpenAI account. The data transmitted to OpenAI mainly consists of the image files uploaded to your website and the specified prompt. |
| 94 | 99 | |
| 95 | 100 | For accurate information on privacy and conditions of use, please consult the [privacy policy](https://openai.com/policies/privacy-policy) and [terms and conditions](https://openai.com/) directly on the official website. It is also advisable to check the costs and usage statistics of the API service on the OpenAI website. |
| 96 | 101 | |
| 102 | +### Anthropic Claude | |
| 103 | +Selecting the generation method "Anthropic's APIs" will use the API services of [Anthropic](https://console.anthropic.com/). | |
| 104 | + | |
| 105 | +This plugin does not collect any information from your Anthropic Claude account. The data transmitted to Anthropic Claude mainly consists of the image files uploaded to your website and the specified prompt. | |
| 106 | + | |
| 107 | +For accurate information on privacy and conditions of use, please consult the [privacy policy](https://www.anthropic.com/legal/privacy), [terms and conditions for consumers](https://www.anthropic.com/legal/consumer-terms) and [terms and conditions for commercial](https://www.anthropic.com/legal/commercial-terms) directly on the official website. It is also advisable to check the costs and usage statistics of the API service on the Anthropic website. | |
| 108 | + | |
| 97 | 109 | ### Azure |
| 98 | 110 | Selecting the "Azure's APIs" generation method will use the API services of [Microsoft Azure](https://azure.microsoft.com/en-us/). |
| 99 | 111 | |
| 100 | 112 | This plugin does not collect any information from your Azure account. The data transmitted to Azure consists mainly of image files uploaded to your website. |
| @@ -100,8 +112,19 @@ | ||
| 100 | 112 | This plugin does not collect any information from your Azure account. The data transmitted to Azure consists mainly of image files uploaded to your website. |
| 101 | 113 | |
| 102 | 114 | For accurate information on privacy and conditions of use, please directly consult the [privacy policy](https://privacy.microsoft.com/en-us/privacystatement) and [terms and conditions](https://azure.microsoft.com/en-us/support/legal/) on the official website. It is also advisable to check the costs and usage statistics of the API service on the Microsoft Azure's website. |
| 103 | 115 | |
| 116 | +## Encryption Constants | |
| 117 | + | |
| 118 | +We **strongly recommend** defining the new plugin-specific constants in your `wp-config.php`: | |
| 119 | + | |
| 120 | +`define( 'AAT_ENCRYPTION_KEY', 'a_random_string_of_at_least_64_characters' );` | |
| 121 | +`define( 'AAT_ENCRYPTION_SALT', 'another_random_string_of_at_least_64_characters' );` | |
| 122 | + | |
| 123 | +You will find these two define(...) lines already generated for you on the Auto Alt Text » Options page – simply copy & paste them before the `/* That's all, stop editing! Happy publishing. */` line in your `wp-config.php`. | |
| 124 | + | |
| 125 | +If you choose not to add them, the plugin will continue to work normally, but it will fall back to using your WordPress `LOGGED_IN_KEY` / `LOGGED_IN_SALT`, which may break if those salts are ever changed. | |
| 126 | + | |
| 104 | 127 | ## Disclaimer |
| 105 | 128 | Auto Alt Text is a plugin that helps users automatically generate Alt Texts of their images using AI services such as OpenAI's ChatGPT or Microsoft Azure. |
| 106 | 129 | Users need their own API key and must follow the rules set by the AI service they choose. |
| 107 | 130 | |
| @@ -117,8 +140,29 @@ | ||
| 117 | 140 | |
| 118 | 141 | = Which generation method should I choose to obtain an accurate description of the image? = |
| 119 | 142 | If you wish to obtain the most accurate description possible of the image, you should use the "OpenAI's APIs" or "Azure's APIs" method. |
| 120 | 143 | |
| 144 | += Why do I see the error “There was a problem with the encryption of your API Key for alt text generation. Please re-enter the key and save”? = | |
| 145 | + | |
| 146 | +This message appears because the plugin was unable to decrypt your stored API Key. In most cases this happens when the cryptographic “salt” or “key” it originally used to encrypt your API Key has changed since you first saved it. | |
| 147 | + | |
| 148 | +**Common causes** | |
| 149 | +- You (or another plugin) have changed the WordPress authentication salts (`LOGGED_IN_KEY` / `LOGGED_IN_SALT`) in your `wp-config.php` after saving the API Key. | |
| 150 | +- You haven’t defined the recommended plugin-specific constants (`AAT_ENCRYPTION_KEY` / `AAT_ENCRYPTION_SALT`) in your `wp-config.php`, so the plugin fell back to the WordPress salts. | |
| 151 | + | |
| 152 | +**How to fix** | |
| 153 | +1. Go to **Auto Alt Text » Options** in your WordPress admin. | |
| 154 | +2. Re-enter your API Key in the appropriate field and click **Save Changes**. | |
| 155 | +3. _(Recommended)_ Prevent this issue in the future by adding these lines **before** the `/* That's all, stop editing! Happy publishing. */` comment in your `wp-config.php`: | |
| 156 | + ``` | |
| 157 | + define( 'AAT_ENCRYPTION_KEY', 'a_random_string_of_at_least_64_characters' ); | |
| 158 | + define( 'AAT_ENCRYPTION_SALT', 'another_random_string_of_at_least_64_characters' ); | |
| 159 | + ``` | |
| 160 | + | |
| 161 | +This ensures the plugin uses stable, plugin-specific values for encryption and won’t break if WordPress salts are ever changed again. | |
| 162 | + | |
| 163 | +Once you’ve re-entered your API Key (and, if desired, added the constants), hit Save Changes — the plugin will re-encrypt your key correctly and the error will disappear | |
| 164 | + | |
| 121 | 165 | == Screenshots == |
| 122 | 166 | |
| 123 | 167 | 1. Azure's APIs method options page |
| 124 | 168 | 2. OpenAI's APIs method options page |
| @@ -123,10 +167,64 @@ | ||
| 123 | 167 | 1. Azure's APIs method options page |
| 124 | 168 | 2. OpenAI's APIs method options page |
| 125 | 169 | 3. Title of the article options page |
| 126 | 170 | 4. Title of the attachment options page |
| 171 | +5. Bulk alt text generation | |
| 172 | +6. Single image alt text generation | |
| 127 | 173 | |
| 128 | 174 | == Changelog == |
| 175 | += 2.5.2 = | |
| 176 | +- Enable the use of OpenAI's GPT-5, GPT-5 Mini and GPT-5 nano models. | |
| 177 | + | |
| 178 | += 2.5.1 = | |
| 179 | +- Replace a deprecated Azure Computer Vision api version. | |
| 180 | + | |
| 181 | += 2.5.0 = | |
| 182 | +- Implement the Anthropic API as an alternative for generating alt text. | |
| 183 | + | |
| 184 | += 2.4.2 = | |
| 185 | +- Modify documentation and build again the assets | |
| 186 | + | |
| 187 | += 2.4.1 = | |
| 188 | +- Fixed: Alt text now correctly persists when generated from both the post media overlay and the main Media Library. | |
| 189 | + | |
| 190 | += 2.4.0 = | |
| 191 | +- Introduce two new plugin-specific constants, `AATXT_ENCRYPTION_KEY` and `AATXT_ENCRYPTION_SALT`, allowing API keys to be encrypted independently of WordPress’s own salts. | |
| 192 | +- Implement automatic migration of existing encrypted API keys: on upgrade, keys encrypted with the old WP salts are decrypted (if possible) and re-encrypted with the new plugin key. | |
| 193 | +- Add an optional info notice on the Auto Alt Text options page showing the ready-to-copy `define()` statements for `wp-config.php`. | |
| 194 | +- Maintain full backward-compatibility: if the new constants are not defined, the plugin continues to use the WordPress `LOGGED_IN_KEY`/`LOGGED_IN_SALT` fallback without interruption. | |
| 195 | + | |
| 196 | += 2.3.4 = | |
| 197 | +- Displays an error message in the administration area if the WordPress salt keys were changed after the OpenAI API key was set. The message asks the user to enter the OpenAI API key again. | |
| 198 | +- Update npm packages | |
| 199 | + | |
| 200 | += 2.3.3 = | |
| 201 | +- Fix a return type error in the alt text generation | |
| 202 | + | |
| 203 | += 2.3.2 = | |
| 204 | +- Avoid generating alt text for not supported mime types | |
| 205 | +- Hide the 'Generate Alt Text' button in media library for unsupported mime types | |
| 206 | +- Update npm packages | |
| 207 | + | |
| 208 | += 2.3.1 = | |
| 209 | +- Tested up to WordPress 6.7.2 | |
| 210 | + | |
| 211 | += 2.3.0 = | |
| 212 | +- Preserves alt tags already present in images by preventing them from being overwritten by those generated by the plugin | |
| 213 | +- Update npm packages | |
| 214 | + | |
| 215 | += 2.2.0 = | |
| 216 | +- Allow users to select the preferred Openai model for generating alt text | |
| 217 | + | |
| 218 | += 2.1.0 = | |
| 219 | +- Allow users to generate the alt text for each individual image in the media library | |
| 220 | + | |
| 221 | += 2.0.0 = | |
| 222 | +- Set a maximum timeout of 90 seconds for OpenAI requests | |
| 223 | +- Implement the gpt-4o model for generating alt text | |
| 224 | +- Implement gpt-4-turbo template for fallback alt text generation | |
| 225 | +- Remove gpt-4 and gpt-3.5 templates as fallback options | |
| 226 | + | |
| 129 | 227 | = 1.3.0 = |
| 130 | 228 | - Implement bulk alt text generation for images already in the media library |
| 131 | 229 | - Update Vite package |
| 132 | 230 | - Implement github actions for automatic release |
| @@ -148,5 +246,5 @@ | ||
| 148 | 246 | = 1.0.0 = |
| 149 | 247 | - Plugin released |
| 150 | 248 | |
| 151 | 249 | == Upgrade Notice == |
| 152 | -- Plugin released | |
| 250 | +- Plugin released | |