Attachment import plugin worked well, but minor bug in code… here’s a mode to index.php to handle soem variants on WXR’s which seem to set values to “”
end of file index.php in plugin change to…
if ($remote_url != “”) {
echo json_encode( process_attachment( $parameters, $remote_url ) );
} else {
echo json_encode( “” ) ;
}
die();}
]]>When I first ran the importer, it only pulled in 179 files and acted like that’s all there was (i.e., the progress bar began on 1/179). There are over 1700 images in my media library, however. I tried running the importer again, but it just pulled the same 179 images. Next, I opened up my WXR file and deleted the first 179 attachment references. I ran the importer again, and this time it brought in the remaining 1526 images.
So I’m not sure what happened in the WXR file between 179 and 180, but there was something preventing the plugin from seeing the images.
]]>Howdy,
I see that your “Other Notes” tab contains a change set. This should be changed to “Changelog” so that WordPress displays the correct tab and can display the change log in the Dashboard.
]]>I was getting this error during an import: import_file_error: Remote file is incorrect size
After some research I found an article and other people with similar issues: https://blog.steadman.io/media-imports-fail-self-hosted-wordpress-sites-same-network/
I also noticed this plugin is on Github and there is a patch for the issue. I applied the patch to the plugin file and now the import is running much smoother:
https://github.com/kander/wp-attachment-importer/tree/patch-1
Are there any plans to update the plugin with the above mentioned patch?
Thanks
]]>Hello
I want to try your plugin (WP 4.1) but I have this message:
There were no attachment files found in the import file.
When I use the “WordPress importer” for the steep 1 (import the content), I have no problem whit my xml file.
Do you have a fix?
]]>We have an ecommerce site that’s live now, hosted on myhosting, built about 3 years ago. DNS points to the live site.
We’re building a new version of the site, on a different host (siteground). It is not live. Can’t make it live (e.g., update DNS) until it’s fully functional.
Would like to import blog posts (216 published, 2 draft) with images, from the current site to the site under development.
Tried and get the error message: import_file_error: Remote server did not respond)
I’m guessing it has something to do with the sites being on two different servers (and hosts) and that the site we are importing IN TO is NOT up on a DNS yet.
Thoughts how to make this work would be greatly appreciated!
Thanks!
Hi, great plugin and quite useful.
My issue is that for some reason any image that starts with a https:// path is not replaced. The original blog is not mine, and I’m not entirely sure why some images come from https while the others come from http. But, regardless, any image with a https filepath does not get replaced, while every single one with a http filepath works perfectly.
Unsure how to fix. I’ve tried a search-and-replace on the XML file to change all the https to http, but did not work. Any help much appreciated!
]]>I ran the importer and it got to somewhere around 500 of 6k images before my browser crashed and had to re-run it (not the plugins fault).
Now it’s using the delay when checking if a file already exists. I don’t know if you’re comparing the remote file, but I think you should be able to check locally and if the file exists move onto the next file, preferably without the 5-6 second delay.
]]>Hi, How do I generate wxr file for images ?
]]>When I try to import my images I get the following error message:
The program could not run. Check the error log below or your JavaScript console for more information
There were no attachment files found in the import file.
That’s odd, because the attachments are already in that import file.
I also checked it with the standard wordpress importer, that imports my images from that file, but breaks up, what on the other hand was my reason for using the attachment importer… ??
How to fix this bug?
]]>Hi Spencer,
Thanks for the plugin — found it very useful when migrating my blogs to a multisite installation.
In my case, I had already moved the attachment files around on my server, which meant I had to modify the plugin a little to get it to work for me. It’s just a few additional lines of code which checks to see whether the files are already in place in the upload area before attempting to upload them from the client.
Here’s the code: (in process_attachment())
$filename = explode('/uploads/', $post['url']);
$fullname = wp_upload_dir();
$fullname = $fullname['basedir'].'/'.$filename[1];
if (file_exists($fullname)) {
$upload['file'] = $fullname;
$updir = wp_upload_dir();
$upload['url'] = $updir['baseurl'].'/'.$filename[1];
} else {
$upload = fetch_remote_file( $url, $post );
}
You’re welcome to use the code in your plugin (no attribution necessary), if you think it’s a good idea. It will allow users with access to their server to reattach files to their posts without having to download and upload all of them during a migration between blogs.
As it stands, the code will only process files that are within the upload directory for the site. Not sure if you would want to make the code handle files stored elsewhere, and I only tested the code to the point where I got it working for me, so no guarantees!
Cheers,
Mike Walker
]]>