Plugin development advice – Gutenberg content check.

Hello everyone. Not sure if the post really belongs here, but I’ll try.

So, I need to make a plugin that will check the number of links in a post or page while being in editor. I understood that Gutenberg was built using React, so I used the JS Mutation Observer to watch for any content edit. And it turned out that Gutenberg makes three mutations to insert a hyperlink. So I made an array to filter out the duplicates by inserting mutation targets into it and then check against it.

I think there is a better way to do what I’d written, but how? Did anybody have a similar task? If so, please help.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer