At the moment, before loading any functionality related to content syncing, tracking or blocks, we call our is_configured utility function. If that function returns false, we don't load the aforementioned functionality and instead we output an admin notice (though only on the WP plugins screen).
The is_configured functions checks to see if any settings are blank and if so, returns false. This means if any settings aren't in place (like the override settings) no functionality gets loaded.
This PR fixes this by modifying our is_configured function to allow checking of each individual section of settings (collector, automation, override or all). We then utilize this to determine what functionality should be loaded as such:
If any Collector settings are blank, we don't load content syncing, tracking or the WP-CLI command
If any Automation settings are blank, we don't load our blocks or site automation functionality
If any Collector or Automation settings are blank, we continue to show our admin notice but we don't stop execution at that point anymore, due to the more strict checks mentioned above
Note: this doesn't change any of the validation, saving or output of error messages on the settings page. Those all remain the same.
Closes #356
Alternate Designs
None
Possible Drawbacks
Should be none but should verify all functionality loads as expected
Verification Process
Add and remove various settings and ensure everything works as expected
Description of the Change
At the moment, before loading any functionality related to content syncing, tracking or blocks, we call our
is_configured
utility function. If that function returnsfalse
, we don't load the aforementioned functionality and instead we output an admin notice (though only on the WP plugins screen).The
is_configured
functions checks to see if any settings are blank and if so, returnsfalse
. This means if any settings aren't in place (like the override settings) no functionality gets loaded.This PR fixes this by modifying our
is_configured
function to allow checking of each individual section of settings (collector, automation, override or all). We then utilize this to determine what functionality should be loaded as such:Note: this doesn't change any of the validation, saving or output of error messages on the settings page. Those all remain the same.
Closes #356
Alternate Designs
None
Possible Drawbacks
Should be none but should verify all functionality loads as expected
Verification Process
Add and remove various settings and ensure everything works as expected
Checklist:
Changelog Entry
Credits
Props @dkotter