Skip to content

Platform Services ​

Every platform WP Social Ninja supports — Google, Facebook, Instagram, YouTube, TikTok, and the rest — is implemented as a service that extends a shared base class. The base class handles the plumbing (auth, caching, cron, settings) so a platform integration only implements what's unique to it.

The three families ​

Platform services live under app/Services/Platforms/, grouped by what they produce:

FamilyDirectoryBase class
ReviewsServices/Platforms/Reviews/BaseReview
FeedsServices/Platforms/Feeds/BaseFeed
ChatsServices/Platforms/Chats/BaseChat

Each concrete platform typically ships a Config.php (credentials/verification) plus its main service class. For example TikTok mirrors this exactly at Services/Platforms/Feeds/Tiktok/{Config, TiktokFeed, Helper}.php, where TiktokFeed extends BaseFeed.

The registry ​

Services/Platforms/PlatformManager.php is the central registry. It resolves the list of feed and review platforms, their icons, official names, and demo templates. Platforms are made known to the plugin through filters:

  • wpsocialreviews/reviews_platforms
  • wpsocialreviews/available_valid_reviews_platforms
  • wpsocialreviews/available_valid_feed_platforms

See Filter Hooks → Platform Registry.

How a platform hooks in ​

A platform integration wires itself up in two complementary ways:

  1. Subclass a base class (BaseReview / BaseFeed / BaseChat) and call registerHooks() — this binds the platform's cron, settings, and rendering.
  2. Register on the dynamic _{platform} action seam — save_advance_settings_{platform}, verify_credential_{platform}, get_editor_settings_{platform}, etc. — so the admin UI and controllers route to your platform. See Action Hooks → Platform Settings Seam.

What's Next ​

WP Social Ninja Developer Documentation