WordPress.org

Ready to get started?Download WordPress

Forums

EWWW Image Optimizer
[resolved] Unsupported file type and Bulk Optimize bug (13 posts)

  1. Julian Fernandes
    Member
    Posted 2 years ago #

    Hello,
    Recently i moved to a new VPS and so, i moved my files too.

    I first used WordPress's import feature, but it did not download some files... so i deleted the folder and used wget to get it all the folder from my old host. Everything works fine... WP can see the files, and all.

    But there is one problem: EWWW Image Optimizer seems to not see them anymore. In WP's media page is shows Unsupported file type and when i try to use Bulk Optimize it look for the images at /wp-content/uploads/ instead of /wp-content/uploads/2012/...

    Any help with that? Servers are going to go live tomorrow, so i really wanted to finish this setup :/

    http://wordpress.org/extend/plugins/ewww-image-optimizer/

  2. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    Seems like the paths are not set quite right in the image meta information on the new install, as that's where EWWW looks to figure out what file it is working on. Oddly, you should be getting totally different error messages. I wonder if wget messes up something on the images, but that seems unlikely. Do you have ftp access to both systems?
    I would have copied all the files to my local computer via ftp/sftp, and then uploaded them using the same method to the new server. Or even better, moved them directly from server to server using scp (if you have shell access). Something like this run from the command line on the new machine should have done it:
    scp -r username@oldservername:/oldpath/wp/ /newpath/wp/

    Is there a way I could look at the new site before it goes live? Just to verify for my own mind that wordpress does indeed see the files where they currently are? Email me via the contact form on my website if need be (http://shanebishop.net).

  3. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    Let's try one other thing also for debugging. Modify the file ewww-image-optimizer.php like so (adding the lines that are NOT indented):

    function ewww_image_optimizer_resize_from_meta_data($meta, $ID = null) {
            $file_path = $meta['file'];
            $store_absolute_path = true;
            $upload_dir = wp_upload_dir();
            $upload_path = trailingslashit( $upload_dir['basedir'] );
    echo "<!-- $file_path --><!--";
    print_r ($upload_dir['basedir']);
    echo "--><!-- $upload_path -->";
            // WordPress >= 2.6.2: determine the absolute $file_path (http://core.trac.wordpress.org/changeset/8796)
            if ( FALSE === strpos($file_path, WP_CONTENT_DIR) ) {
                    $store_absolute_path = false;
                    $file_path =  $upload_path . $file_path;
            }
    
    echo "<!-- $file_path -->";

    Then, from the Media Library, select an image, and use the Bulk Optimize action from the Bulk Actions drop-down. Don't know what you'll get for output on the Bulk Processing page exactly, but in the HTML source, you should then get some output in HTML comments (<!-- something something something -->). Paste that here, or email it to me if you're concerned about security.

  4. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    Now that I'm really thinking (it's 2:30 AM here, I'll check back next time the newborn wakes up), I tested moving a file from where it was supposed to be on my test install, and the Media Library now shows 'Unsupported file type' in the Image Optimizer column, just like you said. So, if my test is any indication, it appears that the file may not have been replaced in the correct location when you did the migration. See my comment earlier about using ftp/sftp or scp to make sure all your images are copied over properly. If you're sure they are in the right place, can you post the url to an image for me to see?
    Still do the code edit from the previous reply, unless this resolves your issue.

  5. Julian Fernandes
    Member
    Posted 2 years ago #

    Did what you asked, but still only get:

    Processing ubuntu-indicadores-aplicacoes…
    – Could not find /var/www/wp-content/uploads/ubuntu-indicadores-aplicacoes-150x150.png

    What i did was tar the files on the old host, and then wget it to the new one. Then i uncompressed it and put it in the right place (that would be /wp-content/uploads/)... and then got this message.

    Problem about the scp method is that i don't have root acess to the other server... it's a shared one :/

  6. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    There should have been some output in the HTML source as well with file paths listed in comment tags. Can you send me that?

  7. Julian Fernandes
    Member
    Posted 2 years ago #

    <p>Processing <strong>ubuntu-indicadores-aplicacoes</strong>&hellip;<br><!-- 201206ubuntu-indicadores-aplicacoes.png --><!--/var/www/wp-content/uploads--><!-- /var/www/wp-content/uploads/ --><!-- /var/www/wp-content/uploads/201206ubuntu-indicadores-aplicacoes.png -->– Could not find <span class='code'>/var/www/wp-content/uploads/ubuntu-indicadores-aplicacoes-150x150.png</span><br></p><p>Processing <strong>skype-for-linux-update</strong>&hellip;<br><!-- 201206skype-for-linux-update.jpg --><!--/var/www/wp-content/uploads--><!-- /var/www/wp-content/uploads/ --><!-- /var/www/wp-content/uploads/201206skype-for-linux-update.jpg -->– Could not find <span class='code'>/var/www/wp-content/uploads/skype-for-linux-update-150x150.jpg</span><br>– Could not find <span class='code'>/var/www/wp-content/uploads/skype-for-linux-update-300x187.jpg</span><br></p><p><b>Finished</b> - <a href="upload.php">Return to Media Library</a></p></div>

    Look at this: 201206ubuntu-indicadores-aplicacoes.png
    It seems the plugin looks for a file instead of the directory itself. Should be /2012/06/ubuntu-indicadores-aplicacoes.png .-.

    Also, i don't have shell acess either :/
    And the FTP method is basicly what i did... but since i did not wanted to copy the entire folder, i just used wget to get the part i wanted, the upload folder

  8. Julian Fernandes
    Member
    Posted 2 years ago #

    Could i edit the file path direcly in the plugin code to see if that solves the issue for now?

  9. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    you could, and then it would break next month... I'm going to investigate if there's a different way to get that path. But it will have to be tomorrow sometime.

  10. Julian Fernandes
    Member
    Posted 2 years ago #

    Could you give me the way i can edit and give the plugin the next path untill you find a way to fix this issue?

    We are going to launch this new server/design today, so i really wanted to optimize all the images .-.

  11. Julian Fernandes
    Member
    Posted 2 years ago #

    I mean, i only have to optimize those images once. The next images i upload, are optimized by the plugin.

  12. Jason
    Member
    Posted 1 year ago #

    I got the path fix

  13. Jason
    Member
    Posted 1 year ago #

    I think I changed lines after #233 to

    // check that the file is within the WP folder
    $upload_dir = wp_upload_dir();
    $wp_upload_dir = $upload_dir['basedir'];
    $wp_upload_url = $upload_dir['baseurl'];

    But now I don't remember and I'm afraid to upgrade...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.