Automattic / vip-go-wpcom-compat

VIP Go / WordPress.com Compatibility
https://wpvip.com
2 stars 6 forks source link

CLI to reverse protected embeds whenever possible #24

Closed joshbetz closed 5 months ago

joshbetz commented 5 years ago

Some protected embeds are handled by core (i.e. youtube). We should reverse these whenever possible.

We have to be careful to make sure they actually match. Just because the domain matches doesn't mean the embed is exactly the same.

Suggest two pass system:

  1. Run the embed code through the embed to shortcode functionality on WordPress.com
  2. Use oembed_get to render the content and compare to the embed we have stored. Reverse if they match.
joshbetz commented 5 years ago

It might make sense to queue this as a cron (or series of cron) that run after post-import cleanup.

joshbetz commented 5 years ago

On WordPress.com, we run do_shortcodes on protected embeds. If we find any shortcodes in the protected embeds table, we can replace the post_content with the shortcode directly.