{"id":23182,"date":"2013-04-30T00:45:51","date_gmt":"2013-04-30T00:45:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/ab-api-call-logger\/"},"modified":"2013-04-30T02:56:08","modified_gmt":"2013-04-30T02:56:08","slug":"ab-api-call-logger","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/ab-api-call-logger\/","author":3397,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1","stable_tag":"trunk","tested":"3.6.1","requires":"3.5.1","requires_php":"","requires_plugins":"","header_name":"API Request Collector","header_author":"Aaron Brazell","header_description":"","assets_banners_color":"","last_updated":"2013-04-30 02:56:08","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/technosailor.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":2043,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1443603","resolution":"1","location":"plugin","width":1042,"height":172}},"screenshots":{"1":"This screenshot (properly obfuscated to protect the innocent) shows a clickable list of API calls performed."}},"plugin_section":[],"plugin_tags":[1556,734],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-23182","plugin","type-plugin","status-publish","hentry","plugin_tags-api","plugin_tags-development","plugin_committers-technosailor"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/ab-api-call-logger.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/ab-api-call-logger\/trunk\/screenshot-1.png?rev=1443603","caption":"This screenshot (properly obfuscated to protect the innocent) shows a clickable list of API calls performed."}],"raw_content":"<!--section=description-->\n<p>This is a very simple plugin that creates a new adminbar menu with a list of pertinent API calls used on a page.<\/p>\n <p>However, no good thing happens in a vacuum, and you good folks, are developers.<\/p>\n <p>In order to log API calls, you should invoke the <code>log_api_call()<\/code> method of the <code>$ab_api_logger<\/code> global object. Of course, if you prefer, you can instantiate your own object using the <code>AB_API_Logger<\/code> class.<\/p>\n <p>The <code>log_api_call()<\/code> method takes two properties. The first is an array of URLs that will be included as menu items (easy access, easy click to see responses). By default, the plugin maintains a property <code>$api_calls<\/code> with this array and uses it to  parse out the menu items.<\/p>\n <p>However, if you wish to maintain your own array, you can do that too. The plugin takes care of what it needs, and you can feel free to maintain what you need.<\/p>\n <p>The second argument for the <code>log_api_calls()<\/code> method is the URL that will be added to the adminbar menu. You can escape it if you want, but I will as well for security.<\/p>\n <p>The reason I built this plugin is because I deal with APIs a lot. My normal approach to API integration is to use a pre-existing PHP library or, more commonly, build a library around the API so I can use it easily without having to remember everything.<\/p>\n <p>Usually, this means I create a class and that class is filled with methods that construct a URL based on parameters and then use <code>wp_remote_get()<\/code> to retrieve the response from the API. Anytime <strong>after<\/strong> the URL is created, invoke this plugin:<\/p>\n <pre><code>if( class_exists( 'AB_API_Logger' ) ) {     \/\/ Example API Call: $api_url (http:\/\/api.example.com?apikey=asdfASD234&amp;post_id=213)     global $ab_api_logger;     $ab_api_logger-&gt;log_api_call( $ab_api_logger-&gt;api_calls, $api_url ); } <\/code><\/pre>\n <p>Pull requests can be submitted via <a href=\"https:\/\/github.com\/technosailor\/ab-api-call-logger\">Github<\/a><\/p>\n\n<!--section=changelog-->\n<h4>0.1<\/h4>\n <ul>\n<li>Initial Release.<\/li>\n<\/ul>","raw_excerpt":"This plugin is made for plugin developers that work with APIs and need easy access to debug information.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23182"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/technosailor"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23182"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23182"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23182"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23182"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23182"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}