You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a debugging mechanism in the Apple News plugin that allows developers to easily preview the full API request data for a given post. The debugging feature should be easily accessible, but restricted to admin users only for security.
Add a new debug_api() method to the Apple_Push class that outputs the API request data when a specific URL parameter (apple_news_debug) is present and the current user is an admin.
The debug_api() method should output the post ID for context, followed by the JSON article data, asset bundles, and post metadata. The output should be clearly separated and formatted for readability.
After outputting the debug data, the method should exit to prevent further execution and avoid actually sending the API request.
Add a new "Debugging" section to the plugin that explains how to use the apple_news_debug parameter to preview API request data.
To test this feature:
Verify that the debug output is only shown when the URL param is present and the user is an admin
Confirm the output contains all expected API request data and is formatted properly
Ensure normal API requests are not affected when the debug parameter is not set
This debugging feature will be a valuable tool for plugin developers, making it much easier to diagnose API issues and validate the data being sent to Apple News.
Use Case
As a developer working on the Apple News plugin, I often need to see the exact data being sent to the Apple News API for a given post. This is necessary for validating the data and diagnosing any issues with the API requests. However, currently there's no easy way to inspect the full request payload, especially for data that's not included in the typical debug output, such as metadata added by custom rules.
The text was updated successfully, but these errors were encountered:
I think we should add a menu option in the Apple News post list (like we have for Download, which downloads the article JSON) which previews what would be sent to the API. Same idea as what you have above, except making it easier to access by putting it in the same place where users already download article JSON. That interface is already restricted to users with manage_options by default (so, admins).
Description
Implement a debugging mechanism in the Apple News plugin that allows developers to easily preview the full API request data for a given post. The debugging feature should be easily accessible, but restricted to admin users only for security.
debug_api()
method to theApple_Push
class that outputs the API request data when a specific URL parameter (apple_news_debug
) is present and the current user is an admin.debug_api()
method should output the post ID for context, followed by the JSON article data, asset bundles, and post metadata. The output should be clearly separated and formatted for readability.apple_news_debug
parameter to preview API request data.To test this feature:
This debugging feature will be a valuable tool for plugin developers, making it much easier to diagnose API issues and validate the data being sent to Apple News.
Use Case
As a developer working on the Apple News plugin, I often need to see the exact data being sent to the Apple News API for a given post. This is necessary for validating the data and diagnosing any issues with the API requests. However, currently there's no easy way to inspect the full request payload, especially for data that's not included in the typical debug output, such as metadata added by custom rules.
The text was updated successfully, but these errors were encountered: