API Request Collector

Description

Version: 0.1

This is a very simple plugin that creates a new adminbar menu with a list of pertinent API calls used on a page.

However, no good thing happens in a vacuum, and you good folks, are developers.

In order to log API calls, you should invoke the log_api_call() method of the $ab_api_logger global object. Of course, if you prefer, you can instantiate your own object using the AB_API_Logger class.

The log_api_call() 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 $api_calls with this array and uses it to parse out the menu items.

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.

The second argument for the log_api_calls() 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.

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.

Usually, this means I create a class and that class is filled with methods that construct a URL based on parameters and then use wp_remote_get() to retrieve the response from the API. Anytime after the URL is created, invoke this plugin:if( class_exists( 'AB_API_Logger' ) ) {
// Example API Call: $api_url (http://api.example.com?apikey=asdfASD234&post_id=213)
global $ab_api_logger;
$ab_api_logger->log_api_call( $ab_api_logger->api_calls, $api_url );
}

Pull requests can be submitted via Github

Tags: api, development

Tags

Requirements

Requires: 3.5.1 or higher
Compatible up to: 3.6-beta1
Last Updated: 3 years ago
Active Installs: Less than 10

Download URL

https://downloads.wordpress.org/plugin/ab-api-call-logger.zip

About

Plugins Room is a directory of WordPress and premium plugins & themes. It’s a place to find all the plugins with a quick download link.

The official WordPress.org Plugin Directory has over 60,000 plugins and themes and is very useful but it only lists free plugins. Thousands of premium WordPress plugins have been released in the last 10 years. Finding them is not always easy because they hasn’t been a directory like there is for free plugins.

The purpose of Plugins Room is to make finding premium WordPress plugins as easy as it is to find free plugins.

If you’re a plugin/theme author, please write us and we can promote your product. The listings on this website come directly from plugin makers. Give us content and we’ll give you exposure. It’s as simple as that.

Questions or comments? Get in touch. We’re listening.

PS: Like the official plugin directory, the plugins listed on this website use 100% GPL-compatible licensing.

Login

This space is used by subscribed members for advanced search and settings.Contact us to find the rates and benefits

We're sorry, could not find this email in our list..

Contact

Feedback, suggestions, scathing criticism goes here.

We're sorry, could not find this email in our list..

Yes! your message was sent and we'll be delivered in couple of seconds.

Sign Up

Disclaimer

This project is made by a comunity of developers and enthousiasts and is 100% FREE for use. Our aim is to help developers, designers, freelancers, start-ups and any Wordpress user to find better scripts in one single place. All the content, description, as well as the downloadable materials are reproduced from public, free to access sources. We do not accept any responsibility or liability for the accuracy, content, completeness, legality, or reliability of the data from any third party site. We reserve the right to use affiliate, sponsored or other marketing methods to promote other commercial products, similar to your search results.

[Tip for developers]: If you find an outdated material or incompatible for use script pelase let us know and we'll do our best to fix the problem so that other users like you can enjoy this place.