Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
The default options for speed bumps are currently:
Never insert in a post fewer than 8 paragraphs long, or fewer than 1200 characters.
Never insert before the the third paragraph, or before 75 words into the post.
Never insert fewer than 3 paragraphs or 75 words from the end of the article.
At least one paragraph from an iframe or embed.
At least two paragraphs from an image.
At least one paragraph from any other speed bump in the post.
How to add more specific rules?
Adding a custom rule for a speed bump is a matter of defining a function and hooking it to the speed_bumps_{id}_constraints filter. The function hooked to that filter will receive several arguments to determine the state of the content, surrounding paragraphs, and other context, and can return false to block insertion.
Simple, stupid example: You have a speed bump called “rickroll” which inserts a beautiful musical video throughout your content. You really need this viral bump (publisher’s words, not yours) so you disable minimum content length and the rules regarding acceptable speed bump distance from start/end of the post. Greedy!
But, maybe that’s a little too extreme. You want to show it in certain situations, say, only when the previous paragraph contains the phrase ‘give {something} up’. Here’s how you would achieve that:
Each rule is hooked to that speed bump’s “constraints” filter. To remove a rule, simply remove the filter which defines that rule, like these lines which remove the default rules for your speed bump:
Compatability: Remove direct $wp_filter access for WP 4.7 compatability.
Compatability: Fix issues throwing warnings in PHP7.
Feature: Add “last ditch fallback” option for speed bump registration.
Feature: Add filter around speed bump insertion content.
Performance: Unregister speed bumps when global constraints prevent them being inserted.
Performance: Unregister speed bumps after inserting them the maximum number of times.
Performance: Allow speed bump constraint filters to short-circuit other filters at an insertion point, or to skip all remaining insertion points in a document.