Skip to content

Saving a big post with Yoast enabled is terribly slow. #16713

@maciejmackowiak

Description

@maciejmackowiak
  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

  1. Saving posts with a lot of links and images takes ages to save.
  2. The other issue is that it also results in timing out the wp autosave ajax request and triggering "connection lost" notice, luckly it doesn't prevent post from being save because.

Looks like the culprit is Indexable_Link_Builder->build() added to wp_insert_post hook in Indexable_Post_Watcher

I've tested it on blank wp install with only Yoast and classic editor installed:
First request is with Yoast enabled and the second one is with Yoast disabled, both requests are wp_autosave:
obraz

Here is sample post:
https://gist.github.com/maciejmackowiak/277427859825d232fe2a37a21d15d7cf

Please describe what you expected to happen and why.

  1. Optimize the Indexable_Link_Builder or if it is not possible to optimize run it in cron job.
  2. Do not run Indexable_Link_Builder on autosaving posts.

How can we reproduce this behavior?

  1. Create a post with a lot of links and images - https://gist.github.com/maciejmackowiak/277427859825d232fe2a37a21d15d7cf
  2. Try to save/autosave the post.

Technical info

  • If relevant, which editor is affected (or editors):
  • Classic Editor
  • Gutenberg
  • Classic Editor plugin
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other

Used versions

  • WordPress version:
  • Yoast SEO version:
  • Gutenberg plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
  • Tested with theme:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions