Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Daniele

    (@dabesa)

    I found this piece of code in lib/plugin/Ai1ecIcsConnectorPlugin.php:

    $this->flush_ics_feed( false, $feed->feed_url );
    			$count = 0;
    			$message = false;
    			// reimport the feed
    			$response = wp_remote_get( $feed->feed_url, array( 'sslverify' => false, 'timeout' => 120 ) );
    			if (
    				! is_wp_error( $response )             &&
    				isset( $response['response'] )         &&
    				isset( $response['response']['code'] ) &&
    				$response['response']['code'] == 200   &&
    				isset( $response['body'] )             &&
    				! empty( $response['body'] )
    			) {
    				$count = @$ai1ec_importer_helper->parse_ics_feed( $feed,  $response['body'] );
    			} else {

    $this->flush_ics_feed deletes all the old events BEFORE checking that the ICS is reachable and working fine.

    I’m considering to move the line:
    $this->flush_ics_feed( false, $feed->feed_url );

    Just before:
    $count = @$ai1ec_importer_helper->parse_ics_feed( $feed, $response[‘body’] );

    To make the import procedure more reliable. Only if the ICS file is reacheable the old events will be deleted.

    Do you see any problem with that?

    Thanks!

    I’ve done this exact thing before with an older version, and it works fine.

    Q: Which version are you doing this to?

    Note: Time.ly is working on changing the update feature, so this might not be quite so necessary in the future.

    Thread Starter Daniele

    (@dabesa)

    Thanks Cefiar.

    I’m on old 1.10.9 for this customer.
    Good to know that the feature will be updated, now it’s quite bad to delete all events and re-add them…

    The issue is it’s quite hard to see if an event gets deleted in the feed but not on your site (you don’t get anything from the feed to say that a feed has been deleted, it’s just not there anymore). It’s doable, but no where near as easy to code for.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Logging in ICS events import’ is closed to new replies.