Support » Plugin: String locator » Search results show case as input by user, not as on files

  • Resolved CB

    (@cbrandt)


    Hello,

    Thanks for this great plugin, it has helped me a lot with maintaining my child themes.

    One thing I noticed: when performing a non-regex search, the results screen highlights the term as input by the user, including capitalization. That may lead to confusion. Say I’m searching for the string Abc, and there are three abc strings in the theme files, with the following capitalization: abc, ABC, Abc. The result screen will highlight them all as if they were in the file as input in the search query, that is, Abc. That can potentially lead to unintended replacing, as the replace operation would have wrongly changed the capitalization of two of the strings (abc and ABC) into Abc. EDIT: just recalled that the plugin doesn’t do the replace operation. So the issue actually means the user may be lead to wrongly conclude the term is only present in the capitalization they’ve input. To be sure, the plugin’s regex option can be used to perform case-sensitive searches.

    Here’s a screenshot with the term “Site-header” in an installation with the Twenty Twenty theme, which has the lowercase term site-header in a few files:

    https://snipboard.io/O9UgG5.jpg

    Best regards,
    CB

    • This topic was modified 11 months, 2 weeks ago by CB.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marius L. J.

    (@clorith)

    Thank you for that suggestion, I agree that this should be fixed, currently the plugin uses the search term wrapped in a <strong> tag, but I agree this could be made smoother with a regex replacement to maintain the actual file string.

    I’ve created a ticket for this in the plugin repository at https://github.com/Clorith/wordpress-string-locator/issues/75, so marking this topic as resolved as there’s a clear path forward for this.

    Thread Starter CB

    (@cbrandt)

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search results show case as input by user, not as on files’ is closed to new replies.