Skip to content

Tag tracking extension points and request accessors @api - #25863

Draft
sgiehl wants to merge 3 commits into
6.x-devfrom
api-tags-tracking
Draft

sgiehl wants to merge 3 commits into
6.x-devfrom
api-tags-tracking

Conversation

@sgiehl

@sgiehl sgiehl commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Description

Tags the tracker extension points and the request and visit accessors they need:

  • Tracker\RequestProcessor (class level, including its six public hooks): no event covers per-request processing, custom log writes or exchanging request metadata between plugins. The class docblock now links the hooks, so they show up in the reference.
  • Tracker\LogTable (class level): needed to make custom log tables segmentable and joinable.
  • Plugin::isTrackerPlugin(): it was @internal, but its docblock tells plugins to override it.
  • Tracker\Request: getParams(), getParam(), setParam() (documented as for RequestProcessor::manipulateRequest() only), getIdSite(), getCurrentTimestamp(), getIpString(), getUserAgent(), getMetadata(), setMetadata(). Request objects are passed to public tracker events and @api dimension hooks.
  • VisitProperties::getProperty()/setProperty() and Visitor::getVisitorColumn().
  • Log value constants: Action::TYPE_* (the complete set of log_action.type values; not the aliases TYPE_EVENT/TYPE_CONTENT) and GoalManager::IDGOAL_ORDER/IDGOAL_CART.
  • Tracker\Cache::getCacheWebsiteAttributes()/deleteCacheWebsiteAttributes(): the read and invalidation side of the Tracker.Cache.getSiteAttributes event, which the caching guide tells plugins to call. An injectable tracker cache service is planned to replace these statics later.

Extending Tracker\Action stays untagged.

Context

Plugins not shipped with core may only rely on code tagged @api, but many classes and hooks they need were never tagged. That includes the protected hooks of @api base classes, which the developer reference only lists when they carry their own @api tag. This series tags what plugins outside core actually use (based on an analysis of 197 Marketplace and other non-bundled plugins) and what we can keep stable until the next major release.

Deliberately not tagged:

  • what an event, native PHP or existing @api code already covers;
  • static accessors of services that should be injected (Config::getInstance(), Plugin\Manager::getInstance(), the Piwik\Cache statics, …). Those get DI follow-ups instead.

All changes are docblocks only: @api/@internal tags, plus docblocks completed to the public API standard (purpose, parameters, return values, how plugins use it). No code, signatures or behaviour change.

Series (merge order)

  1. Clarify which code is the plugin contract in AGENTS.md #25859 — first: the contract the other PRs apply
  2. Tag settings, DI and service APIs @api #25860 — then (followed by the Container DI follow-up)
  3. Tag exceptions and validators @api #25861, Tag static core helpers @api #25862 — then, in any order (exceptions before Allow validators as API parameter attributes #25601)
  4. Tag tracking extension points and request accessors @api #25863, Tag archiving and data APIs @api #25864, Tag protected hooks of plugin base classes @api #25865 — then, in any order
  5. Tag theming, visualization and bundled-plugin APIs @api #25866 — last

This PR: #25863. Each PR adds its own line under 6.1.0 "New APIs" in the CHANGELOG, so later PRs get rebased as earlier ones merge.

Tests

Docblock-only change, so there are no new tests. For each PR:

  • a diff check confirmed that no code lines changed;
  • phpcs is clean on the changed files;
  • full PHPStan is clean (the baseline is updated where a corrected docblock type resolves or changes an entry).

The series was also merged together and checked as a whole: PHPStan is clean, and the only conflicts are the adjacent CHANGELOG lines. The developer-documentation API reference was generated locally from the combined branches to check the new pages and {@link}s.

Checklist

  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules

Review

@sgiehl sgiehl added this to the 6.1.0 milestone Nov 27, 2026
@sgiehl sgiehl added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Nov 27, 2026
@sgiehl
sgiehl force-pushed the api-tags-tracking branch 3 times, most recently from 1183cca to fe53f24 Compare December 1, 2026 18:32
@sgiehl
sgiehl force-pushed the api-tags-tracking branch from fe53f24 to 602dcfb Compare December 1, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.

Development

Successfully merging this pull request may close these issues.

1 participant