Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • Google+
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
Web Design ›
Please fix your WP.org Plugin screenshots

Please fix your WP.org Plugin screenshots

January 1, 2015 Web Design Jesin A 2 Comments

This is a mistake committed even by people I consider the Gods of WordPress (as you’ll see in the screenshot below) and plugins with a million downloads. Even the plugin’s created by the plugin reviewers weren’t spared. Rather than a mistake I would say they all overlooked this minor setting that can ruin a plugin hunter’s experience.

The WordPress.org plugin repository has (or rather had) an annoying feature, when you click on a plugin screenshot on the hopes of viewing it larger the browser pops up the download box like this:

wordpress-plugin-screenshots-download-popup

I sent a HEAD request to the screenshot’s link using curl and got the following reply:

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: application/octet-stream
Date: Wed, 31 Dec 2014 16:22:53 GMT
Etag: "680057//wordpress-seo/assets/screenshot-1.png"
Last-Modified: Mon, 11 Mar 2013 21:59:57 GMT
Server: ECS (sin/EC29)
X-Cache: HIT
X-Pad: avoid browser bug
Content-Length: 195554

The Content-Type header is set to application/octet-stream which is why Firefox opened the download dialog box.

I’m not an expert in SVN or Git and thought this was how the plugin repo worked until I landed on this article by Sarah Gooding on WPTavern. It explained the importance of having screenshots for plugins but what caught my eye was a comment by Samuel Wood (aka Otto).

And set their mime type correctly in svn. Helps a lot. 🙂

I quickly googled “svn set mime type” and came up with the following solution. Users of TortoiseSVN please follow this documentation.

Enter the plugin directory:

cd your-plugin-dir

Check the status of the local copy to make sure there are no changes after the last check in.

svn stat

Check the existing MIME type of the image files.

svn propget svn:mime-type assets/*

It is most probably “application/octet-stream” which is why the images are being downloaded. Set their MIME type appropriately.

svn propset svn:mime-type image/jpeg assets/*.jpg
svn propset svn:mime-type image/jpeg assets/*.jpeg
svn propset svn:mime-type image/png assets/*.png

Check for differences now.

svn diff

You’ll see something like this for each image file:

Property changes on: assets/screenshot-1.png
___________________________________________________________________
Modified: svn:mime-type
- application/octet-stream
+ image/png

Check in the changes to the WP.org plugin repository.

svn ci -m "Modify mime-type of screenshots"

That’s it, wait for a few minutes and try clicking on the images under the “Screenshots” tab.

You can enable “auto-props” for subversion so that all files created in the future have their MIME type automatically set based on their extension.

Related posts:

remove w3 total cache commentW3 Total Cache Remove Footer How to customize the BuddyPress activation email wordpress hooks search tool thumbnailWordPress Hooks (Actions and Filters) Search Tool php category thumbnailRedirecting WordPress archives to a page How to prevent WordPress comment Spam using JavaScript

Tags: svn, wordpress

Comments

  1. Piet says

    January 5, 2015 at 7:42 am

    Thanks for the instructions.

    I use Cornerstone (Mac only I think) and there you can go into Get Info (CMD + I) and then switch to the tab Properties, where you can change the MIME Type with a dropdown.

    Reply
  2. Otto says

    January 5, 2015 at 10:04 am

    Please read our blog. We do try. 😉

    https://make.wordpress.org/plugins/2014/03/20/plugin-screenshots-downloading/

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.