Repository navigation
Releases: blonestar/wp-cortex
Release list
WP Cortex v0.15.0
Added
- Admin chat
create_posttool: the assistant can create a new draft of a post, a page or any custom post type you can create, for example "create a new testimonial": it picks the post type by its name and asks when more than one could match. It sets the title and, optionally, the text and excerpt, shows an action card first and creates the draft only after you confirm it, then opens it in the editor, where the assistant can fill in its fields, terms, blocks and featured image. It never publishes the draft. It can be switched off under Settings > Chat tools.
Changed
- Admin chat: while the editor finds blocks of the post invalid, the assistant no longer publishes, schedules or updates the published post. It lists the broken blocks and offers to fix them first; the check runs again in the editor right before saving, also after you confirm the card. A draft can still be saved, with a warning. You can always publish with the editor's own button.
Fixed
- Admin chat: blocks the assistant inserts no longer end up as "Block contains unexpected or invalid content". A pattern or block markup that the editor finds invalid (for example a pattern written for an older version of a block) is recovered as it is inserted, so the texts filled in are also kept when the post is saved, and content is no longer placed inside a block that does not allow it (such as plain HTML directly in a Columns block instead of in its columns). The assistant now also sees blocks of the post that the editor finds invalid and offers to recover them (as "Attempt recovery" does), remove them or show them in the editor.
WP Cortex v0.14.0
Added
- Admin chat: the assistant can now work with any block in the block editor, not only text. On request it inserts a block the editor allows in the post, including the site's custom and ACF blocks, or a registered block pattern (for example "insert the hero" or "add a hero with the title ..."), moves a block before, after or inside another block, and duplicates blocks. The new
list_block_typestool lets it find blocks and patterns by name;edit_contentgot the operationsinsert_block,insert_pattern,move,duplicateandset_fields. A pattern's headings and paragraphs and the simple fields of an ACF block (text, textarea, WYSIWYG, number, email, URL, select, radio, true/false, range) can be filled as the block is inserted, and those fields changed later; repeaters, images and other complex fields are left for you to fill. The assistant also sees the field values of ACF blocks and the main attributes of other blocks (for example an image's URL). As before, everything is applied in the editor only and nothing is saved until you save the post.list_block_typescan be switched off under Settings > Chat tools. - Admin chat: more of the post's settings can be changed from the chat while the post is open in the block editor.
edit_postnow also sets the template, the parent page and order (page-like post types), the author and the featured image (an image already in the Media Library, found by its title or file name; when several match the assistant asks which one). As before, the change is made in the editor only and you save the post. - Admin chat
create_termstool: the assistant can create tags, categories and terms of other taxonomies that do not exist yet, optionally under a parent category. Because this writes to the site, it shows an action card first and creates the terms only after you confirm it; they are then added to the post in the editor. It can be switched off under Settings > Chat tools. - Visitor chat setting Conversation memory (
public_chat_history, Settings > Visitor chat): how many previous messages of the conversation the assistant sees when it answers, from 2 to 100. The default is 50, up from the fixed 12 until now, so the assistant no longer loses the start of a longer conversation; the total text sent stays capped, so a longer memory cannot be abused to run up provider costs. - Admin chat tools that save the post open in the block editor, on request:
save_post(Save draft / Update),publish_post(publish now, or schedule for a date),set_post_status(switch to draft or pending review) andpreview_post(a preview link in the chat). The post is saved by the editor itself, as if you clicked its button. A draft is saved right away; updating a published post, publishing, scheduling and taking a published post offline run only after you confirm the action card in the chat. "Change the title and save" works in one message. The assistant never saves on its own, only saves the post that is open in the editor, and cannot trash or delete posts. Each tool can be switched off under Settings > Chat tools. - Admin chat
reload_pagetool: asking the assistant to reload or refresh the page reloads the page you are on, with the chat kept open. It does not reload while the page has unsaved changes (the post in the block editor, or ACF fields); the assistant asks you to save them first.
Changed
- Admin chat: the assistant can take up to 15 steps (tool calls) per message, up from 7, so longer requests in the editor fit in one message.
Fixed
- Chat: a request that needs more steps than allowed no longer ends with "The assistant needed too many steps to answer" and the loss of everything done so far. The assistant now uses its last step to say what it did, what is left and what it could not do, and the changes it already made are kept.
WP Cortex v0.13.0
Added
- Lead integration Salesforce (Settings > Leads > Integrations): creates a Salesforce lead for each new lead through Web-to-Lead, with only the organization ID. Campaign parameters, ad click IDs (for example
gclid), the status and the AI rating go into the custom Lead fields you map in the settings. It sends new leads only, because Web-to-Lead cannot update a lead; a debug email address helps find leads Salesforce dropped. - Lead integrations can declare which events they can send (
Integration::supported_events()); the settings only offer those. - Lead integration Slack (Settings > Leads > Integrations): posts each new lead, and its changes if you want them, to a Slack channel through an incoming webhook, with the lead's details and a button that opens the conversation.
- Lead integration Email notification (Settings > Leads > Integrations): emails each new lead, and its changes if you want them, to one or more addresses through the site's own mail. The email lists the contact details, request, status, AI rating and how the visitor found the site, links to the conversation, and a reply goes to the visitor.
- Admin chat
clear_cachetool: clears the WordPress cache on request. The cache of one post (the current one by default) is cleared right away; a site-wide clear (object cache and expired transients, optionally every transient and the permalink rules) runs only after you confirm the action card in the chat. It does not clear page caches of caching plugins, the host or a CDN.
WP Cortex v0.12.0
Added
- Lead attribution and the Cortex > Leads screen. The visitor chat widget records how visitors arrive: UTM parameters, ad click IDs (Google, Microsoft, Meta, LinkedIn, TikTok, X), the referring site, the landing page, the first and the latest visit, the pages viewed and the device. This is stored with the conversation when the visitor writes in the chat. The server classifies each visit into a channel, including AI assistants such as ChatGPT and Perplexity. A conversation becomes a lead when the visitor leaves contact details. The Leads screen shows the key figures compared with the previous period, conversations and leads over time, leads by channel, lead quality, the top sources, campaigns and landing pages, and a leads list with status tracking (new, contacted, qualified, won, lost, spam), AI rating (hot, warm or cold with a score, intent, budget, timeline and next step) and CSV export. Conversations show a Lead card and a "How the visitor found the site" card. Attribution respects marketing consent from Osano, OneTrust, Cookiebot or the WP Consent API (Complianz, CookieYes and others): without it nothing is recorded, and the chat still works. Settings > Leads, with a switch for the whole feature (
leads_enabled, on by default) and an Attribution section (leads_attribution, off by default,leads_attribution_days,leads_consent,leads_onetrust_group,leads_extra_params). With leads off there is no Leads screen, lead status or AI rating, and nothing is recorded about how visitors found the site. With attribution off the Leads screen shows only the figures of the chat itself (no channels, sources, campaigns or landing pages). Lead integrations under Settings > Leads > Integrations send each new lead and its changes in the background to a CRM or another tool, with retries, a delivery log and a Send test lead button. Built in: Webhook (JSON to an HTTPS URL, optionally signed) and HubSpot (creates or updates a contact, with the lead's status, rating, campaign parameters and ad click IDs in "WP Cortex" contact properties). Developers can add their own from the theme'swp-cortex/integrations/folder or thewp_cortex_lead_integrationsfilter (docs/integrations.md). The actionswp_cortex_lead_createdandwp_cortex_lead_updatedfire once per lead and request, only on real changes, and give the whole lead (filterwp_cortex_lead_payload): contact details, status, AI rating and the first and latest visit with every campaign parameter and ad click ID as recorded. The CSV export has the same data, one column per parameter. A conversation becomes a lead when the visitor leaves an email address, phone number, postal address or website; a name alone is not enough. Existing conversations with such details become leads with the status New.
WP Cortex v0.11.0
Added
- Visitor chat
go_to_pagecan reload the page the visitor is on (newreloadargument), for example when the visitor asks to refresh a page that did not load correctly. It only reloads the current page, only after the visitor asks or confirms, and the chat stays open. The Visitor chats screen shows it as "Page reloaded".
Fixed
- Images attached in the visitor chat showed "The image is no longer available." under Cortex > Visitor chats and Issue reports on hosts whose web server answers URLs ending in
.pngor.jpgitself (for example WP Engine), because the admin image route ended with the file name. The route is nowGET /wp-cortex/v1/visitor-chats/<id>/image?name=<name>; images stored earlier show again.
WP Cortex v0.10.2
Fixed
- Admin chat: allowing ACF's
acf/field-groupsability (or any ability whose input schema has an emptypropertieslist) under Settings > Chat tools broke every chat message with "Invalid schema for function ...: [] is not of type 'object'". Empty property lists are no longer sent to the AI provider as[], and an ability whose input accepts no properties is offered without arguments.
WP Cortex v0.10.1
Fixed
- Admin chat: allowing an ability without input (for example ACF's
acf/custom-post-types, whose input schema is"type": "null") under Settings > Chat tools broke every chat message with "Invalid schema for function ...: schema must be a JSON Schema of 'type: "object"'". Abilities without input are now offered without arguments, input schemas that also allow null (such as Akismet'sakismet/get-stats) as plain objects, and any other input is passed through aninputargument.
WP Cortex v0.10.0
Added
-
Chat tools can be added, changed or removed from a theme: PHP files in
wp-cortex/tools/admin/(admin chat) andwp-cortex/tools/public/(visitor chat) return a new tool, the parts of a built-in tool to change (description, arguments, system prompt lines, availability or behavior) orfalseto remove it; a child theme file replaces the parent theme file with the same name. Plugins can do the same with the newwp_cortex_admin_chat_toolsandwp_cortex_public_chat_toolsfilters. The visitor chat never accepts abilities or admin tools. Seedocs/chat-tools.md. -
Settings > Chat tools: every tool of the admin and visitor chats with its source (Cortex, theme or plugin), its kind (an ability, also usable outside the chat, or a chat tool), a switch and a per-message call limit, and what else decides whether it is offered (for example the skills or issue report setting).
-
The admin chat can use abilities registered by WordPress and other plugins: Settings > Chat tools > WordPress abilities lists them with their category and kind (read-only, changes the site, destructive), and only checked abilities are offered. Abilities that are not read-only never run on the assistant's call: the chat shows them as an action card with the arguments, and they run only after you click Run (once, within an hour); the assistant then reports the outcome.
-
Admin chat editor tools: in the block editor you can ask the assistant to change the open post, or to suggest something and apply the suggestion you pick: the title, excerpt, slug and categories, tags and other terms (existing terms only,
edit_post), the Yoast SEO title, meta description and focus keyphrase when Yoast SEO is active (edit_seo), ACF fields such as text, number, select or true/false (edit_fields), and the content: rewrite the text of paragraphs, headings, list items and buttons, insert new content or remove blocks (get_editor_content,edit_content). Changes appear in the editor right away but the post is not saved: review them and save the post as usual, or undo them. The assistant sees the post as it is in the editor, including unsaved changes. Each tool can be switched off under Settings > Chat tools. -
The admin chat panel can be resized: drag the handle in the panel corner away from the chat button (double-click it to restore the default size). The size is kept in the browser and limited to what fits on the screen; on small screens the panel keeps its full-width layout.
Changed
- Every chat tool is now its own class (
src/Chat/Tools/Admin/,src/Chat/Tools/Public/), and both chats share one model/tool loop. The system prompt mentions a tool only while the tool is offered (for example noopen_admin_pagerules on the front end).
WP Cortex v0.9.0
Added
- Issue reports show the images the visitor attached while reporting the problem (for example a screenshot), and the notification email says how many there are. Images are kept with the conversation and disappear when it is deleted.
Fixed
- A visitor who followed up on a problem they had already reported (with more details or a screenshot) created a second report for the same problem. While the conversation log is on, the visitor chat now updates the existing open report of the conversation instead.
WP Cortex v0.8.0
Added
- Separate configuration of the admin and public indexes under Settings > Indexing > Admin index and Public index, shown as two clearly marked sections. Each index has its own post types (
admin_post_types,public_post_types), including media, and its own fields: every field of the core data, taxonomies, Yoast SEO, ACF (grouped by field group), custom meta keys and media can go into the admin index, the public index, both or neither (field_scopes). ACF content fields (text, dates, links to other posts and terms, repeaters...) of the public post types are chosen for the public index by default; settings-like fields (switches, numbers, choices, URLs, images) and fields named like internal data (id,code,note,email...) are not. For example, a post type can be indexed only for visitors. The field lists have a filter box; ACF fields are grouped by field group and only groups stored on posts of the index's post types are listed. A field name used in several field groups is listed in each of them with one shared choice. - Extractors can implement
DescribesFieldsso their fields can be assigned to an index on the settings screen. - Pause and Resume buttons for a running index run (Settings > Indexing > Status & stats,
POST /index/pauseand/index/resume). A paused run continues where it stopped; the time spent paused is not counted in the elapsed time.
Changed
- Fewer fields go into the public index by default: parent post ID, featured image URL and the media MIME type, file name and size, dimensions and audio/video metadata are now admin only. The Yoast SEO title, meta description and social titles and descriptions, which are printed in the page head anyway, now go into the public index as well. Run Sync to apply.
- Settings > Indexing: "What gets indexed" and "Data sources" are replaced by Admin index, Public index and Data sources & sync (Auto sync moved there).
- Sync and Rebuild (Settings > Indexing > Status & stats) run in the background on the server and continue after the page is closed. The page only shows the progress, refreshes it every few seconds (also in other tabs and when you come back) and can cancel the run. A WP-Cron watchdog restarts a run that stopped; where the host blocks loopback requests, an open status page keeps the run going as before.
Fixed
- ACF relationship, post object, taxonomy, user, image, file and gallery fields were indexed as bare IDs (or, for user arrays, with the user's email and account data). They are now indexed as post titles, term names, user display names and image or file titles, alt texts and captions, whatever the field's return format. The admin index names every related post (unpublished ones with their status, for example "Title (draft)") and every term; the public index only published, non-password-protected posts and terms of viewable taxonomies. ACF dates are indexed as ISO dates (
2024-04-29) and password fields are never indexed. Run Sync to apply.
Removed
- The
post_types,index_mediaandacf_publicsettings, replaced by the per-index post types and fields. Saved settings are migrated: the selected post types (and media) go into both indexes. "Include ACF text in the public index" is not carried over: the ACF content fields of the public post types are chosen by default instead (adjust them under Public index). - The warning when leaving the page during indexing, which is no longer needed. The old Resume button (which continued a run in the browser) is replaced by Pause and Resume.