• I’m trying to import all photos from some users with fairly large photo counts (1,000+). Lots of times, the imports seem to time around around 400 photos. The loading indicator keeps running, but the photos quit showing up.

    After the import dies, I can’t seem to figure out a way to restart it. It only looks for *newer* photos, not the older photos left behind. Is there a way to import missing photos? Or to make the main import start with the oldest photo first, so that an import failure would resume at the same place it left off?

    (My host is WP Engine, if that makes any difference. They are usually pretty solid.)

    https://wordpress.org/plugins/dsgnwrks-instagram-importer/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Justin Sternberg

    (@jtsternberg)

    That is a great question, and unfortunately not the first time I have heard it. As soon as I get some time, a feature to be able to do that will be built-in. But until then, the only way to do that would be to hack the plugin, and even that would take some expertise. I’m not really sure what would cause it to timeout after that many photos. Maybe a hiccup on Instagram’s end? But either way, a way to manually select a “get photos before” date would help alleviate those types of issues.

    Thread Starter clarklab

    (@clarklab)

    Any ideas on where I’d start to fix this? I did a little poking around and see that you save the ‘next url’ in wp_options, but couldn’t figure out how to change that to my advantage.

    I’m just bummed because it somehow missed a few shots from Valentine’s day and now I’ve got no way to double back and pick them up.

    Plugin Author Justin Sternberg

    (@jtsternberg)

    If this Valentine’s Day, just delete all imported posts to that date (and empty trash), then re-run it. It should pick up everything after that. If you’re referring to farther in the past, You’ll either need to hack the plugin (I can’t give any guidance at the moment, as I’d have to dig in myself), or wait till a future update where we build in the ability to go back.

    nrivers

    (@nrivers)

    I’m having a similar problem, but the plugin won’t import anything after 4 Instagram posts. I thought it was because my 4th post was a video, and after trying everything, I deleted it. No luck. Coincidentally, these posts are also from February of 2014.

    When trying to first import posts manually, the loading indicator keeps running and shows that the first two posts were successfully imported but no others. After that it just hangs BUT when I look at my posts, there are always a total of 4 Instagram posts imported. Never anymore than 4 regardless of the media type, which suggests that maybe there is something relatively obvious that I’m not seeing.

    Ideas?

    Here is a fast and very dirty workaround:

    open wp-contents/plugins/dsgnwrks-instagram-importer/dsgnwrks-instagram-importer.php

    (make a backup of this file!)

    go to

    public function import( $userid = false ) {

    scroll down until you find

    // Save the date/time to notify users of last import time

    (this should be around line 556)

    just before this line, add:

    else{
    	// set next url to continue importing
    	if( !empty( $messages['next_url'] ) ) {
    		set_transient( 'get_option', $messages['next_url'] );
    		$notices['next_url'] = $messages['next_url'];
    		return $notices;
    	}
    }

    now import your images. The importer will hit the date set or will timeout. Now hit ‘import’ again — this time it will take some time until the importer starts importing again, because it will loop over every image already imported. But eventually it will import your older posts.

    After you imported all old posts, remove the lines again (or restore your backup of the dsgnwrks-instagram-importer.php file) because I don’t know if this code has any effect on the cron importer.

    @maxhaesslein Thanks for the suggestion. That *almost* seems to work but instead of hanging while importing, I get the error message about timing out after 5000ms.

    It would be nice to force import on a date range, but I haven’t had time to experiment with that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Imports timing out’ is closed to new replies.