sophi-for-wordpress icon indicating copy to clipboard operation
sophi-for-wordpress copied to clipboard

Add admin notice if plugin settings are causing Sophi auth issue

Open jeffpaul opened this issue 2 years ago • 0 comments

Is your enhancement related to a problem? Please describe.

If someone enters malformed or inaccurate settings in the plugin (e.g. inaccurate Host/Tenant ID or Site Automation URL, inaccurate Client ID/Secret or Override API URL), then the Sophi Site Automation block will usually get an unauthorized response from Sophi and default to a WP_Query request for the 5 most recent posts. We should do a better job of surfacing plugin settings that cause an unauthorized response from Sophi in an admin notice error so that an admin/editor knows immediately and can fix the plugin settings to ensure the Sophi service will work as expected.

Designs

If settings cause a Sophi unauth error, throw an admin error notice: Collector settings are incorrect and unable to connect to the Sophi.io service. Please update these settings and Save Changes to ensure proper communication with Sophi.

or

Site Automation settings are incorrect and unable to connect to the Sophi.io service. Please update these settings and Save Changes to ensure proper communication with Sophi.

or

Override settings are incorrect and unable to connect to the Sophi.io service. Please update these settings and Save Changes to ensure proper communication with Sophi.

Describe alternatives you've considered

I'd recommend implementing this change in tandem with #59 as they together help improve the UX of settings handling in the plugin.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jeffpaul avatar Nov 01 '22 19:11 jeffpaul