Prevent plugin from intruding on wp-json posts api

Basically what you would want is to disable the RPWE widget whenever a request is made through the API. I haven’t tested it, but this might work:

 add_action ('widgets_init', 'wpse332374_remove_rpwe', 0, 1000) // make sure this is the last action
 function wpse332374_remove_rpwe() {
   if (is_rest()) unregister_widget ('recent_post_widget_extended'); // or whatever the handle is
   }

Note that is_rest() is not a standard WP function. It’s a solution proposed for another question about selective functionality for API calls.