Skip to content

WP Cortex v0.4.0

Choose a tag to compare

@blonestar blonestar released this 12 Oct 21:23
· 102 commits to main since this release

Added

  • Visitor chat AI assistant settings (Settings > Visitor chat > AI assistant): the visitor chat can use its own AI provider, model and reasoning level (public_chat_provider, public_chat_model, public_chat_reasoning) instead of the admin chat's, for example a cheaper or faster model. By default it keeps following the admin chat. The visitor chat custom instructions moved to this section.
  • Visitor chat summary settings (Settings > Visitor chat > Conversation summaries): summaries can use their own AI provider, model and reasoning level (summary_provider, summary_model, summary_reasoning; any model, tool calling is not needed), by default the admin chat's; custom instructions added to every summary (summary_instructions); and the summary language (summary_language). New filter wp_cortex_visitor_chat_summary_system_instruction.
  • Cortex dashboard widget for administrators: visitor chat counts (unread highlighted, total, last 7 days, with contact details) and the latest unread conversations, where each chat is turned on (admin chat in the admin and on the front end, visitor chat), and an overview of both indexes (documents, chunks, embedding coverage, size, last update, pending automatic sync, run status, public exposure warning).
  • The Visitor chats screen opens with a filter from the URL (&filter=unread or &filter=contact).
  • Changelog tab on Cortex > Settings (last tab): the changes of each version, collapsible per version, with the change counts by type, release dates and the installed version marked. Pending changes and the latest release start expanded; Expand all and Collapse all toggle every version.
  • Visitor chat activity: the Visitor chats screen shows whether the visitor is still in a conversation (Active, Idle, ended; a green, yellow or grey dot in front of each conversation in the list). The visitor chat reports every minute that its window is open (while the tab is visible) and at once when it is closed, the tab is hidden or the visitor leaves the page (closes the tab or navigates), through the new public endpoint POST /wp-cortex/v1/public-chat/presence (only while the conversation log is on); new columns seen_at and chat_open in {prefix}wp_cortex_visitor_chats. The open conversation and the list refresh automatically.
  • Safer forwarding of visitor chats: the form warns, and asks for confirmation, while the conversation may not be finished. A conversation that continued after it was sent is flagged ("Changed since sent", with the number of new visitor messages) and Send update forwards it again to the same recipients, with "(update)" in the subject.
  • Visitor chat images (public_chat_images, off by default): visitors can attach an image to a message, for example a screenshot of a problem, by pasting it into the message box, dropping it on the chat or using the new attach button. The image is scaled down in the browser, re-encoded on the server (at most 1600 px, metadata stripped, only real PNG, JPEG, WebP or GIF images accepted) and sent to the visitor chat model with that message; the model must support image input. Images have their own hourly limit per visitor (public_chat_image_limit, default 10). While the conversation log is on, they are stored with the conversation in the protected data directory, shown in the transcript under Cortex > Visitor chats (click to open full size), attached to forwarded emails and deleted with the conversation. New admin route GET /wp-cortex/v1/visitor-chats/<id>/images/<name>.
  • Issue reports (public_chat_reports, on by default): visitors can point out problems on the site in the visitor chat, such as a typo, a broken or missing image, a broken link, outdated information or something that does not work, and the assistant reports them to the site team (report_issue tool) with the page, the quoted text and the conversation. New Cortex > Issue reports screen to resolve, dismiss, reopen, annotate and delete reports, with the open count in the menu, links to the page editor and the conversation, and the reports linked from the conversation transcript. Optional email notification of new reports (public_chat_report_email). The dashboard widget shows open, resolved and dismissed reports and the latest open ones. New table {prefix}wp_cortex_issue_reports and REST routes under /wp-cortex/v1/issue-reports.

Changed

  • Cortex > Indexing: the data directory path in the Storage card is hidden by default; the eye button shows or hides it. Storage warnings stay visible.
  • Visitor chat summaries are written in the site language (Settings > General > Site Language) by default, so the team gets them in one language whatever language the visitor used. The previous behavior (the visitor's language) can be chosen under Conversation summaries.

Fixed

  • Visitor chat contact details silently dropped website URLs whose domain did not resolve from the server (for example www.entity.rs on a local site): URLs were checked with wp_http_validate_url(), which does a DNS lookup and rejects private addresses. They are now checked by syntax only, and save_contact_details returns an error (so the assistant asks again) instead of reporting success when the website URL is not valid.

  • Visitor chat could not list the posts written by an author (for example "find all posts by John Smith"): it only had a text search, which finds pages that mention the name, and its results did not show the author. search_site now has an author filter (the query may be empty to list everything by that author, up to 30 results), and search results and pages include the author and publication date. Author names match regardless of case, accents and short inflected endings ("Johna Smitha" finds "John Smith"), also in the admin search-content author filter. go_to_page can open the author page (author archive) of an author with published content.

  • Visitor chat did not save contact details the visitor gave (for example a name and email address): the assistant kept asking what the visitor wanted to be contacted about and waited for a confirmation, so nothing was saved if the visitor did not answer. Contact details are now saved as soon as the visitor gives them, also a name mentioned in a greeting (without starting the contact flow); the assistant repeats an email address or phone number so the visitor can correct it, and corrections are saved too. When the reason for the contact is not known yet, the assistant asks for it once an email or phone number is saved and adds it to the saved details; it no longer fills in a generic request on its own. When the visitor wants to be contacted and it is clear what about (for example SEO services), the request is saved right away, even before the name and email; the conversation shows it in the Contact column but counts as "with contact details" only once a name, email, phone or other detail is saved. Spelled-out email addresses ("ana at example dot com") are saved in their standard form. Website URLs such as www.example.com or https://www.example.com were silently dropped (they were checked like outgoing requests, with a DNS lookup) while the assistant said they were saved; they are now saved (with https:// added when missing), and an invalid URL is reported back to the assistant.