Skip to content

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 / BaseFeed and 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 β†’ JSON

Read the full walkthrough in Request Lifecycle.

πŸ”Œ Extension Points ​

There are several ways to extend 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 framework

A 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-pro

The 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 ​

LayerPrefixExample
CSS/HTML classes & IDswpsr-wpsr-card-title
PHP variables/functionswpsr_wpsr_process_order()
JS variables/functionswpsr camelCasewpsrProductIds
Database tableswpsr_wpsr_reviews
WordPress optionswpsr_wpsr_reviews_google_settings
Hook / filter namespacewpsocialreviews/wpsocialreviews/backend_sanitized_values

Validation & Sanitization ​

  • Never assume an ID has a value β€” continue on empty in loops, early return in functions, validate before DB queries and API calls. Use empty() in PHP, !value in 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: GlobalHelper and ServicesHelper both map to App\Services\Helper.
  • Platform services extend base classes β€” see Platform Services.
  • boot/globals.php loads before the framework, so never call framework services from it.

Getting Started Checklist ​

πŸ“– Read the fundamentals

πŸ” Explore the hooks

πŸ—οΈ Build your first extension

Community & 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.

WP Social Ninja Developer Documentation