Skip to content

Pro Filters — AI, Review Forms & Testimonial Video ​

These filters live in WP Social Ninja Pro. They only run when Pro is active.

AI review summaries ​

wpsocialreviews/openai_summarizer_prompt ​

wpsocialreviews/openai_summarizer_prompt — Customize the AI summary prompt

When it runs: Applied when Pro builds the prompt sent to the AI provider to summarize reviews. Return a modified prompt string.

Parameters:

  • $prompt (string): the prompt text.

Source: Pro Services/AI/AIReviewSummarizer.php / AIReviewSummarizerHelper.php

Usage:

php
add_filter('wpsocialreviews/openai_summarizer_prompt', function ($prompt) {
    return $prompt . "\nKeep the summary under 40 words.";
});
Other AI filters — prompts, timeout, cache
FilterPurpose
wpsocialreviews/openai_promptBase OpenAI prompt
wpsocialreviews/openrouter_summarizer_promptOpenRouter summary prompt
wpsocialreviews/openai_timeoutRequest timeout
wpsocialreviews/ai_summary_cache_dataThe cached summary payload
wpsocialreviews/ai_summary_cache_expiration_timeSummary cache TTL
wpsocialreviews/ai_summarizer_reviews_parameterWhich reviews feed the summarizer
wpsocialreviews/openrouter_prompt 4.5.0The OpenRouter messages array (see below)
wpsocialreviews/wordpress_ai_summarizer_prompt 4.5.0WordPress AI system instruction

Source: Pro Services/AI/*

Changed in 4.5.0 — OpenRouter takes messages

OpenRouter requests now go to its chat endpoint, so wpsocialreviews/openrouter_prompt filters a messages array: a system message holding the openrouter_summarizer_prompt text, then a user message holding the reviews as JSON. Return the same shape: a list of ['role' => …, 'content' => …].

php
add_filter('wpsocialreviews/openrouter_prompt', function ($messages) {
    $messages[0]['content'] .= "\nAnswer in French.";
    return $messages;
});

wpsocialreviews/ai_default_model 4.5.0 ​

wpsocialreviews/ai_default_model — The model used when "Default" is selected or a model is retired

When it runs: Applied by AIReviewSummarizerHelper::getDefaultModel(). Pro uses this model in two cases: the platform's model is set to Default, or the saved model has been retired or is no longer listed. The same value labels the Default (currently …) option at the top of each platform's model list. Return '' for a platform with no default, and the option is not shown.

Parameters:

  • $model (string): the default model id. It is gpt-6-luna for openai, openai/gpt-6-luna for openrouter, and '' for any other platform (WordPress AI uses its own model).
  • $platform (string): the stored platform value.

Source: Pro app/Services/AI/AIReviewSummarizerHelper.php

Usage:

php
add_filter('wpsocialreviews/ai_default_model', function ($model, $platform) {
    return $platform === 'openrouter' ? 'anthropic/claude-haiku-5-5' : $model;
}, 10, 2);

TIP

Return a model id the provider actually serves. Pro does not check the value, so a typo makes every Default summary fail. With '', the saved model is sent unchanged and retired models do not fall back to anything.

wpsocialreviews/ai_summarizer_api_settings_option changed 4.5.0 — The AI platform and model catalogue

When it runs: Applied by core GlobalSettings::getAISummarizerAPISettingsOptions(), both for the AI settings screen and when Pro resolves the model to send. Core passes an empty ai_platforms list, and Pro's AIReviewSummarizerHelper::addAiPlatforms() replaces it at priority 10. Hook in at a later priority to add or retire models.

Parameters:

  • $options (array): has_wordpress_ai (bool, whether wp_ai_client_prompt() exists) and ai_platforms, a list of ['value', 'label', 'requires_api_key', 'models' => [...]]. Each model is ['value', 'label', 'status' => 'active'|'retired', 'note'].

Source: app/Services/GlobalSettings.php; Pro app/Services/AI/AIReviewSummarizerHelper.php

Usage:

php
add_filter('wpsocialreviews/ai_summarizer_api_settings_option', function ($options) {
    foreach ($options['ai_platforms'] as &$platform) {
        if (strtolower($platform['value']) === 'openai') {
            $platform['models'][] = ['value' => 'my-model', 'label' => 'My Model', 'status' => 'active', 'note' => ''];
        }
    }
    return $options;
}, 20);

A saved model with status => 'retired' falls back to wpsocialreviews/ai_default_model. So does a saved model that no longer appears in the list.

Changed in 4.5.0 — new value shape

Before 4.5.0 core filled this array itself, with the keys available_ai_platforms, open_ai_supported_models, open_router_supported_models and deepseek_supported_models. Those keys are gone. A callback that reads or appends to them now finds nothing. Move it to ai_platforms[*]['models'] and register it after priority 10.

WordPress AI 4.5.0 ​

The wordpress_ai platform sends summaries through the WordPress AI Client (wp_ai_client_prompt(), WordPress 7.0+). The site's AI connector holds the credentials, so Pro stores no API key for it. Its provider is SiteAiProvider.

wpsocialreviews/wordpress_ai_generate — Answer a WordPress AI request yourself

When it runs: Applied by SiteAiProvider::sendRequest() before the AI Client is called. Return a non-null value to skip the AI Client completely; Pro wraps your text in the usual response shape. When you return a value, the WordPress version and connector checks do not run either.

Parameters:

  • $result (null): return the summary text (a JSON string matching $schema) to short-circuit.
  • $userPrompt (string): Knowledgebase: followed by the reviews as JSON.
  • $systemPrompt (string): the system instruction (wordpress_ai_summarizer_prompt).
  • $schema (array|null): the JSON schema the answer must follow.
  • $model (string): the selected model.

Source: Pro app/Services/AI/Providers/SiteAiProvider.php

Usage:

php
add_filter('wpsocialreviews/wordpress_ai_generate', function ($result, $userPrompt, $systemPrompt, $schema, $model) {
    if (!function_exists('my_local_llm')) {
        return $result; // let the AI Client handle it
    }
    return my_local_llm($systemPrompt, $userPrompt, $schema);
}, 10, 5);

WARNING

A short-circuit return must be a non-empty string. Anything else makes Pro throw Invalid response data and the summary fails.

Review forms ​

Review-form filters — validation, submission data, spam protection

When they run: during Pro review-form submission handling.

FilterArgsPurpose
wpsocialreviews/review_form_validation_errors$errors, $data, $schemaAdd/modify validation errors
wpsocialreviews/review_form_submission_data$reviewData, $formTransform submitted data before save
wpsocialreviews/review_form_rate_limit5, $form->idSubmission rate limit
wpsocialreviews/review_form_spam_checkfalse, $data, $formCustom spam decision
wpsocialreviews/review_form_trusted_proxy_cidrs[]Trusted proxy CIDRs for client IP

Source: Pro Services/ReviewForms/*

Usage:

php
add_filter('wpsocialreviews/review_form_submission_data', function ($data, $form) {
    $data['fields']['utm'] = $_COOKIE['utm'] ?? '';
    return $data;
}, 10, 2);

Testimonial video 4.4.0 ​

Testimonial templates can carry a video. Pro renders it through Fluent Player when the template asks for it and the URL is one the player can handle; otherwise it falls back to an iframe, a file player, or a watch link.

wpsocialreviews/testimonial_fluent_player_atts — Attributes passed to Fluent Player

When it runs: Applied in TestimonialVideo::player() just before the Fluent Player embed is rendered, and only when the template selected Fluent Player and the URL passed the playability check. Return the modified attribute array.

Core sets source_poster (only for file URLs — a provider URL carries its own poster) and, when the template names a design media item, video_id.

Parameters:

  • $atts (array): the player attributes.
  • $url (string): the video URL.
  • $template_meta (array): the formatted template settings.

Source: Pro app/Services/Integrations/FluentPlayer/TestimonialVideo.php

Usage:

php
add_filter('wpsocialreviews/testimonial_fluent_player_atts', function ($atts, $url, $template_meta) {
    if (empty($url)) {
        return $atts;
    }
    $atts['muted'] = 'true';
    return $atts;
}, 10, 3);

INFO

If the embed renders empty, Pro discards it and falls through to the non-player markup — so a bad attribute degrades the output rather than blanking the testimonial.

wpsocialreviews/testimonial_fluent_player_can_play — Claim a host Fluent Player can handle

When it runs: The last branch of TestimonialVideo::fluentPlayerCanPlay(). Vimeo and YouTube are decided before the filter (both require a real video id in the path — a provider page carrying none would render an empty player shell), and file URLs are matched by extension. The filter exists for a media CDN host with no extension to go on. Return true to claim the URL.

Parameters:

  • $can_play (bool): false by default.
  • $url (string): the video URL.
  • $host (string): the bare host, www. stripped.

Source: Pro app/Services/Integrations/FluentPlayer/TestimonialVideo.php

Usage:

php
add_filter('wpsocialreviews/testimonial_fluent_player_can_play', function ($can_play, $url, $host) {
    if ($host === 'media.example.com') {
        return true;
    }
    return $can_play;
}, 10, 3);

WARNING

Claiming a host you cannot actually play produces an empty player instead of the iframe or watch-link fallback. Match on the host you control, and return $can_play unchanged otherwise.

The matching output seam is the wpsocialreviews/review_video action — see Template element rendering.

Imports & sources ​

WooCommerce import & custom-source filters
FilterPurpose
wpsocialreviews/max_batches_per_runWooCommerce import batches per run
wpsocialreviews/woo_import_batch_sizeImport batch size
wpsocialreviews/woo_import_max_retriesImport retry limit
wpsocialreviews/woo_import_use_bulk_insertToggle bulk insert
wpsocialreviews/wpsr_import_reviews_without_product_idImport reviews lacking a product ID
wpsocialreviews/ff_form_templatesFluent Forms custom-source templates

Source: Pro Services/Platforms/Reviews/WooCommerce/*, Services/CustomSources/*

WP Social Ninja Developer Documentation