Advanced2min read
Architecture
Internal plugin architecture — class structure, modules and the AI proxy flow.
Plugin Architecture
text
schemafy/
├── 1.0.1.php # Main plugin file
├── includes/
│ ├── class-baseo-core.php # Main orchestrator
│ ├── class-baseo-database.php # Database operations
│ ├── class-baseo-admin.php # Admin interface + AJAX handlers
│ ├── class-baseo-validator.php # JSON + Schema.org validation
│ ├── class-baseo-schema-injector.php # Frontend head injection
│ ├── class-baseo-seo-detector.php # Detects Yoast, Rank Math, etc.
│ ├── class-baseo-rest-api.php # REST API endpoints
│ ├── class-baseo-meta-box.php # Post editor meta boxes
│ ├── class-baseo-gutenberg.php # Gutenberg sidebar
│ ├── builders/
│ │ ├── class-baseo-field-generator.php # Form field generation
│ │ └── class-baseo-schema-builder.php # Smart Builder logic
│ ├── ajax-handler-save-update.php # Save/update handlers
│ └── ajax-handler-dashboard.php # Dashboard handlers
├── assets/js/modules/
│ ├── admin-modular.js # Entry point
│ ├── core/init.js # Tab management
│ ├── dashboard/dashboard.js # Dashboard UI
│ ├── bulk/bulk-manager.js # Bulk operations
│ ├── operations/schema-crud.js # CRUD
│ ├── editor/manual-editor.js # JSON editor
│ ├── ai/ai-generator.js # AI generation
│ ├── builder/smart-builder.js # Visual builder
│ └── import-export/csv-handler.js # CSV tools
└── templates/builder/field-configs/ # JSON config per schema typeAI Generator proxy flow
text
WordPress plugin
│ POST: page content
▼
endpoint-schemafy.vercel.app ← API key stored here (never in the plugin)
│ Calls GPT-4o with schema-specific prompt
▼
OpenAI
│ Returns validated JSON-LD
▼
Plugin → review UI → user approves → saved to databaseWhat happens when a page loads
- WordPress receives the page request
- Schemafy queries
wp_baseo_custom_schemasfor active schemas matching the current URL - Matching schemas are serialized as JSON-LD
- JSON-LD is injected into
<head>viawp_headat priority 5 - Meta tags are injected at priority 1, social tags at priority 2
- The visitor sees no difference — JSON-LD is invisible to humans
- Google reads it and may use it for rich results
Was this page helpful?
Thanks for the feedback!