Mather-Sophi / sophi-for-wordpress

WordPress VIP-compatible plugin for the Sophi.io Site Automation service.
https://sophi.io
GNU General Public License v2.0
21 stars 7 forks source link

Modify the `is_configured` check #361

Closed dkotter closed 2 years ago

dkotter commented 2 years ago

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 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:

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

Changed - Update our configured check to be smarter

Credits

Props @dkotter

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 32 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication