Global Configuration

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

Most of Kirby SEO Audit is configured in your blueprints, per view button or field. config.php holds the options that apply to the whole site.

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 field on the same view shows the new report. The only trigger is publish. A blueprint can turn it on or off per view button or field with the analyzeOn property.

Default: none (no analysis runs on publish)

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. The logs appear in the browser console.

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

Proxy Configuration

The proxy fetches a preview URL whose 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

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. For Kirby inside a Docker container, 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. To authenticate against the preview URL:

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

Custom Plugin Translations

To overwrite a translation of the plugin, register it in the translations extension of a site plugin. The plugin's translations/en.json lists every key. Only the plugin's interface texts can be overwritten, not the result texts of the assessments.

To rename the Analyze button to "Run analysis" in English:

site/plugins/translations/index.php
use Kirby\Cms\App as Kirby;

Kirby::plugin('site/translations', [
    'translations' => [
        'en' => [
            'johannschopplich.seo-audit.analyze' => 'Run analysis'
        ]
    ]
]);

Name the folder so that it sorts after kirby-seo-audit, as translations does.