ahobitt / pagequality
Page Quality Assistant - SEO, GEO and accessibility checks for editors, with optional on-premise AI suggestions.
Package info
github.com/ahobitt/typo3_pagequality
Type:typo3-cms-extension
pkg:composer/ahobitt/pagequality
Fund package maintenance!
Requires
- php: ^8.3
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-mbstring: *
- ext-openssl: *
- psr/http-message: ^1.1 || ^2.0
- psr/log: ^3.0
- typo3/cms-backend: ^14.3
- typo3/cms-core: ^14.3
- typo3/cms-fluid: ^14.3
- typo3/cms-frontend: ^14.3
- typo3/cms-seo: ^14.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- ssch/typo3-rector: ^3.0
- typo3/cms-linkvalidator: ^14.3
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^9.0
Suggests
- typo3/cms-linkvalidator: Enables the broken link check (reads existing linkvalidator results)
- typo3/cms-scheduler: Runs the analysis and the metrics import in the background
Provides
None
Conflicts
None
Replaces
None
README
Deutsche Fassung: README.de.md
Rates a page in three equally weighted dimensions — findability (SEO), citability (GEO) and accessibility — and links every finding directly to the record that needs to change. Optionally, a self-hosted language model suggests meta descriptions.
The extension checks the rendered output of a page for findability, citability
and accessibility. It is not a 1:1 replacement for yoast_seo: Yoast SEO for
TYPO3 is actively maintained (v12 supports TYPO3 14). Taken over are the focus
keyphrase (here "main topic") including a migration, cornerstone ("key page")
and the snippet preview. Deliberately not, or not yet, taken over are the social
preview, internal linking suggestions and the generation of structured data —
the latter belongs in the site package or a schema extension; this extension
only checks it. Yoast, in turn, lacks the accessibility and GEO checks, the
preview of hidden pages and the analysis of the HTML that is actually
delivered.
Screenshots
In the page module: one status line above the content — three scores, the checked language, the time of the check.
Expanded: search result preview, the most urgent findings with a direct link to the field, and usage figures from Matomo — kept apart from the scores.
The full report under Content → Page Quality.
Meta description suggestions from a self-hosted language model. Each one is checked against the recommended length; nothing is saved automatically.
Bulk analysis on the command line, with fetch and total time per page version.
Requirements
- TYPO3 ^14.3
- PHP ^8.3
- The web server must be able to reach its own frontend (the analysis fetches the rendered page)
- Optional: an OpenAI-compatible inference endpoint (Ollama, vLLM, LiteLLM)
- Optional:
EXT:linkvalidatorfor the link check (without it, the check cleanly reports itself as unavailable)
Installation
Composer mode:
composer require ahobitt/pagequality vendor/bin/typo3 extension:setup vendor/bin/typo3 cache:flush
Classic mode: install ue_pagequality from the TYPO3 Extension Repository
via Admin Tools → Extensions → Get Extensions, or download it from
extensions.typo3.org
and upload it there. Then run Admin Tools → Maintenance → Analyze Database
Structure.
The extension deliberately ships no ext_emconf.php — it has been deprecated
since TYPO3 v14.2, and the metadata lives in composer.json (including
extra.typo3/cms.version and an empty providesPackages for classic mode).
TER uploads with Tailor 2.1 or later work without it.
Configuration
Everything is under Admin Tools → Settings → Extension Configuration → ue_pagequality.
| Key | Meaning |
|---|---|
analysis.requestTimeout |
Timeout when fetching the page to be checked |
ai.enabled |
Master switch. Off = no request ever leaves TYPO3 |
ai.baseUrl |
e.g. https://ollama.example.org (without /v1 or /api) |
ai.textModel |
Model identifier |
ai.siteDescription |
Who the website belongs to, added to the prompt — e.g. Website of a German university. Empty = neutral prompt |
ai.apiMode |
ollama (default) or openai — see below |
ai.contextLength |
Context window per request, native API only (default 8192) |
ai.maxTokens |
Maximum answer length in tokens (default 1000) |
ai.requestTimeout |
Be generous, local models take a while on a cold start |
ai.token |
Leave empty and set UE_PAGEQUALITY_AI_TOKEN instead |
ai.rateLimit |
Requests per backend user and hour |
Why the native Ollama API is the default. Thinking models such as Gemma 4
return an empty content field over the OpenAI-compatible endpoint
/v1/chat/completions and put the entire text into a separate reasoning
field — a known Ollama behaviour (issue #15288). The thinking mode can only be
switched off through the native API with "think": false. The native API also
allows setting the context window per request; Ollama's default is small enough
to cut off longer page texts silently. openai remains for servers that are
not Ollama, or for a gateway that only passes the OpenAI interface through. In
OpenAI mode, reasoning_effort: none is sent along — some models follow it
(Qwen 3.5), not all.
If an empty answer still comes back, the error message says why: thinking content only, token budget exhausted, or unknown.
Checking the request in the terminal:
vendor/bin/typo3 pagequality:suggest --page=20 --language=1 vendor/bin/typo3 pagequality:suggest --page=20 --show-prompt --raw
Takes the same path as the button in the backend — render the page, build the prompt, ask the model — but shows the configuration, the response time and, on failure, the raw exchange: which endpoint, what was sent, what came back. It bypasses the suggestion cache and the rate limit, so it always shows what the model is doing right now.
The token belongs in the environment, not in the database:
UE_PAGEQUALITY_AI_TOKEN=…
Usage and visibility (Matomo, Search Console)
Besides the quality of a page, the extension shows whether it is used and found. These numbers are kept strictly separate from the quality rating: they do not feed into any SEO, GEO or accessibility score. A good page with few visitors is not a bad page — perhaps its topic is simply rarely asked for.
| measures | source | feeds into the scores | |
|---|---|---|---|
| SEO, GEO, accessibility | quality of the page | rendered HTML | yes — these are the scores |
| Matomo, Search Console | usage and visibility | external services | no |
The two areas are deliberately not merged into an overall score. A combined grade of "well made" and "often visited" would be neither one nor the other, and an editor could not tell what to work on.
Setup
vendor/bin/typo3 extension:setup
In the extension configuration, set analytics.enabled,
analytics.matomo.enabled, analytics.matomo.baseUrl and
analytics.matomo.siteId. The token comes exclusively from the environment:
UE_PAGEQUALITY_MATOMO_TOKEN=...
For the token, create a dedicated Matomo user with read-only access ("view") to exactly this website, not an admin account. The token is only transmitted in the POST body, never appears in a URL and thus in no server or proxy log, and it is stripped from every error message.
Setting up Search Console
Authentication uses a Google Cloud service account — without user interaction, without expiring refresh tokens, and without Google's PHP library: the extension signs the authentication itself with OpenSSL.
-
In the Google Cloud Console, select or create a project and enable the Google Search Console API under "APIs & Services".
-
Create a service account. It needs no roles in the Cloud project.
-
Create a JSON key for the service account and store it outside the web root, readable only by the user that TYPO3 and the scheduler run as (
chmod 600). The extension rejects a file below the public directory — it could be downloaded from there. -
In Search Console, under Settings → Users and permissions, add the service account's e-mail address with restricted permission. Read access is enough.
-
Set the path to the file in the environment — the path, not the content:
UE_PAGEQUALITY_GSC_CREDENTIALS_FILE=/etc/typo3/secrets/search-console.json
-
In the extension configuration, set
analytics.searchConsole.enabledand the property, exactly as in Search Console:https://www.example.org/(URL prefix, with trailing slash) orsc-domain:example.org.
Only the read-only scope webmasters.readonly is requested. The service
account always acts as itself, never on behalf of a person. The token endpoint
is hard-coded and not read from the key file, so that a tampered file cannot
send the signed assertion to a foreign server. Tokens live for one hour and are
held only in the memory of the running command.
The most common messages and what they mean:
| Message | Cause |
|---|---|
| API is not enabled in the Cloud project | Step 1 is missing |
| The service account … has no access to the property | Step 4 is missing, or the property is spelled differently |
| invalid_grant – Invalid JWT Signature | Key revoked or file damaged |
| invalid_grant – … reasonable timeframe | The server clock is wrong; check NTP |
| quota is exhausted | Quota exhausted; the next run tries again |
Fetching
vendor/bin/typo3 pagequality:metrics vendor/bin/typo3 pagequality:metrics --page=2 --depth=2 --provider=matomo vendor/bin/typo3 pagequality:metrics --force
--page, --depth and --language work as for pagequality:analyse; both
commands use the same page tree traversal and the same language selection.
Without --force, pages whose current period is already complete are skipped —
failed providers are retried on the next run. Run it daily as a scheduler task,
after pagequality:analyse: the analysis stores the canonical URL that was
actually rendered, and the metrics use it without rendering the page again.
A provider that fails does not hold up the others. The command reports it, stores "error" instead of zero for the affected pages, and only ends with an error code if every provider failed for every page.
How it is calculated
Bulk request. Per provider and period, one request goes out that
returns the whole site (for Matomo Actions.getPageUrls with flat=1); the
rows are then matched by URL. Individual requests would mean thousands of
requests for thousands of pages.
Period. 28 full days, compared with the 28 days directly before. The period
ends three days before today (analytics.lagDays), because Search Console
publishes its numbers with a delay of two to three days; ending "yesterday"
would systematically understate the last days and distort every trend. Both
providers use the same period.
Which URL. Matomo counts the address that was actually requested, Search Console groups by canonical. The canonical is only used if it points to the page itself. If it points to another page, Google attributes the search data to that other page — taking it over here would count it twice. The page is then flagged. Comparison happens after normalisation: trailing slash, http/https, upper case in the host, percent encoding and tracking parameters do not matter; several recorded variants of one page are added up.
Which Search Console numbers. Clicks, impressions, click-through rate and average position, plus the top search queries. The page numbers come from one query over the whole property, paged in steps of 25,000 rows. Individual queries are only needed for the search queries, and only for pages that appeared in search at all — most pages of a large site never do. If the quota is exhausted, fetching the search queries stops immediately and the page numbers are kept. Several spellings of one page are merged correctly: clicks and impressions are added, the click-through rate is recalculated from the sums instead of averaged, and the position is weighted by impressions.
The search queries are deliberately called top search queries: the API returns the top rows, and Search Console omits rare queries entirely for privacy reasons. The listed clicks therefore usually add up to less than the page total.
Several hosts in one Matomo site. Rows with a full URL are matched only by
host and path, never by path alone. Only rows that Matomo returns without a URL
fall back to the path — if the site ID covers several hosts (such as www. and
blog.), this is ambiguous for such rows. In that case, check once against the
actual Matomo configuration.
Which Matomo numbers. Page views, entries and average time on page (weighted by page views when there are several variants). Unique and returning visitors are not taken over: they depend on recognising people, which Matomo can only estimate without cookies.
Trends. Counts as percentage change, the click-through rate in percentage points, the position with reversed direction — a smaller number is better. If the previous value is zero, "new" is shown instead of dividing by zero. If the previous period cannot be fetched, no trend is shown rather than a wrong one.
Status. Each provider has one of five states per page: data, no data, not returned, error, disabled. "No data" is a finding — the complete response did not contain the page. "Not returned" is not one: the Search Console response was cut off at the safety limit of 100,000 rows, and the page may lie beyond it. "Error" is not a finding either and is never shown as zero.
Completeness. A run without --force only skips a page if every
requested and enabled provider has a final result for the period. A
Matomo-only run therefore does not make a later Search Console run pointless,
and a provider that is switched on later is queried on the next run. Each
provider carries its own timestamp; "Last updated" names the oldest of the ones
shown.
Freshness of the URL. The address stored during the analysis is only used as long as the page has not changed since. After a slug change whose analysis failed, the metrics run queries the new route instead of the old one — otherwise the numbers of the old URL would end up under the new one. A deliberate gap: if the period of a page has already been fetched completely, it is not queried again on the same day, even after a slug change. Since the period moves on daily, this resolves itself the next day; the alternative would be to resolve the URL anew for every page on every run.
Display
In the page module the status line stays unchanged: three quality scores, nothing else. Only after "Show details" does the Performance section appear below the quality findings — period and last update, the numbers per provider with the change against the previous period, the three most frequent search queries and the hints. If only one provider is enabled, only that one appears; if analytics is switched off entirely, the section does not exist.
In the module a jump navigation divides the report into Quality, Performance and Google Search; the latter lists the ten top search queries as a table. No tabs: sections with headings are simpler, reachable directly by keyboard and screen reader, and the page stays searchable.
Neither the panel nor the module ever queries an external service — not even
when expanding. They read stored rows. If even that fails, for example because
extension:setup has not run yet after an update and the table is missing, a
notice appears; the page module and the quality report are not affected.
Changes are shown as an arrow with text, without red and green. Fewer page views are not bad per se, and the numbers should not be over-interpreted; only the quality traffic lights rate anything. The numbers follow the format of the backend language (12.430 in a German, 12,430 in an English backend). If the numbers are older than three days, a notice points out that the scheduler task has probably stopped running.
Hints
Simple rules, each with an observation and one thing to look into — no score,
no grade, no statement such as "this page is bad". The rules live in
AnalyticsInsightService; a new rule is a method.
| Hint | Condition (per 28 days) |
|---|---|
| Often shown, rarely clicked | ≥ 500 impressions and a click-through rate that is clearly low for the position: < 5 % up to position 3, < 2 % up to position 6, < 1 % up to position 10. Beyond position 10 a low rate is normal. |
| Potential for better rankings | ≥ 500 impressions, average position 5 to 15 |
| Lots of search traffic, weak SEO score | ≥ 100 clicks, SEO score below 70 |
| Key page, rarely visited | marked as key page, < 50 page views |
| Canonical points to another page | explains why the search data is missing |
The click-through threshold is deliberately position-dependent and set low: real click curves lie well above it, and only the clear cases are reported. The minimum volumes keep small pages out of the noise. And every rule only uses numbers that were actually fetched — if a service failed, no hint is created. Unknown is not zero.
No waiting in the backend
Neither the module nor the panel analyses while the page is being built. Rendering a page via HTTP can take many seconds on a large site; on a production site, opening pages without a stored report took 8 to 32 seconds, with nothing but the backend's loading bar. If a report is missing, the module opens immediately and starts the check in the browser — with a progress indicator, a seconds counter and, after 15 seconds, the note that the duration depends on how fast TYPO3 delivers the page.
So that editors don't have to wait at all, a frequent second scheduler task keeps the reports fresh:
# every 15 minutes: only pages without a report or changed since
vendor/bin/typo3 pagequality:analyse --page=1 --depth=99 --only-stale
--only-stale checks per page version, with a few fast database queries,
whether the stored report still matches the page, and renders only the rest.
Where the time goes. Each analysis measures its HTTP requests to the frontend individually and separately from the actual check. At the bottom, the module shows for example "The last check took 28.6 s: fetching the page 28.3 s (2 requests), checking 0.3 s". The command outputs the times as columns and lists the five slowest pages. If the time is spent almost entirely on fetching, TYPO3 renders the page slowly — or the route from the server to its own public address is long. The checks themselves take milliseconds.
Scheduler
By default, both commands check up to 20,000 pages (--limit). A lower default
once silently checked only the first 500 of almost 10,000 pages.
Both commands can be registered as scheduler tasks (Scheduler → New task → Execute console commands). The order matters, because the metrics use the canonical URL stored during the analysis:
# at night, quality first, then usage data vendor/bin/typo3 pagequality:analyse --page=1 --depth=6 \ && vendor/bin/typo3 pagequality:metrics --page=1 --depth=6
The command ends with an error code if every enabled provider failed for every page; disabled providers do not count.
pagequality:metrics skips pages whose period is already complete. A second
run on the same day therefore costs hardly any requests and only catches up on
what failed in the first.
Data protection
Only aggregated values per page and period are stored: no IP addresses, no
visitor IDs, no individual sessions. Earlier periods are kept for
analytics.retentionDays days (default 365, 0 = unlimited) and are removed
after each metrics run. Without this limit, one row per page version would be
added every day — with 5,000 page versions almost two million a year, although
only the most recent one is displayed and it already contains the comparison
period.
One limitation that belongs in the discussion with your data protection
officer: the top search queries are texts that people typed. Google filters out
rare queries, and only the ten most frequent per page are stored. On pages
about people, names may still appear among them — such as "Professor Miller
office hours". These are the names of publicly listed staff, not information
about the people searching. That is why search queries are off by default
(analytics.searchConsole.maxQueries = 0) — set it to e.g. 10 after agreeing
it with data protection. Each page with impressions then costs one extra
request per run.
No credentials end up in the database, in logs, in the backend or in URLs. The Matomo token travels only in the POST body, the Search Console token only in the Authorization header, and both are stripped from every error message. The object holding the private key hides it from every debug output.
Migrating from Yoast SEO
The focus keyphrase (here: main topic) and the cornerstone flag (here: key page) are taken over. Both fields sit in the page properties on the SEO tab, directly after the meta description — where editors are used to them from Yoast.
vendor/bin/typo3 extension:setup vendor/bin/typo3 upgrade:run uePageQuality_yoastMigration
The wizard never overwrites a value that is already set here, and does not touch the Yoast data. It is repeatable, but only for gaps: running it again takes over keyphrases from pages whose field here is still empty — newly created pages or pages that only now get a keyphrase in Yoast. If a keyphrase that has already been taken over is later changed in Yoast, that change no longer arrives; the value here takes precedence. The transition period should therefore be short: take over, check, then stop maintaining it in Yoast. Going back stays simple: keep Yoast.
The two fields follow different translation rules, and the wizard treats them accordingly:
- The main topic is translatable. Each row keeps its own value, an English page its English keyphrase.
- Key page applies across languages — a page either carries the site or it doesn't. The default language is decisive. Yoast stored the flag per row, so a translation can differ from its default language. The wizard counts such cases, reports them and aligns the translation. Because it writes via SQL, bypassing the DataHandler that would otherwise take care of this, it synchronises explicitly.
The main topic holds 255 characters. The Yoast source column is a tinytext
without a length limit in TCA; a shorter target would let MySQL in non-strict
mode truncate silently during the migration.
Before running it, it is worth checking whether synonyms and related keyphrases are used at all — they are not taken over:
SELECT MAX(CHAR_LENGTH(tx_yoastseo_focuskeyword)) AS max_length FROM pages; SELECT SUM(tx_yoastseo_focuskeyword_synonyms <> '') AS pages_with_synonyms FROM pages; SELECT COUNT(*) AS related_keyphrases FROM tx_yoastseo_related_focuskeyword;
Related keyphrases, synonyms and prominent words are not taken over.
What the fields do. seo.focusTopic checks the main topic against title,
headline, introduction, meta description, subheadings and page address — as one
message instead of Yoast's six individual ratings: "Missing in: meta
description, subheadings" says in one line what to do. Matching handles German
compounds and plural forms ("Lehramt" finds "Lehramtsstudium", "Studiengänge"
finds "Studiengang").
The key page changes the expectation: if an ordinary page lacks a main topic, nothing is reported — that is an editorial decision. If a key page lacks one, it is a problem. The flag is an exclude field, because deciding which pages carry the site is up to the editorial lead; the main topic, on the other hand, can be set by any editor.
Usage
"Fix this" opens only the affected fields. TYPO3 has no URL parameter for a
specific tab, and a tab would still leave the editor searching among its
fields. The link therefore uses columnsOnly to open a form with exactly the
fields of the finding: for a missing description the meta description, for the
title both page title and SEO title — because the template decides which one
is rendered. For the main topic, the topic appears together with the page
fields in which it is missing. Since v13, columnsOnly is passed as an array
per table; the former comma-separated string no longer works.
Copying works without HTTPS too. navigator.clipboard only exists in a
secure context, i.e. under HTTPS or localhost. A test system reached via
plain HTTP doesn't have it at all, and the call fails silently there.
clipboard.js uses the Clipboard API where it exists. If it does not, the text
stays selected and a message asks for Ctrl+C — never a click that does
nothing.
AI suggestions appear next to the finding. Directly below the meta description, with "Copy" for each suggestion and a link to the field. While the request is running, the button shows its loading state and below it the note that the first call can take up to a minute while the model is loaded. If the request fails, the server's message appears in the same place.
Panel in the page module. Above the content elements there is a single
line: the three scores with traffic lights, the checked language version, the
time of the check and "Show details". The panel sits between the editor and the
content she wants to edit — by default it is a status bar, not a report.
Expanded, it shows the number of problems and hints, the four most urgent
findings with a direct link, and the buttons to check and to open the full
report. Hooked in via ModifyPageLayoutContentEvent.
Expanded, the first thing shown is the search result preview: site name, address as breadcrumb, title and description, the way a search result shows them. Two decisions behind it:
- From the rendered HTML, not from the page fields. Templates usually append the site name to the title, and EXT:seo overrides it with the SEO title. A preview built from the fields would show a title that no search engine ever displays. That is why the snippet is stored with the report and, after a change, only becomes current with "Analyse again" — like the rest of the report.
- Truncated by the browser, not by character count. Search engines truncate by pixel width; "WWW" and "iii" have the same length but very different widths. A box with the width and font of a search result lets the browser measure. Screen readers still read the full text.
If the meta description is missing, the preview shows the page's introduction in italics — that is the excerpt a search engine is then most likely to choose itself — with a corresponding note. The desktop layout is shown; there is no mobile view.
Expanding is a native <details>: no JavaScript, keyboard-operable out of the
box, no backend request. The state is deliberately not remembered — every page
starts compact, because you usually want to edit it, not assess it.
The traffic light turns green from 90 points. That is deliberately strict: with the weights of the accessibility checks, a page with a single image without alternative text ends up at 79. A threshold of 75 showed it green — the editor would consider the page done while a screen reader fails at exactly that image.
The panel never checks on its own — otherwise every opening of the page module would send an HTTP request to the frontend. It shows the stored report, warns prominently if the page has changed since, and otherwise offers the button.
Page and language come from the request's PageContext, not from the query
parameters: the page module manages its language selection through it and
sends languages[], not language. The query parameters remain as a fallback,
and any error while reading the PageContext is swallowed — a quality panel
must not take the page module down with it.
In language comparison mode, the panel hides the scores and asks for a single
language to be selected. getPrimaryLanguageId() returns 0 both for "default
language" and for "several at once", so a score with a German label next to an
English-French side-by-side view would simply be misleading.
In a workspace the panel hides itself. The analysis renders the live frontend, not the workspace draft; a good score for content the editor isn't even working on would be worse than none.
The panel's AJAX endpoint is a separate one that does not require permission
for the quality module. Otherwise an editor with access to the page module
would see the button and get a 403 when clicking it. It is secured via
PageAccessService with webmount, PAGE_SHOW and backend language
permission.
Backend module under Content → Page Quality: select a page in the tree, read the report, jump directly to the affected record via "Fix this".
Bulk analysis for the central web team:
vendor/bin/typo3 pagequality:analyse --page=1 --depth=4
--language defaults to all: per page, the default language and every
language for which a translation record actually exists are checked. With a
fallback, a missing translation does render the default language, but storing
it under a second language ID would double the report and, above all, suggest
that the translation had been checked.
A single language still works with --language=1. Important: the language ID
is the one from your site configuration, not "0 means German" — if English is
the default language, English is 0.
The command can be registered as a scheduler task (schedulable: true). Run it
at night, and the work list is ready in the morning.
Architecture
Classes/
├── Analysis/ PageAnalyzer, PageDocumentFactory, ScoreCalculator,
│ ReadabilityAnalyzer + Readability/ profiles (German, English),
│ GermanDateExtractor, StructuredDateCollector,
│ PreviewTokenService, JsonLdWalker, PageChangeTimestampService
├── Analytics/ MetricsCollector, Matomo/ and SearchConsole/ providers,
│ AnalyticsInsightService, TrendCalculator, UrlNormalizer
├── Middleware/ PreviewMiddleware (frontend)
├── Check/ CheckInterface + 20 checks in Seo/ Geo/ Accessibility/
├── Ai/ SuggestionProviderInterface, OllamaClient, PromptFactory, RateLimiter
├── Backend/ module and AJAX controllers, presenters, page module event listener
├── Command/ AnalyzePagesCommand, UpdateMetricsCommand, SuggestDescriptionCommand
├── Domain/ AnalysisResultRepository, PageMetricsRepository, BrokenLinkRepository
├── Upgrades/ YoastMigrationWizard
├── Enum/ Model/ enums and value objects (excluded from DI)
└── Exception/
The decisions that explain the rest:
Server-side analysis of the rendered HTML. What is checked is what is delivered — including output of other extensions, TypoScript and the page template. Editorial source data alone would not show that.
Reports are not invalidated but marked as outdated. The page's tstamp at
the time of the check is stored. If the page changes, the module shows "Report
is older than the last change" instead of letting the report disappear.
Hidden pages are checked via a dedicated preview token. The public URL is fetched first — a live page is therefore analysed exactly as it is delivered. Only on 401/403/404 does the extension retry with an HMAC-signed token. Passing on the backend cookie would have been more obvious, but fails for the nightly CLI run, which has no session.
Redirects are not followed on the first fetch. TYPO3 can answer an access
error with a RedirectLoginErrorHandler that sends anonymous visitors to the
login page. If the extension followed it, it would get HTTP 200 and analyse the
login page as the content of the protected page — a formally valid, completely
wrong report without any error message. A 3xx is therefore treated like a 403:
try the preview first. If the preview returns 200, it was an access redirect.
If the preview redirects as well, it is an ordinary canonical or slash redirect
and is followed — but only to a host that belongs to one of the configured
sites (port included). Where a redirect leads is decided by whoever edits a
redirect record or a page; following it anywhere would let them make the web
server fetch an address of their choice, including one inside its own network,
and read parts of the answer in the report.
Only standard pages are analysed. Shortcuts, mount points and links to external URLs answer with a redirect, folders and spacers render nothing of their own. The page module panel does not appear on them, and the page tree walk of both commands descends through them without collecting them — so a section below a shortcut or a folder is still covered.
The URL is built with a preview-capable router context. The router loads the page record to build the slug — with an ordinary frontend context it cannot load a hidden or scheduled page and falls back to the site root. That answers with 200, so the preview fallback never kicks in, and the start page would be rated as the hidden page. The same silent failure type as with the login redirect, hence the same precaution as in the core preview: a cloned context with hidden and scheduled pages visible, used only for building the address.
The target URL is signed, not the page ID. The middleware runs before page
resolution and doesn't know the pageUid yet — it only knows the URL. An
earlier version read the pageUid from the token and checked against exactly
that value; the check was therefore tautological, and a token for one hidden
page opened any other. The pageUid still travels along as signed payload, but
is used solely to look up the fe_group. The URL is what authorises.
Preview responses are excluded from the page cache so that a hidden page is not
subsequently delivered publicly. The middleware removes the parameter from the
request and URI before page resolution runs, and it is additionally listed in
cacheHash.excludedParameters — with enforced cHash validation, an unknown
dynamic parameter would otherwise make exactly the second fetch fail that the
mechanism exists for.
The preview moves the clock instead of switching off scheduling.
includeScheduledRecords would make all scheduled records visible at once: on
a page that starts tomorrow, content that ended yesterday would sit next to
content that starts next week — a state the page never has. Instead, a preview
point in time is set (DateTimeAspect, SIM_ACCESS_TIME): for a future page
its starttime, for an expired one its last valid moment. That answers the
question editors actually ask — what will the page look like when it goes
live?
Time windows and access restrictions are resolved in one pass over the
rootline, because TYPO3 inherits them together via extendToSubpages: a
section that starts tomorrow also holds back its subpages until then. The
effective start is the latest, the effective end the earliest of all applicable
values.
The fe_group is collected over the entire rootline, because
extendToSubpages inherits the restriction downwards; the magic group −2,
which every logged-in frontend user carries, is simulated. The special case −1
("hide at login") deliberately does not trigger a simulation — a session would
hide exactly the page that is supposed to be rendered. Within one level,
fe_group is an OR condition: fe_group = "5,7" means "group 5 is enough,
group 7 is enough". Exactly one of the two is therefore simulated — simulating
both would not be wrong, but unnecessary, and could show content bound to one
of the groups. Across levels, however, the conditions are cumulative: a page
below a protected section must satisfy both, so every restricting level
contributes its own group.
This deliberately differs from TYPO3's own preview link, which only simulates
the nearest restriction — its ADMCMD parameter simply carries only one group.
What counts, however, is what TYPO3 does on access:
checkRootlineForIncludeSection blocks as soon as any rootline page with
extendToSubpages denies access. Anyone who can see a page below two
differently protected sections is therefore in one group per section.
Simulating only the nearest one would model a visitor who cannot reach the page
at all — the preview would then run into a 404.
nestedAccessRestrictionsAreAllSatisfied() in the functional tests settles the
question: the test passes with the cumulative resolution and fails with a
nearest-only one.
Traffic lights with text. Each dimension gets a coloured dot, the number, a status in words ("Good", "Room for improvement", "Needs work") and a bar. Colour never carries the message alone — a tool that checks WCAG 1.4.1 on other people's pages must not fail it itself. The colour tokens have a dark mode variant, because the v13+ backend knows both themes.
A logged-in session is simulated, not just a set of groups. A UserAspect
made only of groups leaves isLoggedIn() false, so conditions such as
[frontend.user.isLoggedIn] would still see an anonymous visitor. The group is
therefore also written into the FrontendUserAuthentication object itself
(user, userGroups), and the aspect is created via its createUserAspect()
— otherwise extensions and Fluid constructs such as f:security.ifHasRole,
which read the raw object, would still see a guest without groups. An existing
real session keeps its identity; the group is only added. The middleware runs
after frontend authentication so that the group simulation is not overwritten.
Readability is measured per language with the matching formula. German by
Amstad, English by Flesch Reading Ease, each with its own abbreviation list and
its own syllable heuristic. This lives in ReadabilityProfileInterface — another
language is one class. Sentence splitting, word counting and long-sentence
detection are language-independent and live in the shared
ReadabilityAnalyzer.
For languages without a profile, the check reports itself as not applicable
instead of outputting a number that looks authoritative and means nothing. The
same still applies to geo.structuredDataConsistency: the date recogniser only
understands German notations, and reporting "October 21, 2026" as a
contradiction would be worse than not checking.
AI suggestions follow the language of the page. The prompt takes the language tag from the site configuration; an English page gets an English system prompt. The language is part of the cache fingerprint.
A technical error is not "not applicable". If a check aborts, the result is
Severity::Error. Both leave the scoring, but they mean the opposite of each
other: "there was nothing to measure" versus "we could not measure". A
dimension with a failed check therefore shows no number at all, but "Not fully
measurable" — a defect that shows up as 100 points is the most dangerous kind
of error a quality dashboard can have. The console outputs n/a there. The
sort rank is attached to the enum itself (Severity::getSortOrder()) instead of
a lookup table: a new case makes match fail loudly instead of silently
leaving a gap — which is exactly how Error once turned into an undefined array
key when sorting.
Stored reports are displayed, not just dated. When a page is opened again,
the stored report is restored from the database and displayed; the outdated
notice is a banner above it, not a replacement for it. The comparison is made
against the maximum of pages.tstamp and the page's tt_content.tstamp,
because editing a content element does not touch the page's timestamp.
sys_file_reference is included too, because a changed alternative text would
otherwise stay invisible, as is content with sys_language_uid = -1. The
timestamp is read before rendering, so that a change during the request is
not stamped onto a report about the old state.
Not covered are records rendered by plugins (news, events, custom tables) as well as template and TypoScript changes. Only targeted invalidation via DataHandler events or cache tags would be reliable for that.
Contradictions are checked asymmetrically. geo.structuredDataConsistency
requires every date from the structured data to appear in the visible text —
not the other way round. The text may mention any number of further dates
without all of them having to be marked up. This has a useful property: a date
recogniser that is too generous leads to fewer reports, never to more. The
error goes in the safe direction.
NotApplicable instead of silent success. A page without images gets no
points for not missing any alternative texts. Such results do not feed into the
score at all.
Adding your own check
One class, nothing else. Registration happens via _instanceof in
Services.yaml:
final readonly class MyCheck implements CheckInterface { public function getIdentifier(): string { return 'seo.myRule'; } public function getDimension(): Dimension { return Dimension::Seo; } public function run(AnalysisContext $context): CheckResult { return CheckResult::create( $this->getIdentifier(), $this->getDimension(), Severity::Problem, 'check.seo.myRule.failed', editTarget: EditTarget::pageProperties($context->getEditablePageUid()), weight: 2, ); } }
Plus three XLF keys: check.seo.myRule.title, .help and one per state.
A note on virus scanners
Windows Defender flagged two earlier versions of this extension as
Trojan:Win32/MalUri.A!cl — a heuristic cloud detection based on machine
learning, not a signature of known malware. Both times a real pattern was
behind it, and both have been removed:
Script elements assembled in PHP. A test built its test page by
concatenating a JSON-LD script element around a variable. That is
indistinguishable from PHP malware that injects scripts into web pages. Test
pages with script elements therefore live as HTML files under
Tests/*/Fixtures/.
Clipboard written from a hidden field. The copy button had a fallback for
insecure contexts: an invisible text field outside the screen, from which the
older browser copy command wrote to the clipboard. That is the technique of
"ClickFix" and pastejacking attacks, which put a command on the clipboard and
then ask the user to paste it into the Run dialog. What was copied was always
the visible suggestion the editor had clicked — but an extension for an
editorial backend should not ship that pattern anyway. clipboard.js now only
uses the Clipboard API, which only exists under HTTPS. Over plain HTTP, the
button selects the text and the editor presses Ctrl+C.
Rules for future changes: don't assemble script elements from PHP strings, don't write to the clipboard from hidden elements, and no blanket scanner exclusions for the project directory.
Quality assurance
composer ci # php-cs-fixer, PHPStan level 8, unit tests composer ci:tests:functional # needs a test database composer fix:php:cs
Unit and functional tests have separate configurations under Build/phpunit/,
because the testing framework ships different bootstraps for the two: only the
functional one creates a real TYPO3 test instance with a database.
The GitHub Actions workflow .github/workflows/ci.yml runs the functional tests
as a separate, mandatory job, not inside composer ci. They take longer — but
preview tokens, hidden pages and frontend groups cannot be covered by unit
tests at all, so the job must not be optional. The functional tests run on
SQLite, so no database service is needed.
typo3/coding-standards provides the core's PSR-12 configuration. Keep it as a
required check in CI, otherwise it erodes after the third sprint.
Not included yet
English date analysis. geo.structuredDataConsistency still bows out on
English pages. The real work is not the list of months but the ambiguity of
10/21/2026 versus 21/10/2026 — guessing wrong would again be a silent
error.
Alt text findings don't link to the image. There is no way back from the
rendered <img> to the sys_file_reference. Solvable by having the page
template output a data-uid, or by cross-checking the page's FAL references.
Accepting findings. There is no way to tick off a finding as a deliberate editorial decision. Without that, no report ever turns green — and a report that never turns green stops being read. Needs a small table with page, check ID, mandatory justification, person and time.
Language switcher in the module. The language parameter is evaluated, but
has no user interface.
FormEngine panel in the page properties. The panel in the page module
covers everyday use; in the page properties it would sit closer to the fields
it criticises — above all for the AI suggestion for the meta description.
Postponed because TYPO3 v14 deprecated several FormEngine APIs
(OuterWrapContainer, FormResultCompiler, TcaDescription fieldInformation).
A custom node should be written against a running 14.3, not blindly.
Alt text suggestions. SuggestionProviderInterface is designed for this;
batch processing via the scheduler is already in place with
AnalyzePagesCommand. Only worthwhile once a vision model is available on the
inference server.
Duplicate detection (identical titles/descriptions across the page tree) — the data storage in the repository is prepared for it.
Releasing (maintainers)
Releases are published to the TER by .github/workflows/publish.yml when a
version tag is pushed.
-
Set the new version in
composer.jsonunderextra.typo3/cms.version(e.g.1.0.1) and commit. -
Create an annotated tag with the same version — its message becomes the TER upload comment — and push it:
git tag -a 1.0.1 -m "Fix the date check for spelled-out months" git push origin 1.0.1
The workflow refuses to publish if the tag and extra.typo3/cms.version
differ. It needs the repository secret TYPO3_API_TOKEN (a TER access token
with the scopes extension:read and extension:write, restricted to
ue_pagequality). Packagist picks up the tag on its own once the GitHub hook is
set up.
Support
- Bug reports and questions: https://github.com/ahobitt/typo3_pagequality/issues
- Pull requests are welcome: https://github.com/ahobitt/typo3_pagequality
If the extension saves you time, you can support its development via GitHub Sponsors.
License
Copyright (C) 2026 ahobitt
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See LICENSE.




