Changeset 3461034
- Timestamp:
- 02/13/2026 08:09:42 PM (7 weeks ago)
- Location:
- altomatic
- Files:
-
- 10 edited
- 1 copied
-
tags/1.0.10 (copied) (copied from altomatic/trunk)
-
tags/1.0.10/admin/partials/settings-page.php (modified) (1 diff)
-
tags/1.0.10/altomatic.php (modified) (2 diffs)
-
tags/1.0.10/includes/class-altomatic-api.php (modified) (5 diffs)
-
tags/1.0.10/includes/class-altomatic-image-optimizer.php (modified) (3 diffs)
-
tags/1.0.10/readme.txt (modified) (5 diffs)
-
trunk/admin/partials/settings-page.php (modified) (1 diff)
-
trunk/altomatic.php (modified) (2 diffs)
-
trunk/includes/class-altomatic-api.php (modified) (5 diffs)
-
trunk/includes/class-altomatic-image-optimizer.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
altomatic/tags/1.0.10/admin/partials/settings-page.php
r3459436 r3461034 70 70 71 71 <div class="wrap altomatic"> 72 <h1 class="screen-reader-text"><?php esc_html_e('Altomatic Settings', 'altomatic'); ?></h1> 72 73 73 74 <!-- Info Tabs --> -
altomatic/tags/1.0.10/altomatic.php
r3459436 r3461034 4 4 * Plugin URI: https://altomatic.ai/wordpress 5 5 * Description: Compress images to WebP/AVIF and auto-generate SEO alt text with AI. Boost Core Web Vitals and accessibility. 6 * Version: 1.0. 76 * Version: 1.0.10 7 7 * Author: Altomatic.ai 8 8 * Author URI: https://altomatic.ai … … 18 18 19 19 // Define plugin constants 20 define('ALTOMATIC_VERSION', '1.0. 7');20 define('ALTOMATIC_VERSION', '1.0.10'); 21 21 define('ALTOMATIC_PATH', plugin_dir_path(__FILE__)); 22 22 define('ALTOMATIC_URL', plugin_dir_url(__FILE__)); -
altomatic/tags/1.0.10/includes/class-altomatic-api.php
r3459436 r3461034 48 48 49 49 /** 50 * Get client identification headers for API requests 51 */ 52 private function get_client_headers() { 53 return array( 54 'X-Altomatic-Client' => 'wordpress_plugin', 55 'X-Altomatic-Client-Version' => defined('ALTOMATIC_VERSION') ? ALTOMATIC_VERSION : 'unknown', 56 ); 57 } 58 59 /** 50 60 * Map file extension to API format 51 61 * @param mixed $format … … 99 109 100 110 $response = wp_remote_post($this->get_api_url('v1/image'), array( 101 'headers' => array (111 'headers' => array_merge(array( 102 112 'Authorization' => 'Bearer ' . $this->api_key, 103 113 'Content-Type' => $mime_type 104 ), 114 ), $this->get_client_headers()), 105 115 'body' => file_get_contents($file_path), 106 116 'timeout' => 30, … … 158 168 159 169 $response = wp_remote_get($url, array( 160 'headers' => array (170 'headers' => array_merge(array( 161 171 'Authorization' => 'Bearer ' . $key_to_validate, 162 172 'Accept' => 'application/json' 163 ), 173 ), $this->get_client_headers()), 164 174 'timeout' => 15, 165 175 'sslverify' => false, … … 227 237 228 238 $response = wp_remote_get($url, array( 229 'headers' => array (239 'headers' => array_merge(array( 230 240 'Authorization' => 'Bearer ' . $this->api_key, 231 241 'Accept' => 'image/*' 232 ), 242 ), $this->get_client_headers()), 233 243 'timeout' => 30, 234 244 'sslverify' => false … … 282 292 283 293 $response = wp_remote_get($url, array( 284 'headers' => array (294 'headers' => array_merge(array( 285 295 'Authorization' => 'Bearer ' . $this->api_key, 286 296 'Accept' => 'application/json' 287 ), 297 ), $this->get_client_headers()), 288 298 'timeout' => 30, 289 299 'sslverify' => false -
altomatic/tags/1.0.10/includes/class-altomatic-image-optimizer.php
r3448999 r3461034 44 44 $selected_sizes = (array) get_option('altomatic_image_sizes', get_intermediate_image_sizes()); 45 45 $selected_formats = (array) get_option('altomatic_format_conversion', array('jpeg', 'webp', 'avif')); 46 $seo_keywords = get_option('altomatic_seo_keywords', ''); 46 $seo_keywords = $this->merge_seo_keywords( 47 get_option('altomatic_seo_keywords', ''), 48 $attachment_id 49 ); 47 50 48 51 $credits_needed = $this->determine_credits_needed($selected_formats, $selected_sizes, $generate_alt_text, $generate_optimized_images); … … 281 284 282 285 /** 286 * Get focus keywords from active SEO plugin for the parent post of an attachment 287 * Supports Yoast SEO, Rank Math, and AIOSEO 288 * 289 * @param int $attachment_id The attachment ID 290 * @return string Comma-separated focus keywords, or empty string 291 */ 292 private function get_seo_plugin_keywords($attachment_id): string { 293 $post_id = (int) get_post_field('post_parent', $attachment_id); 294 if ($post_id === 0) { 295 return ''; 296 } 297 298 // Yoast SEO 299 if (defined('WPSEO_VERSION')) { 300 $focus_kw = get_post_meta($post_id, '_yoast_wpseo_focuskw', true); 301 if (!empty($focus_kw)) { 302 $this->log("Yoast focus keyword for post {$post_id}: {$focus_kw}"); 303 return $focus_kw; 304 } 305 } 306 307 // Rank Math 308 if (class_exists('RankMath')) { 309 $focus_kw = get_post_meta($post_id, 'rank_math_focus_keyword', true); 310 if (!empty($focus_kw)) { 311 $this->log("Rank Math focus keyword for post {$post_id}: {$focus_kw}"); 312 return $focus_kw; 313 } 314 } 315 316 // AIOSEO 317 if (defined('AIOSEO_VERSION')) { 318 $keyphrases_json = get_post_meta($post_id, '_aioseo_keyphrases', true); 319 if (!empty($keyphrases_json)) { 320 $keyphrases = json_decode($keyphrases_json, true); 321 if (!empty($keyphrases['focus']['keyphrase'])) { 322 $focus_kw = $keyphrases['focus']['keyphrase']; 323 $this->log("AIOSEO focus keyphrase for post {$post_id}: {$focus_kw}"); 324 return $focus_kw; 325 } 326 } 327 } 328 329 return ''; 330 } 331 332 /** 333 * Merge global SEO keywords with per-post SEO plugin keywords 334 * 335 * @param string $global_keywords Global keywords from plugin settings 336 * @param int $attachment_id The attachment ID 337 * @return string Combined comma-separated keywords 338 */ 339 private function merge_seo_keywords($global_keywords, $attachment_id): string { 340 $plugin_keywords = $this->get_seo_plugin_keywords($attachment_id); 341 342 if (empty($global_keywords)) { 343 return $plugin_keywords; 344 } 345 if (empty($plugin_keywords)) { 346 return $global_keywords; 347 } 348 349 return $global_keywords . ', ' . $plugin_keywords; 350 } 351 352 /** 283 353 * Handle alt text generation 284 354 * @return string|null … … 333 403 } 334 404 335 $seo_keywords = get_option('altomatic_seo_keywords', ''); 405 $seo_keywords = $this->merge_seo_keywords( 406 get_option('altomatic_seo_keywords', ''), 407 $attachment_id 408 ); 336 409 337 410 $links = $upload_result['links']; -
altomatic/tags/1.0.10/readme.txt
r3459436 r3461034 1 === Altomatic - 2-in-1 AI Image Optimization & Alt Text for speed, SEO, and accessibility ===1 === Altomatic - 2-in-1 AI Image Optimization & Alt Text tool for speed, SEO, and accessibility === 2 2 Contributors: drewser24 3 3 Donate link: https://altomatic.ai … … 5 5 Requires at least: 5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 77 Stable tag: 1.0.10 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 23 23 * **Improve Core Web Vitals** - Smaller images = faster LCP scores 24 24 * **Better SEO** - AI-written alt text helps Google understand your images 25 * **SEO Plugin Integration** - Uses focus keyphrases from Yoast SEO, Rank Math, and AIOSEO for keyword-rich alt text 25 26 * **Accessibility Compliance** - Auto-generated descriptions for screen readers (EAA/ADA/WCAG) 26 27 * **WebP & AVIF Support** - Next-gen formats with automatic browser fallback … … 46 47 47 48 **Automatic Alt Text Generation** 48 - Uses AI to generate relevant, descriptive alt text on image upload 49 - Helps improve accessibility and on-page SEO 50 - Supports multiple languages 51 52 **Advanced Image Optimization** 53 - Compress images automatically with smart algorithms 54 - Convert images to next-gen formats like WebP and AVIF 55 - Optimize responsive image variants (srcset) 56 57 **Built for Speed and Simplicity** 58 - Automatically processes new uploads in the background 59 - Bulk optimization tools for existing media 60 - Maintains original image quality while boosting performance 61 62 **Customizable Settings** 63 - Choose which image sizes to optimize 64 - Set preferred output formats 65 - Enable or disable features per your workflow 66 - Simple, intuitive settings panel in the WordPress admin 49 Every uploaded image is analyzed by AI and descriptive, SEO-friendly alt text is automatically added to the image properties. No manual work required — just upload and go. 50 51 **Image Compression & Format Conversion** 52 Compress images and convert to modern WebP and AVIF formats for dramatically smaller file sizes. The only alt text plugin that also optimizes your images — no second plugin needed. 53 54 **Keyword-Rich Alt Text with SEO Plugin Integration** 55 Seamlessly integrates focus keyphrases from popular SEO plugins, including Yoast SEO, Rank Math, and All in One SEO (AIOSEO), to generate keyword-rich alt text that aligns with your on-page SEO strategy. 56 57 **Optimized for WooCommerce** 58 Automatically optimizes WooCommerce product images, thumbnails, and gallery images. AI-generated alt text helps your products appear in Google Image Search and improves product page SEO. 59 60 **Supports Multiple Formats** 61 Handles JPG, PNG, WebP, and AVIF images. Convert to next-gen formats with automatic browser fallback for maximum compatibility across all devices. 62 63 **Bulk Optimization** 64 Use the bulk optimization tool to process your entire existing media library. Optimize hundreds of images and generate alt text with one click. 65 66 **Core Web Vitals Ready** 67 Smaller images directly improve your Largest Contentful Paint (LCP) score — one of Google's key ranking factors. Fix image-related performance issues automatically. 68 69 **Accessibility Compliance** 70 Auto-generated alt text helps meet EAA, ADA, and WCAG 2.1 requirements for image descriptions. Support screen readers with accurate, meaningful image descriptions on every page. 71 72 **Multiple Languages** 73 AI alt text generation supports multiple languages, so your image descriptions match your site's language. 74 75 **Review and Edit** 76 See what was processed and manually edit or regenerate the AI-generated alt text at any time. Full control over your image descriptions. 77 78 **Try for FREE** 79 50 free credits every month. No credit card needed to get started. 67 80 68 81 == Installation == … … 116 129 = Will this help my Core Web Vitals score? = 117 130 Yes! Image optimization directly improves Largest Contentful Paint (LCP), one of the three Core Web Vitals. Smaller images = faster page loads = better scores. Images cause 80% of LCP issues on most sites. 131 132 = Does it work with Yoast SEO, Rank Math, or AIOSEO? = 133 Yes! Altomatic automatically detects focus keyphrases from Yoast SEO, Rank Math, and All in One SEO (AIOSEO). When generating alt text, the AI uses these keywords to create descriptions that align with your SEO strategy — no extra configuration needed. 118 134 119 135 = Does it work with WooCommerce? = -
altomatic/trunk/admin/partials/settings-page.php
r3459436 r3461034 70 70 71 71 <div class="wrap altomatic"> 72 <h1 class="screen-reader-text"><?php esc_html_e('Altomatic Settings', 'altomatic'); ?></h1> 72 73 73 74 <!-- Info Tabs --> -
altomatic/trunk/altomatic.php
r3459436 r3461034 4 4 * Plugin URI: https://altomatic.ai/wordpress 5 5 * Description: Compress images to WebP/AVIF and auto-generate SEO alt text with AI. Boost Core Web Vitals and accessibility. 6 * Version: 1.0. 76 * Version: 1.0.10 7 7 * Author: Altomatic.ai 8 8 * Author URI: https://altomatic.ai … … 18 18 19 19 // Define plugin constants 20 define('ALTOMATIC_VERSION', '1.0. 7');20 define('ALTOMATIC_VERSION', '1.0.10'); 21 21 define('ALTOMATIC_PATH', plugin_dir_path(__FILE__)); 22 22 define('ALTOMATIC_URL', plugin_dir_url(__FILE__)); -
altomatic/trunk/includes/class-altomatic-api.php
r3459436 r3461034 48 48 49 49 /** 50 * Get client identification headers for API requests 51 */ 52 private function get_client_headers() { 53 return array( 54 'X-Altomatic-Client' => 'wordpress_plugin', 55 'X-Altomatic-Client-Version' => defined('ALTOMATIC_VERSION') ? ALTOMATIC_VERSION : 'unknown', 56 ); 57 } 58 59 /** 50 60 * Map file extension to API format 51 61 * @param mixed $format … … 99 109 100 110 $response = wp_remote_post($this->get_api_url('v1/image'), array( 101 'headers' => array (111 'headers' => array_merge(array( 102 112 'Authorization' => 'Bearer ' . $this->api_key, 103 113 'Content-Type' => $mime_type 104 ), 114 ), $this->get_client_headers()), 105 115 'body' => file_get_contents($file_path), 106 116 'timeout' => 30, … … 158 168 159 169 $response = wp_remote_get($url, array( 160 'headers' => array (170 'headers' => array_merge(array( 161 171 'Authorization' => 'Bearer ' . $key_to_validate, 162 172 'Accept' => 'application/json' 163 ), 173 ), $this->get_client_headers()), 164 174 'timeout' => 15, 165 175 'sslverify' => false, … … 227 237 228 238 $response = wp_remote_get($url, array( 229 'headers' => array (239 'headers' => array_merge(array( 230 240 'Authorization' => 'Bearer ' . $this->api_key, 231 241 'Accept' => 'image/*' 232 ), 242 ), $this->get_client_headers()), 233 243 'timeout' => 30, 234 244 'sslverify' => false … … 282 292 283 293 $response = wp_remote_get($url, array( 284 'headers' => array (294 'headers' => array_merge(array( 285 295 'Authorization' => 'Bearer ' . $this->api_key, 286 296 'Accept' => 'application/json' 287 ), 297 ), $this->get_client_headers()), 288 298 'timeout' => 30, 289 299 'sslverify' => false -
altomatic/trunk/includes/class-altomatic-image-optimizer.php
r3448999 r3461034 44 44 $selected_sizes = (array) get_option('altomatic_image_sizes', get_intermediate_image_sizes()); 45 45 $selected_formats = (array) get_option('altomatic_format_conversion', array('jpeg', 'webp', 'avif')); 46 $seo_keywords = get_option('altomatic_seo_keywords', ''); 46 $seo_keywords = $this->merge_seo_keywords( 47 get_option('altomatic_seo_keywords', ''), 48 $attachment_id 49 ); 47 50 48 51 $credits_needed = $this->determine_credits_needed($selected_formats, $selected_sizes, $generate_alt_text, $generate_optimized_images); … … 281 284 282 285 /** 286 * Get focus keywords from active SEO plugin for the parent post of an attachment 287 * Supports Yoast SEO, Rank Math, and AIOSEO 288 * 289 * @param int $attachment_id The attachment ID 290 * @return string Comma-separated focus keywords, or empty string 291 */ 292 private function get_seo_plugin_keywords($attachment_id): string { 293 $post_id = (int) get_post_field('post_parent', $attachment_id); 294 if ($post_id === 0) { 295 return ''; 296 } 297 298 // Yoast SEO 299 if (defined('WPSEO_VERSION')) { 300 $focus_kw = get_post_meta($post_id, '_yoast_wpseo_focuskw', true); 301 if (!empty($focus_kw)) { 302 $this->log("Yoast focus keyword for post {$post_id}: {$focus_kw}"); 303 return $focus_kw; 304 } 305 } 306 307 // Rank Math 308 if (class_exists('RankMath')) { 309 $focus_kw = get_post_meta($post_id, 'rank_math_focus_keyword', true); 310 if (!empty($focus_kw)) { 311 $this->log("Rank Math focus keyword for post {$post_id}: {$focus_kw}"); 312 return $focus_kw; 313 } 314 } 315 316 // AIOSEO 317 if (defined('AIOSEO_VERSION')) { 318 $keyphrases_json = get_post_meta($post_id, '_aioseo_keyphrases', true); 319 if (!empty($keyphrases_json)) { 320 $keyphrases = json_decode($keyphrases_json, true); 321 if (!empty($keyphrases['focus']['keyphrase'])) { 322 $focus_kw = $keyphrases['focus']['keyphrase']; 323 $this->log("AIOSEO focus keyphrase for post {$post_id}: {$focus_kw}"); 324 return $focus_kw; 325 } 326 } 327 } 328 329 return ''; 330 } 331 332 /** 333 * Merge global SEO keywords with per-post SEO plugin keywords 334 * 335 * @param string $global_keywords Global keywords from plugin settings 336 * @param int $attachment_id The attachment ID 337 * @return string Combined comma-separated keywords 338 */ 339 private function merge_seo_keywords($global_keywords, $attachment_id): string { 340 $plugin_keywords = $this->get_seo_plugin_keywords($attachment_id); 341 342 if (empty($global_keywords)) { 343 return $plugin_keywords; 344 } 345 if (empty($plugin_keywords)) { 346 return $global_keywords; 347 } 348 349 return $global_keywords . ', ' . $plugin_keywords; 350 } 351 352 /** 283 353 * Handle alt text generation 284 354 * @return string|null … … 333 403 } 334 404 335 $seo_keywords = get_option('altomatic_seo_keywords', ''); 405 $seo_keywords = $this->merge_seo_keywords( 406 get_option('altomatic_seo_keywords', ''), 407 $attachment_id 408 ); 336 409 337 410 $links = $upload_result['links']; -
altomatic/trunk/readme.txt
r3459436 r3461034 1 === Altomatic - 2-in-1 AI Image Optimization & Alt Text for speed, SEO, and accessibility ===1 === Altomatic - 2-in-1 AI Image Optimization & Alt Text tool for speed, SEO, and accessibility === 2 2 Contributors: drewser24 3 3 Donate link: https://altomatic.ai … … 5 5 Requires at least: 5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 77 Stable tag: 1.0.10 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 23 23 * **Improve Core Web Vitals** - Smaller images = faster LCP scores 24 24 * **Better SEO** - AI-written alt text helps Google understand your images 25 * **SEO Plugin Integration** - Uses focus keyphrases from Yoast SEO, Rank Math, and AIOSEO for keyword-rich alt text 25 26 * **Accessibility Compliance** - Auto-generated descriptions for screen readers (EAA/ADA/WCAG) 26 27 * **WebP & AVIF Support** - Next-gen formats with automatic browser fallback … … 46 47 47 48 **Automatic Alt Text Generation** 48 - Uses AI to generate relevant, descriptive alt text on image upload 49 - Helps improve accessibility and on-page SEO 50 - Supports multiple languages 51 52 **Advanced Image Optimization** 53 - Compress images automatically with smart algorithms 54 - Convert images to next-gen formats like WebP and AVIF 55 - Optimize responsive image variants (srcset) 56 57 **Built for Speed and Simplicity** 58 - Automatically processes new uploads in the background 59 - Bulk optimization tools for existing media 60 - Maintains original image quality while boosting performance 61 62 **Customizable Settings** 63 - Choose which image sizes to optimize 64 - Set preferred output formats 65 - Enable or disable features per your workflow 66 - Simple, intuitive settings panel in the WordPress admin 49 Every uploaded image is analyzed by AI and descriptive, SEO-friendly alt text is automatically added to the image properties. No manual work required — just upload and go. 50 51 **Image Compression & Format Conversion** 52 Compress images and convert to modern WebP and AVIF formats for dramatically smaller file sizes. The only alt text plugin that also optimizes your images — no second plugin needed. 53 54 **Keyword-Rich Alt Text with SEO Plugin Integration** 55 Seamlessly integrates focus keyphrases from popular SEO plugins, including Yoast SEO, Rank Math, and All in One SEO (AIOSEO), to generate keyword-rich alt text that aligns with your on-page SEO strategy. 56 57 **Optimized for WooCommerce** 58 Automatically optimizes WooCommerce product images, thumbnails, and gallery images. AI-generated alt text helps your products appear in Google Image Search and improves product page SEO. 59 60 **Supports Multiple Formats** 61 Handles JPG, PNG, WebP, and AVIF images. Convert to next-gen formats with automatic browser fallback for maximum compatibility across all devices. 62 63 **Bulk Optimization** 64 Use the bulk optimization tool to process your entire existing media library. Optimize hundreds of images and generate alt text with one click. 65 66 **Core Web Vitals Ready** 67 Smaller images directly improve your Largest Contentful Paint (LCP) score — one of Google's key ranking factors. Fix image-related performance issues automatically. 68 69 **Accessibility Compliance** 70 Auto-generated alt text helps meet EAA, ADA, and WCAG 2.1 requirements for image descriptions. Support screen readers with accurate, meaningful image descriptions on every page. 71 72 **Multiple Languages** 73 AI alt text generation supports multiple languages, so your image descriptions match your site's language. 74 75 **Review and Edit** 76 See what was processed and manually edit or regenerate the AI-generated alt text at any time. Full control over your image descriptions. 77 78 **Try for FREE** 79 50 free credits every month. No credit card needed to get started. 67 80 68 81 == Installation == … … 116 129 = Will this help my Core Web Vitals score? = 117 130 Yes! Image optimization directly improves Largest Contentful Paint (LCP), one of the three Core Web Vitals. Smaller images = faster page loads = better scores. Images cause 80% of LCP issues on most sites. 131 132 = Does it work with Yoast SEO, Rank Math, or AIOSEO? = 133 Yes! Altomatic automatically detects focus keyphrases from Yoast SEO, Rank Math, and All in One SEO (AIOSEO). When generating alt text, the AI uses these keywords to create descriptions that align with your SEO strategy — no extra configuration needed. 118 134 119 135 = Does it work with WooCommerce? =
Note: See TracChangeset
for help on using the changeset viewer.