$data ) { if ( isset( $data['key'] ) ) { $keys[$package] = $data['key']; } else if ( isset( $data['status'] ) && ( 'inactive' == $data['status'] ) ) { $keys[$package] = ''; } } Ithemes_Updater_Keys::set( $keys ); $details = Ithemes_Updater_Packages::get_full_details( $response ); $updates = array( 'update_themes' => array(), 'update_themes_no_update' => array(), 'update_plugins' => array(), 'update_plugins_no_update' => array(), 'expiration' => $details['expiration'], ); if ( ! $cached ) { $updates['timestamp'] = time(); } if ( isset( $response['timeout_multiplier'] ) ) { $updates['timeout-multiplier'] = $response['timeout_multiplier']; } if ( ! isset( $updates['timeout-multiplier'] ) || ( $updates['timeout-multiplier'] < 1 ) ) { $updates['timeout-mulitplier'] = 1; } else if ( $updates['timeout-multiplier'] > 10 ) { $updates['timeout-mulitplier'] = 10; } $use_ssl = $GLOBALS['ithemes-updater-settings']->get_option( 'use_ssl' ); foreach ( $details['packages'] as $path => $data ) { if ( empty( $data['package-url'] ) ) { continue; } $force_minor_version_update = $GLOBALS['ithemes-updater-settings']->get_option( 'force_minor_version_update' ); $quick_releases = $GLOBALS['ithemes-updater-settings']->get_option( 'quick_releases' ); $update_available = true; if ( version_compare( $data['installed'], $data['available'], '>=' ) ) { $update_available = false; } else if ( ( isset( $data['upgrade'] ) && ! $data['upgrade'] ) && ! $force_minor_version_update && ! $quick_releases ) { $update_available = false; } if ( ! $use_ssl ) { $data['package-url'] = preg_replace( '/^https/', 'http', $data['package-url'] ); } if ( 'plugin' == $data['type'] ) { $update = array( 'id' => 0, 'slug' => dirname( $path ), 'plugin' => $path, 'new_version' => $data['available'], 'url' => $data['info-url'], 'package' => $data['package-url'], ); if ( $update_available ) { if ( isset( $data['autoupdate'] ) ) { $update['autoupdate'] = $data['autoupdate']; } if ( isset( $data['upgrade_notice'] ) ) { $update['upgrade_notice'] = $data['upgrade_notice']; } } else { $update['icons'] = array(); $update['banners'] = array(); $update['banners_rtl'] = array(); $update['tested'] = ''; $update['requires_php'] = ''; $update['compatibility'] = new stdClass(); } $update = (object) $update; } else { $update = array( 'theme' => $path, 'new_version' => $data['available'], 'url' => self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . dirname( $path ) . '§ion=changelog&TB_iframe=true&width=600&height=800' ), 'package' => $data['package-url'], ); if ( $update_available ) { if ( isset( $data['autoupdate'] ) ) { $update['autoupdate'] = $data['autoupdate']; } if ( isset( $data['upgrade_notice'] ) ) { $update['upgrade_notice'] = $data['upgrade_notice']; } } else { $update['requires'] = ''; $update['requires_php'] = ''; } $path = dirname( $path ); } if ( $update_available ) { $updates["update_{$data['type']}s"][$path] = $update; } else { $updates["update_{$data['type']}s_no_update"][$path] = $update; } } $GLOBALS['ithemes-updater-settings']->update_options( $updates ); } }