summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2011-04-20 02:39:24 +0300
committerTheo Chatzimichos <tampakrap@gentoo.org>2011-04-20 02:39:24 +0300
commitf7473515da3333b21b699f9c4b3c1674b7172271 (patch)
tree0616a2f980ddff7d069fd36653e222b64c9379a8 /plugins
parentImprove sample entry for themes in the update-wordpress script (diff)
downloadblogs-gentoo-f7473515da3333b21b699f9c4b3c1674b7172271.tar.gz
blogs-gentoo-f7473515da3333b21b699f9c4b3c1674b7172271.tar.bz2
blogs-gentoo-f7473515da3333b21b699f9c4b3c1674b7172271.zip
Update wordpress-importer and smart-youtube
Diffstat (limited to 'plugins')
-rw-r--r--plugins/smart-youtube/readme.txt9
-rw-r--r--plugins/smart-youtube/smartyoutube.class.php30
-rw-r--r--plugins/smart-youtube/smartyoutube.php2
-rw-r--r--plugins/wordpress-importer/parsers.php10
-rw-r--r--plugins/wordpress-importer/readme.txt49
-rw-r--r--plugins/wordpress-importer/wordpress-importer.php60
6 files changed, 126 insertions, 34 deletions
diff --git a/plugins/smart-youtube/readme.txt b/plugins/smart-youtube/readme.txt
index acdecfe6..827a2f80 100644
--- a/plugins/smart-youtube/readme.txt
+++ b/plugins/smart-youtube/readme.txt
@@ -3,7 +3,7 @@ Contributors: freediver
Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
Tags: youtube, video, play, media, Post, posts, admin
Requires at least: 2.0
-Tested up to: 3.1
+Tested up to: 3.1.1
Stable tag: trunk
Smart Youtube plugin allows you to insert full featured YouTube videos into your post, comments and in RSS feed.
@@ -37,6 +37,13 @@ Plugin by Vladimir Prelovac. Looking for <a href="http://www.prelovac.com/vladim
== Changelog ==
+= 3.8.6 =
+* Brought back the loop option (thanks to John Kennedy)
+
+= 3.8.5 =
+* Fixed transparency issues (thanks to John Landells)
+* Added iframe playlist code
+
= 3.8.4 =
* WordPress 3.1 update
diff --git a/plugins/smart-youtube/smartyoutube.class.php b/plugins/smart-youtube/smartyoutube.class.php
index 48e03778..b28cbc86 100644
--- a/plugins/smart-youtube/smartyoutube.class.php
+++ b/plugins/smart-youtube/smartyoutube.class.php
@@ -14,7 +14,7 @@ class SmartYouTube
function __construct()
{
- $this->local_version = '3.8.1'; // TODO: Change this number???
+ $this->local_version = '3.8.6'; // TODO: Change this number???
$this->custom_colors = array(
'blank' => array('d6d6d6', 'f0f0f0'),
'storm' => array('3a3a3a', '999999'),
@@ -106,11 +106,12 @@ class SmartYouTube
$this->options['border'] = !isset($_POST['embedBorder']) ? 0 : 1;
$this->options['color'] = !isset($_POST['embedColor']) ? 'blank' : $_POST['embedColor'];
$this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
+ $this->options['loop'] = !isset($_POST['loop']) ? 0 : 1;
$this->options['privacy'] = !isset($_POST['disp_privacy']) ? 0 : 1;
$this->options['posts'] = !isset($_POST['disp_posts']) ? 'off' : 'on';
$this->options['comments'] = !isset($_POST['disp_comments']) ? 'off' : 'on';
-$this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
+ $this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
$this->options['template'] = !isset($_POST['disp_template']) ?
'{video}' :
@@ -144,6 +145,7 @@ $this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
$disp_heightside = $this->options['heightside'];
$disp_autoplay = $this->options['autoplay'] ? 'checked="checked"' : '';
+ $disp_loop = $this->options['loop'] ? 'checked="checked"' : '';
$disp_rel = $this->options['rel'] ? 'checked="checked"' : '';
$disp_rel2 = $this->options['rel'] ? '' : 'checked="checked"';
$disp_border = $this->options['border'] ? 'checked="checked"' : '';
@@ -232,7 +234,7 @@ $this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
<br />
<div>
<input id="iframe" type="checkbox" name="iframe" $iframe />
- <label for="iframe">Use IFRAME embed code</label> [<a target="_blank" href="http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html">?</a>]
+ <label for="iframe">Use IFRAME embed code (recommended)</label>
</div>
@@ -341,6 +343,7 @@ $this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
<div style="margin: 0 0 0 4px; clear: both;">
<input type="checkbox" onchange="onUpdatePreviewImage();" id="show_border_checkbox" name="embedBorder" $disp_border /><label for="show_border_checkbox"> Show Border</label><br />
<input type="checkbox" id="autoplay_checkbox" name="autoplay" $disp_autoplay /><label for="autoplay_checkbox"> Autoplay videos</label><br />
+ <input type="checkbox" id="loop_checkbox" name="loop" $disp_loop /><label for="loop_checkbox"> Loop videos</label><br />
<input type="checkbox" id="disp_search" name="disp_search" $disp_search /><label for="disp_search"> Display search box</label><br />
<input type="checkbox" id="disp_info" name="disp_info" $disp_info /><label for="disp_info"> Remove Titles & Ratings</label><br />
<input type="checkbox" id="disp_ann" name="disp_ann" $disp_ann /><label for="disp_ann"> Remove Annotations</label><br />
@@ -441,6 +444,7 @@ END;
$disp_border = $this->options['border'];
$disp_color = $this->options['color'];
$autoplay = $this->options['autoplay'];
+ $loop = $this->options['loop'];
$disp_search = $this->options['search'] == 'on' ? 1 : 0;
$disp_info = $this->options['info'] == 'on' ? '&showinfo=0' : '';
$disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : '';
@@ -497,16 +501,16 @@ END;
$root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
if ($this->options['iframe']=='on')
-$video_url = htmlspecialchars("$root_url/embed/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time;
+$video_url = htmlspecialchars("$root_url/embed/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time;
else
-$video_url = htmlspecialchars("$root_url/v/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time;
+$video_url = htmlspecialchars("$root_url/v/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time;
if ($playlist)
{
$video_url = htmlspecialchars("$root_url/p/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time;
-
+if ($this->options['iframe']=='on')
$yte_tag = <<<EOT
<span class="youtube">
<object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
@@ -516,6 +520,12 @@ $yte_tag = <<<EOT
</object>
</span>
EOT;
+else
+$yte_tag = <<<EOT
+<span class="youtube">
+<iframe title="YouTube video player" class="youtube-player" type="text/html" src="$video_url" width="$width" height="$height" frameborder="0"></iframe>
+</span>
+EOT;
}
elseif ($valid == 'off' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')===TRUE)
{
@@ -531,8 +541,8 @@ else
<object width="$width" height="$height">
<param name="movie" value="$video_url" />
<param name="allowFullScreen" value="true" />
-<param name="allowscriptaccess" value="always">
-<embed src="$video_url" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="$width" height="$height"></embed>
+<embed wmode="opaque" src="$video_url" type="application/x-shockwave-flash" allowfullscreen="true" width="$width" height="$height"></embed>
+<param name="wmode" value="opaque" />
</object>
</span>
EOT;
@@ -628,7 +638,7 @@ EOT;
'wtext' => '',
'wtitle' => '',
'tag' => '',
- 'iframe' => 'on'
+ 'iframe' => 'on'
);
// migrate the old-fashion options
@@ -673,7 +683,7 @@ EOT;
'wtext' => '',
'wtitle' => '',
'tag' => '',
- 'iframe' => ''
+ 'iframe' => 'on'
);
$saved = get_option($this->key);
diff --git a/plugins/smart-youtube/smartyoutube.php b/plugins/smart-youtube/smartyoutube.php
index 7c5af877..404b71a9 100644
--- a/plugins/smart-youtube/smartyoutube.php
+++ b/plugins/smart-youtube/smartyoutube.php
@@ -4,7 +4,7 @@ Plugin Name: Smart Youtube
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
Author: Vladimir Prelovac
-Version: 3.8.4
+Version: 3.8.6
Author URI: http://www.prelovac.com/vladimir/
diff --git a/plugins/wordpress-importer/parsers.php b/plugins/wordpress-importer/parsers.php
index 17247296..87c3b9d9 100644
--- a/plugins/wordpress-importer/parsers.php
+++ b/plugins/wordpress-importer/parsers.php
@@ -157,6 +157,9 @@ class WXR_Parser_SimpleXML {
$post['post_password'] = (string) $wp->post_password;
$post['is_sticky'] = (int) $wp->is_sticky;
+ if ( isset($wp->attachment_url) )
+ $post['attachment_url'] = (string) $wp->attachment_url;
+
foreach ( $item->category as $c ) {
$att = $c->attributes();
if ( isset( $att['nicename'] ) )
@@ -211,7 +214,7 @@ class WXR_Parser_SimpleXML {
*/
class WXR_Parser_XML {
var $wp_tags = array(
- 'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status',
+ 'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status', 'wp:attachment_url',
'wp:status', 'wp:post_name', 'wp:post_parent', 'wp:menu_order', 'wp:post_type', 'wp:post_password',
'wp:is_sticky', 'wp:term_id', 'wp:category_nicename', 'wp:category_parent', 'wp:cat_name', 'wp:category_description',
'wp:tag_slug', 'wp:tag_name', 'wp:tag_description', 'wp:term_taxonomy', 'wp:term_parent',
@@ -525,6 +528,10 @@ class WXR_Parser_Regex {
'menu_order', 'post_type', 'post_password', 'is_sticky'
);
+ $attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
+ if ( $attachment_url )
+ $postdata['attachment_url'] = $attachment_url;
+
preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
foreach ( $terms as $t ) {
$post_terms[] = array(
@@ -551,6 +558,7 @@ class WXR_Parser_Regex {
'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
+ 'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
);
}
}
diff --git a/plugins/wordpress-importer/readme.txt b/plugins/wordpress-importer/readme.txt
index 06689a0d..554232f4 100644
--- a/plugins/wordpress-importer/readme.txt
+++ b/plugins/wordpress-importer/readme.txt
@@ -4,38 +4,81 @@ Donate link:
Tags: importer, wordpress
Requires at least: 3.0
Tested up to: 3.1
-Stable tag: 0.2
+Stable tag: 0.4
Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file.
== Description ==
-Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file.
+The WordPress Importer will import the following content from a WordPress export file:
+
+* Posts, pages and other custom post types
+* Comments
+* Custom fields and post meta
+* Categories, tags and terms from custom taxonomies
+* Authors
+
+For further information and instructions please see the [Codex page on Importing Content](http://codex.wordpress.org/Importing_Content#WordPress)
== Installation ==
+The quickest method for installing the importer is:
+
+1. Visit Tools -> Import in the WordPress dashboard
+1. Click on the WordPress link in the list of importers
+1. Click "Install Now"
+1. Finally click "Activate Plugin & Run Importer"
+
+If you would prefer to do things manually then follow these instructions:
+
1. Upload the `wordpress-importer` folder to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Go to the Tools -> Import screen, click on WordPress
== Changelog ==
+= 0.4 =
+* Map comment user_id where possible
+* Import attachments from `wp:attachment_url`
+* Upload attachments to correct directory
+* Remap resized image URLs correctly
+
= 0.3 =
* Use an XML Parser if possible
* Proper import support for nav menus
-* ... and more, see [Trac ticket #15197](http://core.trac.wordpress.org/ticket/15197)
+* ... and much more, see [Trac ticket #15197](http://core.trac.wordpress.org/ticket/15197)
= 0.1 =
* Initial release
== Upgrade Notice ==
+= 0.4 =
+Bug fixes for attachment importing and other small enhancements.
+
= 0.3 =
Upgrade for a more robust and reliable experience when importing WordPress export files, and for compatibility with WordPress 3.1.
+== Frequently Asked Questions ==
+
+= Help! I'm getting out of memory errors or a blank screen. =
+If your exported file is very large, the import script may run into your host's configured memory limit for PHP.
+
+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.
+
+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.
+
+-- [WordPress Codex: Importing Content](http://codex.wordpress.org/Importing_Content#Before_Importing)
+
== Filters ==
The importer has a couple of filters to allow you to completely enable/block certain features:
+
* `import_allow_create_users`: return false if you only want to allow mapping to existing users
* `import_allow_fetch_attachments`: return false if you do not wish to allow importing and downloading of attachments
* `import_attachment_size_limit`: return an integer value for the maximum file size in bytes to save (default is 0, which is unlimited)
+
+There are also a few actions available to hook into:
+
+* `import_start`: occurs after the export file has been uploaded and author import settings have been chosen
+* `import_end`: called after the last output from the importer
diff --git a/plugins/wordpress-importer/wordpress-importer.php b/plugins/wordpress-importer/wordpress-importer.php
index 36285e20..966182ac 100644
--- a/plugins/wordpress-importer/wordpress-importer.php
+++ b/plugins/wordpress-importer/wordpress-importer.php
@@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/wordpress-importer/
Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file.
Author: wordpressdotorg
Author URI: http://wordpress.org/
-Version: 0.3
+Version: 0.4
Text Domain: wordpress-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@@ -103,6 +103,7 @@ class WP_Import extends WP_Importer {
*/
function import( $file ) {
add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
+ add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
$this->import_start( $file );
@@ -393,7 +394,8 @@ class WP_Import extends WP_Importer {
$term_id = term_exists( $cat['category_nicename'], 'category' );
if ( $term_id ) {
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
- $this->processed_terms[intval($cat['term_id'])] = (int) $term_id;
+ if ( isset($cat['term_id']) )
+ $this->processed_terms[intval($cat['term_id'])] = (int) $term_id;
continue;
}
@@ -408,7 +410,8 @@ class WP_Import extends WP_Importer {
$id = wp_insert_category( $catarr );
if ( ! is_wp_error( $id ) ) {
- $this->processed_terms[intval($cat['term_id'])] = $id;
+ if ( isset($cat['term_id']) )
+ $this->processed_terms[intval($cat['term_id'])] = $id;
} else {
printf( __( 'Failed to import category %s', 'wordpress-importer' ), esc_html($cat['category_nicename']) );
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
@@ -435,7 +438,8 @@ class WP_Import extends WP_Importer {
$term_id = term_exists( $tag['tag_slug'], 'post_tag' );
if ( $term_id ) {
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
- $this->processed_terms[intval($tag['term_id'])] = (int) $term_id;
+ if ( isset($tag['term_id']) )
+ $this->processed_terms[intval($tag['term_id'])] = (int) $term_id;
continue;
}
@@ -444,7 +448,8 @@ class WP_Import extends WP_Importer {
$id = wp_insert_term( $tag['tag_name'], 'post_tag', $tagarr );
if ( ! is_wp_error( $id ) ) {
- $this->processed_terms[intval($tag['term_id'])] = $id['term_id'];
+ if ( isset($tag['term_id']) )
+ $this->processed_terms[intval($tag['term_id'])] = $id['term_id'];
} else {
printf( __( 'Failed to import post tag %s', 'wordpress-importer' ), esc_html($tag['tag_name']) );
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
@@ -471,7 +476,8 @@ class WP_Import extends WP_Importer {
$term_id = term_exists( $term['slug'], $term['term_taxonomy'] );
if ( $term_id ) {
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
- $this->processed_terms[intval($term['term_id'])] = (int) $term_id;
+ if ( isset($term['term_id']) )
+ $this->processed_terms[intval($term['term_id'])] = (int) $term_id;
continue;
}
@@ -486,7 +492,8 @@ class WP_Import extends WP_Importer {
$id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );
if ( ! is_wp_error( $id ) ) {
- $this->processed_terms[intval($term['term_id'])] = $id['term_id'];
+ if ( isset($term['term_id']) )
+ $this->processed_terms[intval($term['term_id'])] = $id['term_id'];
} else {
printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($term['term_taxonomy']), esc_html($term['term_name']) );
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
@@ -566,6 +573,20 @@ class WP_Import extends WP_Importer {
if ( 'attachment' == $postdata['post_type'] ) {
$remote_url = ! empty($post['attachment_url']) ? $post['attachment_url'] : $post['guid'];
+
+ // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
+ // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
+ $postdata['upload_date'] = $post['post_date'];
+ if ( isset( $post['postmeta'] ) ) {
+ foreach( $post['postmeta'] as $meta ) {
+ if ( $meta['key'] == '_wp_attached_file' ) {
+ if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) )
+ $postdata['upload_date'] = $matches[0];
+ break;
+ }
+ }
+ }
+
$comment_post_ID = $post_id = $this->process_attachment( $postdata, $remote_url );
} else {
$comment_post_ID = $post_id = wp_insert_post( $postdata, true );
@@ -633,6 +654,8 @@ class WP_Import extends WP_Importer {
$newcomments[$comment_id]['comment_approved'] = $comment['comment_approved'];
$newcomments[$comment_id]['comment_type'] = $comment['comment_type'];
$newcomments[$comment_id]['comment_parent'] = $comment['comment_parent'];
+ if ( isset( $this->processed_authors[$comment['comment_user_id']] ) )
+ $newcomments[$comment_id]['user_id'] = $this->processed_authors[$comment['comment_user_id']];
}
ksort( $newcomments );
@@ -667,7 +690,7 @@ class WP_Import extends WP_Importer {
if ( ! $value )
$value = maybe_unserialize( $meta['value'] );
- update_post_meta( $post_id, $key, $value );
+ add_post_meta( $post_id, $key, $value );
do_action( 'import_post_meta', $post_id, $key, $value );
// if the post has a featured image, take note of this in case of remap
@@ -800,12 +823,15 @@ class WP_Import extends WP_Importer {
$post_id = wp_insert_attachment( $post, $upload['file'] );
wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
- // remap the thumbnail url. this isn't perfect because we're just guessing the original url.
- if ( preg_match( '@^image/@', $info['type'] ) && $thumb_url = wp_get_attachment_thumb_url( $post_id ) ) {
+ // remap resized image URLs, works by stripping the extension and remapping the URL stub.
+ if ( preg_match( '!^image/!', $info['type'] ) ) {
$parts = pathinfo( $url );
- $ext = $parts['extension'];
- $name = basename($parts['basename'], ".{$ext}");
- $this->url_remap[$parts['dirname'] . '/' . $name . '.thumbnail.' . $ext] = $thumb_url;
+ $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
+
+ $parts_new = pathinfo( $upload['url'] );
+ $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
+
+ $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new;
}
return $post_id;
@@ -819,13 +845,11 @@ class WP_Import extends WP_Importer {
* @return array|WP_Error Local file location details on success, WP_Error otherwise
*/
function fetch_remote_file( $url, $post ) {
- add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
-
// extract the file name and extension from the url
$file_name = basename( $url );
// get placeholder file in the upload dir with a unique, sanitized filename
- $upload = wp_upload_bits( $file_name, 0, '', $post['post_date'] );
+ $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );
if ( $upload['error'] )
return new WP_Error( 'upload_dir_error', $upload['error'] );
@@ -864,8 +888,8 @@ class WP_Import extends WP_Importer {
// keep track of the old and new urls so we can substitute them later
$this->url_remap[$url] = $upload['url'];
- $this->url_remap[$post['guid']] = $upload['url'];
- // if the remote url is redirected somewhere else, keep track of the destination too
+ $this->url_remap[$post['guid']] = $upload['url']; // r13735, really needed?
+ // keep track of the destination if the remote url is redirected somewhere else
if ( isset($headers['x-final-location']) && $headers['x-final-location'] != $url )
$this->url_remap[$headers['x-final-location']] = $upload['url'];