get_options(); if ( ! isset( $args->slug ) ) { return $value; } foreach ( (array) $options['update_plugins'] as $path => $data ) { if ( $data->slug == $args->slug ) { require_once( $GLOBALS['ithemes_updater_path'] . '/information.php' ); return Ithemes_Updater_Information::get_plugin_information( $path ); } } foreach ( (array) $options['update_themes'] as $path => $data ) { if ( $path == $args->slug ) { require_once( $GLOBALS['ithemes_updater_path'] . '/information.php' ); return Ithemes_Updater_Information::get_theme_information( $path ); } } $dir = WP_PLUGIN_DIR . '/' . $args->slug; $dh = @opendir( $dir ); if ( ! $dh ) { return $value; } while ( false !== ( $file = readdir( $dh ) ) ) { if ( ! is_file( "$dir/$file" ) ) { continue; } if ( '.php' !== substr( $file, -4 ) ) { continue; } $plugin_data = get_plugin_data( "$dir/$file", false, false ); if ( ! empty ( $plugin_data['Name'] ) ) { $plugin_file = basename( $file ); } } closedir( $dh ); if ( empty( $plugin_file ) ) { return $value; } require_once( $GLOBALS['ithemes_updater_path'] . '/information.php' ); $information = Ithemes_Updater_Information::get_plugin_information( "{$args->slug}/$plugin_file" ); if ( false !== $information ) { return $information; } return $value; } public function filter_upgrader_pre_install( $value ) { $this->set_package_details(); return $value; } public function filter_upgrader_post_install( $value, $hook_extra, $result ) { $options = $GLOBALS['ithemes-updater-settings']->queue_flush(); return $value; } public function clear_activation_package( $deactivated_path ) { $packages = $GLOBALS['ithemes-updater-settings']->get_packages(); $options = $GLOBALS['ithemes-updater-settings']->get_options(); $deactivated_path = WP_PLUGIN_DIR . "/$deactivated_path"; foreach ( $packages as $package => $paths ) { if ( ! in_array( $deactivated_path, $paths ) || ( count( $paths ) > 1 ) ) { continue; } $index = array_search( $package, $options['packages'] ); if ( false === $index ) { return; } unset( $options['packages'][$index] ); $GLOBALS['ithemes-updater-settings']->update_options( $options ); return; } } public function show_activation_message() { $new_packages = $GLOBALS['ithemes-updater-settings']->get_new_packages(); if ( empty( $new_packages ) ) { return; } natcasesort( $new_packages ); require_once( $GLOBALS['ithemes_updater_path'] . '/functions.php' ); $names = array(); foreach ( $new_packages as $package ) { $names = Ithemes_Updater_Functions::get_package_name( $package ); } if ( is_multisite() && is_network_admin() ) { $url = network_admin_url( 'settings.php' ) . "?page={$this->page_name}"; } else { $url = admin_url( 'options-general.php' ) . "?page={$this->page_name}"; } echo '
' . wp_sprintf( __( 'To receive automatic updates for %l, use the iThemes Licensing page found in the Settings menu.', 'it-l10n-ithemes-security-pro' ), $names, $url ) . '