PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
3 stars 0 forks source link

Error logging can break JSON responses from the REST API if display_errors is enabled #226

Closed MichelleBlanchette closed 6 months ago

MichelleBlanchette commented 6 months ago

Some routes have multiple endpoints (support multiple HTTP methods) which causes all of the registered endpoints' permission_callback to be ran as WordPress determines which HTTP methods are available for each registered REST API route.

This implies two things for us:

  1. We shouldn't use log methods that display errors (but WordPress VIP hosting doesn't allow file writes outside of /wp-content/uploads)
  2. We shouldn't use advanced permission checks, such as Asana_Interface::has_connected_asana()

Screenshot 2024-05-05 at 11 11 28 AM

Relates to https://github.com/PurpleTurtleCreative/completionist/issues/134