AI Tools Directory Data Importer
Open-source WordPress plugin for importing, validating, mapping, and managing AI tools directory data from CSV and JSON files.
by AI Tools Directory Team · github.com/zubayer-web/ai-tools-directory-data-importer · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/zubayer-web/ai-tools-directory-data-importer/archive/refs/heads/main.zipOpen-source WordPress plugin for importing, validating, mapping, and managing AI tools directory data from CSV and JSON files.
AI Tools Directory Data Importer is an enterprise-grade, memory-safe data ingestion engine built specifically for WordPress AI Tools directories (such as CatchAIInfo, Futurepedia, and similar high-traffic portals).
🌟 Architecture & Capabilities
flowchart TD
A["Uploaded CSV / JSON File"] --> B["Streaming Parser (CSV / JSON)"]
B --> C["Automatic Field Mapping Engine"]
C --> D["Batch Runner Chunk (10–50 items)"]
D --> E["Duplicate Detection (URL/Domain/Slug/Title)"]
E --> F{"Is Duplicate?"}
F -- "Yes" --> G["Apply Strategy: Skip / Update / Draft"]
F -- "No" --> H["SSRF-Guarded Image Importer"]
H --> I["Download Logo & Validate Magic Bytes / SVG"]
I --> J["Create / Update 'ai_tool' Post & Taxonomies"]
J --> K["Log Transaction Audit Trail"]
K --> L{"More Batches?"}
L -- "Yes" --> D
L -- "No" --> M["✨ Complete: 1-Click Rollback Available"]
🔒 25-Point Production QA Specifications
| # | Inspection Item | Implementation & Protection Standard |
|---|---|---|
| 1 | PHP Syntax Errors | 100% clean under php -l across all PHP 7.4 through 8.2+ runtimes. |
| 2 | WordPress Hook Errors | All actions (plugins_loaded, init, admin_menu, admin_enqueue_scripts, wp_ajax_*, rest_api_init) use strictly verified signatures. |
| 3 | Missing Includes | PSR-4 compliant Autoloader dynamically loads all classes and interfaces. |
| 4 | Incorrect Namespaces | Standardized under root namespace AIToolsDirectory\Importer\.... |
| 5 | Broken Admin Pages | 4 submenus registered with correct slugs, capabilities (manage_options), and script handles. |
| 6 | Broken AJAX/REST | Strict JSON contracts (wp_send_json_success, wp_send_json_error, WP_REST_Response). |
| 7 | Nonce Problems | Nonces created with wp_create_nonce('ai_tools_importer_nonce') and verified with check_ajax_referer(). |
| 8 | Capability Issues | Enforces current_user_can('manage_options') across all AJAX handlers, forms, and REST endpoints. |
| 9 | CSV Parsing Problems | Handles UTF-8 BOM, multiline cells, delimiter auto-detection (,, ;, \t, \|), and memory-safe streaming via fgetcsv(). |
| 10 | JSON Parsing Problems | Supports root array of objects, wrapped object structures ({"tools": [...]}), and detailed error reporting with json_last_error_msg(). |
| 11 | Duplicate Detection Bugs | Multi-vector matching: Normalized Website URL (ignores protocol and www.), Post Slug, Post Title, and Meta Hash. Configurable: Skip, Update, Draft. |
| 12 | Batch-Processing Bugs | Chunked stateless offset/cursor batching. Configurable batch sizes (5–100) with automatic progress reporting (0% to 100%). |
| 13 | Memory/Time Limits | Dynamic time-limit extension (set_time_limit(300)), wp_raise_memory_limit('admin'), and peak memory monitoring. |
| 14 | Image-Import Security | Strict MIME verification (image/jpeg, image/png, image/webp, image/gif, image/svg+xml), size limit (15MB), magic-byte check (getimagesize), and embedded PHP payload stripping. |
| 15 | SSRF Vulnerabilities | SSRF_Guard blocks private and reserved IP subnets (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8, 169.254.169.254, IPv6 loopback) and enforces HTTP/S. |
| 16 | XSS Risks | Comprehensive output escaping (esc_html, esc_attr, esc_url, wp_kses_post) and JS-side HTML entity encoding. |
| 17 | SQL Injection Risks | Strict use of $wpdb->prepare() on custom tables wp_ai_tools_import_sessions and wp_ai_tools_import_logs. |
| 18 | Sanitization/Escaping | Ingestion sanitization: sanitize_text_field, esc_url_raw, sanitize_key, absint, and Sanitizer::sanitize_svg. |
| 19 | Rollback Engine | Single-click atomic rollback that deletes created posts, attachments, and taxonomy terms without affecting existing data. |
| 20 | Uninstall Problems | uninstall.php checks WP_UNINSTALL_PLUGIN and user retention settings before dropping tables and cleaning files. |
| 21 | Settings API | Uses WordPress Settings API for default batch size, duplicate policy, timeout, and uninstall cleanup. |
| 22 | Accessibility (a11y) | Semantic HTML5, ARIA live regions for terminal (aria-live="polite"), progress bar ARIA attributes (role="progressbar"), and high contrast. |
| 23 | Responsive Admin UI | Flexible CSS grid/flexbox layouts supporting 320px to 1920px viewports with horizontally scrollable table containers. |
| 24 | WordPress Standards | Follows WP Coding Standards: class-*.php filenames, snake_case functions, and comprehensive DocBlocks. |
| 25 | Documentation | Fully documented schema, hooks, endpoints, and verification test scripts. |
🛠️ Installation & Quick Start
- Copy the
ai-tools-directory-importerdirectory to your WordPress plugins folder:/wp-content/plugins/. - Navigate to Plugins > Installed Plugins in your WordPress dashboard and activate AI Tools Directory Data Importer.
- Go to AI Tools Importer > Import Wizard to begin importing CSV or JSON datasets.
🧪 Running Automated Tests
Run the standalone CLI test runner:
php tests/run-tests.php
All 6 automated test suites will execute and validate:
- CSV Parser (BOM handling, delimiter detection, quotes)
- JSON Parser (wrapped array handling, schema discovery)
- SSRF Guard (private IP blocking, cloud metadata blocking)
- Duplicate Detection (URL normalization, slug matching)
- Batch Chunking (offsets, bounds, empty batch termination)
- Image Security (MIME verification, SVG sanitization, PHP tag blocking)
🌐 Project Website
AI Tools Directory Data Importer is maintained as part of the CatchAIInfo ecosystem.
For documentation, release notes, and community updates, visit the official project page: https://catchaiinfo.com/ai-tools-directory-data-importer/
📄 License
This project is open-source software licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).