omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

Adding permission to callback which helps to removes a warning message on Wordpress 5.5. #188

Closed mayurkathale closed 4 years ago

mayurkathale commented 4 years ago

1. Objective

Warning messages are shown on Admin backend page regarding rest api once Wordpress version is upgraded to 5.5. This messages are shown on backend page or error logs.

Warning message screenshot (WooCommerce product page): wp-warning-message

Related information: Internal Ticket: https://phabricator.omise.co/T22923

2. Description of change

Updated PHP class Omise_Rest_Webhooks_Controller. Added "permission_callback" parameter to register_rest_route() which defines this webhook as Public.

Adding this parameter is required in Wordpress 5.5 and warning message gets removed.

3. Quality assurance

🔧 Environments:

Try to visit admin backend pages this should not display any error message. e.g. Edit Product page.

4. Impact of the change

NA

5. Priority of change

Normal

6. Additional Notes

NA

danfowler commented 4 years ago

@mayurkathale can you let me know when ready for review?