Documentation · Appendices
Database And Storage Reference
This appendix lists the custom database tables, post types, taxonomies and storage locations used by the ADP Car Market Hub plugin.
When to use this document
Use this reference when planning backups, building reports, diagnosing schema problems or auditing what data the plugin keeps. For the conceptual entity model and schema details, see Database Schema, Data Model and Custom Post Types And Taxonomies.
Overview
The plugin stores data in five places:
- Custom database tables for vehicles, analytics events, search-alert subscriptions and Content Studio jobs/assets.
- Custom post types for vehicles, leads and locations, stored in
wp_postsandwp_postmeta. - Custom taxonomies stored in
wp_terms,wp_term_taxonomyandwp_term_relationships. - WordPress options in
wp_options(all prefixedas24ci_). See Settings Reference. - Transients for short-lived caches and locks.
Custom database tables
All tables use the WordPress prefix (typically wp_). All five custom tables are dropped on uninstall regardless of as24ci_delete_data_on_uninstall, because they may contain visitor or personal data.
| Table suffix | Owner | Schema-version option | Purpose |
|---|---|---|---|
as24_vehicles | AS24CI\Vehicle_Repository | as24ci_vehicles_db_version | One row per imported vehicle, indexed for archive queries. |
as24ci_analytics | AS24CI\Analytics | as24ci_analytics_db_version | Analytics events (views, filter searches, contact opens, lead submissions). |
as24ci_search_agents | AS24CI\Search_Agent | as24ci_search_agent_db_version | Visitor search-alert subscriptions (Smart Stock Alerts). |
as24ci_content_studio_jobs | AS24CI\Content_Studio_Repository | as24ci_content_studio_db_version | One row per Content Studio generation job. |
as24ci_content_studio_assets | AS24CI\Content_Studio_Repository | as24ci_content_studio_db_version | Generated Content Studio assets, linked to a job by job_id. |
as24_vehicles (vehicles repository)
Holds one row per vehicle, linked to its as24ci_car post by post_id. The as24_id column holds the AutoScout24 listing identifier. Both columns have unique indexes. Notable columns include make, model, version_full_name, condition_type, body_type, fuel_type, transmission_type, drive_type, color_exterior, color_interior, mileage, cubic_capacity, range_km, first_registration, power_kw, power_hp, co2_emission, price, list_price, currency, emission_standard, energy_label, battery_capacity, vin, status, is_live, had_accident, equipment_codes, equipment_standard, equipment_optional, images, raw_data, manual_overrides, content_hash, imported_at, updated_at.
Indexes include unique keys on as24_id and post_id, plus secondary indexes on make/model, price, mileage, first_reg_year, fuel_type/condition_type, status/is_live and content_hash. See Database Schema for the complete column list and types.
as24ci_analytics (analytics events)
Stores one row per tracked event. Columns: id, post_id (0 for global events), event_type, extra_data (optional JSON), created_at. Indexes cover (post_id, event_type, created_at), (event_type, created_at) and created_at. Inserts only happen when analytics is enabled. A daily retention job runs through the as24ci_daily_cleanup cron hook and removes rows older than the configured retention window.
as24ci_search_agents (Smart Stock Alerts)
Stores visitor subscriptions. Columns: id, name, email, criteria, token, frequency, status (pending, active, inactive, paused), created_at, confirmed_at. Indexes cover status and token. Because the table contains personal data, it is dropped on uninstall regardless of the cleanup setting.
as24ci_content_studio_jobs (Content Studio jobs)
Stores one row per Content Studio generation job. Columns include id, vehicle_post_id, vehicle_snapshot_hash, content_type, platform_preset, output_format, preset_key, status (draft, queued, processing, ready, failed), prompt_payload, provider, model, language, tone, attempts, last_error, created_by, created_at, updated_at, started_at, completed_at. Indexes cover vehicle_post_id, (status, created_at), platform_preset and content_type.
as24ci_content_studio_assets (Content Studio assets)
Stores generated assets linked to a job by job_id. Columns include id, job_id, vehicle_post_id, asset_type, file_path, file_url, mime_type, file_size, width, height, duration_seconds, caption, hashtags, alt_text, thumbnail_path, payload_json, scheduled_at, schedule_status (unscheduled, scheduled), created_at. Indexes cover job_id, vehicle_post_id, asset_type, created_at, schedule_status and scheduled_at.
Custom post types
| Post type | Public | Has archive | Stored in | Purpose |
|---|---|---|---|---|
as24ci_car | Yes | Yes | wp_posts, wp_postmeta (anchor) + custom table {prefix}as24_vehicles (field data) | Imported vehicles. Linked one-to-one to a row in as24_vehicles by post_id. |
as24ci_lead | No | No | wp_posts, wp_postmeta | Contact-form and Test Drive submissions. |
Dealer locations are not a custom post type. They are stored as a single array in the as24ci_locations WordPress option and rendered through the location/opening-hours shortcodes.
The as24ci_car taxonomies and the most-used vehicle fields are mirrored to post meta with the _as24ci_ prefix for theme compatibility (for example _as24ci_listing_id, _as24ci_make, _as24ci_model, _as24ci_price, _as24ci_mileage, _as24ci_image_ids, _as24ci_manual_image_ids).
as24ci_lead posts carry meta keys such as _as24ci_lead_name, _as24ci_lead_email, _as24ci_lead_phone, _as24ci_lead_message, _as24ci_lead_vehicle_id, _as24ci_lead_vehicle_title, _as24ci_lead_date, _as24ci_lead_is_test_drive, _as24ci_lead_appointment_date, _as24ci_lead_status.
Vehicle taxonomies
The plugin registers 15 vehicle-attribute taxonomies, all attached to as24ci_car:
- Brand
- Model
- Body type
- Condition
- Fuel type
- Transmission
- Drive
- Exterior colour
- Interior colour
- Emission standard
- Energy label
- Vehicle category
- Cylinder arrangement
- Warranty type
- Warranty details
Verify the exact slugs in AS24CI\Taxonomies (see Custom Post Types And Taxonomies) before publishing taxonomy-aware code.
WordPress core tables used
The plugin does not modify the schema of WordPress core tables. It uses them as follows:
wp_posts— stores theas24ci_carandas24ci_leadpost types. (Locations are not a post type; they live in theas24ci_locationsoption.)wp_postmeta— stores backwards-compatibility post meta and lead status.wp_terms,wp_term_taxonomy,wp_term_relationships— store the 15 vehicle taxonomies.wp_options— stores all plugin settings, schema-version markers and the IDs of activation-created pages.wp_usersandwp_usermeta— used indirectly via WordPress capabilities and dealer-profile user meta.
Capabilities and roles
The plugin manages a custom capability set stored in wp_user_roles (the standard WordPress option):
- Custom role:
as24ci_editor. - Custom capabilities: the
as24ci_carandas24ci_carscapability set, plus themanage_as24_importsplugin-management capability.
Transients
Used for short-lived caches and cross-request locks.
| Transient | TTL (approx.) | Purpose |
|---|---|---|
as24ci_cron_import_running | ~40 min | Single-run lock for the import runner. |
as24ci_image_queue_running | ~10 min | Single-run lock for the image-queue worker. |
as24ci_batch_queue | n/a | Pending batch queue payload for the Batch-Wizard. |
as24ci_access_token | Token expiry | OAuth access token cache. |
as24ci_gemini_models | Provider-specific | Cached managed-Gemini model list. |
as24ci_dashboard_page_data, as24ci_dashboard_api_status_v2 | n/a | Dashboard caches. |
as24ci_dw_overview, as24ci_dw_ai_monitor, as24ci_dw_performance, as24ci_dw_recent_leads, as24ci_dw_pricing_intel | n/a | Dashboard widget caches. |
as24ci_analytics_tab_{view} | n/a | Analytics tab caches. |
as24ci_health_ping_{service} | n/a | Health check ping caches. |
as24ci_import_{job_id} | n/a | Per-import progress record. |
as24ci_ai_kb_index_v1, as24ci_docs_v1_{path}, as24ci_models_cache_{hash} | n/a | AI knowledge base / documentation caches. |
as24ci_rate_{email} | n/a | Contact form per-email rate limit. |
as24ci_analytics_market_intel | n/a | Pricing engine cache. |
Stale locks (older than the TTL) are cleared automatically by the next runner.
File system storage
- Imported images are stored as standard WordPress attachments under the WordPress uploads directory. They are referenced from vehicles via
_as24ci_image_ids. - Manually uploaded gallery images are referenced via
_as24ci_manual_image_ids. These are never deleted automatically by the uninstaller. - Plugin logs are written to a plugin-managed log file with auto-rotation at a 10 MB cap. The exact path is shown in the Logs admin tab.
Uninstall behaviour
uninstall.php always:
- Drops the five custom tables (
{prefix}as24_vehicles,{prefix}as24ci_analytics,{prefix}as24ci_search_agents,{prefix}as24ci_content_studio_jobs,{prefix}as24ci_content_studio_assets). - Removes the matching schema-version options.
- Deletes the import lock and OAuth token transients.
- Clears the plugin's scheduled cron events.
Removed only when as24ci_delete_data_on_uninstall is '1':
- All
as24ci_carposts. - All
as24ci_leadposts. - Imported attachments referenced in
_as24ci_image_ids. - The pages whose IDs are stored in
as24ci_page_archive_id,as24ci_page_compare_idandas24ci_page_favorites_id.
Never removed automatically:
- Manually uploaded images referenced in
_as24ci_manual_image_ids. - Dealer user-profile meta (the
as24ci_seller_*user meta keys).
On multisite installations, the same logic is applied per site.
Operational notes
- Schema upgrades are idempotent. Each owner class checks its schema-version option and quick-exits when the table already matches the expected version.
- Direct
wpdbqueries against the custom tables exist in the repository, analytics, search-agent and uninstall code paths. Custom code that bypasses the repository should treat the schema as part of the plugin's internal contract. - Treat the
raw_data,equipment_*andimagescolumns as opaque blobs and access them through the repository helpers when possible.