-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecated get_option notice when viewing Analytics > Orders #49092
Conversation
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Hi , @woocommerce/automata Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix.
Confirmed the deprecated get_options
and update_options
notices are no longer logged. LGTM.
Submission Review Guidelines:
Changes proposed in this Pull Request:
When viewing Analytics > Orders a deprecated message is shown/logged. The reason this happens is because we switched to using a whitelist for allowed options, since WC 6.3. The option
woocommerce_orders_report_date_tour_shown
was not included in this whitelist, which is what this PR changes.We can observe the requests for options by viewing the API requests when visiting Analytics > Orders. There we can see the request to:
https://domain.test/wp-json/wc-admin/options?options=woocommerce_task_list_reminder_bar_hidden%2Cwoocommerce_orders_report_date_tour_shown%2Cwoocommerce_date_type&_locale=user
The only option that was missing from the whitelist was
woocommerce_orders_report_date_tour_shown
. I also checked all the other Analytics pages to ensure they aren't loading any options that weren't whitelisted.Closes #47026
Closes #37592
How to test the changes in this Pull Request:
woocommerce_orders_report_date_tour_shown
tono
(only needed if previously viewed)Got it
to acknowledge the noticewp-content/debug.log
and confirm we see both deprecation messages forget_options
andupdate_options
get_options
orupdate_options
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment