> read() ) !== false ) { if ( preg_match( '|^\.+$|', $file )) continue; if ( is_dir( $importers_root.'/'.$file ) ) { $plugins_subdir = @ dir( $importers_root.'/'.$file ); if ( $plugins_subdir ) { while (($subfile = $plugins_subdir->read() ) !== false ) { if ( preg_match( '|^\.+$|', $subfile )) continue; if ( preg_match( '|\.php$|', $subfile )) $plugin_files[] = "$file/$subfile"; } } } else { if ( preg_match( '|\.php$|', $file )) $plugin_files[] = $file; } } } if ( !$plugins_dir || !$plugin_files ) return $wp_plugins; foreach ( $plugin_files as $plugin_file ) { if ( !is_readable( "$importers_root/$plugin_file" ) ) continue; $plugin_data = get_plugin_data( "$importers_root/$plugin_file" ); if ( empty ( $plugin_data['Name'] ) ) continue; $wp_plugins[plugin_basename( $plugin_file )] = $plugin_data; } uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' )); //print_r($wp_plugins); $plugins = $wp_plugins; if (!current_user_can('edit_plugins') || empty($plugins)) { echo '

'; _e("Couldn’t open plugins directory or there are no plugins available."); // TODO: make more helpful echo '

'; } else { ?> $plugin_data) { $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; $toggle = 'Import »'; $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); // Sanitize all displayed data $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags); $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags); $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags); $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags); if ( $style != '' ) $style = 'class="' . $style . '"'; echo " ". str_replace('{$plugin_data['Title']} "); echo" "; } ?>
$toggle{$plugin_data['Version']}

{$plugin_data['Description']} ".sprintf(__('By %s'), $plugin_data['Author']).".