Git Product home page Git Product logo

vr51 / import-external-images-2 Goto Github PK

View Code? Open in Web Editor NEW
42.0 8.0 21.0 223 KB

Download and import remotely hosted images to the local WordPress media library

Home Page: https://journalxtra.com/wordpress/plugins/wordpress-plugin-import-external-images/

License: GNU General Public License v3.0

JavaScript 8.69% PHP 91.31%
wordpress plugin wordpress-plugin import download external remote images media

import-external-images-2's Introduction

=== Import External Images 2 v2.0.6 ===

Makes local copies of all externally linked images and (Optionally) PDFs in a post or page.

== Description ==

Imports remotely hosted images and PDFs where they are referenced within a post and updates their links to point to the local file.

The plugin shows a number next to the title of posts that contain external images. This number includes the count of links to external images that can be updated. Consider this number to be a count of total changes to be made i.e. it includes images to be imported and links to be updated.

= Features =

  • Import externally hosted images
  • Import post-by-post during post editing
  • Import to multiple posts at a time by visiting Dashboard > Media > Import Images

= Credits =

Version 1.5.x and above: Released by VR51.

This plugin is based on Import External Images by Marty Thornley https://github.com/MartyThornley/import-external-images, which is based on the "Add Linked Images to Gallery" plugin by http://www.bbqiguana.com/.

= Donate =

Donate Link: https://paypal.me/vr51

== Installation ==

  1. Download the "Import External Images 2" zip file.
  2. Upload to your WordPress plugins directory.
  3. Activate the plugin via the WordPress Plugins tab.
  4. Navigate to Media > Import Images or edit a post to import externally linked media.

== Frequently Asked Questions ==

= How does this plugin work? =

This plugin will find IMG attachments or PDF attachments within posts and pages. Any external attachments will be downloaded to your site's media library and their links in posts/pages will be changed to those of the file in your own website's media library.

= Does it work with MultiSite? =

Yes!

= What if I don't want to import images from a third party image hosting site? =

You can use the settings page to make Import External Images 2 ignore domains.

= Images won't import. What can I do? =

  • Install (WP Sweep)[https://en-gb.wordpress.org/plugins/wp-sweep/] Visit Tools > Sweep then sweep the transients (it is the bottom option).
  • Confirm the server that hosts the images does not use hotlink protection. If images are protected you won't be able to download them in some cases.
  • Make sure the site that hosts the remote images is not in maintenance mode and is not blocking your own site's IP address.

= I can't use the bulk image importer to import images into multiple pages simulataneously. What gives? =

This bug began with the release of WordPress 4.9.1 and vanished with 4.9.3. Hopefully you will not meet this bug.

Sometimes pages need to be visited by the admin user before images will import. The pages only need to be briefly opened then closed in a browser tab in the same browser as your active admin session or in a different browser on the same machine (i.e. you don't need to be logged in when viewing the pages).

Use the site's sitemap to visit pages or use the 'view' button next to each post in the bulk options page then run the importer again.

== Changelog == = 2.0.6 =

  • Bugfix: Restored https? protocol check to line 439.

= 2.0.5 =

  • Bugfix: querystrings no longer prevent image import. Thank you rothkj1022
  • Bugfix: image URLs without a protocol no longer prevent image import. Thank you rothkj1022.

= 2.0.4 =

  • Removed external_image_getext(). Appears not to be used anywhere in the plugin code so deemed redundent.
  • Changed title of function is_external_file() to is_allowed_file(). This new name better suits the functions purpose.
  • Edited is_allowed_file(). Combine the arrays $allowed and $allowedAlso into single $allowed. Introduced foreach loop.
  • Reduced duplicate checks against is_allowed_file. Props Ivan0xFF for noticing the superflorous checks.
  • Edited external_image_get_img_tags() to fix issues fetching some remote images with query strings in the URLs. Props Ivan0xFF for this fix.
  • Fixed default options initialisation. Added add_option() configs. No idea how I missed this initially.
  • Added view and edit buttons to import results page.
  • Prefixed all functions and CSS with vr_

= 2.0.3 =

  • Various bugfixes
  • Added 'view' post button to bulk import admin page. A change in WP 4.9 prevents image imports unless a page has been viewed from the IP address of the admin user.

= 2.0.2 =

  • Bugfixes

= 2.0.1 =

  • Bugfix: Use home_url instead of siteurl to prevent external image false positives. Thanks to budrick.
  • Bugfix: Fixed handling of PDF files. Thanks to dcbradley.

= 2.0.0 =

  • Released as version 2 under it's own Github repository so that we can better manage bug reports and suggestions.

= 1.5.2 =

  • Merged ajax.php into main file import-external-images.php. This done to make functional the 'posts to process count' feature.
  • Fixed counting bug that prevented limits being set for the number of posts to process.
  • Fixed counting bug that prevented limits being set for the number of images to process per post.
  • Removed superfluous function 'external_images_verify_permission()'. Was disabled prior to code edits. No longer needed now that ajax.php is merged with import-external-images.php.
  • Corrected comments in import-external-images.js file. Comments suggested we were resizing images when we were only importing images.
  • Adjusted plugin text to better match the text meaning to the actual functions of the plugin.

= 1.5.1 =

  • Improved posts layout table.
  • Various code changes.

= 1.5 =

This is the first VR51 release of this plugin.

  • Fixed bug that caused the plugin to download images hosted on HTTP sites. Now fetches imedia from HTTPS sites too.
  • Changed post query to explicitly loop through all post types with any post status.
  • Added option to import externally linked PDFs.
  • Fixed undefined variable error.
  • Fixed undefined key error.
  • Changed link of Bulk Image Resizer plugin to Regenerate Thumbnails hosted on wordpress.org.
  • Added option to adjust number of images to process per run.
  • Added option to adjust number of posts to process per run.

= 1.3 =

= 1.1 =

  • Fixed title in readme.

import-external-images-2's People

Contributors

bebjakub avatar craftycorvid avatar dcbradley avatar jonmabe avatar josh-gaslamp avatar krothapigroup avatar mcegielka avatar vr51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

import-external-images-2's Issues

Images with spaces in the file name

Hi:
It seems that jpegs with spaces in their file name are not noticed by Import External Images 2 in the dialogue that appears before importing an article. I haven't looked at the code yet, but would be interested in your response.
Thanks,
Alex

Images that do not specify protocol

Images that do not start with http or https do not get imported. Example: //cdn.shopify.com/s/files/1/0599/9033/articles/JAH4WW-Logo_grande.png

bbPress Support

Hi,

Would it be possible to incoroporate support for bbPress?

It would be nice to be able to grab images from 3rd party hosts and store them locally when our users submit posts (and to perform an import from our forum history).

Cheers!

Looks at wrong location for images

Hi,

I am not able to import by bulk or by post.

Background - I imported my blog from Blogger to Wordpress running on Bitnami, AWS. I ran the Blogger Import Extended plugin for this, only a few photos came over, the very oldest.

When I run the plugin it lists the posts and number of photos for each but if I try import single posts nothing shows in the edit page. If I try bulk import it says unable to find photos and I see it is looking at the original temporary address of the Wordpress install before a static address was set. And yes the Blogger import plugin was run prior to the static address being set. I did not know this would cause problem.

I tried WP Sweep. Any suggestions how to resolve the conflict would be welcome.

Thanks.

No show in Gutenberg Editor

Wordpress 5.0 use Gutenberg Editor
and the option not show in Gutenberg Editor
please fix it, thanks

*import Image work fine

Images wont import from Wordpress.com

Hello, thanks for this plug-in! I migrated a blog from wordpress.com to self-hosted (bluehost). In the "Import Images" settings page, the "View" post links are all to the old Wordpress.com site (but the Edit links are to the correct, new site). No images will import.

Plugin errors out with a very large amount of posts on a site.

I have a site with over 30,000 posts that have spanned the last 15 years. Long story short if I try and run the process all posts I get a memory error
Fatal error: Allowed memory size of 786432000 bytes exhausted (tried to allocate 32 bytes) in /home/impactlabtest/public_html/wp-includes/wp-db.php on line 1889

Since i've allocated 1gb of ram to wp itself I dont think I can allocate any more memory to help with this. Any other suggestions? Could I modify the plugin to only get the posts 1-1000 or something like that so I could just do a certain amount of images at a time?

Thanks for your help

wp_insert_post()

I add posts to wordpress using an external PHP script, something like this:

$new_post = array(
	'post_title' => $title,
	'post_content' => "blah blah <img src='https://example.com/image.jpg'> ";
	'post_status' => 'publish',
	'post_author' => $wp_user_id,
	'post_type' => 'post',
	'post_category' => array(),
	'tags_input' => array()
);
	$post_id = wp_insert_post($new_post, true);

But the images are not imported in the local library. The remote image is displayed in the post.

Is there a way I can use your plugin to import external images when posting from an external PHP script instead of using the WP admin dashboard to create a new post ?

Thanks

Can't get image

hey, i already use wp sweep, but still cant get image to media form host
squarespace.com or thespruce.com have similar text

Doesn't seem to do anything.

Its detecting the images in the posts, but doesn't do anything with them.

I tried viewing the page like suggested in the readme. But still the same thing. And all of the URLs are public and can be accessed.

Suggestion for upload image attribute

hello, this plugin work fine, sometime cant change link the url buy image upoad in media.
I have suggestion, can u add import the alt attribute in image to alt image in media too ?

see this plugin: https://github.com/airani/wp-auto-upload
this plugin do jobs like your plugin, plugin work fine too but when edit post, he can duplicate image in media.
of course this for reference, sometime this plugin can upload image to media and change url in post, with your plugin can't do it.

Email?

Hi there,

I'm trying to import pics from Flickr. However, after I installed the plugin, I got this message on the plugin's page (under Media/):

Process all posts
The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

Never got an email, though.

I've got lots of plugins running, could that be the issue?

Bulk Import not working

Hey Lee, I have been trying to bulk import multiple images on multiple blogs. Images are all on photobucket. It works perfectly individually. But the bulk option just sits there and does nothing. I don't see any errors in the log files either. No matter how long I leave it, it never imports a post unless its individually. Latest wordpress running php 7.2 and nginx. Let me know if you have any ideas.
Thanks
Dan

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.