Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter LeonLuc

    (@gameleon)

    Apologies for the late reaction as well (I got no notifications for this thread for some reason).

    I can confirm the timezone handling works perfectly now!

    Thread Starter LeonLuc

    (@gameleon)

    Both Blogger and WordPress were set to Los Angeles time before the first import was started.

    I can reproduce the issue as follows:

    • I have a Blogger and WordPress blog both configured at Los Angeles time
    • I create a post on Blogger at 8:00am Los Angeles time. (keep in mind the new Blogger editor shows the local time of the current machine for some reason, not the actual blog time)
    • I confirm the atom feed returns the time with the proper time and timezone suffix: <published>2021-10-24T08:00:00.000-07:00</published>
    • When importing this post into WordPress using the plugin I can see in the logs that the api.bloggerimporter.com endpoint returns the time in British time (BST timezone) for reason: published: "2021-10-24 16:00:00".
    • The plugin then inserts this British time into the post_date property of wp_insert_post.
    • The post_date property expects a local time value according to the WordPress timezone, so WordPress interprets this as 16:00/4:00pm Los Angeles time, causing the time of the post to be off by 8 hours from the expected time

    This happens with any non-British timezone. Los Angeles is just an example.

    The way to fix this would be to make sure the time returned by api.bloggerimporter.com is UTC rather than BST and then insert it in the post_date_gmt property instead (WordPress will then automatically handle the conversion from UTC back to the WordPress timezone).

    • This reply was modified 3 years, 4 months ago by LeonLuc.
    • This reply was modified 3 years, 4 months ago by LeonLuc.
    • This reply was modified 3 years, 4 months ago by LeonLuc.
    Thread Starter LeonLuc

    (@gameleon)

    I’ve sent a mail as requested with info to test with.

    Thread Starter LeonLuc

    (@gameleon)

    Thank you very much. That did work.

    And here I was trying out complex solutions like adding the ‘import_id’ property to the wp_insert_post call of the importer. Sometimes the solution is a lot simpler ??

    As a continuation of this, would enabling the Blogger importer redirects be any use with these permalink settings? Since the permalinks seem to match up exactly with the original Blogger permalinks now.

    • This reply was modified 3 years, 5 months ago by LeonLuc.
    Thread Starter LeonLuc

    (@gameleon)

    Post content imported without the strip_tags seems to work fine overall (the blog never used really fancy/depecrated HTML, except for a few center tags in some of the really old posts).

    I do have to run the importer again in any case due to about 25% of the posts already having been imported when noticing the issue. So might as well do it after the workaround has been implemented in an update.

    (On a side note: Two tags that users might want to keep but are missing from the $good_tags array are span and center. span is still heavily used and while center is deprecated, some older blog posts might still have it in their content)

    • This reply was modified 6 years, 2 months ago by LeonLuc.
Viewing 5 replies - 1 through 5 (of 5 total)