Global Configuration

Set the analysis to run on publish, the default log level, and the proxy that fetches pages from another origin.

Most of the SEO Audit configuration can be done in your blueprints per view button or section. Additionally, you can configure internal handling of the plugin globally in your config.php file.

Global Defaults

analyzeOn String

Runs the analysis on its own after the editor publishes their changes, so the rating keeps up with the content. Changing the status of a page does not count. The run is silent: no dialog opens and no notification appears. The dot and the rating update, and a section on the same view shows the new report. The only trigger is publish, and the option is off by default. A blueprint can turn it on or off per view button or section with the analyzeOn property.

site/config/config.php
return [
    'johannschopplich.seo-audit' => [
        'analyzeOn' => 'publish'
    ]
];

logLevel String

Default logging level for the analysis. Options: error, warn (default), info, and debug. Inspect the browser console to see the logs.

site/config/config.php
return [
    'johannschopplich.seo-audit' => [
        'logLevel' => 'info'
    ]
];

Proxy Configuration

For specific use cases, such as running Kirby inside Docker containers, you can adjust the proxy configuration globally. The proxy only runs when the preview URL's origin differs from the Panel's – a same-origin preview URL is fetched by the browser, and none of the options below apply.

urlResolver Closure

The urlResolver property accepts a closure that receives the preview URL and returns the URL the proxy fetches instead. It must return a non-empty string, otherwise the request fails. This is useful if you run Kirby inside Docker containers and need to point the URL at the host machine:

site/config/config.php
return [
    'johannschopplich.seo-audit' => [
        'proxy' => [
            'urlResolver' => function (string $url) {
                $uri = new \Kirby\Http\Uri($url);

                if ($uri->domain() === '127.0.0.1:3000') {
                    $uri->setHost('host.docker.internal');
                }

                return $uri->toString();
            }
        ]
    ]
];

params Array

Any parameter supported by Kirby's Remote::request() method can be passed to the proxy API. This is useful if you need to authenticate against the preview URL:

site/config/config.php
return [
    'johannschopplich.seo-audit' => [
        'proxy' => [
            'params' => [
                'basicAuth' => 'user:password'
            ]
        ]
    ]
];

Custom Plugin Translations

If you prefer to overwrite the default translations of the plugin, you can do so by adding translations for your language in the languages directory of your Kirby installation.

See the plugin's translations.php for the full list of translation keys.

For example, to change the translation of the analyze button to Run analysis in English, append the following translations array to the languages/en.php file:

languages/en.php
return [
    'code' => 'en',
    'name' => 'English',
    // ... Other language configuration
    'translations' => [
        'johannschopplich.seo-audit.analyze' => 'Run analysis'
    ]
];