awesomemotive / all-in-one-seo-pack

All in One SEO plugin for WordPress SEO
https://aioseo.com
339 stars 155 forks source link

Bug - Preview Snippet hangs for long posts #3050

Closed arnaudbroes closed 4 years ago

arnaudbroes commented 4 years ago

Not really a bug but for long posts the Preview Snippet may hang while it the JavaScript code processes the content to figure out the description.

By reducing the amount of characters it has to process, we should be able to reduce the impact.

arnaudbroes commented 4 years ago

@EkoJR can you see if you can reproduce this?

EkoJR commented 4 years ago

The problem is with the Regex

https://github.com/semperfiwebdesign/all-in-one-seo-pack/blob/9cd79a41978c6f7d28ec5a46bdf4d6957721adaf/js/admin/aioseop-preview-snippet.js#L142

snippet_performance

Steps to Reproduce

  1. Just have AIOSEOP active; Classic Editor plugin is not required.
  2. Create a new post.
  3. In the content, using Gutenberg, click the + button to select the block type, and select Classic.
  4. Add 10000+ characters to the post.
  5. Typing additional characters in content begins to cause the UI to hang.