Add Azure Language Services provider
Description of the Change
This PR adds Azure Language Services as a provider and adds it to the Excerpt Generation feature.
Closes #159
How to test the Change
Testing Steps:
- Create new Azure resource for Language Services
- Enter Credentials into the Excerpt Generation feature screen
- Confirm valid credentials allow feature to be enabled
- Test 'Generate Excerpt' tag for allowed post types.
Changelog Entry
Added - Azure Language Services provider with Excerpt Generation.
Credits
Props @psorensen @cadic @jeffpaul @Sidsector9 @dkotter
Checklist:
- [x] I agree to follow this project's Code of Conduct.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [x] All new and existing tests pass.
@psorensen thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?
@dkotter How should I handle the VIP flag for wp_remote_get usage? Should I conditionally use it if defined, or ignore this rule?
@dkotter How should I handle the VIP flag for
wp_remote_getusage? Should I conditionally use it if defined, or ignore this rule?
So we've not been consistent with this so far in the codebase. We've basically done both, where we use vip_safe_wp_remote_get if it exists (see here) and otherwise use wp_remote_get and in other places we just use wp_remote_get and add an ignore statement.
Personally I'd prefer we go with the first approach, as this is technically a VIP approved plugin so it's nice to match their standards. We have had issues though a few times with timeouts, as some of these services take a bit to return. vip_safe_wp_remote_get only allows you to set a timeout of 3 seconds so if we need higher than that here, we'll want to stick with wp_remote_get only
sounds good @dkotter - I've included a helper function to facilitate a refactor of all the existing usage of wp_remote_get
@psorensen is this still WIP or can this formally go through review/merge?
@jeffpaul Good to review - removed the WIP from the title
@dkotter @Sidsector9 back to you for review