Maintainer overview of the extraction pipeline, OCR layers, and public endpoints.
Flow
- Editor REST or WP-CLI schedules work through
Action_Scheduler_Handler::schedule(). Extraction_Serviceresolves the PDF (uploads dir or remote download), callsOCR_Orchestrator::extract_text(), and saves apdf_extractionchild post.OCR_Orchestratortries providers by priority. Claude (priority 4) first; Gemini (priority 5) fallback. Each returns plain text, Markdown, and Gutenberg HTML.Rewrite_Rulesintercepts/{slug}/extractionand/{slug}/textearly inparse_request. Markdown serving prefersprc-markdown-for-agentswhen active.Content_Discoveryadds alternate links, JSON-LDDigitalDocument,/llms.txtentries, and robots Allow rules.
Flow
5 relationships
Extraction pipeline
OCR layers
| Layer | Namespace | Responsibility |
|---|---|---|
| Domain | OCR\Domain | Request/response types, exceptions |
| Application | OCR\Application | Orchestrator, validation, page analysis, merge |
| Infrastructure | OCR\Infrastructure | HTTP client, base64 encoder |
| Providers | OCR\Providers | Claude, Gemini, WP AI |
Dependencies
- Required:
prc-platform-core, Action Scheduler - Optional:
prc-markdown-for-agents(legacy Markdown template fallback when absent) - Env:
PRC_PLATFORM_ANTHROPIC_API_KEY(Claude),PRC_PLATFORM_GOOGLE_API_KEY(Gemini)
Key files
| Path | Purpose |
|---|---|
includes/class-bootstrap.php | Module wiring |
includes/class-content-type.php | pdf_extraction CPT + meta |
includes/class-extraction-service.php | Resolve PDF, OCR, save |
includes/class-action-scheduler-handler.php | Async queue + complete/failed actions |
includes/class-rest-api.php | Editor convert/status |
includes/class-rewrite-rules.php | Public URL intercept |
includes/class-content-discovery.php | Discovery metadata |
includes/class-wp-cli-commands.php | Single-post CLI |
includes/class-bulk-cli-command.php | Bulk process (dry-run default) |
Related
- REST API
- Plugin README — hooks and CLI details