🐛 ML Canvas Edit Page Bug Report

Handoff Document for Spencer Forman

⚠️ Issue Summary

The mlcanvas_edit_page tool frequently returns “HTML find string not found” even when the exact string exists in the page content.


Bug Details

Tool: mcp_fmcp-wp-shops_mlcanvas_edit_page

Behavior:

  • Short, single-line find strings sometimes work (e.g., <div class="price-amount">$22</div>)
  • Multi-line HTML strings almost always fail, even when they match the content exactly
  • The tool returns "HTML find string not found" but get_content confirms the string exists

Reproduction Steps

  1. Create a page using mlcanvas_create_page with HTML content
  2. Fetch the page using get_content to see the raw HTML
  3. Copy an exact multi-line string from the content
  4. Try to use mlcanvas_edit_page with that exact string as find_html
  5. Tool returns “HTML find string not found”

Example That Failed

Page ID: 16813 (was deleted, recreated as 16815)

Find string attempted:

<li>One FREE 15-min reading per quarter</li>
          <li>Exclusive Luminary-only sales</li>

Result: “HTML find string not found”

Verification: get_content showed this EXACT string in the raw content


Another Example That Failed

Find string attempted:

<li>15% off all practitioner services</li>
          <li>15% off all shop purchases</li>
          <li>Monthly spiritual newsletter</li>
          <li>New &amp; Full Moon guidance emails</li>
          <li>Priority booking (48hr head start)</li>

Result: “HTML find string not found”


What DOES Work

Short single-line replacements sometimes succeed:

find_html: <div class="price-amount">$22</div>
replace_html: <div class="price-amount">$33</div>
Result: SUCCESS

Suspected Causes

  1. Whitespace handling – The tool may normalize whitespace differently than what’s stored
  2. Encoding differences&amp; vs & or other HTML entities
  3. Line break handling\n vs \r\n or different line ending formats
  4. Block content vs rendered – Tool may be searching rendered HTML instead of raw block content
  5. Unicode normalization – Special characters like ✨ or — may encode differently

Current Workaround

Delete the entire page and recreate it with mlcanvas_create_page:

1. delete_content(page_id, force=true)
2. mlcanvas_create_page(title, html, css, status="publish", ...)

This works 100% of the time but is inefficient for small edits.


Suggested Investigation Points

  1. In fluent-mcp.php – Check how find_html parameter is processed before searching
  2. String comparison – Is it using exact match or some normalization?
  3. Content source – Is it searching post_content raw, the Gutenberg block JSON, or rendered HTML?
  4. Logging – Add debug logging to see what string the tool is actually searching for vs what’s in the content

Files/Locations

  • Plugin file: fluent-mcp.php (line ~9408 area based on previous fix)
  • Tool name: mlcanvas_edit_page
  • Related working tool: mlcanvas_create_page (works perfectly)

Test Page

Current working Inner Circle page: ID 16815

URL: https://shopsacredground.com/inner-circle-11/

You can use this page to test the edit tool – try finding and replacing any multi-line HTML string.


⚡ Priority: Medium-High

The workaround (delete/recreate) works but:

  • It’s slow for small edits
  • It changes the page ID each time
  • It requires sending the entire HTML/CSS content again
  • It breaks revision history

Context

This bug was discovered while building the Sacred Ground “11” pages (Homepage 11, Shop 11, Inner Circle 11, practitioner pages, etc.)

Document created: December 6, 2025

Created by: Phoenix (Claude AI Assistant)

For: Spencer Forman @ WPLaunchify