Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing is broken when plugins output directly during post content #3328

Open
1 task done
tomjn opened this issue Feb 20, 2023 · 2 comments
Open
1 task done

Indexing is broken when plugins output directly during post content #3328

tomjn opened this issue Feb 20, 2023 · 2 comments

Comments

@tomjn
Copy link
Contributor

tomjn commented Feb 20, 2023

Describe the bug

If a plugin has a shortcode that outputs directly rather than returning content, or tries to hook in to display extra output at a later date ( e.g. Gravity Forms ). This breaks the output of syncing and can stop the sync if it was triggered in the Admin UI

Steps to Reproduce

  1. install a plugin that echo's rather than returns its content in a shortcode or block
  2. use that in a post
  3. Trigger an index from WP Admin
  4. Watch as it fails to parse the output due to the stray HTML, and syncing stops

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tomjn tomjn added the bug Something isn't working label Feb 20, 2023
@felipeelia
Copy link
Member

We will need a specific (free) plugin with specific steps for this one, @tomjn, as the documentation specifically states that:

Note that the function called by the shortcode should never produce an output of any kind. Shortcode functions should return the text that is to be used to replace the shortcode.

@tomjn
Copy link
Contributor Author

tomjn commented Feb 21, 2023

Indeed I'm a strong proponent of that, unfortunately lots of new WP devs are unfamiliar with this, I've even had some outright rebel in disbelief when I tell them :( . An output buffer should suffice to mitigate this in the meantime.

@felipeelia felipeelia added enhancement and removed reporter feedback bug Something isn't working labels Feb 23, 2023
@felipeelia felipeelia changed the title BUG: Indexing is broken when plugins output directly during post content Indexing is broken when plugins output directly during post content Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants