Title: tporret API Data Importer
Author: tporret
Published: <strong>April 20, 2026</strong>
Last modified: July 1, 2026

---

Search plugins

![](https://ps.w.org/tporret-api-data-importer/assets/banner-772x250.png?rev=3510907)

![](https://ps.w.org/tporret-api-data-importer/assets/icon-256x256.png?rev=3510907)

# tporret API Data Importer

 By [tporret](https://profiles.wordpress.org/tporret/)

[Download](https://downloads.wordpress.org/plugin/tporret-api-data-importer.1.4.0.zip)

 * [Details](https://vec.wordpress.org/plugins/tporret-api-data-importer/#description)
 * [Reviews](https://vec.wordpress.org/plugins/tporret-api-data-importer/#reviews)
 *  [Installation](https://vec.wordpress.org/plugins/tporret-api-data-importer/#installation)
 * [Development](https://vec.wordpress.org/plugins/tporret-api-data-importer/#developers)

 [Support](https://wordpress.org/support/plugin/tporret-api-data-importer/)

## Description

tporret API Data Importer gives WordPress teams an enterprise-grade ETL pipeline
for importing external API data with confidence.

The plugin ships readable source for its generated admin assets. JavaScript and 
CSS source files are included in the `src/` directory, compiled assets are in `build/`,
and the maintained public source repository is available at https://github.com/tporret/
enterprise-api-importer.

This readme is written for WordPress administrators and site owners evaluating or
using the plugin from the Plugins screen.

Use tporret API Data Importer to run clean, repeatable import workflows without 
sacrificing flexibility:

 * Multi-Connection Job Manager for organizing and scaling imports
 * React Tabbed Import Job Workspace (Source/Auth, Data Rules, Mapping/Templating,
   Automation)
 * Payload Format selection per import job (JSON, iCal .ics, CSV/TSV, or XML/RSS)
 * Format-aware extraction controls (JSON Array Path, CSV Delimiter, XML Node Element)
 * Advanced JSON array traversal and pre-stage data filtering to remove noise before
   insertion
 * Twig Templating Engine for complex logic, loops, and nested object mapping without
   drag-and-drop limitations
 * Twig-powered Post Title Templates with safe sanitization and fallback handling
 * Optional templates for new jobs (start with connection setup, add templates later)
 * Multiple API auth modes: none, bearer token, custom API-key header, and basic
   auth
 * Per-import Target Post Type selection (posts, pages, and public custom post types)
 * Parent Mapping for hierarchical post types using imported external IDs, WordPress
   IDs, or slugs
 * Media Mappings for featured images, gallery attachment IDs, and attachment-ID
   custom fields
 * Per-import Default Target Settings (post status, post author, comment status,
   pingback/trackback status)
 * Per-import editing lock toggle for imported posts (allow editing or enforce read-
   only)
 * Time-aware batch processing via WP-Cron to reduce timeout and memory-risk scenarios
 * Multisite support with per-site importer dashboards and an optional Network Admin
   summary dashboard when the plugin is also active on the primary site
 * **[New v1.3] Deep Module Architecture (internal):**
    - `Tporapdi_Validator` — single validation seam for all import job fields
    - `Tporapdi_Import_Runner` — owns the 5-stage import lifecycle (Extract  Filter
      Stage  Transform  Load)
    - `Tporapdi_Template_Engine` — unified Twig rendering seam for all template 
      fields and dry-run previews
    - `Tporapdi_Security_Guard` — centralised SSRF, CIDR, and Twig security checks
      shared across save and run paths
    - `Tporapdi_Job_Repository`, `Tporapdi_Queue_Repository`, `Tporapdi_Log_Repository`—
      domain repositories hiding all SQL and cache management
    - `Tporapdi_Media_Ingestor` — isolated image sideload, HTML rewrite, featured
      image, gallery, and attachment-meta mapping logic with idempotent deduplication
    - `Tporapdi_Cleanup_Service` — chunked garbage collection for staging queue 
      and log tables
    - Reporter self-registration via glob discovery — adding a new dashboard metric
      requires zero edits to existing files
    - `Tporapdi_Lock_Policy` — single edit-lock policy seam used by all admin UI
      affordances
    - `TPORAPDI_Defaults_Resolver::normalize()` — single normalization seam for 
      post status defaults shared by REST save and import runtime
 * **[New v1.2] Tableau-Style Reporting Dashboard:** Real-time metrics on environment
   health, security posture, and API performance with interactive charts, status
   indicators, and audit activity feed
 * **[New] Credential Encryption & REST Masking:**
    - AES-256-CBC encryption at rest for auth_token and auth_password fields
    - REST GET responses mask credentials; boolean flags indicate stored state
    - Blank credential fields on update preserve existing encrypted values
    - React UI shows saved-credential indicators with placeholder text
    - apply_filters no longer exposes raw tokens to third-party hooks
 * **[New] Import Pipeline Sanitization:**
    - Twig-rendered post content sanitized via wp_kses_post before wp_insert_post
    - Custom meta values sanitized via sanitize_text_field before update_post_meta
    - Admin menu pages restricted to manage_options capability (was read)
 * **[New] Enterprise-Grade Security Hardening:**
    - Dedicated template management capability with multisite support
    - Twig template security validation (disallowed tags, size/complexity limits,
      syntax checking)
    - Template change audit logging with before/after hashes and actor metadata
    - SSRF prevention via hostname and CIDR allowlisting with DNS resolution
    - Twig variable strictness is filterable, with permissive rendering used by 
      default for resilient imports
    - Imported items locked read-only (no editing, deletion, or quick-edit)

Whether you import catalogs, directory records, listings, events, or custom business
data, tporret API Data Importer provides a scalable framework for structured API-
to-WordPress ETL.

Built for real-world production workflows:

 * Title templates are rendered via Twig and sanitized before save
 * Target post type safely falls back to post if invalid or unavailable
 * Attachment is excluded by default from target post type selection
 * Default target post settings are validated and applied at load time for consistent
   publishing/discussion behavior
 * Hierarchical post types can map parent relationships from API fields and reconcile
   out-of-order parent records
 * Media mappings can sideload featured, gallery, and meta attachments while preserving
   legacy featured image fallback behavior
 * Imports are staged and processed in queue batches for safer long-running jobs
 * Imported items are cryptographically linked to their origin import (read-only)
 * Template configuration changes are audit-logged with full actor context
 * Endpoints validated against configurable SSRF allowlists and HTTPS enforcement
 * Inline API connection testing, sample payload preview, and template dry-run rendering
   from the edit workspace

### Development

To rebuild generated admin assets from source:

 1. Install Node.js dependencies: `npm install`
 2. Build production assets: `npm run build` (uses `@wordpress/scripts` / webpack)
 3. For a watch/dev build: `npm start`

 * JavaScript/CSS source lives in `src/`
 * Production assets are generated into `build/`
 * The public source repository is https://github.com/tporret/enterprise-api-importer

### External services

This plugin connects to external APIs that you configure in each import job.

The plugin does not hardcode any third-party API vendor. Data destination, terms,
and privacy practices depend on the endpoint(s) you configure.

## Screenshots

[⌊The Twig Mapping Interface for transforming JSON data.⌉⌊The Twig Mapping Interface
for transforming JSON data.⌉[

The Twig Mapping Interface for transforming JSON data.

[⌊API Connection and Data Filtering rules.⌉⌊API Connection and Data Filtering rules
.⌉[

API Connection and Data Filtering rules.

[[

## Installation

 1. Upload the plugin folder to the /wp-content/plugins/ directory, or install it through
    the WordPress Plugins screen.
 2. Activate the plugin through the Plugins screen in WordPress.
 3. Go to tporret API Data Importer  Manage Imports to configure your API connections,
    filtering rules, target post type, and Twig templates.

Multisite note: activate the plugin on each subsite that should run imports. If 
you also want the Network Admin summary dashboard, activate it on the primary site
too. Do not use Network Activate; that mode is intentionally not supported.

## FAQ

### Does this require WP-CLI?

No. It uses native WP-Cron scheduling, but supports CLI triggers.

### Can I parse nested JSON arrays?

Yes. Nested objects and arrays can be parsed and transformed through Twig templating.

### Can I import iCal feeds (ICS)?

Yes. Set Payload Format to iCal (.ics) and the importer will expand recurring events
into normalized records.

### Can I import CSV/TSV or XML/RSS feeds?

Yes. Set Payload Format to CSV/TSV or XML/RSS. CSV supports delimiter auto-detection(
or manual override), and XML/RSS uses a configurable repeating node element (for
example, `item` or `entry`).

### Does it handle API authentication?

Yes. It supports four modes per import job: none, bearer token, custom API-key header,
and basic auth.

### Can I set dynamic titles for imported posts?

Yes. Use Post Title Template with Twig syntax. If left blank, the importer falls
back to Imported Item {ID}.

### Can I import into custom post types?

Yes. Select any public post type from Target Post Type. If the selected post type
becomes unavailable, imports safely fall back to post.

### How do I list imported items on the front end?

Imported items are saved as the public tporapdi_item post type. You can list them
with a normal archive template such as archive-tporapdi_item.php, or with a WP_Query
that sets post_type to tporapdi_item. The plugin does not include a dedicated front-
end block for imported-item listings.

Example archive template:

    ```
    `php
    ```

    ```
    <?php while ( have_posts() ) : the_post(); ?>
      <article <?php post_class(); ?>>
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <div class="entry-summary"><?php the_excerpt(); ?></div>
      </article>
    <?php endwhile; ?>

    <?php the_posts_pagination(); ?>
    ```

No imported items found.

 `

Example WP_Query loop:

    ```
    `php
    ```

$imported_items = new WP_Query(
 array( ‘post_type’ => ‘tporapdi_item’, ‘post_status’
=> ‘publish’, ‘posts_per_page’ => 10, ) );

if ( $imported_items->have_posts() ) {
 while ( $imported_items->have_posts() ) {
$imported_items->the_post(); echo ‘

[‘ . esc_html( get_the_title() ) . ‘](https://vec.wordpress.org/plugins/tporret-api-data-importer/' . esc_url( get_permalink() ) . '?output_format=md)

‘;
 }

wp_reset_postdata();
 } `

### How does this work on multisite?

Each subsite keeps its own import jobs, schedules, settings, and dashboard. A separate
Network Admin dashboard can summarize active subsites when the plugin is also active
on the primary site. Activate the plugin per site; Network Activate is intentionally
blocked.

### Does this import media attachments automatically from URL fields?

Yes. Configure Media Mappings in the Mapping/Templating tab to sideload featured
images, gallery attachments, or attachment IDs stored in custom fields. The legacy
Featured Image Source Path still works as a fallback when no media mappings are 
configured.

### Can imported pages or hierarchical custom post types keep parent relationships?

Yes. For hierarchical target post types, enable Parent Mapping in the Mapping/Templating
tab. Parent lookup can use an imported external ID, an existing WordPress post ID,
or a post slug. Missing parents can be deferred for later reconciliation, imported
as root items, or skipped.

### Who can edit imported items and templates?

Template configuration requires the `tporapdi_manage_templates` capability or `manage_options`
role. Multisite super admins always have access. Imported item editing can now be
controlled per import job with the “Lock editing of imported posts” setting.

### What Twig features are blocked for security?

The following Twig tags are disallowed to prevent file inclusion and code injection:`
include`, `source`, `import`, `from`, `embed`, `extends`, `use`, `macro`.

### Can I allow imports from internal/private networks?

Yes, but not recommended for production. Go to Settings  Allow Internal Endpoints
to permit RFC1918 and loopback addresses. For whitelisting specific hosts/CIDR blocks,
use Settings  Allowed Endpoint Hosts and Settings  Allowed Endpoint CIDR Blocks.

### Why does the dashboard show a security warning on a new install?

The SSRF Hardening check starts in a warning state until you configure Allowed Endpoint
Hosts or Allowed Endpoint CIDR Blocks. That warning is there to remind you that 
outbound API access is still open until you add an allowlist.

### What should I configure in tporret API Data Importer  Settings first?

Start with Allowed Endpoint Hosts and list only trusted API domains. Leave Allow
Internal Endpoints disabled unless you intentionally import from internal services.
Add CIDR blocks only when you need additional IP-range restrictions.

### Where are template changes logged?

All template configuration changes are logged to the wp_custom_import_logs database
table with before/after hashes, actor information, and precise timestamps. Review
logs via tporret API Data Importer  Manage Imports  Import edit screen.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“tporret API Data Importer” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ tporret ](https://profiles.wordpress.org/tporret/)

[Translate “tporret API Data Importer” into your language.](https://translate.wordpress.org/projects/wp-plugins/tporret-api-data-importer)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/tporret-api-data-importer/),
check out the [SVN repository](https://plugins.svn.wordpress.org/tporret-api-data-importer/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/tporret-api-data-importer/)
by [RSS](https://plugins.trac.wordpress.org/log/tporret-api-data-importer/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.4.0

 * Added per-import Payload Format selection with support for JSON and iCal (.ics)
   feeds.
 * Added iCal parsing and recurrence expansion with normalized event fields (`uid`,`
   instance_uid`, start/end dates, all-day flag).
 * Unified payload extraction for endpoint test, REST preview, dry-run, and import
   runtime to keep behavior consistent.
 * Added database migration support for the new `data_format` column on existing
   installs.
 * Updated the import workspace to pass payload format through preview and dry-run
   requests, with iCal-specific Unique ID guidance.
 * Added `sabre/vobject` as a runtime dependency for iCal parsing.

#### 1.3.1

 * Maintenance release.

#### 1.3.0

 * **Architectural deepening release — no breaking changes to existing import jobs,
   REST API, or admin UI.**
 * Extracted `Tporapdi_Validator` module: single entry point for all import job 
   field validation (auth, recurrence, templates, post defaults, meta mappings) 
   replacing scattered inline checks in rest.php.
 * Extracted `Tporapdi_Import_Runner` module: owns the full 5-stage import lifecycle(
   Extract, Filter, Stage, Transform, Load) with state transitions and failure semantics
   in one place.
 * Extracted `Tporapdi_Template_Engine` module: single `render()` seam used by both
   live import runs and dry-run previews, guaranteeing identical Twig security and
   output behaviour across all template fields.
 * Extracted `Tporapdi_Security_Guard` module: centralises SSRF, CIDR, and Twig 
   security validation — same rules enforced at save time and run time.
 * Extracted three domain repositories (`Tporapdi_Job_Repository`, `Tporapdi_Queue_Repository`,`
   Tporapdi_Log_Repository`): all SQL and cache management moved out of db.php, 
   which is now a thin backwards-compatible shim layer.
 * Extracted `Tporapdi_Media_Ingestor` module: image sideload, deduplication, and
   HTML content rewriting isolated from lifecycle cleanup.
 * Added parent mapping for hierarchical post types, with lookup by imported external
   ID, WordPress post ID, or slug and configurable missing-parent behavior.
 * Added media mappings for featured images, gallery attachment IDs, and attachment-
   ID meta fields, including image metadata paths for alt text, title, caption, 
   and description.
 * Extracted `Tporapdi_Cleanup_Service` module: chunked garbage collection for staging
   queue and log tables, independent of media handling.
 * Reporting Discovery Engine: reporters now self-register via `TPORAPDI_Reporting_Aggregator::
   register()`; `reporting.php` uses glob-based auto-discovery so new reporters 
   require no edits to existing files.
 * Extracted `Tporapdi_Lock_Policy` module: single `is_locked(int $post_id)` seam
   for all import-managed post edit-locking; all content.php hook callbacks route
   through this one policy.
 * Deepened `TPORAPDI_Defaults_Resolver`: new `normalize(string $post_type, array
   $raw_input)` static method is the single seam for post status/comment status/
   ping status normalization — used identically by the REST save path and the import
   runtime.
 * Legacy admin-post import save submissions now delegate to the same import-job
   validator used by REST create/update so newer mapping fields cannot drift from
   the modern workspace path.
 * Updated the public plugin name to tporret API Data Importer for WordPress.org
   resubmission.

#### 1.2.4

 * Aligned Twig dry-run template normalization with save-time normalization so preview
   output matches persisted output.

#### 1.2.3

 * Added multisite Network Admin dashboard support while preserving per-site importer
   dashboards.
 * Added multisite activation safeguards so unsupported Network Activate attempts
   are blocked and reverted.
 * Added multisite admin guidance for primary-site activation requirements and network
   dashboard availability.
 * Softened the SSRF Hardening reporter so fresh installs show a warning until an
   endpoint allowlist is configured.
 * Tightened and de-duplicated release packaging workflows.

#### 1.2.2

 * Security hardening release.
 * Encrypted credential storage at rest for auth_token and auth_password.
 * REST import-job GET now masks credentials and returns has_auth_token / has_auth_password
   flags.
 * Update handlers preserve existing encrypted credentials when masked fields are
   submitted blank.
 * Removed raw token exposure from tporapdi_remote_request_args filter context.
 * Added post-content sanitization with wp_kses_post before post insert/update.
 * Added custom-meta sanitization with sanitize_text_field before update_post_meta.
 * Tightened admin menu capability from read to manage_options.

#### 1.2.1

 * Maintenance release from cleaned git history.
 * Removed accidentally committed documentation/test-data directories from repository
   history and release packaging.
 * No runtime feature changes.

#### 1.2.0

 * **Updated: React Import Job Workspace**
    - Replaced the legacy linear create/edit form with a tabbed workspace in wp-
      admin.
    - Added sticky footer actions for save, run now, and update existing item content.
 * **Updated: REST Import Job CRUD + actions**
    - Added REST routes for create/read/update import jobs and run/template sync
      actions.
    - Added centralized sanitization for import job payloads used by create/update
      handlers.
 * **Updated: API validation and preview tooling**
    - Added in-workspace API test button with sample record preview support.
    - Added Twig dry-run test support from the Mapping & Templating tab.
 * **Updated: Authentication model**
    - Added four auth methods per import job: none, bearer, custom API-key header,
      and basic auth.
 * **Updated: Optional templates for new imports**
    - New imports can be created without title or mapping templates; templates can
      be added later.
 * **Updated: Per-import editing lock control**
    - Added “Lock editing of imported posts” toggle in Mapping & Templating.
    - Edit/delete restrictions now apply by import configuration and can be disabled
      per job.
 * **Updated: Default target post settings**
    - Added per-import defaults for Post Status, Post Author, Comment Status, and
      Pingback/Trackback Status in Mapping & Templating.
    - Added REST sanitization and persistence for these fields in import job create/
      update handlers.
    - Import load now applies these defaults during `wp_insert_post()` and sync 
      updates discussion settings during `wp_update_post()`.
 * **New: Enterprise Reporting Dashboard (Tableau-Style)**
    - Real-time operations command center with global health status badge and force-
      refresh controls.
    - Nine enterprise-grade metrics across three pillars:
    - **Environment Health:** Cron heartbeat, queue depth, daily success rate.
    - **Security & Compliance:** SSRF hardening status, audit integrity tracking,
      protocol enforcement (HTTPS vs HTTP).
    - **Connectivity & Performance:** API latency trends, active endpoint count,
      hourly throughput.
    - High-performance React UI with Recharts data visualization and Lucide icons.
    - Responsive grid layout with KPI stat cards (sparkline trends), status lists,
      donut charts, area charts, and system pulse marquee.
    - REST API endpoints: `/wp-json/eapi/v1/dashboard` (metrics) and `/wp-json/eapi/
      v1/dashboard/history` (time-series data).
    - Transient-backed caching (600s TTL) with force-refresh capability.
    - Shimmer loading states and dark/light theme-aware styling via Tailwind CSS(
      namespaced to avoid wp-admin conflicts).
    - Menu: EAPI  Dashboard (requires read capability).
 * **Credential Encryption & Data Sanitization**
    - Credential fields (auth_token, auth_password) are now encrypted at rest with
      AES-256-CBC using a key derived from wp_salt(‘auth’).
    - REST GET responses mask credential values and expose boolean has_auth_token/
      has_auth_password flags.
    - Credential preservation on update: blank credential fields retain existing
      encrypted values.
    - React auth fields show “Credential saved” indicators with placeholder text
      for stored credentials.
    - apply_filters(‘tporapdi_remote_request_args’) no longer passes raw token —
      passes auth_method instead.
    - Twig-rendered post content now passes through wp_kses_post() before wp_insert_post()(
      stored XSS prevention).
    - Twig-compiled custom meta values now pass through sanitize_text_field() before
      update_post_meta().
    - Admin menu pages capability changed from ‘read’ to ‘manage_options’ (subscriber
      access blocked).
 * **Enhanced Security Hardening (Enterprise-Grade)**
    - Added dedicated `tporapdi_manage_templates` capability for template configuration
      access (separate from `manage_options`).
    - Implemented multisite-aware permission system: `tporapdi_manage_templates`
      OR `manage_options` OR `is_super_admin()`.
    - Locked imported items as read-only (no editing, deletion, or quick-edit permissions
      via `map_meta_cap`).
    - Added comprehensive Twig template security validator:
    - Disallowed tags: include, source, import, from, embed, extends, use, macro(
      prevents SSTI and file inclusion).
    - Size limits: 50 KB for mapping templates, 2 KB for title templates (filterable).
    - Expression count limit: 250 default (filterable).
    - Nesting depth limit: 12 levels default (filterable).
    - Parse-time syntax validation via Twig tokenizer.
    - Added template change audit logging:
    - Logs to wp_custom_import_logs with before/after SHA256 hashes.
    - Captures actor metadata (user login, role, display name).
    - Tracks template lengths and create vs. update distinction.
    - Implemented SSRF prevention via allowlist system:
    - Hostname allowlisting (exact + wildcard *.example.com support).
    - CIDR allowlisting (IPv4 and IPv6 support).
    - DNS resolution for hostname validation.
    - Settings UI for managing allowed hosts and CIDR blocks.
    - Twig variable strictness is filterable; permissive rendering now avoids row
      failures when a template references a missing key.
    - Added Settings page (EAPI  Settings) for endpoint security configuration.

#### 1.0.0

 * Initial Release.
 * Added dynamic Twig Post Title Template support with sanitization and fallback
   logic.
 * Added Target Post Type selector for loading imports into posts, pages, or public
   custom post types.
 * Added runtime fallback to post when target post type is invalid or missing.
 * Added secure media sideload helper foundation with source URL deduplication metadata.

## Meta

 *  Version **1.4.0**
 *  Last updated **6 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.3 or higher **
 *  Tested up to **7.0.0**
 *  PHP version ** 8.1 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/tporret-api-data-importer/)
 * Tags
 * [api](https://vec.wordpress.org/plugins/tags/api/)[etl](https://vec.wordpress.org/plugins/tags/etl/)
   [ical](https://vec.wordpress.org/plugins/tags/ical/)[import](https://vec.wordpress.org/plugins/tags/import/)
   [xml](https://vec.wordpress.org/plugins/tags/xml/)
 *  [Advanced View](https://vec.wordpress.org/plugins/tporret-api-data-importer/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/tporret-api-data-importer/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/tporret-api-data-importer/reviews/)

## Contributors

 *   [ tporret ](https://profiles.wordpress.org/tporret/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/tporret-api-data-importer/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://porretto.com/donate)