Welcome to The Tar Pit! again.

October 11, 2019 by Lucian Mogosanu

Hello, world!
The Tar Pit is now unofficially a candidate for the highest number of introductory posts in a blog.

Seriously now though, I have to celebrate the mp-wpization of this blog somehow, don't I? And how else than through a brand new introductory article?

I'd initially estimated that migrating from ye olde LBS to MP-WP would take some (at the time estimated to be significant) amount of pain and some (at the time unknown) amount of time. To be completely fair, I only had a vague idea of where this was going, so ultimately I found it appropriate to determine the amount of both pain and time through direct experience.

Now, the man-hours involved are the simple part: I spent around twenty-five hours importing the articles, by writing a couple of scripts that read the content from the old database and inserting it into the new one. Of these man-hours, about ten consisted of "coding" and another fifteen were involved in testing the code and verifying all the posts... though to be fair, I am having someone proofread the entire blog at this very moment, which is still work, although not exactly mine, though... anyway, I'll publish the code very soon for whomever might be interested. Add to this another circa two to three hours of bringing up the theme in its current state and the (yet-to-be-spent) few hours required to clean it up and you get the total time required to get a The Tar Pit up and running.

As for the pain, I'm not sure this can be measured in anything other than "what the fuck happened here"s. Pressing and installing MP-WP was entirely painless; initial configuration, link redirection and importing usefuls from the old blog was really easy; tweaking the theme to my needs was okay, although it still needs work before publishing; getting this scaffolding to work with all the existing content was somewhat of a pain in the ass.

For one, I had to make a choice. The fact that many years ago I took to writing my posts in the Markdown is no secret: this may be construed as intellectual wankery, whatever, I don't care; The Tar Pit articles came stored as Markdown files, so I had to either convert them to HTML and dump them into the new blog, or keep them as they are and use a Wordpress plug-in that eats Markdown and spits HTML; which I had been using before 2013, which is why I chose the latter alternative, with all its shortcomings.

Unfortunately, there's a marked difference between Pandoc and the PHP Markdown thing -- by the way, I'm also going to post this as a V patch on top of MP-WP; for all I know, nobody else cares about this, and yet this isn't a reason not to make it public. So I imported the posts year by year, checked that the page is correctly rendered and made corrections where needed. This, by the way, wasn't as much work as I thought it would be.

The pain came, as things usually tend to go with intellectual work, from striving to understand things. For example wp_insert_post sanitizes the input before storing it in the Wordpress database, which is a good thing. More precisely, among others, it removes bogus (non-HTML) tags, so, things that come between angular brackets -- I'm not sure why this is needed, it's not like I'm going to start dumping malicious input into my posts, but whatever, it's ok. Ok? Well, it seems that some of my posts came with stuff stored between "less-than" and "greater-than", which got arbitrarily eaten; which means that I'd have to convert some of those to HTML entities, the ampersand thing, you know, only just some, not all of them.

Except, this is when I found out that Wordpress' editor is broken, because it converts entities to their rendered counterparts each time I update/save the post. On one hand this proved to be useful, because it converted some of my "&lt" -- by the way, notice how I'm avoiding placing these in the post? -- to the correct symbol; and at the same time, it was a fucking pain in the ass, since some particular "&lt" I do want to keep the way they are. Actually, let's reproduce the bug: assuming if you have a MP-WP installation, start a new draft post, then input the following piece in the content box:

<b>this is a quoted bold text</b>

then save and preview the post. It shows what you expect, i.e. the tags and the text, right? Now save and preview it again. What do you see now? No, I don't want to hear that "that's what it's supposed to do". I input something, then save the content and the content is transformed into something other than what I've inputted. If not insanity, then what the hell is this?

Other than this, exploring the MP-WP code isn't nearly as mind-numbing as one would expect. I for one haven't done this in six years and yet I can find my way around it pretty easily, which is how right now I have a working theme, comments, external trackbacks and selection. There's still plenty of work to be done, from figuring out why the hell internal trackbacks aren't sending (meanwhile fixed) to looking into the image uploader to perhaps replacing the HTML post editing interface with something else entirely.

Anyway, as I was saying, welcome to The new new Tar Pit! Enjoy your stay here and feel free to use all this new nifty functionality it comes with. If for some reason you're looking for the old blog, you can find it archived at old.thetarpit.org. Meanwhile, if you find any errors, issues or shortcomings with this one, describe them in a comment and you'll at the very least have my eternal gratitude for pointing them out.

Filed under: meta.
RSS 2.0 feed. Comment. Send trackback.

7 Responses to “Welcome to The Tar Pit! again.”

  1. #1:
    spyked says:

    Let's try to post a comment and see how this works. The Tar Pit is muh blog. ;)

  2. #2:
    spyked says:

    Testing yet another example commend.

    With bold. And emphasis. Should these work?

  3. #3:
    Mircea Popescu says:

    It shows what you expect, i.e. the tags and the text, right? Now save and preview it again. What do you see now? No, I don't want to hear that "that's what it's supposed to do".

    I just tried this on trilema, it shows left quote b right quote this is a quoted bold text left quote slash b right quote each time. Was the behaviour you observed different then ?

    But mazel tov in any case.

  4. #4:
    spyked says:

    Thank you!

    The fact that this isn't reproducible on other MP-WP installs adds to the weird and I'm going to have to investigate.

    So, to explain the scenario in more detail: I'm inputting "ampersand-lt-semicolon b ampersand-gt-semicolon this is a quoted bold text ampersand-lt-semicolon slash b ampersand-gt-semicolon", saving, previewing, which gives same as your description, i.e. "left quote b right quote this is a quoted bold text left quote slash b right quote".

    However, upon saving, the text in the box is also converted to "left quote b right quote this is a quoted bold text left quote slash b right quote", so if I save and preview again, this is going to yield "this is a quoted bold text" in bold.

    There's a small chance I fucked up some code while playing with the importer I wrote. At least this part is easy to figure out (diff against a clean MP-WP press), I'll look into it one of these days.

  5. #5:
    spyked says:

    We're almost one year into this MP-WP-ian Tar Pit, so I guess this is as good a time as any to review it.

    The whole framework has served me more than adequately since I installed it; and it's certainly capable of way more, both horizontally, in the weight it can take, comments, articles and so on; and vertically, in the features it provides. In fact, if there's a problem with it, it's that it provides too much, and whoever thought that uploading "media", configuring the blog or hell, posting stuff -- whoever thought that any of these things should be done through a web interface is seriously fucked in the head.

    In short: using Haskell code lifted off the Internet was a bad idea and writing a Lisp blog was misguided; meanwhile, reverting to Wordpress isn't that far off, but what can I do. The epitome of web publishing technology shall for a long time remain some piece of shit written in PHP, so we might as well live with it.

  6. [...] looking into it for a bit. My own investigation followed from some weird that I'd discovered while setting up my blog, which makes the purpose of this post twofold: on one hand I'm recounting some of my own adventures [...]

  7. [...] that be cool? I might be getting a bit overexcited about this, but anyway, in my transition to MP-WP I've cooked up these two scripts, mpwp-get-post.php and mpwp-update-post.php, that can be [...]

Leave a Reply