I have a client that has just moved a very larger, well established wordpress site to a new host. He has a series of JSON api’s delivered via a plugin that have stopped validating (killing a mobile app).
I’ve identified the problem as that after the tags <a or <img are used in the WP admin, a mysterious line break is added. Its not present in the WP html wyswig — but the html src for the page also has the line break.
I’ve tried the following:
- replace: \n, \r, \r\n, char(10) (in various orders) — No change
- replace: different char(#) — No change
- using BBEdit to Zap Gremlins — No change
- opening in VI to make sure that the line breaks are part of the file (they are – $ everywhere)
I’m open to suggestions on a method either identifying and removing these annoyances.
UPDATE: After typing this all out, I realized I should check using a HexEditor. The character is 0A.
EDIT: Edited because part of my question was poorly formatted. The character is being added previous to the JSON output.
After much testing I outlined every known fact:
After all that we decided that it had to be a plug-in and went through another round of checks.
It turned out to be the plugin wp-minify combined poor testing during the deactivation check. The response was being cached and I assumed that there was no change.