Automattic / Automattic/jetpack
Shortcodes: embed filters stripping HTML from services not supported by any Jetpack shortcode
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
In #5838 we added new methods to convert HTML into Jetpack shortcodes. Unfortunately, those methods are active as soon as you activate the Shortcode Embeds module and are not specific to the shortcodes supported in Jetpack.
As a result, other unrelated HTML embeds get stripped when Jetpack should not touch.
Example in 3129369-t where forms added via the Optinmonster plugin get stripped by Jetpack. When commenting out these two lines:
https://github.com/Automattic/jetpack/blob/master/modules/shortcodes/class.filter-embedded-html-objects.php#L9-L10
... the issue goes away.
Contributor guide
Research direction
Start with modules/shortcodes/class.filter-embedded-html-objects.php, especially lines 9–10, and trace how the Shortcode Embeds module registers the HTML conversion methods. Reproduce the Optinmonster form case from the issue and verify that unrelated embeds remain intact while supported Jetpack shortcode conversions still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100