This is how you can get the URL of the latest download of a plugin in the WordPress plugin repository. This will get the link URL to the ZIP file of the latest release.
It does not return the HTML link tag, but rather only the URL.
This code goes into your functions.
/** * Get the download link URL for the zip file of the latest version of a plugin on the WordPress repo. */ function isa_latest_plugin_tag_download_url( $plugin_slug ) { $tag = 'Stable tag'; $trunk_readme = @file( 'https://plugins.svn.wordpress.org/' . $plugin_slug . '/trunk/readme.txt' ); if ( is_array( $trunk_readme ) ) { foreach( $trunk_readme as $i => $line ) { if ( substr_count( $line, $tag . ': ' ) > 0 ) { $latest_version = trim( substr( $line, strpos( $line, $tag . ': ' ) + strlen( $tag ) + 2 ) ); return 'https://downloads.wordpress.org/plugin/' . $plugin_slug . '.' . $latest_version . '.zip'; } } } return NULL; }
Questions and Comments are Welcome