Appearance
WP Social Ninja Developer Guide β
Welcome to the complete developer guide for WP Social Ninja β the all-in-one WordPress plugin for social feeds, business reviews, testimonials, and chat widgets. This guide takes you from understanding the fundamentals to building sophisticated integrations and custom functionality across the whole plugin family.
What is WP Social Ninja? β
WP Social Ninja aggregates social media feeds, business reviews, chat widgets, testimonials, and shoppable content from 12+ platforms β Google, Facebook, Instagram, TikTok, YouTube, Airbnb, Yelp, TripAdvisor, Amazon, AliExpress, Booking.com, and WooCommerce β and displays them anywhere on a WordPress site.
Under the hood it runs on WPFluent, a Laravel-inspired mini-framework with a service container, REST routing, policies, an Eloquent-like ORM, and migrations. If you have used Laravel, extending WP Social Ninja will feel familiar.
Why Extend WP Social Ninja? β
WP Social Ninja is designed to be highly extensible. Whether you are customizing a client site or building a commercial add-on, the plugin exposes clean, well-defined extension points instead of forcing you to modify core files.
π§ Built for Customization β
- Extensive hook system β dozens of action and filter hooks across reviews, feeds, chat, and templates.
- Template override seam β every rendered element (avatar, rating, content, mediaβ¦) is an action hook you can replace.
- RESTful API β a policy-authorized REST namespace you can extend with your own endpoints.
- WordPress-native β follows WordPress coding standards and the plugin's own
wpsr_conventions.
ποΈ Flexible Extension Points β
- New platforms β subclass
BaseReview/BaseFeedand register via the dynamic per-platform settings hooks. - Custom output β override any template element hook to change how a review or feed item renders.
- Data integrations β react to review/template/widget lifecycle hooks to sync data elsewhere.
- Custom endpoints β register REST routes for external apps or mobile clients.
πΌ The Plugin Family β
- No lock-in β your customizations live in your own plugin, hooking a stable API.
- Pro-aware β the same hook seam that powers the free templates is where Pro layers its premium features.
- Complete control β modify any aspect of the output to match your design.
The Three Plugins β
WP Social Ninja ships as a family of plugins. This documentation covers all three.
WP Social Ninja (Free Core) β
The foundation. Slug: wp-social-reviews. Provides the WPFluent framework, REST API, admin Vue SPA, migrations, and most platforms.
- β Social Feeds β Facebook, Instagram, Twitter/X, YouTube
- β Business Reviews β Google, Facebook, Yelp, and more
- β Testimonials & Chat Widgets
- β Shortcode & template system
- β Full developer API β hooks and REST endpoints
WP Social Ninja Pro β
Slug: wp-social-ninja-pro. A premium add-on that boots off the free core and layers in advanced features by hooking the same wpsocialreviews/ seam.
- π Premium platforms & templates
- π Native review-collection forms (
[wpsr_review_form]) - π AI review summaries (OpenAI / OpenRouter)
- π WooCommerce & FluentCart product reviews, custom sources, managers
- π Licensing & updates
Pro refuses to boot unless a compatible core version is active β see Core β Pro Coupling.
Custom Feed for TikTok β
Slug: custom-feed-for-tiktok. A standalone free TikTok feed plugin that versions independently (1.x.x) and renders through the core shortcode. See Custom Feed for TikTok.
Core Development Concepts β
π Data Architecture β
WP Social Ninja stores its data in a small set of custom wpsr_ tables plus WordPress postmeta and options:
- β Reviews (
wpsr_reviews) β every review, testimonial, and custom review. - ποΈ Caches (
wpsr_caches) β feed/API response cache with expiration. - π Review Forms (
wpsr_review_forms) β native review-collection form definitions. - πΌοΈ Optimized Images (
wpsr_optimize_images) β locally optimized media records. - Templates & widgets β stored as WordPress posts with
_wpsr_*post meta.
See the Database Schema for the full column-by-column reference and an interactive ER diagram.
π How a Request Flows β
plugins_loaded β Application boots β wp_social_reviews_loaded(_v2)
rest_api_init β routes.php β api.php β Router registers routes
HTTP request β Policy β Controller β Service β Model β Cache/DB β JSONRead the full walkthrough in Request Lifecycle.
π Extension Points β
There are several ways to extend WP Social Ninja:
- WordPress hooks β actions and filters for events and output.
- REST API β register your own endpoints.
- Platform services β add a platform by subclassing a base class.
- Shortcodes β render templates programmatically with
[wp_social_ninja].
Directory Structure β
Understanding the core plugin (wp-social-reviews) layout:
wp-social-reviews/
βββ wp-social-reviews.php # Entry point β defines constants, requires boot/app.php
βββ boot/
β βββ app.php # Creates the Application, fires bootstrap hooks
β βββ globals.php # Framework-independent global helpers (loaded first)
βββ config/
β βββ app.php # App config incl. rest_namespace / rest_version
β βββ database.php # Database config
βββ app/
β βββ Http/
β β βββ Controllers/ # REST controllers
β β βββ Routes/api.php # All REST endpoints (policy-authorized)
β β βββ Policies/ # Authorization policies
β βββ Services/Platforms/ # Reviews / Feeds / Chats integrations
β βββ Models/ # Eloquent-like models (wpsr_ tables)
β βββ Hooks/Handlers/ # WordPress hook handlers
β βββ Views/ # PHP template files
βββ database/Migrations/ # Schema migrations (classmap autoloaded)
βββ resources/ # Vue admin SPA, public JS, SCSS
βββ vendor/wpfluent/ # The WPFluent frameworkA deeper tour is in Directory Structure.
Development Environment Setup β
Prerequisites β
- WordPress 5.0+ β a modern WordPress installation
- PHP 7.4+ β the plugin's minimum (PHP 7.0 is explicitly blocked)
- Node.js + npm β for the front-end build
- Composer β for PHP dependencies
- Basic WordPress development β hooks, plugins, and the REST API
Install & Build β
bash
# Install dependencies
npm install
composer install
# Development watch mode
npx mix watch
# Production build
npx mix --production
# Full release build (free + pro)
sh ./build.sh --node-build --with-proThe front end is compiled with Laravel Mix 6 (webpack.mix.js) β Vue 3 + Element Plus for the admin SPA, React for Gutenberg blocks.
PHP Quality Gate β
A pre-push hook runs PHPStan (level 2) and PHPCS (PHPCompatibility 7.4β8.4) on every push that touches PHP files. See dev/README.md in the core plugin for setup and manual run commands. Run it before pushing to catch issues early.
Coding Conventions β
These conventions are mandatory and keep contributions consistent.
Naming Prefixes β
| Layer | Prefix | Example |
|---|---|---|
| CSS/HTML classes & IDs | wpsr- | wpsr-card-title |
| PHP variables/functions | wpsr_ | wpsr_process_order() |
| JS variables/functions | wpsr camelCase | wpsrProductIds |
| Database tables | wpsr_ | wpsr_reviews |
| WordPress options | wpsr_ | wpsr_reviews_google_settings |
| Hook / filter namespace | wpsocialreviews/ | wpsocialreviews/backend_sanitized_values |
Validation & Sanitization β
- Never assume an ID has a value β
continueon empty in loops, earlyreturnin functions, validate before DB queries and API calls. Useempty()in PHP,!valuein JS. - Sanitize backend input with
wpsr_backend_sanitizer()and a sanitize map. - Persist options with autoload disabled:
update_option($key, $value, 'no'). - Sanitize style/CSS config with the
wpsr_sanitize_*helpers β see Sanitizers.
PHP Patterns β
- Namespaces:
WPSocialReviews\App\(application),WPSocialReviews\Framework\(framework). - Helper aliases:
GlobalHelperandServicesHelperboth map toApp\Services\Helper. - Platform services extend base classes β see Platform Services.
boot/globals.phploads before the framework, so never call framework services from it.
Getting Started Checklist β
π Read the fundamentals
- [ ] Understand the architecture and request lifecycle
- [ ] Review the database schema and models
- [ ] Skim the global helpers
π Explore the hooks
- [ ] Browse action hooks
- [ ] Study filter hooks
- [ ] Try overriding a template element hook
ποΈ Build your first extension
- [ ] React to
wpsocialreviews/custom_review_created - [ ] Register a REST endpoint
- [ ] Scaffold a platform service
Community & Support β
- User Documentation β the site-owner guide
- WP Social Ninja Website β product & support
Versions at time of writing
Core, Pro, WPSOCIALREVIEWS_CORE_MIN_VERSION, and WPSOCIALREVIEWS_PRO_MIN_VERSION are all 4.4.0; the database schema version (WPSOCIALREVIEWS_DB_VERSION) is 122; Custom Feed for TikTok is 1.2.5. Always check the plugin headers for the versions you target.

