Could this be the last huge WP into MU code merge?

Well, this might be one of the last times I do a huge WordPress MU merge! I’ve just finished merging the code from WordPress 2.9 beta 1 into WordPress MU trunk. No, I didn’t link to the actual merge changeset. That’s 2007 and huge! :)

Want to give it a go? Grab the zip file from here and install it on a test server. Do not, under any circumstances install it on your production server! Be aware that I haven’t tested most of the code yet so there may have been errors made during the merge.

We also need to work out a good way of adding the commentmeta table to each blog. If your MU site has more than a few dozen blogs you need to add this table before you upgrade. On WordPress.com, it took quite a long time to add that table to each of the millions of blogs there! It’s probably something that an external plugin should handle. It’ll have to be linked from the MU download page and hopefully talked about enough that nobody tries to upgrade without it. Ideas?

Oh, I’m testing out WordPress 2.9-beta-1 and changed theme here. I’m using a heavily modified version of P2. Love it so far. I’ve managed to hack it to do what I want. Noel did a great job with the theme.


You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos to explore too!

Published by

Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Google+ and Twitter.

30 thoughts on “Could this be the last huge WP into MU code merge?”


  1. Woo! That’s exciting!

    As for the commentmeta table, I really don’t think you can trust that people will know. No matter how much you talk about it, some people just don’t read everything. And those kinds of messages are typically only seen by people keeping up with their upgrades. Think about the people in the MU forum who are trying to do a straight upgrade install from something like 1.5 to 2.8.6. Think about how much they haven’t been paying attention.


    1. True, I think the “Run the upgrade script” message will have to be more annoying in this release to encourage every site admin to run it. It’s a pretty intensive operation creating tables so I may reduce the chance the automatic upgrader runs. Right now, if your site has more than 50 blogs it divides that number by 50 and runs the upgrader if a random number between 0 and that number is 1. I might halve the chance, or even make it a 1 in “blog count” chance.

      Without that comment table the comments moderation page probably won’t work well, and it might stop users leaving comments too of course. :(


    2. Can’t seem to get the post thumbnail to work. The box and link show up, but link no worky. Haven’t really looked at why yet, but I figured I’d post it here to get the word out, see if anyone else has the problem, or if anyone else has fixed it.


      1. Solved. The problem is if you hide the MU Media Button for add_image, the #id doesn’t exist and the jQuery doesn’t fire. My guess is this is a bug, so I’ll plop this into the trac.


    1. It won’t crash but your server might be stressed as the automatic upgrader tries to upgrade each blog. To reduce the load on your server, the upgrade script doesn’t run every time the dashboad is loaded on your blogs. Once an MU site is bigger than 50 blogs the chance the upgrader script runs in the background reduces (on your site with 150 blogs, there’s a 1 in 3 chance the upgrader will run when one of your users visits their dashboard). You’re encouraged to use the “Upgrade Site” page to upgrade all your blogs.

      See this chunk of code for the upgrade code.


      1. I’m hosted on shared “nightmarehost” servers and foresee a huge problem if this is resource heavy. would it be possible to just have the script run like once every time the dashboard is visited and i just spend a few hours doing one at a time?

        Side question- whats the status of individual site(blog) avatars?


  2. Few bumps in the road but was able to make it go. Had to manually add the commentsmeta table, and remove some duplicate code out of wp-settings.php. shutdown_action_hook was declared twice, and streams.php and gettext.php no longer exist.


    1. Thanks John, I had fixed the shutdown function on my test server but forgot to merge that change in. I’ve removed those includes too. :)

      Strange that the table wasn’t created automatically, they were when I ran a site upgrade.


      1. I have a feeling that I didn’t need to make them myself, but when my upgrade white screened, instead of checking error logs like a good boy I made the table manually thinking it being missing broke something. Ah well… Good way to spend an hour I guess. :)


  3. So, uh… you merged beta 1 – the day after beta 2 was released?
    Just joking; I know it’s a lot of work to catch up with the main WP.

    So, why could it be the last huge code merge? That’s not explained in your post.


    1. Caesar – believe it or not, but merging this amount of code actually takes several days. You have to start somewhere and there’s no point in refreshing the WP svn every time there’s an update.

      It’s probably the last big merge because WP and MU will be merged in WordPress 3.0 :)


      1. That is a *very* scary though… Even though it would be a most welcome improvement…

        I foresee plenty upgrade problems when we do this. Especially on sites that already share users tables among multiple sites. :-)


      2. Donncha, I do understand about it taking a long time to merge – I don’t envy you having to do it! :-) I was just joking ’cause of the coincidence of your finishing on the same date as the next beta was released…

        I’m happy to hear that WP and MU will be merged in 3.0. I thought this had been cancelled.


      3. Any guess on when we’ll see WP 3.0? Q1 ’10? I’ve got a ton of stuff I want to do with WPMU, but am considering waiting until they’re merged as a lot of what I’m doing is fixing stuff that works in WP but not WPMU. Thanks.


        1. I’m with Forrest, the merge is a huge thing for me. I know it’s hard to give any dates but even a hint would be great.


          1. I don’t know, but I wouldn’t let the merge stop me using the software. MU will likely work the same after the merge as it does now.

            Forrest – if you’re fixing bugs why not submit tickets to trac? Save you fixing them each release!


        2. Donncha, I’m referring to bugs in plugins. The ones I’m thinking of have been sent to the developers many times but they still don’t implement the changes needed for WPMU. One that I’m thinking of is popular with many themes, and it gets tiring updating it all. The whole reason I’m using WPMU is to make updating easy.

          If it were bugs in WPMU I was fixing, you bet I’d be submitting those.


          1. Ouch, sucks that they won’t update their plugins. Perhaps make a blog post publishing all the “WordPress MU ready” versions of plugins that you’ve modified? Of course include a note saying that the original authors had been sent the changes already. I know a lot of users would be grateful for such a post!


  4. Donncha, I love what you’ve done with P2. Did you do a child theme, or did you just mod the main theme? I tried creating a P2 child last night and started seeing all kinds of funky behavior — site kept logging me out when I’d add a photo or edit a post.


    1. Ted – unfortunately I had to change to a different theme as P2 was too resource hungry. The constant checks for updates was really killing my server as lots of people left my blog open all day which polled continuously. Definitely not good. Unfortunately.


      1. Bummer. Have you seen P2 successfully implemented on any large WPMU installations? I’m really hoping to use it on a newspaper site that I run, but I’m really worried about how it’ll function on shared hosting. Bad idea?


    1. There’ll be a beta release next week but because of the Christmas holidays it’d be fool-hardy to promise a final release next week. A final 2.9 will probably appear in early January.


  5. First of all, thank you for taking great care of WPMU. While it looked intimidating to me way back WPMU 1.2 with the “run, don’t walk, to http://wordpress.com/” in the readme.txt, it continues to be a great adventure.

    I experienced white screen in frontend and backend when I upgraded a development install way back to WPMU 2.9 beta 2 – trunk-r2026 and ran http://mysite.com/wp-admin/upgrade.php script. Fortunately, I upgraded via FTP upload at that time and noticed wpmu-upgrade-site.php in wp-admin folder as I was uploading WPMU files and folders.

    Running http://mysite.com/wp-admin/wpmu-upgrade-site.php gave me back my frontend and backend. Check in database showed new commentmeta table for all blogs. I am using WPMU latest trunk version now and no hiccups so far :-)

    Thank you again, Donncha.

Leave a Reply