=== Bring Images Home - Copy Remote Images Locally ===
Contributors: coderevolution
Tags: images, media library, remote images, sideload, bulk
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically copies remote images from post content into the WordPress Media Library and replaces external URLs with local attachment URLs.

== Description ==

Bring Images Home scans post content for remote image URLs, downloads those images into the WordPress Media Library, attaches them to the post, and replaces the remote URLs in the post content with the local attachment URLs.

Use it for new posts, already published content, or large backfills with filters and progress tracking.

= Features =

* Copies remote images when posts are published or updated (configurable).
* Processes already published posts from a single post screen or in bulk.
* Bulk processing with filters for post type, status, author, category, tag, search, date range, and remote-only posts.
* Modern admin dashboard with scan preview, progress bar, and per-post results log.
* Block Editor sidebar panel and classic editor metabox for single-post processing.
* Manual row action in post list tables.
* Copies images into the Media Library and sets the post as the attachment parent.
* Replaces remote image URLs in post content with local attachment URLs.
* Supports img src, srcset, block editor image URLs, featured images, and optional CSS background images.
* Skips images already hosted on the current site.
* Reuses previously copied images for the same post and source URL.
* Domain allowlist and blocklist support.
* Configurable download timeout, batch size, and supported post types.
* Uses WordPress core media sideloading APIs with nonces and capability checks.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/bring-images-home/`.
2. Activate the plugin through the Plugins screen in WordPress.
3. Go to **Bring Images Home** in the admin sidebar for the dashboard, bulk processing, and settings.
4. Publish a post containing remote images, or process existing posts from the post editor or bulk screen.

== Frequently Asked Questions ==

= Does it copy images already hosted on my own site? =

No. Images from the same host as your WordPress site are skipped.

= Does it attach images to the post? =

Yes. Every successfully copied image is created as a Media Library attachment with the processed post as its parent.

= Can I process already published posts? =

Yes. Open any supported post in the editor and use the **Bring Images Home** panel, or go to **Bring Images Home → Bulk Process** to process many posts at once with filters.

= Can I control which post types are processed? =

Yes. Choose supported post types in **Bring Images Home → Settings**. Developers can also use the `brinimho_supported_post_types` filter.

Example:

`add_filter( 'brinimho_supported_post_types', function( $post_types ) { return array( 'post' ); } );`

= Does it hotlink or proxy images? =

No. It downloads the files into the local Media Library.

== Screenshots ==

1. Dashboard with overview stats and quick actions.
2. Bulk processing screen with filters, scan preview, and progress log.
3. Settings page for automation and processing options.
4. Block Editor sidebar panel for single-post processing.

== Changelog ==

= 2.0.0 =
* Added modern admin dashboard, settings page, and bulk processing UI.
* Added single-post processing in the Block Editor sidebar and classic editor metabox.
* Added bulk filters for post type, status, author, category, tag, search, date range, and remote-only posts.
* Added featured image, block editor URL, background image, and domain rule support.
* Added configurable automation, batch size, and download timeout settings.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.0 =
Major update with dashboard, settings, bulk processing, and improved single-post tools.
