Your observation is correct. This is not obvious. Even the book by Brad and Auger (version of the plugin ed. Wrox) contains an error in the example on page 267 in the chapter “Create your own API repository”. Like you, I spent (lost) time to find a problem with two plugins in an alternative API ...
Solution: Remember that the first parameter in the WP filter is the original value passed to the filter. So in order to concatenate filters (listed by plugins using an alternative api) ... the first line should be:
function xiliw_altapi_information( $false, $action, $args ) { $plugin_slug = plugin_basename( __FILE__ ); // Check if this plugins API is about this plugin if( $args->slug != $plugin_slug ) { return $false; // var to conserve the value of previous filter of plugins list in alternate api. fixes book error not val false } // POST data to send to your API $args = array( 'action' => 'plugin_information', 'plugin_name' => $plugin_slug, 'version' => $transient->checked[$plugin_slug], 'registration' => $this->registration );//../..
Performing this test, every time a list of hooks is called up, only one - the corresponding plugin - gives the correct answer for displaying information for the splash window.
If I have the time, I will most likely soon publish a more complete article on the class to manage this alternative powerful API and how to add it to the -private-plugin.
source share