Git Product home page Git Product logo

Comments (12)

chrislabeard avatar chrislabeard commented on June 2, 2024 1

No problem! Thanks for all the work on the plugin!

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

Make sure you have the Import External Images 2 plugin as downloaded from here on GitHub. The original plugin found in the WordPress repository does not work (I took over maintenance of it to create version 2, which is not in the WP repository).

I have noticed a few instances where the HTML of a page's content prevents the plugin fetching external files. Up to now I've not been able to solve this without editing affected pages to clean up their code. It is usually a single badly formatted iframe, embed or anchor link that causes the problem.

Some web servers time out before the plugin can complete its tasks. Bluehost and Hostgator servers are hit and miss for this plugin and no amount of PHP resource limit changes in cPanel or wp-config.php help for any length of time (BH and HG impose rate limits quite quickly). As a side note, I like Namecheap servers.

The fault is unlikely to be due to the WordPress update to 4.9.3. I successfully used a freshly downloaded version of the plugin in an fully up to date WordPress site yesterday.

Do you have a link to an affected page? I will see whether I notice anything obvious that might be a problem for the plugin.

from import-external-images-2.

chrislabeard avatar chrislabeard commented on June 2, 2024

Thanks for getting back to me, the site is currently local. So I can't give you a direct link but I can paste the HTML of the post.

https://pastebin.com/BB2FZvqy

I also used WP All Import to import them from a CSV. Not sure if that matters or not.

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

Did that snippet come directly from the content editor? There is a stray at the bottom of the snippet. Could be that the posts are wrapped in div tags.

Is this a Blogger or Wix migration? Blogspot/Wix imports often have lots of div and span tags. They can affect the image import process.

from import-external-images-2.

chrislabeard avatar chrislabeard commented on June 2, 2024

Oh no thats my bad, I just grabbed it from the inspector and removed the wrapper div. Here it is from the editor.

https://pastebin.com/BKZDURJp

The content is coming from Drupal, and I'm stripping everything but <p><a><img> out.

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

Tested on a local installation using your post excerpt so same text, same image, same markup. The results are strange.

First test. The image import succeeded.
Second test. Reverted to the original version of the post. Reran the import. The image import failed.
Third test. Deleted the media file imported by the first test (used the Media library to delete it) then tried to import again. The image import failed.
Fourth test. Deleted the post. Recreated the post. The image import succeeded.
Fifth test. Reverted the 4th test's post to the original post. Wiped the WP transients using WP Sweep.
The image import succeeded.

I've noticed the transients affect this plugin before but that was in relation to something else.

Run WP Sweep then sweep the transients stored in the database. Then try another import. Hopefully this will work.

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

I tested deleting transients in another site a few moments ago. Clearing transients with WP Sweep fixed the problem.

from import-external-images-2.

chrislabeard avatar chrislabeard commented on June 2, 2024

I appreciate all your help, I installed WP Sweep and deleted the transients. Still doing the same thing.

I guess the only thing I can think of is that this is a multi site? But this plugin should work regardless.

Is there anyway to see a debug log on what might be going on?

When I run from Media > Import Images I just get this for every post:
No images imported. Check whether they still exist!

I tried just creating a new post, using that same pastebin I sent you. No dice. I'm gonna start disabling plugins see if something is screwing with it.

Edit: Disabled all plugins except the import one, and changed the theme. Still not importing... hmm not sure what else to try.

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

At this stage I have few idea where the fault might be. The plugin uses no special PHP functions or libraries and uses WordPress media functions to manage the images.

I wonder.. are the images already in wp-content/uploads/* ? WP All Import can be set to import remote images but it doesn't always correct the image src URLs in posts. If the images already exists the Import External Images might fail.

You can disable WP All Import safely once your CSV imports are complete. It won't delete its data.

There is no debug log created by Import External Images. Your server might record errors in its error_logs.

from import-external-images-2.

chrislabeard avatar chrislabeard commented on June 2, 2024

I just did a vanilla WP install of 4.9.4, and installed this plugin. It still won't import images on posts. Not sure what I'm doing wrong...

from import-external-images-2.

chrislabeard avatar chrislabeard commented on June 2, 2024

Alright I found the issue! Woohoo

So on line 303 of import-external-images.php
$images_count_custom = get_option('external_image_images_count_custom');

Returns nothing, it should return a count. So the import script isn't running because there is no count.

Okay so to expand on this, I should have set the max setting for images per post and posts per run.

That should be set by default, so it isn't required to have a value to run.

from import-external-images-2.

VR51 avatar VR51 commented on June 2, 2024

That explains it. ** Forgive my maniacal giggling here ** Yeah, the defaults are supposed to be set on plugin activation. I will look into the reason that's not happening at the moment and release a fix. Thank you for uncovering that.

from import-external-images-2.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.