Avoid processing the_content when o2_process_the_content is false#244
Open
Avoid processing the_content when o2_process_the_content is false#244
Conversation
This method isn't using the `o2_process_the_content` filter which can cause a significant speed issue when the content filters are being run in a context that doesn't require the metadata - such as within a shortcode output in the middle of the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This method isn't using the
o2_process_the_contentfilter which can cause a significant speed issue when the content filters are being run in a context that doesn't require the metadata - such as within a shortcode output in the middle of the page.On URLs such as this:
https://make.wordpress.org/docs/handbook/documentation-team-handbook/tone-and-voice-guide/
Where all of the notice blocks are shortcodes that render
the_contentwithin you'd end up with many duplicate o2<script>'s which then caused shortcode parsing to timeout.With this change, the page load time of the above page goes from 100+ seconds to <1s when xDebug is enabled, and from 0.6-0.7s to ~0.4 in production.