Skip to content

Architecture Overview ​

WP Social Ninja is built on a custom WPFluent framework rather than procedural WordPress code. If you have used Laravel, most of this will feel familiar: there is a service container, request routing, controllers, policies, an Eloquent-like ORM, and migrations.

The big picture ​

wp-social-reviews.php          → defines constants, requires boot/app.php
  boot/app.php                 → creates the Application, registers activation hooks,
                                 fires wp_social_reviews_loaded(_v2) on plugins_loaded
  boot/globals.php             → framework-independent global helpers (loaded first)
  app/                         → application code (MVC + services)
    Http/Controllers/          → REST controllers
    Http/Routes/api.php        → all REST endpoints (policy-authorized)
    Http/Policies/             → authorization policies
    Services/Platforms/        → platform integrations (Reviews / Feeds / Chats)
    Models/                    → Eloquent-like models (wpsr_ tables)
    Hooks/Handlers/            → WordPress hook handlers
    Views/                     → PHP templates
  database/Migrations/         → schema migrations (classmap autoloaded)
  resources/                   → Vue admin SPA, public JS, SCSS
  vendor/wpfluent/             → the framework itself

Layers ​

  • Framework (WPSocialReviews\Framework\) — the WPFluent foundation: the Application container, routing, request/response, the query builder & ORM, and migration runner. Covered in WPFluent Framework.

  • Application (WPSocialReviews\App\) — everything specific to WP Social Ninja: controllers, policies, models, platform services, and hook handlers.

  • Presentation — a Vue 3 + Element Plus admin SPA under resources/admin/, React Gutenberg blocks, and public-facing templates/JS that render feeds, reviews, and widgets on the front end.

How a request flows ​

  1. WordPress loads plugins and fires plugins_loaded.
  2. The core boots the Application and fires wp_social_reviews_loaded / _v2.
  3. Admin AJAX/REST requests are routed through app/Http/Routes/api.php, authorized by a policy, and dispatched to a controller.
  4. Controllers call platform services (which extend base classes) to fetch/normalize data, cache it, and store reviews/feeds in the wpsr_ tables.
  5. Front-end output is rendered via shortcodes and PHP views.

Read on:

WP Social Ninja Developer Documentation