Hooks reference

Every action and filter the plugins provide, with examples you can copy. All names start with siteryn_ai_product_recommendations_.

FreePro

Engine

HookArgumentsUse
…_strategy$strategy, Context $cReplace or wrap the ranking strategy
…_candidates$candidates, $source_idsAdd or remove candidates (also sent to the AI)
…_rule_score$score, $product, Context $cAdjust a rule-based score
…_results$ids, Context $cReorder, remove or add products (re-validated afterwards)
…_is_recommendable$ok, $productExclude products everywhere, including cached lists and AI picks
…_schedule_ranking$schedule, Context $cStop a placement from queueing AI rankings
…_ranking_generated (action)$product_id, $rankingAfter an AI ranking is saved

AI

HookArgumentsUse
…_providers$providersRegister providers
…_provider_configProviderConfigThe config used for rankings
…_prompt_payload$payload, $sourceThe product data sent (source, candidates, max_items)
…_system_prompt$system, $versionThe system instructions
…_max_retries$retries, $provider_id0–2 retries
…_allow_private_endpoint · …_allow_insecure_local_endpoint$allow, $urlSelf-hosted models

Rendering & templates

HookArgumentsUse
…_product_page_position{hook, priority}Move the product page list
…_placement_args$args, $placementThe product page list's limit (1–24), title, columns, columns_tablet (1–4), columns_mobile (1–2), class, layout (grid or compact) and title_align
…_template_args$args, Context $cVariables passed to the list template
…_html$html, Context $c, $idsThe final list HTML
…_card_button_attributes$attrs, $product, $placementAttributes on the card's add to cart button
…_card_after_body (action)$product, $placement, $layoutAdd content to cards
…_locate_template$template, $template_nameThe template file used (theme copy or bundled)
…_before_template · …_after_template (actions)$template_name, $argsOutput around each template
…_bundled_templates$templatesTemplates checked for outdated theme copies

Lifecycle & settings

…_loaded, …_upgrade, …_deactivate (actions); …_settings_get_all, …_settings_sections, …_settings_fields, …_render_field_{type}, …_sanitize_field_{type}, …_settings_save_redirect, …_settings_reset_actions, …_settings_nav_visible / _nav_badge / _nav_icon / _nav_sublabel, …_settings_description, …_settings_before_form / _after_form, …_settings_main_after, …_settings_sidebar / …_settings_sidebar_{section} (actions), …_icons, …_nav_icons, …_status_cards. Shared by every Siteryn plugin: siteryn_dashboard_plugins and siteryn_deactivation_feedback_endpoint.

Pro

HookUse
…_pro_loaded · …_pro_upgrade · …_pro_deactivateLifecycle
…_pro_license_activated · …_pro_license_deactivatedLicense changes
…_pro_client_ipThe visitor IP used for rate limits (set it behind a CDN)
…_pro_admin_configAdmin script config
…_pro_fbt_build · …_pro_fbt_weekly · …_pro_license_checkScheduled jobs

Examples

Never recommend a category

add_filter( 'siteryn_ai_product_recommendations_is_recommendable', function ( $ok, $product ) {
	return $ok && ! has_term( 'gift-cards', 'product_cat', $product->get_id() );
}, 10, 2 );

Boost high-margin products

add_filter( 'siteryn_ai_product_recommendations_rule_score', function ( $score, $product, $context ) {
	return 'yes' === $product->get_meta( '_high_margin' ) ? $score + 3 : $score;
}, 10, 3 );

Move the product page list

add_filter( 'siteryn_ai_product_recommendations_product_page_position', function () {
	return array( 'hook' => 'woocommerce_after_single_product', 'priority' => 5 );
}, 20 ); // above 10 to override Pro's Position setting

Send the brand to the AI

add_filter( 'siteryn_ai_product_recommendations_prompt_payload', function ( $payload, $source ) {
	foreach ( $payload['candidates'] as &$candidate ) {
		$candidate['brand'] = (string) wc_get_product( $candidate['id'] )->get_attribute( 'pa_brand' );
	}
	return $payload;
}, 10, 2 );

Tag add to cart clicks from lists

add_filter( 'siteryn_ai_product_recommendations_card_button_attributes', function ( $attrs, $product, $placement ) {
	$attrs['data-siteryn_source'] = $placement;
	return $attrs;
}, 10, 3 );

Pro: real visitor IP behind Cloudflare

add_filter( 'siteryn_ai_product_recommendations_pro_client_ip', function ( $ip ) {
	return isset( $_SERVER['HTTP_CF_CONNECTING_IP'] )
		? sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) )
		: $ip;
} );