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

Problems displaying oik_shortcodes when WordPress SEO is activated #1

Closed
bobbingwide opened this issue Sep 8, 2015 · 2 comments
Closed
Assignees
Labels

Comments

@bobbingwide
Copy link
Owner

Problem description

The oik_shortcodes post type will add a [bw_code] shortcode to the content
if no shortcodes are present. This shortcode is then run and further functionality invoked to display Examples, Snippets etc.

Sometimes this works.
Other times we get recursion, leading to an un-captured Fatal error and an Aw, snap message from Chrome.

Problem explanation

When WordPress SEO is trying to display OpenGraph tags in the header it attempts to obtain the meta description for the post. If this is not available it builds one from the excerpt. If that is not available WordPress creates an excerpt which invokes the_content.

Not knowing any better all the plugins that hook into the_content do their thing and then the excerpt gets produced.

Problems can occur if nested shortcode expansion is performed and 'the_content' filtering goes recursive.

Even if it doesn't go wrong, you'll notice that up to twice as much work is being done than is actually required.

Workaround

Either define a Meta Description in the WordPress SEO meta box.
or deactivate WordPress SEO.

Solution

Add oik_get_the_excerpt() to prevent recursion in 'the_content' processing.
Change the 'the_content' filter logic so that content is only 'enhanced' once.

@bobbingwide bobbingwide added the bug label Sep 8, 2015
@bobbingwide bobbingwide self-assigned this Sep 8, 2015
@bobbingwide bobbingwide changed the title Problems displayed oik_shortcodes when WordPress SEO is activated Problems displaying oik_shortcodes when WordPress SEO is activated Sep 8, 2015
bobbingwide added a commit that referenced this issue Sep 10, 2015
Add oik_get_the_excerpt() to prevent recursion in 'the_content' processing.
This solution should work post types created in oik-plugins and oik-themes as well.
@bobbingwide
Copy link
Owner Author

bobbingwide commented Jan 30, 2019

The question asked in oik issue 115 was “does this fix this problem?”. The answer is that it’s a lot better now. There are still problems with the [bw_code] shortcode being expanded in the block editor, but these are addressed elsewhere. See #58.

@bobbingwide
Copy link
Owner Author

finally closing this one then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant