-
Notifications
You must be signed in to change notification settings - Fork 93
Description
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
- Go to WP Admin → Tools → Plugin Check Namer.
- Enter a plugin name.
- Click Evaluate name.
- Wait for the result to be generated.
- 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
The issue can be observed in the result section where token usage is reported as undefined instead of a numeric value.