Skip to content

Architecture

The plugin operates as part of a three-tier architecture:

RecMan (app.recman.no)
|
v
Bonsy API (recman-api.bonsy.no) ← enriches, translates, caches, validates
|
v
WordPress Plugin (your site) ← caches locally, renders on frontend
|
v
Your Visitors ← see the jobs

The plugin never talks directly to RecMan. All communication goes through the Bonsy API middleware.

The Bonsy API acts as an intelligent layer between RecMan and your site:

  • Fetches and normalizes data from the RecMan API
  • Cleans HTML — sanitizes job descriptions for proper rendering
  • Generates excerpts — ~200 character previews with sentence-boundary detection
  • Translates field values — sector, employment type, location, etc.
  • Creates permalinks — URL-friendly slugs from job titles
  • Formats apply URLs — direct links to the application form
  • Normalizes social links — ensures HTTPS for Facebook, LinkedIn, Twitter, Instagram
  • Calculates similar jobs — weighted matching across 14 fields
  • Generates search indexes — lowercased, compressed strings for client-side search
  • Validates licenses — checks API key permissions and license expiration
  • Handles sorting — by post ID, updated date, or start date
  • Manages expired jobs — configurable retention of recently expired postings

The Bonsy API maintains a 5-minute server-side cache per client. Both processed and raw JSON are cached. Cache can be flushed with ?flush=1.

The plugin handles the client-side:

File-based JSON cache in wp-content/cache/bonsy-recman/ with time-of-day aware refresh intervals. Falls back to cached data if the API is unreachable.

Two approaches for rendering jobs:

  1. Shortcodes — drop into any page, customizable HTML/CSS from admin
  2. Template functions — PHP API following WordPress conventions

Generates page titles, canonical URLs, meta descriptions, Open Graph tags, and Twitter Cards. Aware of Yoast SEO and The SEO Framework.

Creates clean URLs for individual job posts and handles expired job redirects.

Tabbed dashboard for managing settings, viewing cache, editing templates, and monitoring jobs.

The plugin follows a single-responsibility class architecture:

ClassResponsibility
Recman_Api_ClientAPI communication
Recman_Cache_ManagerLocal caching
Recman_Job_FilterFiltering logic
Recman_Job_RepositoryData access
Recman_Job_IteratorLoop/iteration
Recman_SeoSEO metadata
Recman_RewriteURL rewriting
Recman_PostCustom Post Type
  • WordPress nonces on all admin actions
  • Capability checks on admin pages
  • Input sanitization and output escaping throughout
  • RecMan API key stored on Bonsy server, not in WordPress
  • Timing-safe comparison for cache flush authentication
  • Secret key authentication for CPT cron endpoint
ComponentRequirement
WordPress6.4.1+
PHP8.0+
DependenciesNone (zero JS or PHP dependencies)