FortAwesome / wordpress-fontawesome

Font Awesome Official WordPress Plugin
Other
57 stars 19 forks source link

Make Font Awesome 6 the default and update latest_version handling #171

Closed mlwilkerson closed 2 years ago

mlwilkerson commented 2 years ago

The theme of this PR is tidying up some details related to Font Awesome 6--in particular, using the latest version 6 as the default upon activation. Prior to this PR, the plugin worked with Font Awesome 6, both for kits and cdn. However, there were some missing pieces for making it the default, and for showing it as the latest in the version dropdown on the admin settings page.

The key underlying issue is that the symbolic version "latest" that appears in the GraphQL API has been deprecated since the release of Font Awesome 6. With the release of Font Awesome 6, the symbolic versions "5.x" and "6.x" were introduced, corresponding to the "latest version 5" and the "latest version 6," respectively. The deprecated symbolic version "latest" continues to resolve exactly the same as "5.x".

So everywhere that this plugin assumed that there was only one kind "latest" version, that needed to be updated.

A related API change is that FontAwesome::latest_version() is being deprecated. FontAwesome::latest_version_5() and FontAwesome::latest_version_6() are being introduced to correspond to "5.x" and "6.x," respectively. FontAwesome::latest_version() is defined to produce exactly the same result as FontAwesome::latest_version_5().

Thus, the PHP API changes directly mirror the symbolic version changes in the GraphQL API.

Secondarily, this PR updates JavaScript dependencies, to address security notifications from dependabot.

Finally, it includes some additional error reporting for failed requests to the REST API.

Closes #163 Closes #162 Closes #107

TODO: