• Resolved Glenn

    (@gadgetgusto)


    WooCommerce products have Blank Thumbnails in WP Media Library

    Problem:
    Blank thumbnails in WordPress Media Library after uploading downloadable file (Photo) and entering the URL in WooCommerce for a product.

    My Procedure:
    1. In “Add Product” of the WooCommerce plugin, under “downloadable files” I select “choose file”
    2. After the WordPress “Media Library” launches, I select the “Upload Files” tab, then choose the file to upload (how I put the files in …/wp-content/uploads/woocommerce_uploads to secure the file until purchased)
    3. File uploads to the media library
    4. Choose the “insert file URL” button.
    5. I checked my server, file is uploaded to the directory…/wp-content/uploads/woocommerce_uploads
    6. BUT, the thumbnail in the WordPress media library is blank. (They also don’t appear when I use them as a Product Image for a product-as a test)

    My Attempts to Solve the Problem:
    1. Regenerated all Thumbnails with the “Force Regenerate Thumbnails” Plugin
    2. Checked the permissions in my woocommerce_uploads folder on the server, which are 755 (Folder) and 644 (files)
    3. Deactivated the woocommerce plugin then re-activated it.
    4. The .htaccess file on the server in woocommerce_uploads folder contains “deny from all” and in the WooCommerce plugin under Settings>Products>Downloadable Products, I chose “Force Downloads” as the “File Download Method”
    5. GD Module/Extension is included with all PHP versions according to SiteGround.com server host.

    Final Question if the above is not fixed: Will users still be able to download the product?

    • This topic was modified 6 years, 8 months ago by Glenn.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    This has to do with security around the WC downloads folder, and maybe some server config.

    I’d just test to see if the items can still be downloaded.

    Thread Starter Glenn

    (@gadgetgusto)

    Thank you. I presented the problem to my server host, Site Ground, but they said it was something else. I’ll check with them again.

    Glenn

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    I’m actually able to replicate this on my test site(s) as well. Upload an image for a downloadable product file, then view it in the media gallery.

    Can’t say for sure though if this is a bug or not, as it may be an expected / necessary result of protected permissions that is needed for downloadable files.

    If the image needs to be used elsewhere on the site and doesn’t require strict protections (like it is just apart of the a bigger download for example), then you could upload first in the media gallery, then link to it in the downloadable area.

    Thread Starter Glenn

    (@gadgetgusto)

    Thanks. This is what the web host (Site Ground) said): I have added the following line in your ~/public_html/.htaccess file and then I uploaded 2 images successfully.

    SetEnv MAGICK_THREAD_LIMIT 1

    Please, delete the images with the broken thumbnails and re-upload them from the media library again.
    —————————–
    However, the problem still occurs with my following response (additional info for this thread). Site Ground is very helpful and we are working on it, but still no solution.

    Thanks but still not working. You may have tested it by going to Media Library first, then “Add New” and “select files.” Then going to the Woocommerce product page and entering the URL. Yes, this works but it does not place the file in …/wp-content/uploads/woocommerce_uploads. It needs to be here to secure the file from linking or downloading until after the purchase.

    It still doesn’t work when I actually start in the Woocommerce product page like this:
    1. In “Add Product” of the WooCommerce plugin, under “downloadable files” I select “choose file”
    2. After the WordPress “Media Library” launches, I select the “Upload Files” tab, then choose the file to upload (I need put the files in …/wp-content/uploads/woocommerce_uploads to secure the file until purchased)
    3. File uploads to the media library
    4. Choose the “insert file URL” button.
    5. I checked my server, file is uploaded to the directory…/wp-content/uploads/woocommerce_uploads
    6. BUT, the thumbnail in the WordPress media library is blank.

    Even after regenerating my images/thumbnails, nothing works.

    Note: in several of the htaccess files, the previous tech replaced “deny from all” to “options +index” or something like that.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Just checked with our developers.

    The WC uploads directory is protected so files won’t be readable/viewable in media library. The folder has htaccess rules to block direct access.

    So it is expected behavior with downloads.

    Thread Starter Glenn

    (@gadgetgusto)

    Latest update:

    My Procedure:
    1. In “Add Product” of the WooCommerce plugin, under “downloadable files” I select “choose file”

    2. After the WordPress “Media Library” launches, I select the “Upload Files” tab, then choose the file to upload (Required to put the files in …/wp-content/uploads/woocommerce_uploads to secure the file until purchased. Starting in the “Media Library first puts file in …/wp-content/uploads and not protected)

    3. File uploads to the media library

    4. Choose the “insert file URL” button.

    5. I checked my server, file is uploaded to the directory…/wp-content/uploads/woocommerce_uploads

    6. BUT, the thumbnail in the WordPress media library is blank.

    My Attempts to Solve the Problem (with web host support and woocommerce plugin support):

    1. The .htaccess files on the server were modified according to the following folder/file paths:

    – public_html/.htaccess – Added at the bottom
    SetEnv MAGICK_THREAD_LIMIT 1
    – public_html/wp-content/uploads/.htaccess – Replaced “deny from all” with
    Options +Indexes
    RewriteBase /
    RewriteOptions InheritDown
    – public_html/wp-content/uploads/woocommerce_uploads/.htaccess – Replaced “deny from all” with
    Options +Indexes
    – public_html/wp-content/uploads/wc-logs/.htaccess – Replaced “deny from all” with
    Options +Indexes

    2. Regenerated all Thumbnails with the “Force Regenerate Thumbnails” Plugin

    3. Checked the permissions in my woocommerce_uploads folder on the server, which are 755 (Folder) and 644 (files)

    4. Deactivated the woocommerce plugin then re-activated it. the “File Download Method”

    5. GD Module/Extension is included with all PHP versions according to SiteGround.com server host.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Thread Starter Glenn

    (@gadgetgusto)

    Ok, thanks all. Appreciate it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WooCommerce products have Blank Thumbnails in WP Media Library’ is closed to new replies.