Skip to content

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

Merged
mayurkathale merged 1 commit intomasterfrom
fix-rest-api
Sep 8, 2020
Merged

Adding permission to callback which helps to removes a warning message on Wordpress 5.5.#188
mayurkathale merged 1 commit intomasterfrom
fix-rest-api

Conversation

@mayurkathale
Copy link
Copy Markdown
Contributor

@mayurkathale mayurkathale commented Aug 31, 2020

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:

  • WooCommerce: v4.4.1
  • WordPress: v5.5
  • PHP version: 7.2.1
  • Omise plugin version: Omise-WooCommerce 4.1
    ✏️ Details:

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

@mayurkathale mayurkathale changed the title [WIP] Adding permission to callback which helps to removes a warning message. [WIP] Adding permission to callback which helps to removes a warning message on Wordpress 5.5. Aug 31, 2020
@mayurkathale mayurkathale requested a review from danfowler August 31, 2020 06:26
@danfowler
Copy link
Copy Markdown
Contributor

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

@mayurkathale mayurkathale changed the title [WIP] Adding permission to callback which helps to removes a warning message on Wordpress 5.5. Adding permission to callback which helps to removes a warning message on Wordpress 5.5. Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants