Skip to content

Token usage not displayed in Plugin Check Namer result #1220

@raftaar1191

Description

@raftaar1191

The Plugin Check Namer Tool does not correctly display the total number of tokens used during the AI evaluation process. Instead of showing the actual token count, the UI currently displays “undefined total”.

This prevents users from understanding the token consumption for the AI request.

Page where the issue occurs

/wp-admin/tools.php?page=plugin-check-namer

Current Behavior

After running an evaluation, the result section displays:

Tokens used: openai:gpt-4.1 - undefined total

The total token count is not populated even though the request completes successfully.

Expected Behavior

The result section should display the actual total number of tokens used for the request.

Example:

Tokens used: openai:gpt-4.1 - 1,234 total

or ideally a breakdown:

Tokens used:
Prompt: 850
Completion: 384
Total: 1,234

Steps to Reproduce

  1. Go to WP Admin → Tools → Plugin Check Namer.
  2. Enter a plugin name.
  3. Click Evaluate name.
  4. Wait for the result to be generated.
  5. Check the Tokens used line in the result section.

Observed Result

The UI displays:

Tokens used: openai:gpt-4.1 - undefined total

Expected Result

The UI should display the actual token count returned by the AI provider.

Screenshot

Image

The issue can be observed in the result section where token usage is reported as undefined instead of a numeric value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions