Ticket #21231: 21231.2.diff
| File 21231.2.diff, 87.5 KB (added by , 14 years ago) |
|---|
-
wp-content/themes/twentytwelve/inc/custom-header.php
9 9 */ 10 10 11 11 /** 12 * Back compat support for get_custom_header().13 * New since WordPress version 3.4.14 *15 * To provide backward compatibility with previous versions, we16 * will define our own version of this function.17 *18 * @todo Should this go into core instead?19 *20 * @return stdClass All properties represent attributes of the current header image.21 *22 * @package Twenty_Twelve23 * @since Twenty Twelve 1.024 */25 if ( ! function_exists( 'get_custom_header' ) ) {26 function get_custom_header() {27 return (object) array(28 'url' => get_header_image(),29 'thumbnail_url' => get_header_image(),30 'width' => HEADER_IMAGE_WIDTH,31 'height' => HEADER_IMAGE_HEIGHT32 );33 }34 }35 36 /**37 12 * Setup the WordPress core custom header arguments and settings. 38 13 * 39 14 * Use add_theme_support() to register support for WordPress 3.4+ 40 * as well as provide backward compatibility for previous versions.41 *42 * Use feature detection of wp_get_theme() which was introduced43 * in WordPress 3.4.44 15 * 45 16 * @uses twentytwelve_header_style() 46 17 * @uses twentytwelve_admin_header_style() … … 72 43 'admin-preview-callback' => 'twentytwelve_admin_header_image', 73 44 ); 74 45 75 // Allow child themes to filter any of these arguments. 76 $args = apply_filters( 'twentytwelve_custom_header_args', $args ); 77 78 if ( function_exists( 'wp_get_theme' ) ) { 79 add_theme_support( 'custom-header', $args ); 80 } else { 81 // Back compat for < 3.4 versions. 82 define( 'HEADER_TEXTCOLOR', $args['default-text-color'] ); 83 define( 'HEADER_IMAGE', $args['default-image'] ); 84 define( 'HEADER_IMAGE_WIDTH', $args['width'] ); 85 define( 'HEADER_IMAGE_HEIGHT', $args['height'] ); 86 add_custom_image_header( $args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback'] ); 87 } 46 // Add support and allow child themes to filter any of these arguments. 47 add_theme_support( 'custom-header', apply_filters( 'twentytwelve_custom_header_args', $args ) ); 88 48 } 89 49 add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' ); 90 50 -
wp-content/plugins/wordpress-importer/wordpress-importer.php
1 <?php 2 /* 3 Plugin Name: WordPress Importer 4 Plugin URI: http://wordpress.org/extend/plugins/wordpress-importer/ 5 Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. 6 Author: wordpressdotorg 7 Author URI: http://wordpress.org/ 8 Version: 0.6 9 Text Domain: wordpress-importer 10 License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 */ 12 13 if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) 14 return; 15 16 /** Display verbose errors */ 17 define( 'IMPORT_DEBUG', false ); 18 19 // Load Importer API 20 require_once ABSPATH . 'wp-admin/includes/import.php'; 21 22 if ( ! class_exists( 'WP_Importer' ) ) { 23 $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; 24 if ( file_exists( $class_wp_importer ) ) 25 require $class_wp_importer; 26 } 27 28 // include WXR file parsers 29 require dirname( __FILE__ ) . '/parsers.php'; 30 31 /** 32 * WordPress Importer class for managing the import process of a WXR file 33 * 34 * @package WordPress 35 * @subpackage Importer 36 */ 37 if ( class_exists( 'WP_Importer' ) ) { 38 class WP_Import extends WP_Importer { 39 var $max_wxr_version = 1.2; // max. supported WXR version 40 41 var $id; // WXR attachment ID 42 43 // information to import from WXR file 44 var $version; 45 var $authors = array(); 46 var $posts = array(); 47 var $terms = array(); 48 var $categories = array(); 49 var $tags = array(); 50 var $base_url = ''; 51 52 // mappings from old information to new 53 var $processed_authors = array(); 54 var $author_mapping = array(); 55 var $processed_terms = array(); 56 var $processed_posts = array(); 57 var $post_orphans = array(); 58 var $processed_menu_items = array(); 59 var $menu_item_orphans = array(); 60 var $missing_menu_items = array(); 61 62 var $fetch_attachments = false; 63 var $url_remap = array(); 64 var $featured_images = array(); 65 66 function WP_Import() { /* nothing */ } 67 68 /** 69 * Registered callback function for the WordPress Importer 70 * 71 * Manages the three separate stages of the WXR import process 72 */ 73 function dispatch() { 74 $this->header(); 75 76 $step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step']; 77 switch ( $step ) { 78 case 0: 79 $this->greet(); 80 break; 81 case 1: 82 check_admin_referer( 'import-upload' ); 83 if ( $this->handle_upload() ) 84 $this->import_options(); 85 break; 86 case 2: 87 check_admin_referer( 'import-wordpress' ); 88 $this->fetch_attachments = ( ! empty( $_POST['fetch_attachments'] ) && $this->allow_fetch_attachments() ); 89 $this->id = (int) $_POST['import_id']; 90 $file = get_attached_file( $this->id ); 91 set_time_limit(0); 92 $this->import( $file ); 93 break; 94 } 95 96 $this->footer(); 97 } 98 99 /** 100 * The main controller for the actual import stage. 101 * 102 * @param string $file Path to the WXR file for importing 103 */ 104 function import( $file ) { 105 add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) ); 106 add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); 107 108 $this->import_start( $file ); 109 110 $this->get_author_mapping(); 111 112 wp_suspend_cache_invalidation( true ); 113 $this->process_categories(); 114 $this->process_tags(); 115 $this->process_terms(); 116 $this->process_posts(); 117 wp_suspend_cache_invalidation( false ); 118 119 // update incorrect/missing information in the DB 120 $this->backfill_parents(); 121 $this->backfill_attachment_urls(); 122 $this->remap_featured_images(); 123 124 $this->import_end(); 125 } 126 127 /** 128 * Parses the WXR file and prepares us for the task of processing parsed data 129 * 130 * @param string $file Path to the WXR file for importing 131 */ 132 function import_start( $file ) { 133 if ( ! is_file($file) ) { 134 echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; 135 echo __( 'The file does not exist, please try again.', 'wordpress-importer' ) . '</p>'; 136 $this->footer(); 137 die(); 138 } 139 140 $import_data = $this->parse( $file ); 141 142 if ( is_wp_error( $import_data ) ) { 143 echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; 144 echo esc_html( $import_data->get_error_message() ) . '</p>'; 145 $this->footer(); 146 die(); 147 } 148 149 $this->version = $import_data['version']; 150 $this->get_authors_from_import( $import_data ); 151 $this->posts = $import_data['posts']; 152 $this->terms = $import_data['terms']; 153 $this->categories = $import_data['categories']; 154 $this->tags = $import_data['tags']; 155 $this->base_url = esc_url( $import_data['base_url'] ); 156 157 wp_defer_term_counting( true ); 158 wp_defer_comment_counting( true ); 159 160 do_action( 'import_start' ); 161 } 162 163 /** 164 * Performs post-import cleanup of files and the cache 165 */ 166 function import_end() { 167 wp_import_cleanup( $this->id ); 168 169 wp_cache_flush(); 170 foreach ( get_taxonomies() as $tax ) { 171 delete_option( "{$tax}_children" ); 172 _get_term_hierarchy( $tax ); 173 } 174 175 wp_defer_term_counting( false ); 176 wp_defer_comment_counting( false ); 177 178 echo '<p>' . __( 'All done.', 'wordpress-importer' ) . ' <a href="' . admin_url() . '">' . __( 'Have fun!', 'wordpress-importer' ) . '</a>' . '</p>'; 179 echo '<p>' . __( 'Remember to update the passwords and roles of imported users.', 'wordpress-importer' ) . '</p>'; 180 181 do_action( 'import_end' ); 182 } 183 184 /** 185 * Handles the WXR upload and initial parsing of the file to prepare for 186 * displaying author import options 187 * 188 * @return bool False if error uploading or invalid file, true otherwise 189 */ 190 function handle_upload() { 191 $file = wp_import_handle_upload(); 192 193 if ( isset( $file['error'] ) ) { 194 echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; 195 echo esc_html( $file['error'] ) . '</p>'; 196 return false; 197 } else if ( ! file_exists( $file['file'] ) ) { 198 echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; 199 printf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'wordpress-importer' ), esc_html( $file['file'] ) ); 200 echo '</p>'; 201 return false; 202 } 203 204 $this->id = (int) $file['id']; 205 $import_data = $this->parse( $file['file'] ); 206 if ( is_wp_error( $import_data ) ) { 207 echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; 208 echo esc_html( $import_data->get_error_message() ) . '</p>'; 209 return false; 210 } 211 212 $this->version = $import_data['version']; 213 if ( $this->version > $this->max_wxr_version ) { 214 echo '<div class="error"><p><strong>'; 215 printf( __( 'This WXR file (version %s) may not be supported by this version of the importer. Please consider updating.', 'wordpress-importer' ), esc_html($import_data['version']) ); 216 echo '</strong></p></div>'; 217 } 218 219 $this->get_authors_from_import( $import_data ); 220 221 return true; 222 } 223 224 /** 225 * Retrieve authors from parsed WXR data 226 * 227 * Uses the provided author information from WXR 1.1 files 228 * or extracts info from each post for WXR 1.0 files 229 * 230 * @param array $import_data Data returned by a WXR parser 231 */ 232 function get_authors_from_import( $import_data ) { 233 if ( ! empty( $import_data['authors'] ) ) { 234 $this->authors = $import_data['authors']; 235 // no author information, grab it from the posts 236 } else { 237 foreach ( $import_data['posts'] as $post ) { 238 $login = sanitize_user( $post['post_author'], true ); 239 if ( empty( $login ) ) { 240 printf( __( 'Failed to import author %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html( $post['post_author'] ) ); 241 echo '<br />'; 242 continue; 243 } 244 245 if ( ! isset($this->authors[$login]) ) 246 $this->authors[$login] = array( 247 'author_login' => $login, 248 'author_display_name' => $post['post_author'] 249 ); 250 } 251 } 252 } 253 254 /** 255 * Display pre-import options, author importing/mapping and option to 256 * fetch attachments 257 */ 258 function import_options() { 259 $j = 0; 260 ?> 261 <form action="<?php echo admin_url( 'admin.php?import=wordpress&step=2' ); ?>" method="post"> 262 <?php wp_nonce_field( 'import-wordpress' ); ?> 263 <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" /> 264 265 <?php if ( ! empty( $this->authors ) ) : ?> 266 <h3><?php _e( 'Assign Authors', 'wordpress-importer' ); ?></h3> 267 <p><?php _e( 'To make it easier for you to edit and save the imported content, you may want to reassign the author of the imported item to an existing user of this site. For example, you may want to import all the entries as <code>admin</code>s entries.', 'wordpress-importer' ); ?></p> 268 <?php if ( $this->allow_create_users() ) : ?> 269 <p><?php printf( __( 'If a new user is created by WordPress, a new password will be randomly generated and the new user’s role will be set as %s. Manually changing the new user’s details will be necessary.', 'wordpress-importer' ), esc_html( get_option('default_role') ) ); ?></p> 270 <?php endif; ?> 271 <ol id="authors"> 272 <?php foreach ( $this->authors as $author ) : ?> 273 <li><?php $this->author_select( $j++, $author ); ?></li> 274 <?php endforeach; ?> 275 </ol> 276 <?php endif; ?> 277 278 <?php if ( $this->allow_fetch_attachments() ) : ?> 279 <h3><?php _e( 'Import Attachments', 'wordpress-importer' ); ?></h3> 280 <p> 281 <input type="checkbox" value="1" name="fetch_attachments" id="import-attachments" /> 282 <label for="import-attachments"><?php _e( 'Download and import file attachments', 'wordpress-importer' ); ?></label> 283 </p> 284 <?php endif; ?> 285 286 <p class="submit"><input type="submit" class="button" value="<?php esc_attr_e( 'Submit', 'wordpress-importer' ); ?>" /></p> 287 </form> 288 <?php 289 } 290 291 /** 292 * Display import options for an individual author. That is, either create 293 * a new user based on import info or map to an existing user 294 * 295 * @param int $n Index for each author in the form 296 * @param array $author Author information, e.g. login, display name, email 297 */ 298 function author_select( $n, $author ) { 299 _e( 'Import author:', 'wordpress-importer' ); 300 echo ' <strong>' . esc_html( $author['author_display_name'] ); 301 if ( $this->version != '1.0' ) echo ' (' . esc_html( $author['author_login'] ) . ')'; 302 echo '</strong><br />'; 303 304 if ( $this->version != '1.0' ) 305 echo '<div style="margin-left:18px">'; 306 307 $create_users = $this->allow_create_users(); 308 if ( $create_users ) { 309 if ( $this->version != '1.0' ) { 310 _e( 'or create new user with login name:', 'wordpress-importer' ); 311 $value = ''; 312 } else { 313 _e( 'as a new user:', 'wordpress-importer' ); 314 $value = esc_attr( sanitize_user( $author['author_login'], true ) ); 315 } 316 317 echo ' <input type="text" name="user_new['.$n.']" value="'. $value .'" /><br />'; 318 } 319 320 if ( ! $create_users && $this->version == '1.0' ) 321 _e( 'assign posts to an existing user:', 'wordpress-importer' ); 322 else 323 _e( 'or assign posts to an existing user:', 'wordpress-importer' ); 324 wp_dropdown_users( array( 'name' => "user_map[$n]", 'multi' => true, 'show_option_all' => __( '- Select -', 'wordpress-importer' ) ) ); 325 echo '<input type="hidden" name="imported_authors['.$n.']" value="' . esc_attr( $author['author_login'] ) . '" />'; 326 327 if ( $this->version != '1.0' ) 328 echo '</div>'; 329 } 330 331 /** 332 * Map old author logins to local user IDs based on decisions made 333 * in import options form. Can map to an existing user, create a new user 334 * or falls back to the current user in case of error with either of the previous 335 */ 336 function get_author_mapping() { 337 if ( ! isset( $_POST['imported_authors'] ) ) 338 return; 339 340 $create_users = $this->allow_create_users(); 341 342 foreach ( (array) $_POST['imported_authors'] as $i => $old_login ) { 343 // Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts. 344 $santized_old_login = sanitize_user( $old_login, true ); 345 $old_id = isset( $this->authors[$old_login]['author_id'] ) ? intval($this->authors[$old_login]['author_id']) : false; 346 347 if ( ! empty( $_POST['user_map'][$i] ) ) { 348 $user = get_userdata( intval($_POST['user_map'][$i]) ); 349 if ( isset( $user->ID ) ) { 350 if ( $old_id ) 351 $this->processed_authors[$old_id] = $user->ID; 352 $this->author_mapping[$santized_old_login] = $user->ID; 353 } 354 } else if ( $create_users ) { 355 if ( ! empty($_POST['user_new'][$i]) ) { 356 $user_id = wp_create_user( $_POST['user_new'][$i], wp_generate_password() ); 357 } else if ( $this->version != '1.0' ) { 358 $user_data = array( 359 'user_login' => $old_login, 360 'user_pass' => wp_generate_password(), 361 'user_email' => isset( $this->authors[$old_login]['author_email'] ) ? $this->authors[$old_login]['author_email'] : '', 362 'display_name' => $this->authors[$old_login]['author_display_name'], 363 'first_name' => isset( $this->authors[$old_login]['author_first_name'] ) ? $this->authors[$old_login]['author_first_name'] : '', 364 'last_name' => isset( $this->authors[$old_login]['author_last_name'] ) ? $this->authors[$old_login]['author_last_name'] : '', 365 ); 366 $user_id = wp_insert_user( $user_data ); 367 } 368 369 if ( ! is_wp_error( $user_id ) ) { 370 if ( $old_id ) 371 $this->processed_authors[$old_id] = $user_id; 372 $this->author_mapping[$santized_old_login] = $user_id; 373 } else { 374 printf( __( 'Failed to create new user for %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html($this->authors[$old_login]['author_display_name']) ); 375 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 376 echo ' ' . $user_id->get_error_message(); 377 echo '<br />'; 378 } 379 } 380 381 // failsafe: if the user_id was invalid, default to the current user 382 if ( ! isset( $this->author_mapping[$santized_old_login] ) ) { 383 if ( $old_id ) 384 $this->processed_authors[$old_id] = (int) get_current_user_id(); 385 $this->author_mapping[$santized_old_login] = (int) get_current_user_id(); 386 } 387 } 388 } 389 390 /** 391 * Create new categories based on import information 392 * 393 * Doesn't create a new category if its slug already exists 394 */ 395 function process_categories() { 396 if ( empty( $this->categories ) ) 397 return; 398 399 foreach ( $this->categories as $cat ) { 400 // if the category already exists leave it alone 401 $term_id = term_exists( $cat['category_nicename'], 'category' ); 402 if ( $term_id ) { 403 if ( is_array($term_id) ) $term_id = $term_id['term_id']; 404 if ( isset($cat['term_id']) ) 405 $this->processed_terms[intval($cat['term_id'])] = (int) $term_id; 406 continue; 407 } 408 409 $category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] ); 410 $category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : ''; 411 $catarr = array( 412 'category_nicename' => $cat['category_nicename'], 413 'category_parent' => $category_parent, 414 'cat_name' => $cat['cat_name'], 415 'category_description' => $category_description 416 ); 417 418 $id = wp_insert_category( $catarr ); 419 if ( ! is_wp_error( $id ) ) { 420 if ( isset($cat['term_id']) ) 421 $this->processed_terms[intval($cat['term_id'])] = $id; 422 } else { 423 printf( __( 'Failed to import category %s', 'wordpress-importer' ), esc_html($cat['category_nicename']) ); 424 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 425 echo ': ' . $id->get_error_message(); 426 echo '<br />'; 427 continue; 428 } 429 } 430 431 unset( $this->categories ); 432 } 433 434 /** 435 * Create new post tags based on import information 436 * 437 * Doesn't create a tag if its slug already exists 438 */ 439 function process_tags() { 440 if ( empty( $this->tags ) ) 441 return; 442 443 foreach ( $this->tags as $tag ) { 444 // if the tag already exists leave it alone 445 $term_id = term_exists( $tag['tag_slug'], 'post_tag' ); 446 if ( $term_id ) { 447 if ( is_array($term_id) ) $term_id = $term_id['term_id']; 448 if ( isset($tag['term_id']) ) 449 $this->processed_terms[intval($tag['term_id'])] = (int) $term_id; 450 continue; 451 } 452 453 $tag_desc = isset( $tag['tag_description'] ) ? $tag['tag_description'] : ''; 454 $tagarr = array( 'slug' => $tag['tag_slug'], 'description' => $tag_desc ); 455 456 $id = wp_insert_term( $tag['tag_name'], 'post_tag', $tagarr ); 457 if ( ! is_wp_error( $id ) ) { 458 if ( isset($tag['term_id']) ) 459 $this->processed_terms[intval($tag['term_id'])] = $id['term_id']; 460 } else { 461 printf( __( 'Failed to import post tag %s', 'wordpress-importer' ), esc_html($tag['tag_name']) ); 462 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 463 echo ': ' . $id->get_error_message(); 464 echo '<br />'; 465 continue; 466 } 467 } 468 469 unset( $this->tags ); 470 } 471 472 /** 473 * Create new terms based on import information 474 * 475 * Doesn't create a term its slug already exists 476 */ 477 function process_terms() { 478 if ( empty( $this->terms ) ) 479 return; 480 481 foreach ( $this->terms as $term ) { 482 // if the term already exists in the correct taxonomy leave it alone 483 $term_id = term_exists( $term['slug'], $term['term_taxonomy'] ); 484 if ( $term_id ) { 485 if ( is_array($term_id) ) $term_id = $term_id['term_id']; 486 if ( isset($term['term_id']) ) 487 $this->processed_terms[intval($term['term_id'])] = (int) $term_id; 488 continue; 489 } 490 491 if ( empty( $term['term_parent'] ) ) { 492 $parent = 0; 493 } else { 494 $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] ); 495 if ( is_array( $parent ) ) $parent = $parent['term_id']; 496 } 497 $description = isset( $term['term_description'] ) ? $term['term_description'] : ''; 498 $termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) ); 499 500 $id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr ); 501 if ( ! is_wp_error( $id ) ) { 502 if ( isset($term['term_id']) ) 503 $this->processed_terms[intval($term['term_id'])] = $id['term_id']; 504 } else { 505 printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($term['term_taxonomy']), esc_html($term['term_name']) ); 506 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 507 echo ': ' . $id->get_error_message(); 508 echo '<br />'; 509 continue; 510 } 511 } 512 513 unset( $this->terms ); 514 } 515 516 /** 517 * Create new posts based on import information 518 * 519 * Posts marked as having a parent which doesn't exist will become top level items. 520 * Doesn't create a new post if: the post type doesn't exist, the given post ID 521 * is already noted as imported or a post with the same title and date already exists. 522 * Note that new/updated terms, comments and meta are imported for the last of the above. 523 */ 524 function process_posts() { 525 foreach ( $this->posts as $post ) { 526 if ( ! post_type_exists( $post['post_type'] ) ) { 527 printf( __( 'Failed to import “%s”: Invalid post type %s', 'wordpress-importer' ), 528 esc_html($post['post_title']), esc_html($post['post_type']) ); 529 echo '<br />'; 530 continue; 531 } 532 533 if ( isset( $this->processed_posts[$post['post_id']] ) && ! empty( $post['post_id'] ) ) 534 continue; 535 536 if ( $post['status'] == 'auto-draft' ) 537 continue; 538 539 if ( 'nav_menu_item' == $post['post_type'] ) { 540 $this->process_menu_item( $post ); 541 continue; 542 } 543 544 $post_type_object = get_post_type_object( $post['post_type'] ); 545 546 $post_exists = post_exists( $post['post_title'], '', $post['post_date'] ); 547 if ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) { 548 printf( __('%s “%s” already exists.', 'wordpress-importer'), $post_type_object->labels->singular_name, esc_html($post['post_title']) ); 549 echo '<br />'; 550 $comment_post_ID = $post_id = $post_exists; 551 } else { 552 $post_parent = (int) $post['post_parent']; 553 if ( $post_parent ) { 554 // if we already know the parent, map it to the new local ID 555 if ( isset( $this->processed_posts[$post_parent] ) ) { 556 $post_parent = $this->processed_posts[$post_parent]; 557 // otherwise record the parent for later 558 } else { 559 $this->post_orphans[intval($post['post_id'])] = $post_parent; 560 $post_parent = 0; 561 } 562 } 563 564 // map the post author 565 $author = sanitize_user( $post['post_author'], true ); 566 if ( isset( $this->author_mapping[$author] ) ) 567 $author = $this->author_mapping[$author]; 568 else 569 $author = (int) get_current_user_id(); 570 571 $postdata = array( 572 'import_id' => $post['post_id'], 'post_author' => $author, 'post_date' => $post['post_date'], 573 'post_date_gmt' => $post['post_date_gmt'], 'post_content' => $post['post_content'], 574 'post_excerpt' => $post['post_excerpt'], 'post_title' => $post['post_title'], 575 'post_status' => $post['status'], 'post_name' => $post['post_name'], 576 'comment_status' => $post['comment_status'], 'ping_status' => $post['ping_status'], 577 'guid' => $post['guid'], 'post_parent' => $post_parent, 'menu_order' => $post['menu_order'], 578 'post_type' => $post['post_type'], 'post_password' => $post['post_password'] 579 ); 580 581 if ( 'attachment' == $postdata['post_type'] ) { 582 $remote_url = ! empty($post['attachment_url']) ? $post['attachment_url'] : $post['guid']; 583 584 // try to use _wp_attached file for upload folder placement to ensure the same location as the export site 585 // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload() 586 $postdata['upload_date'] = $post['post_date']; 587 if ( isset( $post['postmeta'] ) ) { 588 foreach( $post['postmeta'] as $meta ) { 589 if ( $meta['key'] == '_wp_attached_file' ) { 590 if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) ) 591 $postdata['upload_date'] = $matches[0]; 592 break; 593 } 594 } 595 } 596 597 $comment_post_ID = $post_id = $this->process_attachment( $postdata, $remote_url ); 598 } else { 599 $comment_post_ID = $post_id = wp_insert_post( $postdata, true ); 600 } 601 602 if ( is_wp_error( $post_id ) ) { 603 printf( __( 'Failed to import %s “%s”', 'wordpress-importer' ), 604 $post_type_object->labels->singular_name, esc_html($post['post_title']) ); 605 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 606 echo ': ' . $post_id->get_error_message(); 607 echo '<br />'; 608 continue; 609 } 610 611 if ( $post['is_sticky'] == 1 ) 612 stick_post( $post_id ); 613 } 614 615 // map pre-import ID to local ID 616 $this->processed_posts[intval($post['post_id'])] = (int) $post_id; 617 618 // add categories, tags and other terms 619 if ( ! empty( $post['terms'] ) ) { 620 $terms_to_set = array(); 621 foreach ( $post['terms'] as $term ) { 622 // back compat with WXR 1.0 map 'tag' to 'post_tag' 623 $taxonomy = ( 'tag' == $term['domain'] ) ? 'post_tag' : $term['domain']; 624 $term_exists = term_exists( $term['slug'], $taxonomy ); 625 $term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists; 626 if ( ! $term_id ) { 627 $t = wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) ); 628 if ( ! is_wp_error( $t ) ) { 629 $term_id = $t['term_id']; 630 } else { 631 printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($taxonomy), esc_html($term['name']) ); 632 if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG ) 633 echo ': ' . $t->get_error_message(); 634 echo '<br />'; 635 continue; 636 } 637 } 638 $terms_to_set[$taxonomy][] = intval( $term_id ); 639 } 640 641 foreach ( $terms_to_set as $tax => $ids ) { 642 $tt_ids = wp_set_post_terms( $post_id, $ids, $tax ); 643 } 644 unset( $post['terms'], $terms_to_set ); 645 } 646 647 // add/update comments 648 if ( ! empty( $post['comments'] ) ) { 649 $num_comments = 0; 650 $inserted_comments = array(); 651 foreach ( $post['comments'] as $comment ) { 652 $comment_id = $comment['comment_id']; 653 $newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID; 654 $newcomments[$comment_id]['comment_author'] = $comment['comment_author']; 655 $newcomments[$comment_id]['comment_author_email'] = $comment['comment_author_email']; 656 $newcomments[$comment_id]['comment_author_IP'] = $comment['comment_author_IP']; 657 $newcomments[$comment_id]['comment_author_url'] = $comment['comment_author_url']; 658 $newcomments[$comment_id]['comment_date'] = $comment['comment_date']; 659 $newcomments[$comment_id]['comment_date_gmt'] = $comment['comment_date_gmt']; 660 $newcomments[$comment_id]['comment_content'] = $comment['comment_content']; 661 $newcomments[$comment_id]['comment_approved'] = $comment['comment_approved']; 662 $newcomments[$comment_id]['comment_type'] = $comment['comment_type']; 663 $newcomments[$comment_id]['comment_parent'] = $comment['comment_parent']; 664 $newcomments[$comment_id]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array(); 665 if ( isset( $this->processed_authors[$comment['comment_user_id']] ) ) 666 $newcomments[$comment_id]['user_id'] = $this->processed_authors[$comment['comment_user_id']]; 667 } 668 ksort( $newcomments ); 669 670 foreach ( $newcomments as $key => $comment ) { 671 // if this is a new post we can skip the comment_exists() check 672 if ( ! $post_exists || ! comment_exists( $comment['comment_author'], $comment['comment_date'] ) ) { 673 if ( isset( $inserted_comments[$comment['comment_parent']] ) ) 674 $comment['comment_parent'] = $inserted_comments[$comment['comment_parent']]; 675 $comment = wp_filter_comment( $comment ); 676 $inserted_comments[$key] = wp_insert_comment( $comment ); 677 678 foreach( $comment['commentmeta'] as $meta ) { 679 $value = maybe_unserialize( $meta['value'] ); 680 add_comment_meta( $inserted_comments[$key], $meta['key'], $value ); 681 } 682 683 $num_comments++; 684 } 685 } 686 unset( $newcomments, $inserted_comments, $post['comments'] ); 687 } 688 689 // add/update post meta 690 if ( isset( $post['postmeta'] ) ) { 691 foreach ( $post['postmeta'] as $meta ) { 692 $key = apply_filters( 'import_post_meta_key', $meta['key'] ); 693 $value = false; 694 695 if ( '_edit_last' == $key ) { 696 if ( isset( $this->processed_authors[intval($meta['value'])] ) ) 697 $value = $this->processed_authors[intval($meta['value'])]; 698 else 699 $key = false; 700 } 701 702 if ( $key ) { 703 // export gets meta straight from the DB so could have a serialized string 704 if ( ! $value ) 705 $value = maybe_unserialize( $meta['value'] ); 706 707 add_post_meta( $post_id, $key, $value ); 708 do_action( 'import_post_meta', $post_id, $key, $value ); 709 710 // if the post has a featured image, take note of this in case of remap 711 if ( '_thumbnail_id' == $key ) 712 $this->featured_images[$post_id] = (int) $value; 713 } 714 } 715 } 716 } 717 718 unset( $this->posts ); 719 } 720 721 /** 722 * Attempt to create a new menu item from import data 723 * 724 * Fails for draft, orphaned menu items and those without an associated nav_menu 725 * or an invalid nav_menu term. If the post type or term object which the menu item 726 * represents doesn't exist then the menu item will not be imported (waits until the 727 * end of the import to retry again before discarding). 728 * 729 * @param array $item Menu item details from WXR file 730 */ 731 function process_menu_item( $item ) { 732 // skip draft, orphaned menu items 733 if ( 'draft' == $item['status'] ) 734 return; 735 736 $menu_slug = false; 737 if ( isset($item['terms']) ) { 738 // loop through terms, assume first nav_menu term is correct menu 739 foreach ( $item['terms'] as $term ) { 740 if ( 'nav_menu' == $term['domain'] ) { 741 $menu_slug = $term['slug']; 742 break; 743 } 744 } 745 } 746 747 // no nav_menu term associated with this menu item 748 if ( ! $menu_slug ) { 749 _e( 'Menu item skipped due to missing menu slug', 'wordpress-importer' ); 750 echo '<br />'; 751 return; 752 } 753 754 $menu_id = term_exists( $menu_slug, 'nav_menu' ); 755 if ( ! $menu_id ) { 756 printf( __( 'Menu item skipped due to invalid menu slug: %s', 'wordpress-importer' ), esc_html( $menu_slug ) ); 757 echo '<br />'; 758 return; 759 } else { 760 $menu_id = is_array( $menu_id ) ? $menu_id['term_id'] : $menu_id; 761 } 762 763 foreach ( $item['postmeta'] as $meta ) 764 $$meta['key'] = $meta['value']; 765 766 if ( 'taxonomy' == $_menu_item_type && isset( $this->processed_terms[intval($_menu_item_object_id)] ) ) { 767 $_menu_item_object_id = $this->processed_terms[intval($_menu_item_object_id)]; 768 } else if ( 'post_type' == $_menu_item_type && isset( $this->processed_posts[intval($_menu_item_object_id)] ) ) { 769 $_menu_item_object_id = $this->processed_posts[intval($_menu_item_object_id)]; 770 } else if ( 'custom' != $_menu_item_type ) { 771 // associated object is missing or not imported yet, we'll retry later 772 $this->missing_menu_items[] = $item; 773 return; 774 } 775 776 if ( isset( $this->processed_menu_items[intval($_menu_item_menu_item_parent)] ) ) { 777 $_menu_item_menu_item_parent = $this->processed_menu_items[intval($_menu_item_menu_item_parent)]; 778 } else if ( $_menu_item_menu_item_parent ) { 779 $this->menu_item_orphans[intval($item['post_id'])] = (int) $_menu_item_menu_item_parent; 780 $_menu_item_menu_item_parent = 0; 781 } 782 783 // wp_update_nav_menu_item expects CSS classes as a space separated string 784 $_menu_item_classes = maybe_unserialize( $_menu_item_classes ); 785 if ( is_array( $_menu_item_classes ) ) 786 $_menu_item_classes = implode( ' ', $_menu_item_classes ); 787 788 $args = array( 789 'menu-item-object-id' => $_menu_item_object_id, 790 'menu-item-object' => $_menu_item_object, 791 'menu-item-parent-id' => $_menu_item_menu_item_parent, 792 'menu-item-position' => intval( $item['menu_order'] ), 793 'menu-item-type' => $_menu_item_type, 794 'menu-item-title' => $item['post_title'], 795 'menu-item-url' => $_menu_item_url, 796 'menu-item-description' => $item['post_content'], 797 'menu-item-attr-title' => $item['post_excerpt'], 798 'menu-item-target' => $_menu_item_target, 799 'menu-item-classes' => $_menu_item_classes, 800 'menu-item-xfn' => $_menu_item_xfn, 801 'menu-item-status' => $item['status'] 802 ); 803 804 $id = wp_update_nav_menu_item( $menu_id, 0, $args ); 805 if ( $id && ! is_wp_error( $id ) ) 806 $this->processed_menu_items[intval($item['post_id'])] = (int) $id; 807 } 808 809 /** 810 * If fetching attachments is enabled then attempt to create a new attachment 811 * 812 * @param array $post Attachment post details from WXR 813 * @param string $url URL to fetch attachment from 814 * @return int|WP_Error Post ID on success, WP_Error otherwise 815 */ 816 function process_attachment( $post, $url ) { 817 if ( ! $this->fetch_attachments ) 818 return new WP_Error( 'attachment_processing_error', 819 __( 'Fetching attachments is not enabled', 'wordpress-importer' ) ); 820 821 // if the URL is absolute, but does not contain address, then upload it assuming base_site_url 822 if ( preg_match( '|^/[\w\W]+$|', $url ) ) 823 $url = rtrim( $this->base_url, '/' ) . $url; 824 825 $upload = $this->fetch_remote_file( $url, $post ); 826 if ( is_wp_error( $upload ) ) 827 return $upload; 828 829 if ( $info = wp_check_filetype( $upload['file'] ) ) 830 $post['post_mime_type'] = $info['type']; 831 else 832 return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') ); 833 834 $post['guid'] = $upload['url']; 835 836 // as per wp-admin/includes/upload.php 837 $post_id = wp_insert_attachment( $post, $upload['file'] ); 838 wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) ); 839 840 // remap resized image URLs, works by stripping the extension and remapping the URL stub. 841 if ( preg_match( '!^image/!', $info['type'] ) ) { 842 $parts = pathinfo( $url ); 843 $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2 844 845 $parts_new = pathinfo( $upload['url'] ); 846 $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" ); 847 848 $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new; 849 } 850 851 return $post_id; 852 } 853 854 /** 855 * Attempt to download a remote file attachment 856 * 857 * @param string $url URL of item to fetch 858 * @param array $post Attachment details 859 * @return array|WP_Error Local file location details on success, WP_Error otherwise 860 */ 861 function fetch_remote_file( $url, $post ) { 862 // extract the file name and extension from the url 863 $file_name = basename( $url ); 864 865 // get placeholder file in the upload dir with a unique, sanitized filename 866 $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); 867 if ( $upload['error'] ) 868 return new WP_Error( 'upload_dir_error', $upload['error'] ); 869 870 // fetch the remote url and write it to the placeholder file 871 $headers = wp_get_http( $url, $upload['file'] ); 872 873 // request failed 874 if ( ! $headers ) { 875 @unlink( $upload['file'] ); 876 return new WP_Error( 'import_file_error', __('Remote server did not respond', 'wordpress-importer') ); 877 } 878 879 // make sure the fetch was successful 880 if ( $headers['response'] != '200' ) { 881 @unlink( $upload['file'] ); 882 return new WP_Error( 'import_file_error', sprintf( __('Remote server returned error response %1$d %2$s', 'wordpress-importer'), esc_html($headers['response']), get_status_header_desc($headers['response']) ) ); 883 } 884 885 $filesize = filesize( $upload['file'] ); 886 887 if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) { 888 @unlink( $upload['file'] ); 889 return new WP_Error( 'import_file_error', __('Remote file is incorrect size', 'wordpress-importer') ); 890 } 891 892 if ( 0 == $filesize ) { 893 @unlink( $upload['file'] ); 894 return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'wordpress-importer') ); 895 } 896 897 $max_size = (int) $this->max_attachment_size(); 898 if ( ! empty( $max_size ) && $filesize > $max_size ) { 899 @unlink( $upload['file'] ); 900 return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', 'wordpress-importer'), size_format($max_size) ) ); 901 } 902 903 // keep track of the old and new urls so we can substitute them later 904 $this->url_remap[$url] = $upload['url']; 905 $this->url_remap[$post['guid']] = $upload['url']; // r13735, really needed? 906 // keep track of the destination if the remote url is redirected somewhere else 907 if ( isset($headers['x-final-location']) && $headers['x-final-location'] != $url ) 908 $this->url_remap[$headers['x-final-location']] = $upload['url']; 909 910 return $upload; 911 } 912 913 /** 914 * Attempt to associate posts and menu items with previously missing parents 915 * 916 * An imported post's parent may not have been imported when it was first created 917 * so try again. Similarly for child menu items and menu items which were missing 918 * the object (e.g. post) they represent in the menu 919 */ 920 function backfill_parents() { 921 global $wpdb; 922 923 // find parents for post orphans 924 foreach ( $this->post_orphans as $child_id => $parent_id ) { 925 $local_child_id = $local_parent_id = false; 926 if ( isset( $this->processed_posts[$child_id] ) ) 927 $local_child_id = $this->processed_posts[$child_id]; 928 if ( isset( $this->processed_posts[$parent_id] ) ) 929 $local_parent_id = $this->processed_posts[$parent_id]; 930 931 if ( $local_child_id && $local_parent_id ) 932 $wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' ); 933 } 934 935 // all other posts/terms are imported, retry menu items with missing associated object 936 $missing_menu_items = $this->missing_menu_items; 937 foreach ( $missing_menu_items as $item ) 938 $this->process_menu_item( $item ); 939 940 // find parents for menu item orphans 941 foreach ( $this->menu_item_orphans as $child_id => $parent_id ) { 942 $local_child_id = $local_parent_id = 0; 943 if ( isset( $this->processed_menu_items[$child_id] ) ) 944 $local_child_id = $this->processed_menu_items[$child_id]; 945 if ( isset( $this->processed_menu_items[$parent_id] ) ) 946 $local_parent_id = $this->processed_menu_items[$parent_id]; 947 948 if ( $local_child_id && $local_parent_id ) 949 update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id ); 950 } 951 } 952 953 /** 954 * Use stored mapping information to update old attachment URLs 955 */ 956 function backfill_attachment_urls() { 957 global $wpdb; 958 // make sure we do the longest urls first, in case one is a substring of another 959 uksort( $this->url_remap, array(&$this, 'cmpr_strlen') ); 960 961 foreach ( $this->url_remap as $from_url => $to_url ) { 962 // remap urls in post_content 963 $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url) ); 964 // remap enclosure urls 965 $result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url) ); 966 } 967 } 968 969 /** 970 * Update _thumbnail_id meta to new, imported attachment IDs 971 */ 972 function remap_featured_images() { 973 // cycle through posts that have a featured image 974 foreach ( $this->featured_images as $post_id => $value ) { 975 if ( isset( $this->processed_posts[$value] ) ) { 976 $new_id = $this->processed_posts[$value]; 977 // only update if there's a difference 978 if ( $new_id != $value ) 979 update_post_meta( $post_id, '_thumbnail_id', $new_id ); 980 } 981 } 982 } 983 984 /** 985 * Parse a WXR file 986 * 987 * @param string $file Path to WXR file for parsing 988 * @return array Information gathered from the WXR file 989 */ 990 function parse( $file ) { 991 $parser = new WXR_Parser(); 992 return $parser->parse( $file ); 993 } 994 995 // Display import page title 996 function header() { 997 echo '<div class="wrap">'; 998 screen_icon(); 999 echo '<h2>' . __( 'Import WordPress', 'wordpress-importer' ) . '</h2>'; 1000 1001 $updates = get_plugin_updates(); 1002 $basename = plugin_basename(__FILE__); 1003 if ( isset( $updates[$basename] ) ) { 1004 $update = $updates[$basename]; 1005 echo '<div class="error"><p><strong>'; 1006 printf( __( 'A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer' ), $update->update->new_version ); 1007 echo '</strong></p></div>'; 1008 } 1009 } 1010 1011 // Close div.wrap 1012 function footer() { 1013 echo '</div>'; 1014 } 1015 1016 /** 1017 * Display introductory text and file upload form 1018 */ 1019 function greet() { 1020 echo '<div class="narrow">'; 1021 echo '<p>'.__( 'Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, pages, comments, custom fields, categories, and tags into this site.', 'wordpress-importer' ).'</p>'; 1022 echo '<p>'.__( 'Choose a WXR (.xml) file to upload, then click Upload file and import.', 'wordpress-importer' ).'</p>'; 1023 wp_import_upload_form( 'admin.php?import=wordpress&step=1' ); 1024 echo '</div>'; 1025 } 1026 1027 /** 1028 * Decide if the given meta key maps to information we will want to import 1029 * 1030 * @param string $key The meta key to check 1031 * @return string|bool The key if we do want to import, false if not 1032 */ 1033 function is_valid_meta_key( $key ) { 1034 // skip attachment metadata since we'll regenerate it from scratch 1035 // skip _edit_lock as not relevant for import 1036 if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) 1037 return false; 1038 return $key; 1039 } 1040 1041 /** 1042 * Decide whether or not the importer is allowed to create users. 1043 * Default is true, can be filtered via import_allow_create_users 1044 * 1045 * @return bool True if creating users is allowed 1046 */ 1047 function allow_create_users() { 1048 return apply_filters( 'import_allow_create_users', true ); 1049 } 1050 1051 /** 1052 * Decide whether or not the importer should attempt to download attachment files. 1053 * Default is true, can be filtered via import_allow_fetch_attachments. The choice 1054 * made at the import options screen must also be true, false here hides that checkbox. 1055 * 1056 * @return bool True if downloading attachments is allowed 1057 */ 1058 function allow_fetch_attachments() { 1059 return apply_filters( 'import_allow_fetch_attachments', true ); 1060 } 1061 1062 /** 1063 * Decide what the maximum file size for downloaded attachments is. 1064 * Default is 0 (unlimited), can be filtered via import_attachment_size_limit 1065 * 1066 * @return int Maximum attachment file size to import 1067 */ 1068 function max_attachment_size() { 1069 return apply_filters( 'import_attachment_size_limit', 0 ); 1070 } 1071 1072 /** 1073 * Added to http_request_timeout filter to force timeout at 60 seconds during import 1074 * @return int 60 1075 */ 1076 function bump_request_timeout() { 1077 return 60; 1078 } 1079 1080 // return the difference in length between two strings 1081 function cmpr_strlen( $a, $b ) { 1082 return strlen($b) - strlen($a); 1083 } 1084 } 1085 1086 } // class_exists( 'WP_Importer' ) 1087 1088 function wordpress_importer_init() { 1089 load_plugin_textdomain( 'wordpress-importer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 1090 1091 /** 1092 * WordPress Importer object for registering the import callback 1093 * @global WP_Import $wp_import 1094 */ 1095 $GLOBALS['wp_import'] = new WP_Import(); 1096 register_importer( 'wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array( $GLOBALS['wp_import'], 'dispatch' ) ); 1097 } 1098 add_action( 'admin_init', 'wordpress_importer_init' ); -
wp-content/plugins/wordpress-importer/readme.txt
1 === Plugin Name === 2 Contributors: wordpressdotorg 3 Donate link: 4 Tags: importer, wordpress 5 Requires at least: 3.0 6 Tested up to: 3.4 7 Stable tag: 0.6 8 9 Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. 10 11 == Description == 12 13 The WordPress Importer will import the following content from a WordPress export file: 14 15 * Posts, pages and other custom post types 16 * Comments 17 * Custom fields and post meta 18 * Categories, tags and terms from custom taxonomies 19 * Authors 20 21 For further information and instructions please see the [Codex page on Importing Content](http://codex.wordpress.org/Importing_Content#WordPress) 22 23 == Installation == 24 25 The quickest method for installing the importer is: 26 27 1. Visit Tools -> Import in the WordPress dashboard 28 1. Click on the WordPress link in the list of importers 29 1. Click "Install Now" 30 1. Finally click "Activate Plugin & Run Importer" 31 32 If you would prefer to do things manually then follow these instructions: 33 34 1. Upload the `wordpress-importer` folder to the `/wp-content/plugins/` directory 35 1. Activate the plugin through the 'Plugins' menu in WordPress 36 1. Go to the Tools -> Import screen, click on WordPress 37 38 == Changelog == 39 40 = 0.6 = 41 * Support for WXR 1.2 and multiple CDATA sections 42 * Post aren't duplicates if their post_type's are different 43 44 = 0.5.2 = 45 * Double check that the uploaded export file exists before processing it. This prevents incorrect error messages when 46 an export file is uploaded to a server with bad permissions and WordPress 3.3 or 3.3.1 is being used. 47 48 = 0.5 = 49 * Import comment meta (requires export from WordPress 3.2) 50 * Minor bugfixes and enhancements 51 52 = 0.4 = 53 * Map comment user_id where possible 54 * Import attachments from `wp:attachment_url` 55 * Upload attachments to correct directory 56 * Remap resized image URLs correctly 57 58 = 0.3 = 59 * Use an XML Parser if possible 60 * Proper import support for nav menus 61 * ... and much more, see [Trac ticket #15197](http://core.trac.wordpress.org/ticket/15197) 62 63 = 0.1 = 64 * Initial release 65 66 == Upgrade Notice == 67 68 = 0.6 = 69 Support for exports from WordPress 3.4. 70 71 = 0.5.2 = 72 Fix incorrect error message when the export file could not be uploaded. 73 74 = 0.5 = 75 Import comment meta and other minor bugfixes and enhancements. 76 77 = 0.4 = 78 Bug fixes for attachment importing and other small enhancements. 79 80 = 0.3 = 81 Upgrade for a more robust and reliable experience when importing WordPress export files, and for compatibility with WordPress 3.1. 82 83 == Frequently Asked Questions == 84 85 = Help! I'm getting out of memory errors or a blank screen. = 86 If your exported file is very large, the import script may run into your host's configured memory limit for PHP. 87 88 A message like "Fatal error: Allowed memory size of 8388608 bytes exhausted" indicates that the script can't successfully import your XML file under the current PHP memory limit. If you have access to the php.ini file, you can manually increase the limit; if you do not (your WordPress installation is hosted on a shared server, for instance), you might have to break your exported XML file into several smaller pieces and run the import script one at a time. 89 90 For those with shared hosting, the best alternative may be to consult hosting support to determine the safest approach for running the import. A host may be willing to temporarily lift the memory limit and/or run the process directly from their end. 91 92 -- [WordPress Codex: Importing Content](http://codex.wordpress.org/Importing_Content#Before_Importing) 93 94 == Filters == 95 96 The importer has a couple of filters to allow you to completely enable/block certain features: 97 98 * `import_allow_create_users`: return false if you only want to allow mapping to existing users 99 * `import_allow_fetch_attachments`: return false if you do not wish to allow importing and downloading of attachments 100 * `import_attachment_size_limit`: return an integer value for the maximum file size in bytes to save (default is 0, which is unlimited) 101 102 There are also a few actions available to hook into: 103 104 * `import_start`: occurs after the export file has been uploaded and author import settings have been chosen 105 * `import_end`: called after the last output from the importer -
wp-content/plugins/wordpress-importer/parsers.php
1 <?php 2 /** 3 * WordPress eXtended RSS file parser implementations 4 * 5 * @package WordPress 6 * @subpackage Importer 7 */ 8 9 /** 10 * WordPress Importer class for managing parsing of WXR files. 11 */ 12 class WXR_Parser { 13 function parse( $file ) { 14 // Attempt to use proper XML parsers first 15 if ( extension_loaded( 'simplexml' ) ) { 16 $parser = new WXR_Parser_SimpleXML; 17 $result = $parser->parse( $file ); 18 19 // If SimpleXML succeeds or this is an invalid WXR file then return the results 20 if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' != $result->get_error_code() ) 21 return $result; 22 } else if ( extension_loaded( 'xml' ) ) { 23 $parser = new WXR_Parser_XML; 24 $result = $parser->parse( $file ); 25 26 // If XMLParser succeeds or this is an invalid WXR file then return the results 27 if ( ! is_wp_error( $result ) || 'XML_parse_error' != $result->get_error_code() ) 28 return $result; 29 } 30 31 // We have a malformed XML file, so display the error and fallthrough to regex 32 if ( isset($result) && defined('IMPORT_DEBUG') && IMPORT_DEBUG ) { 33 echo '<pre>'; 34 if ( 'SimpleXML_parse_error' == $result->get_error_code() ) { 35 foreach ( $result->get_error_data() as $error ) 36 echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n"; 37 } else if ( 'XML_parse_error' == $result->get_error_code() ) { 38 $error = $result->get_error_data(); 39 echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] ); 40 } 41 echo '</pre>'; 42 echo '<p><strong>' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '</strong><br />'; 43 echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '</p>'; 44 } 45 46 // use regular expressions if nothing else available or this is bad XML 47 $parser = new WXR_Parser_Regex; 48 return $parser->parse( $file ); 49 } 50 } 51 52 /** 53 * WXR Parser that makes use of the SimpleXML PHP extension. 54 */ 55 class WXR_Parser_SimpleXML { 56 function parse( $file ) { 57 $authors = $posts = $categories = $tags = $terms = array(); 58 59 $internal_errors = libxml_use_internal_errors(true); 60 $xml = simplexml_load_file( $file ); 61 // halt if loading produces an error 62 if ( ! $xml ) 63 return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() ); 64 65 $wxr_version = $xml->xpath('/rss/channel/wp:wxr_version'); 66 if ( ! $wxr_version ) 67 return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); 68 69 $wxr_version = (string) trim( $wxr_version[0] ); 70 // confirm that we are dealing with the correct file format 71 if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) ) 72 return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); 73 74 $base_url = $xml->xpath('/rss/channel/wp:base_site_url'); 75 $base_url = (string) trim( $base_url[0] ); 76 77 $namespaces = $xml->getDocNamespaces(); 78 if ( ! isset( $namespaces['wp'] ) ) 79 $namespaces['wp'] = 'http://wordpress.org/export/1.1/'; 80 if ( ! isset( $namespaces['excerpt'] ) ) 81 $namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/'; 82 83 // grab authors 84 foreach ( $xml->xpath('/rss/channel/wp:author') as $author_arr ) { 85 $a = $author_arr->children( $namespaces['wp'] ); 86 $login = (string) $a->author_login; 87 $authors[$login] = array( 88 'author_id' => (int) $a->author_id, 89 'author_login' => $login, 90 'author_email' => (string) $a->author_email, 91 'author_display_name' => (string) $a->author_display_name, 92 'author_first_name' => (string) $a->author_first_name, 93 'author_last_name' => (string) $a->author_last_name 94 ); 95 } 96 97 // grab cats, tags and terms 98 foreach ( $xml->xpath('/rss/channel/wp:category') as $term_arr ) { 99 $t = $term_arr->children( $namespaces['wp'] ); 100 $categories[] = array( 101 'term_id' => (int) $t->term_id, 102 'category_nicename' => (string) $t->category_nicename, 103 'category_parent' => (string) $t->category_parent, 104 'cat_name' => (string) $t->cat_name, 105 'category_description' => (string) $t->category_description 106 ); 107 } 108 109 foreach ( $xml->xpath('/rss/channel/wp:tag') as $term_arr ) { 110 $t = $term_arr->children( $namespaces['wp'] ); 111 $tags[] = array( 112 'term_id' => (int) $t->term_id, 113 'tag_slug' => (string) $t->tag_slug, 114 'tag_name' => (string) $t->tag_name, 115 'tag_description' => (string) $t->tag_description 116 ); 117 } 118 119 foreach ( $xml->xpath('/rss/channel/wp:term') as $term_arr ) { 120 $t = $term_arr->children( $namespaces['wp'] ); 121 $terms[] = array( 122 'term_id' => (int) $t->term_id, 123 'term_taxonomy' => (string) $t->term_taxonomy, 124 'slug' => (string) $t->term_slug, 125 'term_parent' => (string) $t->term_parent, 126 'term_name' => (string) $t->term_name, 127 'term_description' => (string) $t->term_description 128 ); 129 } 130 131 // grab posts 132 foreach ( $xml->channel->item as $item ) { 133 $post = array( 134 'post_title' => (string) $item->title, 135 'guid' => (string) $item->guid, 136 ); 137 138 $dc = $item->children( 'http://purl.org/dc/elements/1.1/' ); 139 $post['post_author'] = (string) $dc->creator; 140 141 $content = $item->children( 'http://purl.org/rss/1.0/modules/content/' ); 142 $excerpt = $item->children( $namespaces['excerpt'] ); 143 $post['post_content'] = (string) $content->encoded; 144 $post['post_excerpt'] = (string) $excerpt->encoded; 145 146 $wp = $item->children( $namespaces['wp'] ); 147 $post['post_id'] = (int) $wp->post_id; 148 $post['post_date'] = (string) $wp->post_date; 149 $post['post_date_gmt'] = (string) $wp->post_date_gmt; 150 $post['comment_status'] = (string) $wp->comment_status; 151 $post['ping_status'] = (string) $wp->ping_status; 152 $post['post_name'] = (string) $wp->post_name; 153 $post['status'] = (string) $wp->status; 154 $post['post_parent'] = (int) $wp->post_parent; 155 $post['menu_order'] = (int) $wp->menu_order; 156 $post['post_type'] = (string) $wp->post_type; 157 $post['post_password'] = (string) $wp->post_password; 158 $post['is_sticky'] = (int) $wp->is_sticky; 159 160 if ( isset($wp->attachment_url) ) 161 $post['attachment_url'] = (string) $wp->attachment_url; 162 163 foreach ( $item->category as $c ) { 164 $att = $c->attributes(); 165 if ( isset( $att['nicename'] ) ) 166 $post['terms'][] = array( 167 'name' => (string) $c, 168 'slug' => (string) $att['nicename'], 169 'domain' => (string) $att['domain'] 170 ); 171 } 172 173 foreach ( $wp->postmeta as $meta ) { 174 $post['postmeta'][] = array( 175 'key' => (string) $meta->meta_key, 176 'value' => (string) $meta->meta_value 177 ); 178 } 179 180 foreach ( $wp->comment as $comment ) { 181 $meta = array(); 182 if ( isset( $comment->commentmeta ) ) { 183 foreach ( $comment->commentmeta as $m ) { 184 $meta[] = array( 185 'key' => (string) $m->meta_key, 186 'value' => (string) $m->meta_value 187 ); 188 } 189 } 190 191 $post['comments'][] = array( 192 'comment_id' => (int) $comment->comment_id, 193 'comment_author' => (string) $comment->comment_author, 194 'comment_author_email' => (string) $comment->comment_author_email, 195 'comment_author_IP' => (string) $comment->comment_author_IP, 196 'comment_author_url' => (string) $comment->comment_author_url, 197 'comment_date' => (string) $comment->comment_date, 198 'comment_date_gmt' => (string) $comment->comment_date_gmt, 199 'comment_content' => (string) $comment->comment_content, 200 'comment_approved' => (string) $comment->comment_approved, 201 'comment_type' => (string) $comment->comment_type, 202 'comment_parent' => (string) $comment->comment_parent, 203 'comment_user_id' => (int) $comment->comment_user_id, 204 'commentmeta' => $meta, 205 ); 206 } 207 208 $posts[] = $post; 209 } 210 211 return array( 212 'authors' => $authors, 213 'posts' => $posts, 214 'categories' => $categories, 215 'tags' => $tags, 216 'terms' => $terms, 217 'base_url' => $base_url, 218 'version' => $wxr_version 219 ); 220 } 221 } 222 223 /** 224 * WXR Parser that makes use of the XML Parser PHP extension. 225 */ 226 class WXR_Parser_XML { 227 var $wp_tags = array( 228 'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status', 'wp:attachment_url', 229 'wp:status', 'wp:post_name', 'wp:post_parent', 'wp:menu_order', 'wp:post_type', 'wp:post_password', 230 'wp:is_sticky', 'wp:term_id', 'wp:category_nicename', 'wp:category_parent', 'wp:cat_name', 'wp:category_description', 231 'wp:tag_slug', 'wp:tag_name', 'wp:tag_description', 'wp:term_taxonomy', 'wp:term_parent', 232 'wp:term_name', 'wp:term_description', 'wp:author_id', 'wp:author_login', 'wp:author_email', 'wp:author_display_name', 233 'wp:author_first_name', 'wp:author_last_name', 234 ); 235 var $wp_sub_tags = array( 236 'wp:comment_id', 'wp:comment_author', 'wp:comment_author_email', 'wp:comment_author_url', 237 'wp:comment_author_IP', 'wp:comment_date', 'wp:comment_date_gmt', 'wp:comment_content', 238 'wp:comment_approved', 'wp:comment_type', 'wp:comment_parent', 'wp:comment_user_id', 239 ); 240 241 function parse( $file ) { 242 $this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false; 243 $this->authors = $this->posts = $this->term = $this->category = $this->tag = array(); 244 245 $xml = xml_parser_create( 'UTF-8' ); 246 xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 ); 247 xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 ); 248 xml_set_object( $xml, $this ); 249 xml_set_character_data_handler( $xml, 'cdata' ); 250 xml_set_element_handler( $xml, 'tag_open', 'tag_close' ); 251 252 if ( ! xml_parse( $xml, file_get_contents( $file ), true ) ) { 253 $current_line = xml_get_current_line_number( $xml ); 254 $current_column = xml_get_current_column_number( $xml ); 255 $error_code = xml_get_error_code( $xml ); 256 $error_string = xml_error_string( $error_code ); 257 return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array( $current_line, $current_column, $error_string ) ); 258 } 259 xml_parser_free( $xml ); 260 261 if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) ) 262 return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); 263 264 return array( 265 'authors' => $this->authors, 266 'posts' => $this->posts, 267 'categories' => $this->category, 268 'tags' => $this->tag, 269 'terms' => $this->term, 270 'base_url' => $this->base_url, 271 'version' => $this->wxr_version 272 ); 273 } 274 275 function tag_open( $parse, $tag, $attr ) { 276 if ( in_array( $tag, $this->wp_tags ) ) { 277 $this->in_tag = substr( $tag, 3 ); 278 return; 279 } 280 281 if ( in_array( $tag, $this->wp_sub_tags ) ) { 282 $this->in_sub_tag = substr( $tag, 3 ); 283 return; 284 } 285 286 switch ( $tag ) { 287 case 'category': 288 if ( isset($attr['domain'], $attr['nicename']) ) { 289 $this->sub_data['domain'] = $attr['domain']; 290 $this->sub_data['slug'] = $attr['nicename']; 291 } 292 break; 293 case 'item': $this->in_post = true; 294 case 'title': if ( $this->in_post ) $this->in_tag = 'post_title'; break; 295 case 'guid': $this->in_tag = 'guid'; break; 296 case 'dc:creator': $this->in_tag = 'post_author'; break; 297 case 'content:encoded': $this->in_tag = 'post_content'; break; 298 case 'excerpt:encoded': $this->in_tag = 'post_excerpt'; break; 299 300 case 'wp:term_slug': $this->in_tag = 'slug'; break; 301 case 'wp:meta_key': $this->in_sub_tag = 'key'; break; 302 case 'wp:meta_value': $this->in_sub_tag = 'value'; break; 303 } 304 } 305 306 function cdata( $parser, $cdata ) { 307 if ( ! trim( $cdata ) ) 308 return; 309 310 $this->cdata .= trim( $cdata ); 311 } 312 313 function tag_close( $parser, $tag ) { 314 switch ( $tag ) { 315 case 'wp:comment': 316 unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data 317 if ( ! empty( $this->sub_data ) ) 318 $this->data['comments'][] = $this->sub_data; 319 $this->sub_data = false; 320 break; 321 case 'wp:commentmeta': 322 $this->sub_data['commentmeta'][] = array( 323 'key' => $this->sub_data['key'], 324 'value' => $this->sub_data['value'] 325 ); 326 break; 327 case 'category': 328 if ( ! empty( $this->sub_data ) ) { 329 $this->sub_data['name'] = $this->cdata; 330 $this->data['terms'][] = $this->sub_data; 331 } 332 $this->sub_data = false; 333 break; 334 case 'wp:postmeta': 335 if ( ! empty( $this->sub_data ) ) 336 $this->data['postmeta'][] = $this->sub_data; 337 $this->sub_data = false; 338 break; 339 case 'item': 340 $this->posts[] = $this->data; 341 $this->data = false; 342 break; 343 case 'wp:category': 344 case 'wp:tag': 345 case 'wp:term': 346 $n = substr( $tag, 3 ); 347 array_push( $this->$n, $this->data ); 348 $this->data = false; 349 break; 350 case 'wp:author': 351 if ( ! empty($this->data['author_login']) ) 352 $this->authors[$this->data['author_login']] = $this->data; 353 $this->data = false; 354 break; 355 case 'wp:base_site_url': 356 $this->base_url = $this->cdata; 357 break; 358 case 'wp:wxr_version': 359 $this->wxr_version = $this->cdata; 360 break; 361 362 default: 363 if ( $this->in_sub_tag ) { 364 $this->sub_data[$this->in_sub_tag] = ! empty( $this->cdata ) ? $this->cdata : ''; 365 $this->in_sub_tag = false; 366 } else if ( $this->in_tag ) { 367 $this->data[$this->in_tag] = ! empty( $this->cdata ) ? $this->cdata : ''; 368 $this->in_tag = false; 369 } 370 } 371 372 $this->cdata = false; 373 } 374 } 375 376 /** 377 * WXR Parser that uses regular expressions. Fallback for installs without an XML parser. 378 */ 379 class WXR_Parser_Regex { 380 var $authors = array(); 381 var $posts = array(); 382 var $categories = array(); 383 var $tags = array(); 384 var $terms = array(); 385 var $base_url = ''; 386 387 function WXR_Parser_Regex() { 388 $this->__construct(); 389 } 390 391 function __construct() { 392 $this->has_gzip = is_callable( 'gzopen' ); 393 } 394 395 function parse( $file ) { 396 $wxr_version = $in_post = false; 397 398 $fp = $this->fopen( $file, 'r' ); 399 if ( $fp ) { 400 while ( ! $this->feof( $fp ) ) { 401 $importline = rtrim( $this->fgets( $fp ) ); 402 403 if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) ) 404 $wxr_version = $version[1]; 405 406 if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) { 407 preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url ); 408 $this->base_url = $url[1]; 409 continue; 410 } 411 if ( false !== strpos( $importline, '<wp:category>' ) ) { 412 preg_match( '|<wp:category>(.*?)</wp:category>|is', $importline, $category ); 413 $this->categories[] = $this->process_category( $category[1] ); 414 continue; 415 } 416 if ( false !== strpos( $importline, '<wp:tag>' ) ) { 417 preg_match( '|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag ); 418 $this->tags[] = $this->process_tag( $tag[1] ); 419 continue; 420 } 421 if ( false !== strpos( $importline, '<wp:term>' ) ) { 422 preg_match( '|<wp:term>(.*?)</wp:term>|is', $importline, $term ); 423 $this->terms[] = $this->process_term( $term[1] ); 424 continue; 425 } 426 if ( false !== strpos( $importline, '<wp:author>' ) ) { 427 preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author ); 428 $a = $this->process_author( $author[1] ); 429 $this->authors[$a['author_login']] = $a; 430 continue; 431 } 432 if ( false !== strpos( $importline, '<item>' ) ) { 433 $post = ''; 434 $in_post = true; 435 continue; 436 } 437 if ( false !== strpos( $importline, '</item>' ) ) { 438 $in_post = false; 439 $this->posts[] = $this->process_post( $post ); 440 continue; 441 } 442 if ( $in_post ) { 443 $post .= $importline . "\n"; 444 } 445 } 446 447 $this->fclose($fp); 448 } 449 450 if ( ! $wxr_version ) 451 return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); 452 453 return array( 454 'authors' => $this->authors, 455 'posts' => $this->posts, 456 'categories' => $this->categories, 457 'tags' => $this->tags, 458 'terms' => $this->terms, 459 'base_url' => $this->base_url, 460 'version' => $wxr_version 461 ); 462 } 463 464 function get_tag( $string, $tag ) { 465 preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return ); 466 if ( isset( $return[1] ) ) { 467 if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) { 468 if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) { 469 preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches ); 470 $return = ''; 471 foreach( $matches[1] as $match ) 472 $return .= $match; 473 } else { 474 $return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] ); 475 } 476 } else { 477 $return = $return[1]; 478 } 479 } else { 480 $return = ''; 481 } 482 return $return; 483 } 484 485 function process_category( $c ) { 486 return array( 487 'term_id' => $this->get_tag( $c, 'wp:term_id' ), 488 'cat_name' => $this->get_tag( $c, 'wp:cat_name' ), 489 'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ), 490 'category_parent' => $this->get_tag( $c, 'wp:category_parent' ), 491 'category_description' => $this->get_tag( $c, 'wp:category_description' ), 492 ); 493 } 494 495 function process_tag( $t ) { 496 return array( 497 'term_id' => $this->get_tag( $t, 'wp:term_id' ), 498 'tag_name' => $this->get_tag( $t, 'wp:tag_name' ), 499 'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ), 500 'tag_description' => $this->get_tag( $t, 'wp:tag_description' ), 501 ); 502 } 503 504 function process_term( $t ) { 505 return array( 506 'term_id' => $this->get_tag( $t, 'wp:term_id' ), 507 'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ), 508 'slug' => $this->get_tag( $t, 'wp:term_slug' ), 509 'term_parent' => $this->get_tag( $t, 'wp:term_parent' ), 510 'term_name' => $this->get_tag( $t, 'wp:term_name' ), 511 'term_description' => $this->get_tag( $t, 'wp:term_description' ), 512 ); 513 } 514 515 function process_author( $a ) { 516 return array( 517 'author_id' => $this->get_tag( $a, 'wp:author_id' ), 518 'author_login' => $this->get_tag( $a, 'wp:author_login' ), 519 'author_email' => $this->get_tag( $a, 'wp:author_email' ), 520 'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ), 521 'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ), 522 'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ), 523 ); 524 } 525 526 function process_post( $post ) { 527 $post_id = $this->get_tag( $post, 'wp:post_id' ); 528 $post_title = $this->get_tag( $post, 'title' ); 529 $post_date = $this->get_tag( $post, 'wp:post_date' ); 530 $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' ); 531 $comment_status = $this->get_tag( $post, 'wp:comment_status' ); 532 $ping_status = $this->get_tag( $post, 'wp:ping_status' ); 533 $status = $this->get_tag( $post, 'wp:status' ); 534 $post_name = $this->get_tag( $post, 'wp:post_name' ); 535 $post_parent = $this->get_tag( $post, 'wp:post_parent' ); 536 $menu_order = $this->get_tag( $post, 'wp:menu_order' ); 537 $post_type = $this->get_tag( $post, 'wp:post_type' ); 538 $post_password = $this->get_tag( $post, 'wp:post_password' ); 539 $is_sticky = $this->get_tag( $post, 'wp:is_sticky' ); 540 $guid = $this->get_tag( $post, 'guid' ); 541 $post_author = $this->get_tag( $post, 'dc:creator' ); 542 543 $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); 544 $post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt ); 545 $post_excerpt = str_replace( '<br>', '<br />', $post_excerpt ); 546 $post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt ); 547 548 $post_content = $this->get_tag( $post, 'content:encoded' ); 549 $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content ); 550 $post_content = str_replace( '<br>', '<br />', $post_content ); 551 $post_content = str_replace( '<hr>', '<hr />', $post_content ); 552 553 $postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 554 'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 555 'menu_order', 'post_type', 'post_password', 'is_sticky' 556 ); 557 558 $attachment_url = $this->get_tag( $post, 'wp:attachment_url' ); 559 if ( $attachment_url ) 560 $postdata['attachment_url'] = $attachment_url; 561 562 preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER ); 563 foreach ( $terms as $t ) { 564 $post_terms[] = array( 565 'slug' => $t[2], 566 'domain' => $t[1], 567 'name' => str_replace( array( '<![CDATA[', ']]>' ), '', $t[3] ), 568 ); 569 } 570 if ( ! empty( $post_terms ) ) $postdata['terms'] = $post_terms; 571 572 preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments ); 573 $comments = $comments[1]; 574 if ( $comments ) { 575 foreach ( $comments as $comment ) { 576 preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta ); 577 $commentmeta = $commentmeta[1]; 578 $c_meta = array(); 579 foreach ( $commentmeta as $m ) { 580 $c_meta[] = array( 581 'key' => $this->get_tag( $m, 'wp:meta_key' ), 582 'value' => $this->get_tag( $m, 'wp:meta_value' ), 583 ); 584 } 585 586 $post_comments[] = array( 587 'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ), 588 'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ), 589 'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ), 590 'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ), 591 'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ), 592 'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ), 593 'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ), 594 'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ), 595 'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ), 596 'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ), 597 'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ), 598 'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ), 599 'commentmeta' => $c_meta, 600 ); 601 } 602 } 603 if ( ! empty( $post_comments ) ) $postdata['comments'] = $post_comments; 604 605 preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta ); 606 $postmeta = $postmeta[1]; 607 if ( $postmeta ) { 608 foreach ( $postmeta as $p ) { 609 $post_postmeta[] = array( 610 'key' => $this->get_tag( $p, 'wp:meta_key' ), 611 'value' => $this->get_tag( $p, 'wp:meta_value' ), 612 ); 613 } 614 } 615 if ( ! empty( $post_postmeta ) ) $postdata['postmeta'] = $post_postmeta; 616 617 return $postdata; 618 } 619 620 function _normalize_tag( $matches ) { 621 return '<' . strtolower( $matches[1] ); 622 } 623 624 function fopen( $filename, $mode = 'r' ) { 625 if ( $this->has_gzip ) 626 return gzopen( $filename, $mode ); 627 return fopen( $filename, $mode ); 628 } 629 630 function feof( $fp ) { 631 if ( $this->has_gzip ) 632 return gzeof( $fp ); 633 return feof( $fp ); 634 } 635 636 function fgets( $fp, $len = 8192 ) { 637 if ( $this->has_gzip ) 638 return gzgets( $fp, $len ); 639 return fgets( $fp, $len ); 640 } 641 642 function fclose( $fp ) { 643 if ( $this->has_gzip ) 644 return gzclose( $fp ); 645 return fclose( $fp ); 646 } 647 } -
wp-content/plugins/wordpress-importer/languages/wordpress-importer.pot
1 # Copyright (C) 2011 WordPress Importer 2 # This file is distributed under the same license as the WordPress Importer package. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: WordPress Importer 0.5\n" 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/wordpress-importer\n" 7 "POT-Creation-Date: 2011-07-16 15:45:12+00:00\n" 8 "MIME-Version: 1.0\n" 9 "Content-Type: text/plain; charset=UTF-8\n" 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Language-Team: LANGUAGE <LL@li.org>\n" 14 15 #: parsers.php:42 parsers.php:63 16 msgid "There was an error when reading this WXR file" 17 msgstr "" 18 19 #: parsers.php:43 20 msgid "" 21 "Details are shown above. The importer will now try again with a different " 22 "parser..." 23 msgstr "" 24 25 #: parsers.php:67 parsers.php:72 parsers.php:262 parsers.php:451 26 msgid "" 27 "This does not appear to be a WXR file, missing/invalid WXR version number" 28 msgstr "" 29 30 #: wordpress-importer.php:134 wordpress-importer.php:143 31 #: wordpress-importer.php:194 wordpress-importer.php:202 32 msgid "Sorry, there has been an error." 33 msgstr "" 34 35 #: wordpress-importer.php:135 36 msgid "The file does not exist, please try again." 37 msgstr "" 38 39 #: wordpress-importer.php:178 40 msgid "All done." 41 msgstr "" 42 43 #: wordpress-importer.php:178 44 msgid "Have fun!" 45 msgstr "" 46 47 #: wordpress-importer.php:179 48 msgid "Remember to update the passwords and roles of imported users." 49 msgstr "" 50 51 #: wordpress-importer.php:210 52 msgid "" 53 "This WXR file (version %s) may not be supported by this version of the " 54 "importer. Please consider updating." 55 msgstr "" 56 57 #: wordpress-importer.php:235 58 msgid "" 59 "Failed to import author %s. Their posts will be attributed to the current " 60 "user." 61 msgstr "" 62 63 #: wordpress-importer.php:261 64 msgid "Assign Authors" 65 msgstr "" 66 67 #: wordpress-importer.php:262 68 msgid "" 69 "To make it easier for you to edit and save the imported content, you may " 70 "want to reassign the author of the imported item to an existing user of this " 71 "site. For example, you may want to import all the entries as <code>admin</" 72 "code>s entries." 73 msgstr "" 74 75 #: wordpress-importer.php:264 76 msgid "" 77 "If a new user is created by WordPress, a new password will be randomly " 78 "generated and the new user’s role will be set as %s. Manually changing " 79 "the new user’s details will be necessary." 80 msgstr "" 81 82 #: wordpress-importer.php:274 83 msgid "Import Attachments" 84 msgstr "" 85 86 #: wordpress-importer.php:277 87 msgid "Download and import file attachments" 88 msgstr "" 89 90 #: wordpress-importer.php:281 91 msgid "Submit" 92 msgstr "" 93 94 #: wordpress-importer.php:294 95 msgid "Import author:" 96 msgstr "" 97 98 #: wordpress-importer.php:305 99 msgid "or create new user with login name:" 100 msgstr "" 101 102 #: wordpress-importer.php:308 103 msgid "as a new user:" 104 msgstr "" 105 106 #: wordpress-importer.php:316 107 msgid "assign posts to an existing user:" 108 msgstr "" 109 110 #: wordpress-importer.php:318 111 msgid "or assign posts to an existing user:" 112 msgstr "" 113 114 #: wordpress-importer.php:319 115 msgid "- Select -" 116 msgstr "" 117 118 #: wordpress-importer.php:369 119 msgid "" 120 "Failed to create new user for %s. Their posts will be attributed to the " 121 "current user." 122 msgstr "" 123 124 #: wordpress-importer.php:418 125 msgid "Failed to import category %s" 126 msgstr "" 127 128 #: wordpress-importer.php:456 129 msgid "Failed to import post tag %s" 130 msgstr "" 131 132 #: wordpress-importer.php:500 wordpress-importer.php:626 133 msgid "Failed to import %s %s" 134 msgstr "" 135 136 #: wordpress-importer.php:522 137 msgid "Failed to import “%s”: Invalid post type %s" 138 msgstr "" 139 140 #: wordpress-importer.php:543 141 msgid "%s “%s” already exists." 142 msgstr "" 143 144 #: wordpress-importer.php:598 145 msgid "Failed to import %s “%s”" 146 msgstr "" 147 148 #: wordpress-importer.php:744 149 msgid "Menu item skipped due to missing menu slug" 150 msgstr "" 151 152 #: wordpress-importer.php:751 153 msgid "Menu item skipped due to invalid menu slug: %s" 154 msgstr "" 155 156 #: wordpress-importer.php:814 157 msgid "Fetching attachments is not enabled" 158 msgstr "" 159 160 #: wordpress-importer.php:827 161 msgid "Invalid file type" 162 msgstr "" 163 164 #: wordpress-importer.php:871 165 msgid "Remote server did not respond" 166 msgstr "" 167 168 #: wordpress-importer.php:877 169 msgid "Remote server returned error response %1$d %2$s" 170 msgstr "" 171 172 #: wordpress-importer.php:884 173 msgid "Remote file is incorrect size" 174 msgstr "" 175 176 #: wordpress-importer.php:889 177 msgid "Zero size file downloaded" 178 msgstr "" 179 180 #: wordpress-importer.php:895 181 msgid "Remote file is too large, limit is %s" 182 msgstr "" 183 184 #: wordpress-importer.php:994 185 msgid "Import WordPress" 186 msgstr "" 187 188 #: wordpress-importer.php:1001 189 msgid "" 190 "A new version of this importer is available. Please update to version %s to " 191 "ensure compatibility with newer export files." 192 msgstr "" 193 194 #: wordpress-importer.php:1016 195 msgid "" 196 "Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import " 197 "the posts, pages, comments, custom fields, categories, and tags into this " 198 "site." 199 msgstr "" 200 201 #: wordpress-importer.php:1017 202 msgid "Choose a WXR (.xml) file to upload, then click Upload file and import." 203 msgstr "" 204 205 #: wordpress-importer.php:1091 206 msgid "" 207 "Import <strong>posts, pages, comments, custom fields, categories, and tags</" 208 "strong> from a WordPress export file." 209 msgstr "" 210 211 #. Plugin Name of the plugin/theme 212 msgid "WordPress Importer" 213 msgstr "" 214 215 #. Plugin URI of the plugin/theme 216 msgid "http://wordpress.org/extend/plugins/wordpress-importer/" 217 msgstr "" 218 219 #. Description of the plugin/theme 220 msgid "" 221 "Import posts, pages, comments, custom fields, categories, tags and more from " 222 "a WordPress export file." 223 msgstr "" 224 225 #. Author of the plugin/theme 226 msgid "wordpressdotorg" 227 msgstr "" 228 229 #. Author URI of the plugin/theme 230 msgid "http://wordpress.org/" 231 msgstr "" -
.buildpath
1 <?xml version="1.0" encoding="UTF-8"?> 2 <buildpath> 3 <buildpathentry kind="src" path=""/> 4 <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> 5 </buildpath> -
wp-cnnonfig.php
1 <?php 2 /** 3 * The base configurations of the WordPress. 4 * 5 * This file has the following configurations: MySQL settings, Table Prefix, 6 * Secret Keys, WordPress Language, and ABSPATH. You can find more information 7 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing 8 * wp-config.php} Codex page. You can get the MySQL settings from your web host. 9 * 10 * This file is used by the wp-config.php creation script during the 11 * installation. You don't have to use the web site, you can just copy this file 12 * to "wp-config.php" and fill in the values. 13 * 14 * @package WordPress 15 */ 16 17 // ** MySQL settings - You can get this info from your web host ** // 18 /** The name of the database for WordPress */ 19 define('DB_NAME', 'wordpress'); 20 21 /** MySQL database username */ 22 define('DB_USER', 'root'); 23 24 /** MySQL database password */ 25 define('DB_PASSWORD', 'root'); 26 27 /** MySQL hostname */ 28 define('DB_HOST', 'localhost'); 29 30 /** Database Charset to use in creating database tables. */ 31 define('DB_CHARSET', 'utf8'); 32 33 /** The Database Collate type. Don't change this if in doubt. */ 34 define('DB_COLLATE', ''); 35 36 /**#@+ 37 * Authentication Unique Keys and Salts. 38 * 39 * Change these to different unique phrases! 40 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} 41 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. 42 * 43 * @since 2.6.0 44 */ 45 define('AUTH_KEY', 'm8hYEX:N#3?/D6U6m|<A{ky9[[~AHQ<OkLg+)[oWL=M46x-Q-e}i([, -,xMz^6 '); 46 define('SECURE_AUTH_KEY', 'g}#7~UjkGYia^$yX0cxP(cY`x5,/Ap9[qcT/}dB}E^pobJE4C*1L+}6`i9e|:J41'); 47 define('LOGGED_IN_KEY', 'rKDJO>/1*ZwgDT0Uk_+rXw,t/$(R!f&-7x49O[4pv;v~SDo?+yJ37w-s{F(%5pyz'); 48 define('NONCE_KEY', 'KEBCdW_c-1x849p{>7,f_8~g$^mi]b-L-:9u?l+]qIY>q`C6us1KLC_rJOc{v303'); 49 define('AUTH_SALT', 'P?Fs& ~E;,{:&8/A>p|~b|-8Nnik!!Ds92gpP:q ?xz7LZ4gTC/ZrnfZYBO;C-kj'); 50 define('SECURE_AUTH_SALT', '7>{$NA[RR47shL1$N0;rnzS*L)NJB4`?wQS]8l>ZY-hr=-wx5(|y?RxfpJbyInYU'); 51 define('LOGGED_IN_SALT', 'N D`&LDrDDaW.y]Z<jM6f%QrP_!-8KiIY{g|s|HNH8f?#5SGf*V?5/2?eB=K!(x8'); 52 define('NONCE_SALT', '1I<M3%)1nkgjKwfO2I(;9|xcDL#>![q~j%w?DcI pwe)7zX1->l|d_TZ|eO5>/|&'); 53 54 /**#@-*/ 55 56 /** 57 * WordPress Database Table prefix. 58 * 59 * You can have multiple installations in one database if you give each a unique 60 * prefix. Only numbers, letters, and underscores please! 61 */ 62 $table_prefix = 'wp_trunk_'; 63 64 /** 65 * WordPress Localized Language, defaults to English. 66 * 67 * Change this to localize WordPress. A corresponding MO file for the chosen 68 * language must be installed to wp-content/languages. For example, install 69 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German 70 * language support. 71 */ 72 define('WPLANG', ''); 73 74 /** 75 * For developers: WordPress debugging mode. 76 * 77 * Change this to true to enable the display of notices during development. 78 * It is strongly recommended that plugin and theme developers use WP_DEBUG 79 * in their development environments. 80 */ 81 define('WP_DEBUG', true); 82 define('SCRIPT_DEBUG', true); 83 84 /* That's all, stop editing! Happy blogging. */ 85 86 /** Absolute path to the WordPress directory. */ 87 if ( !defined('ABSPATH') ) 88 define('ABSPATH', dirname(__FILE__) . '/'); 89 90 /** Sets up WordPress vars and included files. */ 91 require_once(ABSPATH . 'wp-settings.php'); -
wp-config.php
1 <?php 2 /** 3 * The base configurations of the WordPress. 4 * 5 * This file has the following configurations: MySQL settings, Table Prefix, 6 * Secret Keys, WordPress Language, and ABSPATH. You can find more information 7 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing 8 * wp-config.php} Codex page. You can get the MySQL settings from your web host. 9 * 10 * This file is used by the wp-config.php creation script during the 11 * installation. You don't have to use the web site, you can just copy this file 12 * to "wp-config.php" and fill in the values. 13 * 14 * @package WordPress 15 */ 16 17 // ** MySQL settings - You can get this info from your web host ** // 18 /** The name of the database for WordPress */ 19 define('DB_NAME', 'wordpress'); 20 21 /** MySQL database username */ 22 define('DB_USER', 'root'); 23 24 /** MySQL database password */ 25 define('DB_PASSWORD', 'root'); 26 27 /** MySQL hostname */ 28 define('DB_HOST', 'localhost'); 29 30 /** Database Charset to use in creating database tables. */ 31 define('DB_CHARSET', 'utf8'); 32 33 /** The Database Collate type. Don't change this if in doubt. */ 34 define('DB_COLLATE', ''); 35 36 /**#@+ 37 * Authentication Unique Keys and Salts. 38 * 39 * Change these to different unique phrases! 40 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} 41 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. 42 * 43 * @since 2.6.0 44 */ 45 define('AUTH_KEY', '-J)N4BN!zn6B4(l2ko%@VH>m:|-hc{}.ow[[|9-CY[RQ+dA/Ur.kb@)HfsAvH D6'); 46 define('SECURE_AUTH_KEY', 'eCp7N/R5g/F/<0o8Mw,atf;JW*y`8|&o_oiF]D=[sRfi:eFW49~JT-`>LEn/A^%t'); 47 define('LOGGED_IN_KEY', '>.;9*>7#2+CR-VD}`Tx+_<Y=-JLrVRmLyXn:NqV@RWn*`~Sc;a[qDZZdHT<tq:T+'); 48 define('NONCE_KEY', 'gr/0ZM9?g{4~a.rQq/u/@}U7:}8bv4hM^d3ZYY_,rGsyj0Of2JIeO]J[dD!L{QML'); 49 define('AUTH_SALT', 'XKS+/:3V/*,iX,b~%7dlr?(+-p|qtt_ <R|l?8/TNQi5>ygc7<|<oa;I5IW6{Uq`'); 50 define('SECURE_AUTH_SALT', 'P^>y!.)rCW5n:#APw${c+Q*.gsvA~<[jrAH}/|dDnwV=H&rark-JWp:[st-@[x9y'); 51 define('LOGGED_IN_SALT', 'uP00|SVHVTCcz>e;^jq,!]y->-$YgmV2z c!yr|hr9370VgZx!B}&hsn</3_S!q+'); 52 define('NONCE_SALT', ',A@anfC2mP9}buH}uC|CYCYuGG4Lu:(g}(0XA6=zp<-@BJ$oS2FN?J6FZJusT-ty'); 53 54 /**#@-*/ 55 56 /** 57 * WordPress Database Table prefix. 58 * 59 * You can have multiple installations in one database if you give each a unique 60 * prefix. Only numbers, letters, and underscores please! 61 */ 62 $table_prefix = 'wp44_'; 63 64 /** 65 * WordPress Localized Language, defaults to English. 66 * 67 * Change this to localize WordPress. A corresponding MO file for the chosen 68 * language must be installed to wp-content/languages. For example, install 69 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German 70 * language support. 71 */ 72 define('WPLANG', ''); 73 74 /** 75 * For developers: WordPress debugging mode. 76 * 77 * Change this to true to enable the display of notices during development. 78 * It is strongly recommended that plugin and theme developers use WP_DEBUG 79 * in their development environments. 80 */ 81 define('WP_DEBUG', true); 82 83 /* That's all, stop editing! Happy blogging. */ 84 85 /** Absolute path to the WordPress directory. */ 86 if ( !defined('ABSPATH') ) 87 define('ABSPATH', dirname(__FILE__) . '/'); 88 89 /** Sets up WordPress vars and included files. */ 90 require_once(ABSPATH . 'wp-settings.php'); -
.project
1 <?xml version="1.0" encoding="UTF-8"?> 2 <projectDescription> 3 <name>trunk</name> 4 <comment></comment> 5 <projects> 6 </projects> 7 <buildSpec> 8 <buildCommand> 9 <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> 10 <arguments> 11 </arguments> 12 </buildCommand> 13 <buildCommand> 14 <name>org.eclipse.wst.validation.validationbuilder</name> 15 <arguments> 16 </arguments> 17 </buildCommand> 18 <buildCommand> 19 <name>org.eclipse.dltk.core.scriptbuilder</name> 20 <arguments> 21 </arguments> 22 </buildCommand> 23 </buildSpec> 24 <natures> 25 <nature>org.eclipse.php.core.PHPNature</nature> 26 <nature>org.eclipse.wst.jsdt.core.jsNature</nature> 27 </natures> 28 </projectDescription> -
.settings/.jsdtscope
1 <?xml version="1.0" encoding="UTF-8"?> 2 <classpath> 3 <classpathentry kind="src" path=""> 4 <attributes> 5 <attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/> 6 </attributes> 7 </classpathentry> 8 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> 9 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> 10 <attributes> 11 <attribute name="hide" value="true"/> 12 </attributes> 13 </classpathentry> 14 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> 15 <classpathentry kind="output" path=""/> 16 </classpath> -
.settings/org.eclipse.php.core.prefs
1 eclipse.preferences.version=1 2 include_path=0;/trunk -
.settings/org.eclipse.wst.jsdt.ui.superType.container
1 org.eclipse.wst.jsdt.launching.baseBrowserLibrary 2 No newline at end of file -
.settings/org.eclipse.wst.jsdt.ui.superType.name
1 Window 2 No newline at end of file