• Resolved moxiecreek

    (@moxiecreek)


    I’m installing from a predefined location on my server and the plugin is able to download all of the files just fine. I keep getting an error during import. The blog-aside is a placeholder image for the blogs and there are no other image/media files. Any ideas of what is causing this? I have shortened the file name but still no luck! Thanks for your help.

    Importing content—
    [ERROR] Failed to import “blog-aside” (Media)

    Max execution time after content import = 300

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    hmmm, there can be a few issues here…

    1. delete the image from the exporting WP site and upload it again (export the content again, and try importing again)
    2. your server is not allowing the image to be downloaded… I think this scenario is more likely. If you have an option, I would advise you to try it on another hosting server… If not, you can send me the XML file and I can test it out and see what the issue is.

    Take care!

    Hi,

    I have the same issue “Failed to import (Media)”.

    The strange thing is that some images are imported and “smaller image” failed to import.

    I’m php developer so I didn’t hasitate and I dived into the code. I noticed this several lines that prevents smaller images to be imported.

    file: vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php

    
    if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
    			unlink( $upload['file'] );
    			return new \WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) );
    		}
    

    If I remove this check all images are imported. Also I found following article about this issue. (https://www.playnicetogether.com/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/)

    Proposed solution does not work with the latest version of WP.

    Do you have any suggestion how to fix this without touching plugin’s code?

    Thanks in advance.

    Cheers,
    Milos

    • This reply was modified 7 years, 8 months ago by docodes.
    Plugin Author Gregor Capuder

    (@capuderg)

    Hi Milos,

    thanks for reporting this issue. We already had a user open a pull request on our WP content importer github repo: https://github.com/proteusthemes/WordPress-Importer/pull/2

    But I wanted to test this out myself, to see what the issue was. The user never answered and so there was no progress on this issue.

    You are now the second user to report this exact issue and thank you for explaining it in more details…

    How small are these images that are failing (in KB and image dimension)?

    Could you please send me the XML file so I can test it out myself (please post it in the GH PR so, we have everything in one place)?

    I will fix this in the next version of the plugin (accept the PR on github), if everything goes ok with my testing.

    Take care!

    Hi Capuderg,

    here is the link to the XML file.( XML Import )

    Smaller images are about 1Kb or smaller.

    Cheers,
    Milos

    P.S.
    I posted a comment on GH PR so you can download a file from there as well.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi Milos,

    thank you! I’ve posted more info in the PR.

    Take care!

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @docodes,

    could you please test out this release candidate (v2.2.1) of our plugin, where the smaller images issues should be fixed.

    You can download this test version of the plugin here (the download button is in the top right corner).

    Let me know, how it goes.

    Take care!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Failed to import (Media)’ is closed to new replies.