Kjeks
← All docs

Kjeks AI Reviewer

Suggests a category and metadata for each unreviewed tracker using WordPress 7's core AI client. Advisory only — you confirm every suggestion.

Requires WordPress 7.0+PHP 8.3+Requires the Kjeks coreSource on GitHub →

101 Getting started

Reviewing a large tracker inventory by hand is slow. The AI Reviewer proposes a category and metadata for each unreviewed tracker so triage becomes a quick yes/no instead of research.

Requirements

  • WordPress 7.0+ — it uses the core AI client (wp_ai_client_prompt).
  • The Kjeks core plugin, active. Without it the add-on only shows an admin notice.

Install & activate

Download the latestkjeks-ai-reviewer.zipand upload it under Plugins → Add New → Upload Plugin, then activate it (network-activate on multisite). It adds no menu of its own — instead it appears as a tab on the existing Cookie Consent screen. Updates arrive automatically from GitHub releases viaplugin-update-checker.

Run a review

  1. Open Cookie Consent and switch to the AI Reviewer tab.
  2. Trigger a suggestion pass for the unreviewed trackers.
  3. For each suggestion, read the rationale and confidence, then Accept or Reject.
Accepting a suggestion is what marks a tracker reviewed and applies the category. Nothing is changed until you confirm it.

201 How suggestions work

Database first, AI second

The reviewer first looks the tracker up in a bundled copy of theOpen Cookie Database. A confident, complete match avoids an AI call entirely. Only when that misses does it prompt the AI model.

What each suggestion contains

FieldNotes
categoryOne of necessary, preferences, analytics, marketing.
partyfirst or third.
provider, purpose, retentionEnriched metadata for the cookie declaration.
documentation_urlReference link, when known.
confidenceHow sure the model is.
rationaleShort explanation you can sanity-check.
model, grounded_by, generated_atProvenance: which model, what it was grounded on, and when.

How the category is chosen

The reviewer is deliberately conservative: it picksnecessary only when an item is clearly essential (session, auth, security), and prefers marketing when unsure. Any label it can't map to a Kjeks category also falls back to marketing — never necessary. So genuinely third-party resources (e.g. Google Fonts, Gravatar) usually land on marketing — a safe default for a consent tool, not a bug.

You keep the final say: Accept takes an optional category override, so you can reclassify a suggestion (or self-host the resource to make it first-party) before confirming.

Advisory, not authoritative. The model can be wrong. Suggestions never set reviewed on their own — an administrator accepts each one.

301 REST, cron & internals

The AI call

The reviewer asks the core client for a strict JSON answer with a small token budget:

wp_ai_client_prompt( $prompt )
    ->using_max_tokens( 400 )
    ->generate_text();

REST API

All routes live under kjeks-ai/v1 and require manage_networkon multisite, or manage_options on a single site.

Method & routeBody
GET /stateCurrent pending trackers and their suggestions.
POST /suggestOptional boolean force to regenerate.
POST /settingsRequired boolean cron_enabled.
POST /acceptRequired id, optional category override.
POST /rejectRequired id.
POST /wp-json/kjeks-ai/v1/accept
{
  "id": "_ga",
  "category": "analytics"   // optional override of the suggestion
}

Weekly cron (opt-in)

A scheduled job, kjeks_ai_weekly_suggest, can pre-generate suggestions for new trackers. It is disabled by default — enable it by postingcron_enabled: true to /settings (stored inkjeks_ai_settings).

Options

OptionHolds
kjeks_ai_suggestionsSuggestions keyed by tracker ID.
kjeks_ai_settingsAdd-on settings (currently cron_enabled).

Admin integration

The tab is injected client-side: the add-on enqueues ontoplevel_page_kjeks-network and registers itself through thekjeks.networkAdminTabs JavaScript filter — no separate admin page.