Disable Submit-Button, until recipe-global settings are loaded

[ad_1]

Hi there

We found a big conceptional bug in the global settings page of the plugin (/wp-admin/admin.php?page=delicious_recipes_global_settings)

Until the response of /wp-json/deliciousrecipe/v1/recipe-global is received, the whole settings form is pre-filled with default values, so it shouldn’t be possible to submit the form with this values. But it is!

This could (and have for us in production) lead to lost of all your options and could easily be avoided by disabling the submit button, until the REST API has responded and the settings form is populated with the values from the response!

How to reproduce:

  1. open DR Settings /wp-admin/admin.php?page=delicious_recipes_global_settings
  2. set some custom options and save
  3. throttle network speed to very low, reload options page and then submit the Settings until the request to /wp-json/deliciousrecipe/v1/recipe-global is pending
  4. all your plugin settings are back to default values

 

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