Description
Get plugin information in XML format for cacheingIf the plugin is installed locally we can obtain the information from the plugin data BUT this doesn't necessarily tell us if it's hosted on WordPress.org A null response from bw_get_local_plugin_xml() tells us it's either hosted on wordpress.org OR we don't know about the plugin. If the oik_server is set then we don't bother accessing WordPress.org but point to the oik server. For plugins that are dual hosted ( wordpress.org and an oik server) then it all depends on what's in the current setting for the plugin server. response_xml oik_server action ———— ———- ——————————— null null find information from wordpress.org null set NOT possible set null possibly find information from wordpress.org set set don't bother bw_get_plugin_info2(4) plugin_data Array ( [Name] => oik-nivo-slider [PluginURI] => http://www.oik-plugins.com/oik-plugins/oik-nivo-slider/ [Version] => 1.9 [Description] => [nivo] shortcode for the Nivo slider using oik <cite>By <a href="http://www.bobbingwide.com" title="Visit author homepage">bobbingwide</a>.</cite> [Author] => <a href="http://www.bobbingwide.com" title="Visit author homepage">bobbingwide</a> [AuthorURI] => http://www.bobbingwide.com [TextDomain] => [DomainPath] => [Network] => [Title] => <a href="http://www.oik-plugins.com/oik-plugins/oik-nivo-slider/" title="Visit plugin homepage">oik-nivo-slider</a> [AuthorName] => bobbingwide ) These come from the readme.txt file Requires at least: 3.5 Tested up to: 3.6 <?xml version="1.0" encoding="utf-8"?> <plugin> <name type="string"> <![CDATA[ oik-nivo-slider ]]></name> <slug type="string"><![CDATA[ oik-nivo-slider ]]></slug> <version type="string"><![CDATA[ 1.8 ]]> </version> <author type="string"> <![CDATA[<a href="http://www.bobbingwide.com">bobbingwide</a> ]]> </author> <author_profile type="string"><![CDATA[ http://profiles.wordpress.org/bobbingwide ]]> </author_profile> <contributors type="array"> <bobbingwide type="string"> <![CDATA[ http://profiles.wordpress.org/bobbingwide ]]> </bobbingwide> </contributors> <requires type="string"> <![CDATA[ 3.3 ]]> </requires> <tested type="string"> <![CDATA[ 3.5.2 ]]> </tested> <rating type="double">73.4</rating> <num_ratings type="integer">12</num_ratings> <downloaded type="integer">56775</downloaded> <last_updated type="string"> <![CDATA[ 2013-02-21 ]]> </last_updated> <added type="string"> <![CDATA[ 2012-04-11 ]]> </added> <homepage type="string"> <![CDATA[ http://www.oik-plugins.com/oik-plugins/oik-nivo-slider/ ]]> </homepage>
Usage
bw_get_plugin_info2( $plugin_slug );Parameters
- $plugin_slug
- ( mixed ) required –
Returns
voidSource
File name: oik-bob-bing-wide/shortcodes/oik-plug.phpLines:
function bw_get_plugin_info2( $plugin_slug ) { list( $response_xml, $oik_server ) = bw_get_local_plugin_data( $plugin_slug ); //bw_trace( $response_xml, __FUNCTION__, __LINE__, __FILE__, "response_xml" ); if ( $oik_server ) { // We found the plugin information and also know that it's an oik server } else { // We may have found the plugin information OR believe it's wordpress.org // let's check wordpress.org. If we find some information overwrite what we already know. $request_url = "http://api.wordpress.org/plugins/info/1.0/$plugin_slug.php?fields[short_description]=true"; $response_xml = bw_remote_get2( $request_url ); //, null ); //$response_xml = bw_analyze_response_xml2( $response_xml2, $response_xml ); } //bw_trace( $response_xml, __FUNCTION__, __LINE__, __FILE__, "response_xml" ); return $response_xml; }View on GitHub
