Cities Importer Plugin
For this demo, I developed a custom WordPress plugin that imports European capitals and stores them as custom post types. The plugin is fully idempotent, meaning it only creates or updates cities when necessary, avoiding duplicates. It integrates with ACF (Advanced Custom Fields) for storing meta data such as latitude, longitude, population, currency, and featured images (country flags).
The plugin includes a WP-CLI command, allowing the import process to be triggered via the terminal rather than relying on HTTP requests. This provides a clean and professional workflow with real-time logging, showing successes, warnings, and errors per city.
Additionally, I implemented an optional AI-powered city summary feature using the OpenAI API. When enabled via a CLI flag, the plugin generates detailed summaries for each city.
Key aspects demonstrated in this project:
-
Custom post type management with ACF integration
-
Idempotent data import and update logic
-
Featured image handling via URL
-
CLI automation with logging and progress tracking
-
External API integration with fallback, retries, and error handling