Support » Plugin: Plugin README Parser » Images under 'assets' will not display

  • Since the WordPress plugin repository now allows the inclusion of an “assets” top directory, where snapshots and the cute banner for the WP plugin page are stored, Artiss README Parser seems not to be able to get them to display them properly. When the snapshot images are inside “trunk”, there is no problem.

    I suppose this can be a simple fix, i.e. test for the existence of “assets” first, and, if it exists, load the images from there. Also, it would be nice to get the banner for the plugin as well 🙂

    http://wordpress.org/extend/plugins/wp-readme-parser/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Gwyneth Llewelyn

    (@gwynethllewelyn)

    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…

    Thread Starter Gwyneth Llewelyn

    (@gwynethllewelyn)

    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…

    Plugin Contributor David Artiss

    (@dartiss)

    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.

    Thread Starter Gwyneth Llewelyn

    (@gwynethllewelyn)

    Great, David 🙂 Thank you very much! As said, it shouldn’t be too hard.

    Plugin Contributor David Artiss

    (@dartiss)

    No, it won’t be 😉

    David.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Images under 'assets' will not display’ is closed to new replies.