supseven / opinion
Collects feedback from editors including a screenshot and environment details and delivers it by email
Requires
- php: ^8.4
- typo3/cms-adminpanel: ^14.3
- typo3/cms-backend: ^14.3
- typo3/cms-core: ^14.3
- typo3/cms-frontend: ^14.3
Requires (Dev)
- a9f/typo3-fractor: ^1.1
- friendsofphp/php-cs-fixer: ^3.95
- kubawerlos/php-cs-fixer-custom-fixers: ^3.37
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- saschaegerer/phpstan-typo3: ^3.0
- ssch/typo3-rector: ^3.17
- typo3/cms-dashboard: ^14.3
- typo3/testing-framework: ^9.5
Suggests
- typo3/cms-dashboard: Dashboard widgets for open feedback, new messages and the latest feedback
Provides
None
Conflicts
None
Replaces
None
README
TYPO3 extension opinion
The full documentation is on docs.typo3.org.
Collects feedback from editors: a description, a category and severity, an optional screenshot or (when switched on) video of the current browser tab and details about browser and TYPO3. Every submission is stored as a record and delivered by email.
The dialog opens from two places:
- Frontend: entry "Feedback" in the admin panel; a click opens the dialog. The page, site, language and workspace are attached.
- Backend: speech-bubble button in the toolbar. The current module, page and module URL are attached.
Both are only shown to users who may send feedback (see below).
Before sending, the screenshot can be marked up in a full-screen editor: frame an area with a rectangle, point at something with an arrow, add a short text note, black out personal data or crop it to the relevant part. The markings are burnt into the image; only the marked-up image is sent.
With videoEnabled, a switch in the dialog offers a video of the tab instead,
for problems that are a sequence. The dialog warns that everything visible and
typed is in the video, closes while recording and opens again with the input
kept; a bar shows the remaining time and clicks are marked. In the backend the
recording continues across saving records and switching modules.
Admins find all feedback in the module Feedback: search, filters, a list with status and conversation, and a detail view with message, screenshot, a conversation with the sender and all collected details. Editors who may send feedback see their own feedback there and answer in the conversation; unread messages are counted on the module menu entry.
The open feedback of a page is shown where people work on it: in the admin panel ("Feedback on this page", frontend feedback) and in the page module (frontend and backend feedback), so a problem is not reported twice. With the optional TYPO3 dashboard, three widgets show open feedback, new messages and the latest feedback.
Requirements
- TYPO3 v14.3, PHP 8.4 or 8.5
- HTTPS for screenshots and videos (
getDisplayMedia()needs a secure context) - For videos:
MediaRecorderin the browser and PHP upload limits that fitvideoMaxDuration(60 s needupload_max_filesize = 10M,post_max_size = 12M)
Installation
composer require vkemeter/opinion vendor/bin/typo3 extension:setup
Without Composer, install it from the TYPO3 Extension Repository. Changes are listed in the changelog.
extension:setup creates the tables tx_opinion_feedback, tx_opinion_message
and tx_opinion_read and the file storage "Opinion screenshots" (see below).
Updating from version 1, also run vendor/bin/typo3 upgrade:run opinion_pageUid
once. For the dashboard widgets, install typo3/cms-dashboard.
Configuration
Admin Tools → Settings → Extension Configuration → opinion:
| Setting | Default | Meaning |
|---|---|---|
recipients |
– | Comma-separated email addresses. Invalid ones are ignored. |
categories |
bug,content,idea,other |
Categories in the dialog: value or value=Label, comma-separated; a translation category.<value> wins |
statuses |
new,in_progress,closed |
Processing statuses, same syntax; the first is the status of new feedback |
closedStatuses |
closed |
Statuses that count as done; all others are open |
reopenStatus |
in_progress |
Status of a closed feedback after a reply of its sender |
subjectPrefix |
[Opinion] |
Prefix of the email subject |
retentionDays |
180 |
Age after which opinion:cleanup deletes feedback |
redeliverMaxAttempts |
5 |
Attempts after which opinion:redeliver gives up, 0 = no limit |
rateLimit |
10 |
Feedback per backend user and hour, 0 = no limit |
enabled |
1 |
0 hides the triggers and rejects submissions |
videoEnabled |
0 |
1 offers a video of the tab as an alternative to the screenshot |
videoMaxDuration |
60 |
Maximum video length in seconds (10–300); the server accepts at most this × 160 KB |
Without valid recipients the feedback is still stored, its delivery status is "failed".
Collected details
The tab "Collected details" of the extension configuration has a switch for every detail, grouped into browser, server and page/module (e.g. IP address, screen size, time zone, images on the page). All are on by default. A switched-off detail is not collected by the browser and is removed on the server, even if a request sends it. The sender (name, username, email) is always kept.
deniedUrlParameters in the same tab lists query parameters that are removed
from the page and module URL (default
ADMCMD_*,logintype,user,pass,redirect_url,tx_felogin_login; a trailing *
matches a prefix). The backend request token is always removed.
The sender address is $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'];
the sending backend user becomes reply-to.
Who may send feedback
Admins always. Other backend users need this user or group TSconfig:
options.opinion.enable = 1
Sending feedback also needs a valid email address in the user account, so the team can answer. Users without one see the button, but get a note with a link to their user settings instead of the form; the endpoint rejects their submissions as well.
For the frontend button the admin panel itself must be shown:
- the site set
vkemeter/opinion("Opinion: editor feedback") added to the site, which setsconfig.admPanel = 1(site settingopinion.adminPanel.enable, default on); without it, addconfig.admPanel = 1to the TypoScript yourself - user TSconfig with at least one enabled admin panel module, e.g.
admPanel.enable.opinion = 1(admins getadmPanel.enable.all = 1from the core). Site sets cannot provide user TSconfig, so this stays in the user or group records.
The "Feedback" tab only appears for users who may send feedback.
Deliver again
Failed or pending feedback (e.g. the mail server was down) is delivered again by
vendor/bin/typo3 opinion:redeliver # older than 10 minutes
vendor/bin/typo3 opinion:redeliver --min-age=0
vendor/bin/typo3 opinion:redeliver --dry-run
It skips records with redeliverMaxAttempts attempts and can run as a
Scheduler task. In the admin module, the detail view of an undelivered
feedback has a button "Deliver again" for a single record.
Cleanup
vendor/bin/typo3 opinion:cleanup # older than retentionDays vendor/bin/typo3 opinion:cleanup --days=30 vendor/bin/typo3 opinion:cleanup --days=0 --status=closed # all closed feedback vendor/bin/typo3 opinion:cleanup --dry-run
To run it regularly, add a Scheduler task "Execute console commands" with the
command opinion:cleanup.
Data and privacy
- Records live on the root level (
pid = 0), read-only, and are shown in the module "Feedback" only, not in the List module. - Conversation messages are shown only to administrators and the sender of the feedback, are never sent by email and are removed with their feedback.
- Everybody who may send feedback sees text, date and status of the open feedback of the page they view, also of other senders (without names).
- Screenshots are stored in a local, non-public FAL storage below
var/opinion/, outside the web root. Only the feedback module delivers them, to administrators and the sender; thedumpFileURL always answers403. - Videos are stored and delivered like screenshots. The email never carries a video, it links the detail view instead. Videos cannot be blacked out, so they are off by default.
- Blacked-out areas are burnt into the screenshot in the browser; the original capture never leaves the page.
- The browser sends a fixed set of environment details (URL, title, user agent,
language, time zone, screen and viewport size, pixel ratio, color scheme,
reduced motion, online state). The server drops every other key. Cookies,
localStorageandsessionStorageare never read. - Feedback from the admin panel also contains the details of its tab "Info → General": page type, cache state and reasons, uncached elements, parse time, document size, simulated frontend user and the images on the page. Images and document size are only known when the page was rendered without cache, like in the admin panel itself. Cookies, server variables and request parameters of that tab are not taken.
- The IP address is stored anonymised.
opinion:cleanupremoves records, references, screenshot and video files and conversations.
Deployment
var/opinion/ must survive deployments (shared directory). The storage is
configured relative to the public path (../var/opinion/), so it stays valid
when the release directory changes. The path is inside the project root, no
BE.lockRootPath entry is needed.
Integration for further entry points
Build the dialog configuration on the server and pass it to the JavaScript module:
$configuration = $dialogConfigurationBuilder->build($backendUser, Source::Frontend, ['pageUid' => 12]);
import { openOpinionDialog } from '@vkemeter/opinion/opinion-dialog.js'; openOpinionDialog(configuration);
Load EXT:opinion/Resources/Public/Css/opinion-dialog.css as well. Check
AccessChecker::hasAccess() before rendering a trigger.
Extension points:
ContextProviderInterfacevalidates the context an entry point sends along. Context of a source without a provider is dropped.DeliveryChannelInterfaceadds a delivery channel, e.g. a ticket system. All implementations are collected automatically.ConfigurationProviderInterfacereplaces the source of the configuration.
Endpoint
POST to the backend AJAX route opinion_submit, multipart/form-data:
message, category (one of categories, default bug|content|idea|other), severity
(low|normal|high), source (frontend|backend), clientInfo (JSON),
context (JSON), screenshot (PNG/JPEG, at most 10 MB) or video (MP4/WebM,
at most videoMaxDuration × 160 KB, only with videoEnabled, never together
with screenshot), contextAtEnd (JSON, context when a backend recording
stopped).
| Status | Meaning |
|---|---|
200 |
Stored; delivered tells whether all channels succeeded |
401 |
No backend session (answered by the core) |
403 |
No access or extension disabled |
422 |
Invalid input, errors holds a message per field |
503 |
Screenshot storage unavailable |
Development
make help lists all tasks: make install, make test, make check,
make fix, make docs, make ci (everything the CI runs) and more. The
variables PHP, DB and CONTAINER select PHP version, database and
container tool, e.g. make test-functional DB=mariadb. The targets wrap the
commands below.
The PHP suites run in ghcr.io/typo3/core-testing-php84 containers (docker or
podman), no local PHP or Composer needed. Dependencies are installed into
.Build/.
Build/Scripts/runTests.sh -s composerUpdate # install dependencies Build/Scripts/runTests.sh -s unit Build/Scripts/runTests.sh -s functional # SQLite Build/Scripts/runTests.sh -s functional -d mariadb # also mysql, postgres Build/Scripts/runTests.sh -s phpstan Build/Scripts/runTests.sh -s cgl -n # php-cs-fixer dry run Build/Scripts/runTests.sh -s lint Build/Scripts/runTests.sh -h # all options
The browser test runs the dialog against a mocked endpoint in headless
Chromium, including the screenshot flow. Playwright comes from Build/:
npm --prefix Build ci
npx --prefix Build playwright install chromium
node Tests/Browser/dialog.test.mjs
npm --prefix Build run lint:js # ESLint, Build/eslint.config.mjs
GitHub Actions (.github/workflows/ci.yml) runs the same commands on every push
to main and on pull requests: lint, CGL and PHPStan; ESLint; unit and functional tests
on PHP 8.4 with SQLite, MariaDB, MySQL and PostgreSQL and on PHP 8.5 with SQLite;
the browser test; a test rendering of the documentation.
Documentation
docker run --rm --pull always -v $(pwd):/project -it \
ghcr.io/typo3-documentation/render-guides:latest --config=Documentation
Open Documentation-GENERATED-temp/Index.html.
