Page:
Architecture
Clone
Architecture
Package Structure
pkg_mokoog
com_mokoog -- Admin component (dashboard, CRUD, batch, CSV)
plg_system_mokoog -- System plugin (frontend meta tag injection)
plg_content_mokoog -- Content plugin (editor form fields, live preview)
plg_webservices_mokoog -- WebServices plugin (REST API routes)
Data Flow
Frontend (onBeforeCompileHead)
- System plugin detects current page (
option,view,id) - Loads custom OG data from
#__mokoog_tags(language-aware) - Falls back to category/menu OG data if available
- Auto-generates missing fields from article/product content
- Resolves image URL, auto-resizes if enabled
- Emits OG, Twitter, LinkedIn, Discord, Telegram meta tags
- Builds JSON-LD schema (Article, Product, or WebPage)
- Fires
onMokoOGAfterRenderfor third-party extensions
Admin (content plugin)
- Content plugin adds OG fields tab to article/menu/category editor forms
- On save, stores custom OG data to
#__mokoog_tagswith language - Live preview updates Facebook/Twitter card preview in real-time
API
- WebServices plugin registers routes on
onBeforeApiRoute - JSON:API controller provides full CRUD + content lookup endpoint
- Field whitelist prevents information leakage
Key Classes
| Class | Location | Purpose |
|---|---|---|
| MokoOG | plg_system_mokoog | Main system plugin, meta tag injection |
| MokoOGContent | plg_content_mokoog | Editor form injection, OG data save/load |
| MokoOGWebServices | plg_webservices_mokoog | API route registration |
| TagsController | com_mokoog (admin) | Admin list publish/delete operations |
| BatchController | com_mokoog | Batch OG generation for existing articles |
| ImportExportController | com_mokoog | CSV import/export with language support |
| TagTable | com_mokoog | DB table with field validation |
| ImageHelper | plg_system_mokoog | Image resize, center-crop, validation |
| ImageGenerator | plg_system_mokoog | Text overlay image generation (GD) |
| JsonLdBuilder | plg_system_mokoog | Article, Product, WebPage, Breadcrumb schemas |
Database
Single table: #__mokoog_tags
- Unique key:
(content_type, content_id, language) - Supports:
com_content,com_content.category,menu,com_mokoshop - Language-aware queries prefer specific language over
*wildcard
Performance
loadArticle()andloadShopProduct()use static per-request caching- Article pages: 1 DB query instead of 5 (consolidated in v1.0)
- Batch processing capped at 200 per request
- Generated images cached by content hash in
images/mokoog/generated/