=== Sage Auto Upload Images ===
Contributors: josylad
Donate link: https://www.buymeacoffee.com/josylad
Tags: external images, image import, media library, bulk import, image SEO
Requires at least: 3.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Automatically detect and import external images to your WordPress media library. Bulk process existing posts and prevent broken links.

== Description ==

**Sage Auto Upload Images** is a comprehensive WordPress plugin that automatically detects external images in your post content, imports them to your local media library, and optimizes them for better SEO performance. Perfect for content migration, broken link prevention, and improving website loading speeds.

**🚀 Why Choose Sage Auto Upload Images?**

Stop worrying about broken image links and slow loading times caused by external image dependencies. This plugin automatically converts external image URLs into locally hosted media files, ensuring your content remains intact and loads faster for better user experience and SEO rankings.

**💡 Perfect For:**
* Content migration from other platforms
* Importing RSS feeds with external images
* Fixing broken image links in bulk
* Optimizing website performance and SEO
* Managing large volumes of content with external media
* Bloggers and content creators who frequently use external images

== Features ==

**🔄 Automatic Image Import & Processing**
* Automatically detect external images in post content during save
* Download and import images to your WordPress media library
* Replace external URLs with local URLs in post content
* Process images on-the-fly without manual intervention

**⚙️ Advanced Customization Options**
* Custom image file name patterns with dynamic placeholders ({post_id}, {index}, etc.)
* Custom alt text patterns for better image SEO ({post_title}, {post_id}, etc.)
* Exclude specific post types from automatic processing
* Domain exclusion list to skip trusted external sources
* Custom base URL configuration for uploaded images

**📏 Image Processing & Control**
* Set maximum width and height for uploaded images
* Automatic image resizing using WordPress image editor
* JPEG compression quality control (1-100%, default: 82%)
* Support for multiple image formats (JPG, JPEG, PNG, GIF, WebP)
* Fallback to JPG format for unsupported file types
* Automatic featured image setting (first imported image)
* Duplicate image detection and prevention

**📦 Bulk Import & Processing**
* Retroactively process existing posts with external images
* Batch processing of posts (10 at a time for reliability)
* Detailed import logs with success/error tracking
* Download retry mechanism with exponential backoff
* Ideal for processing large amounts of existing content

**🎨 Modern Admin Interface**
* Success and error notifications after processing
* Intuitive bulk import tool with detailed logging
* User-friendly configuration options

== Installation ==

**Quick Setup in 3 Steps:**

1. **Install & Activate**: Upload the plugin to your `/wp-content/plugins/` directory and activate it through the WordPress admin panel
2. **Configure Settings**: Navigate to **Settings > Sage Auto Upload Images** to customize your preferences
3. **Process Content**: Use the **Bulk Import** tab to retroactively process existing posts with external images

**Post-Installation:**
* The plugin works automatically on new posts - external images are detected and imported when you save/update posts
* For existing content, use the bulk import feature to process posts in manageable batches
* Check the detailed logs to monitor import progress and troubleshoot any issues

== Frequently Asked Questions ==

= Does this plugin work with Gutenberg and Classic editors? =
Yes! The plugin is compatible with both Gutenberg (Block Editor) and Classic Editor. After saving with AJAX, new URLs may not show immediately in the Gutenberg editor, but they are properly updated in the database and frontend.

= How does this improve my website's SEO? =
By hosting images locally, you eliminate external dependencies, reduce broken links, improve page loading speeds, and have better control over image SEO attributes like alt text and file names - all factors that positively impact search engine rankings.

= What happens to my website's performance? =
The plugin significantly improves performance by eliminating external HTTP requests for images. Local images load faster, reduce server response times, and provide a better user experience.

= Can I customize how images are named and organized? =
Absolutely! Use dynamic patterns like `post-{post_id}-image-{index}` for file names and `Image for {post_title}` for alt text. This helps with SEO and media library organization. The plugin can also automatically set the first imported image as the featured image if none exists.

= What is the "Exclude Domains" feature? =
You can specify trusted external domains (comma-separated) that should not be processed. This is useful for CDNs, partner sites, or other reliable external sources you want to keep as-is.

= How does the Bulk Import tool work? =
The bulk import processes existing posts in batches of 10 for optimal performance and reliability. It provides detailed logs showing which images were successfully imported and any errors encountered. Failed downloads are automatically retried with exponential backoff for better reliability.

= What image formats are supported? =
The plugin supports JPG, JPEG, PNG, GIF, and WebP formats. Files with unsupported extensions are saved with a .jpg extension. JPEG images can be compressed with adjustable quality settings (1-100%).

= Will this break my existing content? =
No! The plugin only replaces external image URLs with local ones after successfully downloading and importing them. If an import fails, the original URL remains unchanged.

= Does the plugin prevent importing duplicate images? =
Yes! The plugin can detect and skip images that already exist in your media library based on filename matching. This helps prevent cluttering your media library with duplicate files.

= Can I undo the changes made by this plugin? =
While the plugin doesn't have a built-in undo feature, you can always restore from a backup. We recommend backing up your database before running bulk imports on large amounts of content.

== Screenshots ==

1. Modern settings page with tabbed interface
2. Bulk Import tool with detailed progress logging and error tracking
3. Successful image import notifications in WordPress admin
4. Advanced customization options for file naming and SEO optimization

== Changelog ==

= 1.0.0 =
* 🎉 Initial release with comprehensive image import functionality
* ✅ Automatic external image detection and local import
* ⚙️ Advanced customization options for file naming and alt text patterns
* 📦 Bulk import tool for processing existing content
* 📊 Detailed logging and error tracking
* 🔧 Post type and domain exclusion options
* 📏 Image resizing and optimization features
* 🚀 Full WordPress 6.8 and PHP 8.2 compatibility

== Upgrade Notice ==

= 1.0.0 =
First stable release! Perfect for content migration, improving website performance, and preventing broken image links. Features modern UI, bulk processing, and comprehensive SEO optimization tools.
