Magento 2 AI Review TranslatorMagento 2 AI Review Translator
Live Demo
Buy Now
Support
Live Demo
Buy Now
Support
  • Getting Started

    • Introduction
    • Key Features
    • How It Works
  • Installation

    • Requirements
    • Install the Module
    • Install the AI Packages
    • Enable & Compile
    • Verify the Installation
    • Content Security Policy
    • Translating the Interface
  • Setup

    • Enable the Module
    • Activate Your Licence
    • Select an LLM Provider
    • Validate & Load Models
    • First Translation
  • Configuration

    • Overview
    • General Settings
    • Limits & Timeouts
    • Store Views & Languages
    • Admin Menu
    • Access Control
  • LLM Providers

    • Provider Overview
    • How Validation Works
    • Choosing a Model
    • Switching Providers
  • Ollama (Self-Hosted)

    • Install Ollama
    • Connect to Magento
    • Timeouts & Batch Size
    • Troubleshooting
  • Translating Reviews

    • Translation Basics
    • What Is Sent to the Model
    • Fallback Behaviour
    • Automatic Translation
    • The Queue Consumer
    • Running the Consumer
    • Bulk CLI Command
    • Batch Size
    • CLI Output & Exit Codes
  • Storefront

    • On the Storefront
    • The Toggle
    • Styling
  • Developers

    • GraphQL API
    • Querying from Code
    • Data Model
    • Useful SQL
  • Help

    • Setup Problems
    • Translation Problems
    • Queue Problems
    • Storefront Problems
    • FAQ

Content Security Policy

Skip this page unless your store runs CSP in restrict mode. Most stores run it in report-only mode, where nothing here applies.

Why it matters

In restrict mode the browser blocks resources that are not explicitly allowed. The extension's storefront JavaScript is served from your own domain, so it is allowed by default — but the admin-side connection to your LLM provider is made from PHP, and the host it dials has to be known to the compiled configuration.

The order that works

  1. Open Stores → Configuration → Webkul → AI Review Translation.
  2. Save the provider host and port — for Ollama this is the Ollama Endpoint.
  3. Only then recompile:
php bin/magento setup:di:compile
php bin/magento cache:flush

Compile after saving, not before

Compiling first bakes in the previous, empty host. The symptom is a connection that validates from the command line but fails from the admin.

Adding a host manually

If you need to whitelist the provider yourself, add a csp_whitelist.xml to a custom module:

<policies>
    <policy id="connect-src">
        <values>
            <value id="llm-provider" type="host">api.openai.com</value>
        </values>
    </policy>
</policies>

Then php bin/magento setup:di:compile and cache:flush.

Next: Translating the Interface.

Prev
Verify the Installation
Next
Translating the Interface