Mhh. I’ve looked at the code, and this shoudn’t be too hard. There is a check for:
if ( strtolower( $version ) == 'trunk' ) {
$screenshot_url = 'http://plugins.svn.wordpress.org/' . $plugin_name . '/trunk/';
} else {
$screenshot_url = 'http://plugins.svn.wordpress.org/' . $plugin_name . '/tags/' . $version . '/';
}
and later on:
$this_screenshot = $screenshot_url . 'screenshot-' . $screenshot . '.';
// Depending on file existence, set the appropriate file extension
$ext = arp_check_img_exists( $this_screenshot, 'png' );
Maybe all that is needed is to see if the extension is valid. If not, it means it’s looking under the wrong place, so something like that (at the end of the three checks):
/* add more last checks */
if ( !$ext ) {
$temp_screenshot_url = 'http://plugins.svn.wordpress.org/' . $plugin_name . '/assets/' . 'screenshot-' . $screenshot . '.';
$ext = arp_check_img_exists( $temp_screenshot_url, 'jpeg' );
if (!$ext) $ext = arp_check_img_exists( $temp_screenshot_url, 'jpg' );
if (!$ext) $ext = arp_check_img_exists( $temp_screenshot_url, 'png' );
if (!$ext) $screenshot_url = $temp_screenshot_url;
}
/* original plugin code continues here */
$this_screenshot .= $ext;
I did that, and it seems to have worked 🙂 At least on one case…
Please disregard the request for the banner; I hadn’t seen the [readme_banner] tag before hehe!
But shouldn’t it be retrieving the banner-772×250.png file instead? Or maybe I’m still using the wrong filename? Oops…
Although I return the banner (and only the 772×250 version) I do need to look in the assets folder too for screenshots, which can be placed there. I’ll add that in the next release – plus the option to show the HD banner too.
David.
Great, David 🙂 Thank you very much! As said, it shouldn’t be too hard.