Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

The --precise flag description suggested default results are imprecise and didn't explain when to use it. The command already auto-detects serialized data and switches to PHP processing - --precise forces PHP for all columns.

Changes

Updated flag description:

  • Changed from vague "more thorough, but slower" to explicit behavior: forces PHP for all columns
  • Explained automatic PHP fallback when serialized data is detected (^[aiO]:[1-9] pattern)
  • Clarified use case: ensuring consistent PHP processing across all columns with complex serialized data

Added example:

# Use precise mode for complex serialized data
$ wp search-replace 'oldurl.com' 'newurl.com' --precise

Context

Default behavior (lines 477-496):

  • SQL queries for speed
  • Auto-switches to PHP when serialized data detected
  • --precise bypasses detection, forces PHP everywhere

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.wordpress.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Explain the purpose of the --precise flag</issue_title>
<issue_description>The description of the --precise flag suggests that default results are not precise. Is this the case?

I think the description of this flag needs to be improved, and possibly an example added to the Examples section demonstrating when it should be used.</issue_description>

Comments on the Issue (you are @copilot in this section)

@schlessera My best guess is that some occurrences of the pattern to search might be hidden by escaping or serialization, and you'd need to iterate over the dataset with PHP and transform the data before looking for the pattern to match them. A pure SQL query will miss these.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update description and examples for --precise flag Clarify --precise flag behavior and when to use it Jan 7, 2026
Copilot AI requested a review from swissspidy January 7, 2026 19:11
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explain the purpose of the --precise flag

2 participants