Documentation · User Handbook
Vehicle Import Workflow
This document describes how to import vehicle listings from the AutoScout24 API into WordPress using the ADP Car Market Hub plugin. It covers both manual import methods and the automatic scheduled import, as well as import options, change detection, image handling, and Full Sync.
When to use this document
Read this document if you:
- Need to perform or monitor a vehicle import for the first time or on demand.
- Want to understand the difference between manual import, Batch-Wizard, and scheduled (automatic) import.
- Are troubleshooting import failures or unexpected results.
- Need to understand how the plugin handles updated listings, images, and removed vehicles.
For a concise daily check of import status, see Daily Usage Workflows.
Overview
The plugin fetches vehicle listings from the AutoScout24 API for all configured seller IDs and stores each listing as a WordPress post of the custom post type as24ci_car. Vehicle metadata (price, mileage, specifications, equipment, images) is stored in post meta and a dedicated custom database table.
There are three ways to trigger an import:
- Single vehicle import — import or re-import one listing from the Car Importer tab.
- Batch-Wizard — manually run a full import of all listings with live progress monitoring. Suitable for the initial import or a forced full refresh.
- Automatic scheduled import — runs at a configured interval via WP-Cron or an external server cron. The recommended method for ongoing synchronisation.
All three paths use the same underlying import logic: connect to the API, fetch listings for each configured seller, compare with the local copy using content hashes, and create or update WordPress posts as needed.
Requirements or prerequisites
- Valid API credentials (API Base URL, Seller ID(s), Client ID, Client Secret, Token URL, and Audience) must be entered and saved in ADP Car Market Hub → Settings before any import can run.
- The WordPress site must be able to make outbound HTTPS connections to the configured API endpoint.
- For image imports, the WordPress uploads directory must be writable.
- At least one Seller ID must be configured. The plugin reads the
as24ci_seller_idsoption (comma-separated list of IDs).
Step-by-step instructions
Importing a single vehicle
- Navigate to ADP Car Market Hub → Car Importer.
- The Pending vehicles table lists listings available from the API that have not yet been imported into WordPress.
- Find the vehicle you want to import.
- Click Import next to the listing.
- The page reloads and the vehicle appears in the Imported vehicles table above.
- To refresh an already-imported vehicle (for example, after a price change on AutoScout24), find it in the Imported vehicles table and click Re-import.
Running the Batch-Wizard (manual full import)
The Batch-Wizard is the recommended method for the initial full import of all listings and for performing a forced refresh outside the regular schedule.
- Navigate to ADP Car Market Hub → Import & Limits.
- Click the Trigger now button.
- The Batch-Wizard starts and displays a live progress bar showing: - Total vehicles to process. - Vehicles processed so far. - Estimated remaining time. - Current action (inserting, updating, or skipping).
- The wizard processes one vehicle at a time by default (adaptive batch size: 1–5 vehicles per step). This avoids PHP execution time errors on shared hosting.
- Use the Pause button to temporarily suspend the import. Click Resume to continue.
- Use the Abort button to stop the import. Vehicles already processed in the current run remain in WordPress.
- After the wizard finishes, a summary shows the number of vehicles inserted, updated, skipped, and any errors.
Configuring and running scheduled automatic imports
For ongoing synchronisation, enable the automatic scheduler:
- Navigate to ADP Car Market Hub → Import & Limits.
- Enable Automatic import (the checkbox or toggle on the tab).
- Choose the import interval: - Hourly - Every 6 hours - Twice daily - Daily - Custom (minimum 15 minutes — configure the minute value in the custom interval field)
- For daily and twice-daily schedules, optionally set the start time.
- Save the automation settings.
- WordPress WP-Cron will now trigger imports at the configured interval whenever the site receives traffic.
For production sites, server cron is recommended:
- Set Cron mode to Server cron on the Import & Limits tab.
- Copy the displayed cron endpoint URL (the URL includes a security token).
- Add a server-side cron job (for example, via
crontab) calling the endpoint URL usingcurlorwgetat your desired interval. - If you regenerate the token (Import & Limits → Regenerate token), update your cron job with the new URL.
How imports work
Change detection
The importer calculates and stores a content hash and an image hash for each imported vehicle. On subsequent import runs, a vehicle is skipped if neither hash has changed. This keeps import runs fast, especially for large inventories where most vehicles are unchanged.
When a listing is updated on AutoScout24 (for example, a price change or new images), the hashes no longer match and the vehicle is updated in WordPress.
Import outcome codes
Each vehicle processed during an import run is counted in one of four categories:
| Outcome | Meaning |
|---|---|
| Inserted | New vehicle post created in WordPress |
| Updated | Existing vehicle post refreshed with new data |
| Skipped | Vehicle data unchanged; no action needed |
| Error | A problem occurred for this vehicle (see Logs tab) |
The import summary on the Import & Limits tab and Batch-Wizard displays these counts after each run.
Image import and the image queue
- When Import images is enabled in Settings, the importer downloads vehicle images from the API and attaches them to the WordPress post.
- Max images per vehicle (Settings) limits how many images are downloaded per listing (0 = unlimited).
- Image queue mode (enabled by default for cron/REST imports): during scheduled imports, only the first image per vehicle is downloaded immediately. All remaining images are added to a persistent background queue and processed asynchronously by the image queue worker, which runs approximately every 5 minutes. This prevents PHP execution timeout errors during large imports.
- The image queue worker processes up to 30 images per batch.
- The current queue size and worker status are visible on the System & Help tab.
- To process the image queue immediately, click Run image queue now on the System & Help tab.
- WebP conversion: if enabled in Settings and GD or Imagick is available, images are converted to WebP format upon download. The quality level is configurable (1–100, default 80).
Import lock
The plugin uses a transient-based run-lock with a TTL of approximately 40 minutes. If an import run is already in progress when a second trigger arrives (from WP-Cron, server cron, or a manual button), the second trigger is skipped and a "already in progress" message is logged. If the lock is stale (older than the TTL), it is automatically cleared so the next run can proceed.
Full Sync
When Full Sync is enabled on the Import & Limits tab, the importer compares the set of listing IDs returned by the API against all vehicle posts in WordPress. Any local post whose listing ID is not in the current remote listing is permanently deleted — including all attached images.
- Enable Full Sync only when you want the WordPress inventory to mirror the live AutoScout24 listing exactly.
- Full Sync deletions are recorded in the plugin log with
sync_deletedcounts. - When Full Sync is disabled, vehicles removed from AutoScout24 remain in WordPress until deleted manually.
Vehicle post status
Imported vehicles are created with the post status configured in Settings → Default post status (publish or draft). When a vehicle is updated by a subsequent import run, its post status is not changed — a published post remains published.
Configuration reference
| Setting | Location | Description |
|---|---|---|
| API Base URL | Settings | AutoScout24 API endpoint (must include https://) |
| Seller ID(s) | Settings | Comma-separated seller/dealer identifiers |
| Client ID | Settings | OAuth client ID for the API |
| Client Secret | Settings | OAuth client secret for the API |
| Default post status | Settings | Post status applied to newly imported vehicles (publish or draft) |
| Import images | Settings | Enable or disable image downloading during imports |
| Max images per vehicle | Settings | Maximum images downloaded per listing (0 = unlimited) |
| Convert to WebP | Settings | Convert downloaded images to WebP (requires GD or Imagick) |
| WebP quality | Settings | Compression quality for WebP conversion (1–100) |
| Auto import enabled | Import & Limits | Enable the WP-Cron automatic import schedule |
| Import interval | Import & Limits | Schedule frequency (hourly, 6h, twice daily, daily, custom) |
| Cron mode | Import & Limits | WP-Cron (default) or server cron |
| Max vehicles per cron run | Import & Limits | Limit the number of vehicles processed per scheduled run (0 = unlimited) |
| Image queue (cron) | Import & Limits | Enable background image queue mode for cron/REST imports |
| Full Sync | Import & Limits | Delete local vehicles not found in the current remote listing |
Operational notes
- Multiple seller IDs: the importer runs separately for each configured seller ID. An error for one seller does not stop imports for other sellers.
- Cron robustness: the import runner raises the PHP execution time limit to 300 seconds during cron/REST-triggered runs. On hosting environments that restrict
set_time_limit(), this may not take effect. - Batch-Wizard batch size: the wizard adapts its batch size (1–5 vehicles per step) to stay within safe execution time boundaries.
- Manual trigger during active cron: if the automatic cron is running when you click Trigger now, the manual trigger will be skipped due to the run-lock. Wait for the current run to complete or clear the lock.
- Import log: all import events (API calls, inserted/updated/skipped/error per vehicle, image downloads) are written to the plugin log. Review ADP Car Market Hub → Logs for details.
- Verbose logging: if enabled, the log includes per-vehicle and per-image detail. Disable in production to reduce log growth.
Troubleshooting
| Symptom | Likely cause | Check |
|---|---|---|
| No listings appear in the Car Importer | API credentials are incorrect or the API endpoint is unreachable | Verify credentials in Settings; run connection test on System & Help |
| Import runs but no new vehicles appear | Default post status is draft, or all listings were already imported and unchanged | Check post status in Settings; check the import summary for "skipped" counts |
| Images are not downloading | Image import is disabled, uploads directory is not writable, or the image queue worker is not running | Check Settings → Import images; check System & Help for uploads status and queue size |
| Scheduled import does not run | WP-Cron is disabled or the site has no traffic | Switch to server cron or verify the cron endpoint is reachable |
| Import shows many errors | API rate limiting, network issues, or malformed listing data | Review the Logs tab for error details; check API status with your integration partner |
| Vehicles disappear unexpectedly | Full Sync is enabled and the vehicles were removed from AutoScout24 | Check Logs for sync_deleted entries; disable Full Sync if unintended |
| Batch-Wizard stops or times out | PHP execution time limit is too low | Check System & Help for execution time value; contact your hosting provider |
| Import lock prevents runs | A previous import run died without releasing the lock | Wait up to 40 minutes for the lock to expire automatically, or check Logs for details |