Article Overview
- Category: Media Handling, Performance & Storage Optimization
- Audience: Site Owners, WooCommerce Store Managers, Developers, and Technical Support
- Applies To: NextGen Smart Data Importer (Community Free & Enterprise Pro Editions)
1. Introduction: How NextGen Handles Media & Image URLs
When migrating websites or importing supplier catalogs, spreadsheets often contain image columns with external URLs:
https://images.example.com/products/summer-tshirt-blue.jpgNextGen Smart Data Importer offers two distinct image processing architectures:
- Synchronous Sideloading Mode: Real-time, inline downloading during each row’s creation (Default in Free & Pro toggle).
- Asynchronous Background Queue Mode: Non-blocking, decoupled downloading via background workers (Enterprise Pro Feature).
2. Synchronous Mode (When Async is Turned OFF or on Free Edition)
How It Works Under the Hood
In Synchronous Mode, the importer pauses the row insertion loop until the image is 100% downloaded, cropped, and saved to the database:
- URL Resolution & Redirect Handling:
- Checks the image URL and resolves redirects (e.g. tracking links or CDN shortlinks) to locate the true binary file and extension (
.jpg,.png,.webp,.avif).
- Checks the image URL and resolves redirects (e.g. tracking links or CDN shortlinks) to locate the true binary file and extension (
- Collision Evaluation:
- Determines whether to reuse an existing image, replace it, or force a new copy (see Collision Behavior section below).
- Core Sideloading via Native WordPress API:
- Invokes WordPress core functions:
media_sideload_image()fromwp-admin/includes/media.php,file.php, andimage.php. - WordPress downloads the remote file directly to
/wp-content/uploads/YYYY/MM/. - WordPress automatically generates all registered responsive thumbnail sizes (Thumbnail, Medium, Large, and custom WooCommerce catalog sizes).
- Invokes WordPress core functions:
- Metadata & Entity Linking:
- Sets the image as the Featured Image (
_thumbnail_id) or appends it to the WooCommerce Product Gallery (_product_image_gallery). - Writes mapped Alt Text, Image Title, Caption, and Description directly into
wp_postmetaandwp_posts.
- Sets the image as the Featured Image (
- Entity Tracking for Rollback:
- Tracks the generated Attachment ID in the session log so that if you run a 1-Click Rollback, the image file and its attachments are completely cleaned up without leaving orphaned files on your server.
Pros & Cons of Synchronous Mode:
- ✅ Immediate Completeness: The moment the import progress bar reaches 100%, every image is already downloaded, linked, and visible to site visitors.
- ⚠️ Slower Import Velocity: Every spreadsheet row must wait for remote HTTP network latency and thumbnail generation before advancing.
- ⚠️ Server Timeout Exposure on Massive Files: If you are importing 5,000 products on budget shared hosting with 10 MB images, synchronous downloads can encounter PHP
max_execution_timelimits.
3. Asynchronous Mode (Enterprise Pro Feature)
How It Works Under the Hood
In Asynchronous Mode, the importer decouples heavy network downloads from primary database record creation:
- Lightweight Queueing:
- During the batch import, the importer creates the post/product record and writes a lightweight pending job to the
wp_nextgen_image_queuedatabase table:
- During the batch import, the importer creates the post/product record and writes a lightweight pending job to the
INSERT INTO wp_nextgen_image_queue (import_id, post_id, image_url, image_type, media_meta, status)
VALUES (101, 4520, 'https://supplier.com/item.jpg', 'featured', '{"alt":"Blue Shirt"}', 'pending');- 50x Faster Primary Import:
- Instead of waiting 3 to 5 seconds per image, each product record is created in under 20 milliseconds.
- A 10,000-product catalog that would take 4 hours synchronously finishes primary record insertion in under 6 minutes.
- Background Download Engine:
- A dedicated background worker (triggered via WP-Cron or tokenized micro-batches) fetches pending images in the background.
- As images finish downloading, they automatically attach to their respective products and generate responsive thumbnails without impacting front-end site performance or admin user interfaces.
4. Understanding Collision Behavior Settings
When importing files repeatedly, you will inevitably encounter images with filenames that already exist in your WordPress Media Library. NextGen provides three collision strategies:
| Collision Mode | Behavior | Best Used When |
|---|---|---|
| Use Existing Media (Fastest - MD5 Check) (Pro) | Checks the media library by filename and MD5 URL hash. If a match exists, it reuses the existing Attachment ID without re-downloading. | Daily inventory/pricing feeds. Prevents duplicating images, saves disk space, and speeds up syncs by up to 90%. |
| Overwrite / Replace Media Image | Deletes the old attachment and its cropped thumbnails from disk and replaces it with the newly downloaded file. | Product catalog refreshes where suppliers keep identical filenames but update the actual product photo. |
| Always Create As New Image | Bypasses collision checks and saves the file with an incremental suffix (e.g. product-1.jpg, product-2.jpg). |
Multi-vendor catalogs where multiple unique products share common filenames (e.g. front.jpg). |
5. Frequently Asked Questions (FAQ) for Customers & Support
Q1: If I turn OFF Asynchronous Downloading, will my images still be imported?
Yes, 100%. Turning Asynchronous Downloading OFF simply instructs NextGen to download images immediately (synchronously) during each row's creation. When the import completes, all images are fully downloaded and attached.
Q2: Why is my import taking longer when Asynchronous Downloading is OFF?
In synchronous mode, the speed of your import depends on:
- The network speed of the remote server hosting the images.
- The size of the image files (e.g. 500 KB vs. 8 MB).
- How many thumbnail sizes your active theme and plugins register (WordPress typically crops 5 to 10 thumbnail sizes for each uploaded image).
Tip: To make imports up to 50x faster, enable Download Images Asynchronously in NextGen Pro.
Q3: What happens if a remote image URL is broken (404 Not Found)?
In both Synchronous and Asynchronous modes, NextGen will log the broken image error in the session log, skip the invalid image, and continue importing the rest of your product data without crashing the import session.
Q4: Does NextGen download images to my hosting server or hotlink them?
By default, if "Download External Images to Media Library" is enabled, NextGen downloads all images directly to your
/wp-content/uploads/directory so your site is 100% self-hosted and independent.
If you prefer zero disk consumption, you can use our built-in External CDN / FIFU integration to display external images without storing them on your server.
Q5: Can I extract images embedded inside article HTML content?
Yes. With NextGen Pro’s Inline Content Image Sideloading, the importer scans
post_contentfor<img>tags, downloads the images into your Media Library, and automatically rewrites the HTML URLs to point to your local WordPress installation.
Document Version: 1.0.0
Target: NextGen Customer Knowledge Base & FAQ Portal
Author: NextGen Technical Architecture & Customer Success Team