Global Configuration
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)
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.
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:
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:
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:
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.