Lafayette College on WordPress

Ken Knewquist just announced that the Lafayette College redesigned website recently launched as a WordPress multi-site. And I have to say, that did it exactly right. It was created and designed by Viget Labs, which has a kinda markety innocuous post about the site launch, framing brand and all that compromised terminology. But what I’d love to hear about, and what is apparent from just navigating around their site is how they are using various separate subdomain sites (or sites within sites) to allow for various users in different blogs.

For example all the department sites seem to be subdomain sites (not sure if they are separate sites, or simply running this in subdomains) allow for various authors, their own space, and basically the power and convenience of WordPress, while the architecture off the main page treats lafayette.edu as a regular single site. It is similar to some of the thoughts I had here, though seeing their work, I am increasingly thinking we need the whole instance subdomain blogs by department. That is mint!

Kudos to the Lafayette College and Vigent Labs folks, I do believe this is a very intelligent conception and design, and this will indeed “be a vital source of information and will play a new, enhanced role in communicating what is exciting and special about Lafayette to all our audiences.” And this is exactly the example we need to frame ours off of. Now the next step to consider, and Lafayette College is already there given they have faculty and students blogging for courses, is to integrate the teaching and learning going on around that campus through the site. Department sites as aggregation hubs of content, etc. A nice design, bully for Lafayette. And who was it that said WordPress is just a blog again?

Now, Ken, I want to know more about the architecture!!! :)

Posted in Lafayette College, Vigent Labs, WordPress, devwpmued, wordpress mutli-user, wp30, wpmu, wpmued | Leave a comment

UMW Blogs Upgraded to WP 3.0 (a play-by-play)

I’m glad (and relieved) to finally say UMW Blogs has been upgraded to the WP 3.0 merged core files without a hitch. Whew! This was a burner for me, a bit more fear and trembling going into this one than usual, but alas all is good in the UMW Blogs hood. In no small part thanks to Ron Rennick who recently upgraded his SharDB plugin to 3.0.1, which did the trick in terms of making sure all was smooth with the multiple-database setup upgrade. You rule Ron!

As for the rest, it was pretty standard, and only one pretty minor hiccup in regards to the Atalhuapa theme which I will outline below (and the fix below comes care of the inestimable Luke Waltzer).

Basics before upgrade
You know the drill by now: Always back up all files and the database (or in my case databases), and make sure not to copy over wp-config.php as well as the wp-content directory.

OK, done with disclaimers, now for some preliminary steps before copying over the WP 3.0.1 core files, make sure you
delete the wp-content/blogs.php file for those upgrading from WPMu (which is whom this tutorial is for).

You will also need to change the .htaccess file, particularly the line pointing to wp-content/blogs.php, which now needs to point to: wp-includes/ms-files.php

This line in our .htaccess file now looks like this:

RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

You should also delete your wpmu-settings.php file located in the root install directory.

If you are like me and you are using SharDB to spread your sites/blogs across several databases, you need to update to Ron’s Rennick’s latest version of SharDB.

And where ever Ron is, Andrea is not far behind (or is that vice versa?). In order to ensure that all the blogs using the default theme (which was Kubrick) are changed to TwentyTen, include the following call in your wp-config.php file (a tip you can find thanks to Andrea here):

Our default theme define in the wp-config.php file looks like this:

define(‘WP_DEFAULT_THEME’, ‘default’);

And to contextualize this a bit more, we changed the twentyten theme folder name to default, and moved the old default theme files for Kubrick into a folder called Kubrick for any of the faithful who still want to pursue it (be sure to make it available in Super Admin). Now, all sites on UMW Blogs that once had the default Kubrick theme now have TwentyTen automatically–which also means Menus will work for all those sites, and there are a good number.

Finally, I was sure to upgrade DSader’s More Privacy Options plugin before upgrading given it was throwing errors in the bavatuesdays WP 3.0 setup, I keep the new version of this plugin in the wp-content/mu-plugins directory.

The Actual Upgrade
Now run the upgrade by simply copying all the core files and directories, except wp-content and wp-config.php, into your WordPress install.

After that, go to http://yourinstall.com/wp-admin/upgrade.php and upgrade the database, cross your fingers!

If that works, go to Super Admin–> Update and updates all the individual blogs, this will take a while if you have a lot.

Finally, in the Dashboard you’ll be asked to add a Nonce Salt to your wp-config.php file. Something like:

define( ‘NONCE_SALT’, ‘yoursuppersecretkey’ ); to your wp-config.php file

The Ongoing Aftermath
The upgrade should then be done, but there may be some cleanup. For example, Luke Waltzer pointed me to this fix If you were using Ataluapa in WPMu, you’ll find none of your customized header images in Ataluapa are there, it returns to the default. This is because the theme is looking for the file wpmu-settings.php (now deprecated) instead of wp-settings.php. A quick find and replace of wpmu-settings with wp-settings on the following three files in the Atalhuapa theme did the trick for me:
functions.php
functions/bfa_header_config
functions/bfa_rotating_headers.php

And, that’s about it thus far, it was all rather smooth in the end. Though I am sure many more issues will emerge over time, I’m sure they will prove resolvable and I am quite relieved—especially given 3 sites within sites (what would now be called multi-networks?) http://greenwoodlibrary.orghttp://facultyacademy.org, and http://hamptondigitalhumanities.org all survived unharmed. Saying that, I was also relieved to see that mapped domains were also left intact.

And what’s more, Ken Newquist at Lafayette College sent out the following email to the wp-edu mailing list, and it provides an excellent list of issues and updates on their road to an upgrade to WP 3.0. I’ll reproduce it in it’s entirety below, and it is very good to know new activations of Next-Gen Gallery may have issues:

Everyone,

Back in June there was some talk about WordPress 3.0 and its compatibility (or lack there of) with popular plugins and themes. We’ve recently upgraded our production instances of WordPress to 3.0, and I thought I’d give a rundown of the the problems we encountered.

==More Privacy Options==
The plugin continues to work, but it generates a PHP fatal error when you edit a site’s properties as an admin, making it impossible to save configuration changes. The latest version of the plugin fixes this problem.

==nextGen Gallery: Ignoring MultiSite directory options==
nextGen Gallery has issues with WordPress 3.0 multisite. While existing installations are working ok, folks who add the plugin after the upgrade get this error message:

“Directory wp-content/gallery/ didn’t exist. Please create first the main gallery folder !”

The problem is that Blog Directory Path, which is a network-wide option set under the super admin menu, is no longer being respected at the per site level by nextGen. If you manually set the site’s directory path using the site’s ID (available from the main site directory list in the super admin view), then things work properly, but the default setting is now incorrect.

The plugin author is aware of the problem, and is working on this and other MultiSite-specific issues for the next release.
 http://wordpress.org/support/topic/41200…

 http://code.google.com/p/nextgen-gallery…

==nextGen Gallery: Slideshow links don’t work on a static home page==
If you insert a nextGen Gallery into a page, and then make that page your home page, the link to the slideshow will not work.

==Anarchy Media Player==
Anarchy’s settings page no longer loads under WordPress 3.0.

==Mandigo (theme)==
The Mandigo setting page doesn’t load if you’re using Mandigo 1.40.1. It works properly with the current version.

==Mandigo + nextGen + WordPress 3.0==
Here’s a very specific bug — Mandigo uses an older version of JQuery in its theme, one that doesn’t include a particular method that nextGen needs. This causes a fatal error in NextGen, which then causes the JavaScript portions of the Mandigo theme to stop working.

That’s about it, and I’ll be sure to blog any and all issues, problems, or fixes we come across, and I am sure there will be more than a few. In fact, I have to do this fix for Userthemes, thank you Boone.

Posted in UMW Blogs, WordPress, devwpmued, umwblogs, upgrade, wordpress multi-user, wordpress mutli-user, wp30, wpmu, wpmued | Leave a comment

Into the mud, Scum Web! Or, picking through the ruins that was WPMu

Image credit: Thomas Hawk’s No Dark Sarcasm in the classroom

I’m not sure when I got derailed from the Summer of Love, it was all going so well. And then the bastards, scum bags, and profit-driven web denizens seemed to hang over my thoughts like a dark cloud. I’ve been brooding a lot, and generally gnashing my teeth, in fact I’ve found myself pausing before coffin warehouses, and bringing up the rear of every funeral I meet. And whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking peoples hats off — then, I account it high time to get back to some tinkering. And the only thing I know how to tinker with is WPMu, which is now gone, so I started playing with WP 3.0 and BuddyPress for a project I am working on (more on this anon).

And for the last few days I have been hacking around in 3.0 and BuddyPress, and doing some research into what is working on UMW Blogs and what isn’t in terms of plugins, themes, etc. And what struck me as I was searching for updated versions of plugins for WPMu (as well as themes for BuddyPress) was just how brilliantly James Farmer has turned the hard, GPL-licensed work of many a WPMu plugin developer that once lived contently on http://wpmudev.org into a subscription-based business model. I mean, it’s as if all those plugins on WPMuDev that the WPMu community consulted and used for years have all but vanished behind a pay wall.

Now don’t get me wrong, there are still a few free plugins there, but the original links to WPMu plugins like Dsaders Userthemes, More Privacy Options, and his Sitewide 3-in-1 Multi Widget Panel have strangely morphed into plugins behind the pay wall. Let’s take a look how this whole SEO, google-inspired, redirect scam works.

So, I look for the 3-in-1 widget and I get to the above wpmu.org page (no link there from this blog, which reminds me that I need to clean up my database, which has become inadvertently full of links to the premium.wpmudev.org site—given the old links to the plugins on wpmudev.org are now all redirected there….scummy). This post about the 3-in-1 plugin is on wpmudev.org, and was submitted to wpmu.org for the WPMu plugin contest sponsored by Farmer and co. for the last few years, and has since become one of the top hits in google for getting this plugin.

Now, what happens when you click the link to get his plugin….

It seems subtle, but what happens here is that wpmu.org is pushing you not to the plugin site (which seems all but gone off wpmudev.org), but rather a plugin cobbled together by the wpmudev premium team that has the same ideas and functionality as dsaders 3-in-1 widget, with one huge difference—its not free to download. Its locked up with the rest of the history of WPMu behind the premium pay wall. And you might say, oh well, such is life. WPMu is defunct now, and those plugins would just be so much internet kipple anyway, so no big loss. In fact, Farmer and his ilk are doing us a favor—they are keeping us clean and honest, not unlike Apple. But what strikes me here, is that those plugins are just as relevant as they were two years ago, we still need to display content from the tags blog in UMW Blogs, and a whole public space of development happened on Farmers server, and when the time was right, he commodified all that work and development to make his brand, seal is google dominance (which is insanely impressive, btw), and I guess he had every right to. He provided the space, and ultimately that means he dicatated the terms. The terms were pretty unilateral in retrospect, and a lot of great work seems all but lost now

And just in the event someone says the example above is an isolated case, let me give you yet another one that I stumbled on while trying to piece together a site.

More Privacy Options, which used to be a plugin that you could get on wpmudev.org through a straight link: http://wpmudev.org/project/More-Privacy-… (I link to that plugin in this post from 2009) and if you follow the link you’ll quickly see it has been transmogrified into a way to sell Farmer’s premium service plugins (links as capital remains its own crazy economy, and one farmer has figured out very well). It points to a page selling their Privacy options for WordPress MU plugin (almost exactly the same plugin as dsader’s, with one or two tweaks for sitewide settings). So, the bava has become a way of driving traffic, and by extension advertising, wpmudev’s premium subscription and I didn’t even realize it. I’m gonna need to erase a whole series of links from my database. Now doesn’t that seem scummy? Not even a redirect to the plugin which is now in the wordpress.org repository, why? Fact is, all these plugins are still relevant, and this link-laid scam makes it seem as if they are all pay-to-play now—how is that for stewardship of a community?

Is there anyone else out there in the WPMu/WP community that sees this shit going on and is like, “Jesus, wpmudev can suck it!” Sometimes I wonder, and add to that they are the only folks pumping out BuddyPress themes, and it would appear that WPMUDev are the main developers for the flagship projects like multi-site and BuddyPress in the WordPress community. Once again, the Google manipulation works, and the emergence of wpmu.org and wpmudev.org as the dominant sites for wpmu, buddypress, and beyond is all too apparent to me these last days of rusty searching.

But then, there is a light, a strong beacon I can hold onto: this list of free (can you imagine that?!) plugins at CUNY’s Academic Commons gives me hope for an developmental education community around blogging, multi-site, themes, and plugins that is not all about link baiting for Google juice to control the world. Long live Boone Gorges! Oh wait, and then there is the awesome work by the hit squad at UBC’s OLT, featured beautifully in this wiki page on their Management Framework development.

My only question is, can the free and open rebellion survive when the essence of the web, a simple url, is being hijacked for profit or eliminated all together by the gold-lined app revolution?

Posted in WordPress, devwpmued, wordpress multi-user, wordpress mutli-user, wpmu, wpmued | 1 Comment

Upgrading from WPMu to WP 3.0: Keep your config!

I just updated to the latest version of WordPress 3.0 (release candidate 1) and one of the things I realized while upgrading my own sites is that you should really keep your WPMu wp-config.php file. I figured that I would need to use the updated config file with WP 3.0, but that’s not necessarily the case. You see, the wp-config.php file is still geared towards a single WP install, which makes sense, but it also leaves a ton of the essential defines for a mutli-site system completely out.

So, here is a quick look at my wp-config file, with bold annotations of what you should keep if you are doing the multi-site option:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
/** MySQL database username */
define('DB_USER', 'username_here');
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
//Note: the following elements are specific to a WPMu/Multi-Site setup, and there is no sign of them in the config file for 3.0, so be sure to copy them over. But comment out
define('DOMAIN_CURRENT_SITE', 'yourmaindomain.com' ); -if you have issues on a multi-site setup because that one was giving me redirect problems on my setup.
/** The Database Collate type. Don't change this if in doubt. */
define('VHOST', 'yes');
$base = '/';
//define('DOMAIN_CURRENT_SITE', 'yourmaindomain.com' );
define('PATH_CURRENT_SITE', '/' );
define('BLOGID_CURRENT_SITE', '1' );
//End Note.
/**#@+
* Authentication Unique Keys and Salts.
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1...;WordPress.org secret-key service}
* 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.
*
* @since 2.6.0
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de.mo to wp-content/languages and set WPLANG to 'de' to enable German
* language support.
*/
define ('WPLANG', '');
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
//Note: sunrise.php is specifically for mapping domains on blogs, and you will need to include this in your wp-config file for multi-site if you want to map domains.
// uncomment this to enable wp-content/sunrise.php support
define( 'SUNRISE', 'on' );
//End Note.
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )

define(‘ABSPATH’, dirname(__FILE__) . ‘/’);
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);

That’s it, really not too bad, but enough to screw an idiot like me up, so I figured I’d share it out.

Posted in WordPress, wordpress multi-user, wordpress mutli-user, wp30, wpmu, wpmued | Leave a comment

I’ll Miss You Mu!!

It is kind of weird to write this, but as of today the bava is no longer powered by WordPress Multi-User. I have upgraded this site to WP 3.0 Beta 2. For almost three years now this site has been running on a multi-site WPMu setup that contained not only this blog, but jimgroom.net, wpmued.org (now a deprecated name space:( ), and several other personal sites. The bava WPMu install became my test bed for UMW Blogs over the last three years, and to see it return back to a straight WordPress site (though it’s not really that anymore with 3.0) is kinda bizarre.

I’ve been working with WPMu for more than four years, and I’ve literally written hundreds of posts on this blog about my work at hacking it. And I’ll be the first to admit I am the worst of hacks—don’t know a lick of code—but that being the case, WPMu made me. I can daydream that my b-movie posts or my tour-de-force toy blogging put me on the map, but it was my sophomoric work with WPMu and UMW Blogs that gave me a reason to blog just about everyday for almost four years. It was a good run, and I couldn’t have done it without Donncha—so thank you kindly. And while I know it’s time to move on, I certainly mourn a chapter of this blog that is effectively closing. I’ll still be blogging through the transition of UMW Blogs from WPMu 2.9.2 to WP 3.0, and there is much to talk about and figure out there yet, but with this post a piece of the bava is dying. But, that said, I wouldn’t trade it for the world because, as William Faulkner says, “Given a choice between grief and nothing, I’d choose grief.” Good bye Mu, I’ll miss you!

On a more prosaic note, the upgrade from WPMu 2.9.2 to WP 3.0 Beta 2 went extremely smoothly following this tutorial (just be careful of the wording in Step 1, what he means to say is replace all files and folders except wp-content, leave that be).  Some initial observations:

  • Userthemes is further borked after the upgrade (no surprise there), but it looks like WP 3.0 Beta 2 has theme editing built-in across sites. I may be wrong, but when I deleted the Userthemes plugin, an edit button showed up on various blogs. This could be awesome, but it also means I have to find a way to un-usertheme a lot of blogs that were using Userthemes in UMW Blogs. This will take some looking into.
  • The various mapped WPMu sites I had on by own WPMu install worked without issue. jimgroom.net is a full blown WPMu site within a site (or the correct terminology now would be network within a network?–not sure.) Those worked fine, as did some straightforward mapped domains, which is nice. But, I am still using the mu-plugins folder with various plugins that control these functions.  Need to experiment with how much they bork when I start deleting MU plugins, we’ll see.¹
  • Need to test the Sitewide Tag Pages Plugin that Donncha created, this plugin has been key to the syndication framework on UMW Blogs, but I’m not sure it will be managed for too much longer even if it does still work.  Need to find out if some global posts/tags/terms are being used across sites.  We’ll see.
  • On that note, need to see what FeedWordPress is all about in 3.0, that will prove crucial as well.
  • Need to figure out the whole Child Theme thing, as well as test out a whole series of plugins while cleaning out my mu-plugins folder.

As you can see my list of things is long, and there is much work ahead and I plan on blogging it all. But as of now a big step 1 is done [sniff].

___________

Update:

¹ Turns out mu-plugins will be supported for the foreseeable future reframing the mu-plugins from the association of MultiUser to “Must-Use,” basically making them active across entire installation (which means more than one network). Also, there is another cool feature for keeping WPMu sites like UMW Blogs afloat: “Drop-Ins.” To quote this excellent article on both of these new additions to WP 3.0:

Some core functionality of the WordPress core can be replaced by so called Drop-Ins. Those are PHP files on specific locations that get included if they exist. The inclusion is done for a specific task, for example db.php get’s loaded to replace the default PHP database class. So you can replace it with one that is faster, more stable and secure for example. Drop-Ins exist since various versions, depending on them. The Multi-Site since 3.0 naturally.

This means it should square any sharedb.php issues with UMW Blogs, which is mint. It is also why sunrise.php for the Domain Mapping plugging kept working seamlessly. See the article above for a list of WordPress Drop-Ins.

Additionally, as my turn to terminology in comments might have suggested, I went searching for posts about the new terminology being used in WP 3.0 as the merge of WP and WPMu comes to pass. Here is another good post on the new terminology in WordPress 3.0 for blogs, sites, networks, etc., and here is a nice presentation on it as well. The changing terminology is something I am actually really interested in, and may be the basis of a longer series of thoughts about the importance of terminoloy in watching WordPress develop and grow.

Posted in UWM Blogs, WordPress, wordpress multi-user, wordpress mutli-user, wpmu, wpmued | Leave a comment

WordPress University

Image by Tom Woodward: WordPress RevolutionThe NorthEast Regional Computing Program (NERCOMP) is hosting an all day conference on April 6th that is entirely dedicated to WordPress in Higher Ed brilliantly titled “WordPress University.” The conference features a range of speakers dealing with everything from WordPress for libraries, college web sites, academic networks, and teaching and learning spaces. It’s a pretty comprehensive program and covers a lot of ground, and I’m definitely interested in Jay Collier’s work with Bates College, their main site is run on WordPress, and given UMW is currently thinking about a new CMS for their website, Jerry Slezak and I are going to make the pitch for WPMu being the hub for the umw.edu site. And I have some interesting ideas for the architecture, syndication, and deep integration with UMW Blogs, so Jay’s session is of particular interest to me right now.

What’s more, Matt Gold and Boone Gorges will be featuring their awesome work with the CUNY Academic Commons and the cutting edge work they are doing with Buddypress. Their approach to the social network for faculty and graduate students at CUNY should be of pressing interest to just about every college and university out there right now—they are making a social network that respects people’s pre-existing spaces online while simultaneously providing an essential network for the folks of CUNY.

And while unlike the WordCampEd events this one isn’t free, I hope they figure out a way to stream and/or capture these sessions because I for one am dying to see them.

And on a broader note, it is fascinating to see a professional organization like NERCOMP devote an entire conference to WordPress, I think it is more than warranted and a sign of things to come. More campuses exploring and hacking on open source applications like WordPress to start re-imagining the social implications of web-based communities for publishing, research, teaching, and learning. It points to one possible future of how colleges and universities can start re-imagining their web presence as more than a brochure, but an open, dynamic space that exposes and shares the thinking happening at these institutions, and the next logical step is for us to start making more meaningful connections between individuals at the distributed learning institutions. Something as simple as a new platform, provides something as beautifully powerful and complex as a rich network of teaching, learning, and scholarship.  We need to explore these possibilities together. NERCOMP’s “WordPress University” seems like an excellent step in that direction.

Image credit: Bionic Teaching’s “WordPress Revolution”

Posted in WordCampEd, WordPress, Wordpress as CMS, wordpress multi-user, wordpress mutli-user, wpmu, wpmued | Leave a comment

A Useful Plugin: ShowID for Post/Page/Category/Tag/Comment plugin

I find myself in every recent version of WP (and WPMu) searching for the ID numbers for various pages, posts, categories, and/or tags on a number of occasions. I’m not sure when this feature got dropped from the core, but I do remember it was at one time part of the edit post/edit page metadata. As of the latest versions the only way to find ID numbers is to actually edit the page (or post, tag, category, comment, etc.) and look for the ID value in the URL field (pictured below). Not very intuitive, in fact, ridiculous.

ShowID for Post/Page/Category/Tag/Comment plugin actually shows the ID value right from the edit section of any of these elements. Something like the following:

I am going to activate this plugin sitewide for UMW Blogs, because a number of the plugins/widgets we have actually ask for page/posts IDs to exclude pages/posts etc. from a widget, or include categories in a page. And explaining how to find this information without this plugin is just that much more difficult. I really don’t understand why this isn’t a core feature of WP given core widgets (such as the pages widgets) and a wide variety of plugins depend on ID values.

Posted in Uncategorized, WP, WordPress, devwpmued, plugins, wordpress mutli-user, wpmu, wpmued | Leave a comment

Momentum for WP as LMS building

EDUPUNKIN you LMS Image by Tom Woodward
Image credit: bionicteaching’s “Edupunking your CMS”

Maybe it’s just cause I live in a particular bubble on the internet, but over the past six months or a year there has been what seems to me like some serious momentum towards thinking through WordPress (and/or WPMu) as a serious alternative to Learning Management Systems. And posts like this interview with Kyle Jones as well as Joe Ugoretz’s tour-de-force two part series on how he is putting the idea of WordPress as a LMS into action are pretty badass. This is some amazing stuff, and I really think Kyle Jones nails what the appeal of WP as an LMS is for many with this quote from his interview at wpmu.org:

But [offering faculty and students a hands-on approach to designing their learning] is what makes using WordPress MU wonderful as a LMS: We’ve modified and tweaked it at the students’ request, making their learning space what they need it to be – not what some company says it should be.

And, on top of that, Kyle captures the engine that is driving this emerging cooperation amongst and between a distributed group of faculty, students, and technologist all over the world:

We learn from each other, we steal from each other, in the end we try to give back to those who have helped us.

That really sums up what this vision of openness is as we work through our issues, tinker with the tools, think through the implications, and share back what we’ve learned. I might be crazy, but I still have faith that through this kind of process we can take back the means of imagining our own spaces for teaching and learning from the expedients of institutional efficiency, cause it’s exactly the imagination of these spaces that is a necessary and integral part of the teaching and learning process as Joe Ugoretz’s posts make all too clear. I may be biased, but I can;t help but think what we are seeing in the educational community working with WordPress, is just one part of a larger momentum of people using a variety of tools to escape the prison house of learning that is the LMS. And that brings me to a bigger point, I really don’t think we are simply using WordPress to ape the LMS, but rather to re-imagine the ideas that under gird this design: give students ownership of their work, control over the design, and the ability to seamlessly integrate a wide variety of other tools they already use to network online. More than that, the bigger push is to put students in a pace they own and share back what they choose, an expectation that they take ownership of their work and identities online.

Paternity leave is over, and the bava is back!!!

Posted in CMS, WordPress, lms, wordpress multi-user, wordpress mutli-user, wpmu, wpmued | Leave a comment

Deleting old MySQL tables across blogs and databases in WPMu

OK, so this will probably be the final installment of my “pimp your WPMu databases” series :) Part one was moving from WPMuDEV’s Multi-DB package to SharDB; part two dealt with optimizing tables across a number of databases in MySQL, and the final installation will share some SQL code, once again thanks to Gowtham, for deleting specific tables across various blogs and databases.

Ok, so here is the setup, when we started UMW Blogs we used the spam filter Spam Karma 2. It was a personal favorite of mine, and while a lot more work than Akismet, it did a pretty good job of shutting out spam. Spam karma 2 has since died, and we moved to Akismet well over a year ago now. However, for at least the first 500 or 600 blogs (maybe more) we had Spam karma 2 installed, which inserted two tables into each blog kinda like this:
wp_21_sk2_logs
wp_21_sk2_spams

Where 21 was the blog ID, so across numerous blogs and databases there are a number of blogs with two fields like those above (just a different blog ID number, say wp_581_sk2_logs) filled with spam. It would make sense to drop these tables out as part of an optimization of our databases, but the only question I had was how?

Well I went to Gowtham, the oracle, once again (I hope this well of riches doesn’t go dry for overuse :) ) and he sent me the following script for deleting all tables with _sk2_ in the name. Now I imagine very few folks have this specific issue with Spam Karma 2, so the details of this script may seem irrelevant. But if you think about it, if there is a plugin that inserts tables on numerous blogs spread across various databases, and an uninstall of that plugin doesn’t delete the tables, then such a script would be quite useful to you. Just change the list of databases from my specific setup to yours and instead of the following bit of code:
$sql_q = "SHOW TABLES LIKE '%_sk2_%'";

Put a unique series of characters between the ‘%_uniquecharacters_%’ to delete a series of tables across blogs and databases.

How freaking cool is this? I tested the script on UMW Blogs, and it worked beautifully, UMW Blogs databases just lost another half a gig of spam fat, and I’m am happy to say it’s never been healthier. No heart disease in the future of this WPMu install—though we can never rule out plugin cancer :)

Here is a text version of the script.

And here it is sans the opening and closing PHP calls:

# PHP script to find all tables, whose name contains
# the string '_sk2', in a given set of MySQL databases
# and delete them. This is a 2-step process.
# Run this script as
#
# php mysql_skarma.php > mysql_skarma.sql
#
# Then, run the following command in a terminal
#
# mysql -u USERNAME -p < mysql_skarma.sql
#
# and enter PASSWORD when prompted.
#
# First written: Gowtham, Mon, 25 Jan 2010 08:01:48 -0500
# Last modified: Gowtham, Mon, 25 Jan 2010 09:20:22 -0500

# Connect to the database
# It is expected that you will be able to connect
# to all your databases [listed below] with this
# set of credentials
$host = 'localhost';
$dbuser = 'username';
$dbpasswd = 'password';

# The act of connecting to the MySQL server
$connect = mysql_connect($host, $dbuser, $dbpasswd) or
die('MySQL Connection Error: ' .
mysql_errno() . ': ' .
mysql_error());

# List of databases
$databases = array(
"umwblogs_wpmu_0",
"umwblogs_wpmu_1",
"umwblogs_wpmu_2",
"umwblogs_wpmu_3",
"umwblogs_wpmu_4",
"umwblogs_wpmu_5",
"umwblogs_wpmu_6",
"umwblogs_wpmu_7",
"umwblogs_wpmu_8",
"umwblogs_wpmu_9",
"umwblogs_wpmu_a",
"umwblogs_wpmu_b",
"umwblogs_wpmu_c",
"umwblogs_wpmu_d",
"umwblogs_wpmu_e",
"umwblogs_wpmu_f",
"umwblogs_wpmu_global",
"umwblogs_wpmu_vip1"
);

# FOREACH_LOOP_DATABASES BEGINS
# Loop through the array, 'databases'
# Each array element will be stored in the variable 'database'
foreach ($databases as $database) {

# Connect to the database using details specified
# above - it expects that there is one username-password
# combination that can connect to all your databases
mysql_select_db($database, $connect) or
die('Database Connection Error: ' .
mysql_errno() . ': ' .
mysql_error());

# Select all tables from 'database' that have '_sk2_'
# in their name
$sql_q = "SHOW TABLES LIKE '%_sk2_%'";
$result = mysql_query($sql_q) or
die('Invalid Query: ' .
mysql_errno() . ': ' .
mysql_error());

# WHILE_LOOP BEGINS
# Loop through the list of tables from 'database'
while ($table_details = mysql_fetch_row($result)) {
$table_name = $table_details[0];

# SQL query to DROP the table
# This will be written out to a flat text [SQL] file
# to be imported into MySQL. This is necessary because
# tables with an underscore in their names cannot be
# directly deleted from PHP [to my limited knowledge]
print "DROP TABLE `$database`.`$table_name`; \n";
}
# WHILE_LOOP ENDS

}
# FOREACH_LOOP_DATABASES ENDS

# Close the connection
mysql_close($connect);

Posted in MySQL, UMW Blogs, WordPress, devwpmued, wordpress multi-user, wordpress mutli-user, wpmu, wpmudev, wpmued | Leave a comment

Changing the Oil on a Multi-Database WPMu Install

And to build on my last post about Moving from Multi-DB to SharDB on WPMu, here is a rundown on some of the work done to further optimize the multiple-databases for our WPMu at UMW Blogs.

First off, we have a plugin install called WordPress MU Sitewide Tag Pages that basically republishes every public post from around UMW Blogs into one blog, the tags blog, which is located at http://tags.umwblogs.org. This plugin has a ton of uses for us, not least of which is sitewide tags and categories, as well as feeds off those sitewide tags and categories for syndication and republishing into course sites. Another function of this blog could be a searchable archive of all the public work done. So, needless to say, this blog is important enough that we have let it run now for almost two years without pruning. And when I checked the wp_posts table of this blog in the database there was what seemed to be 99,066 posts.

And that one table was weighing in at a hefty 425 MBs, which mean it was out-of-control, and I imagine some of our recent performance and down time issues might be related, so I decided to cull this table. So after backing it up, I tweeted looking for advice on how I might delete all posts from the tags blog before a certain day, say August 15, 2009—the week before the Fall semester started this year.

And in no time at all, Michigan’s finest, Gowtham (and sgowtham on Twitter) sent me the following bit of code:

DELETE FROM wp_posts WHERE post_date < "2009-08-15";

Along with the note, “please be sure to replace the right table name in place of wp_posts though.” Which would like like this for the tags blog with the ID 1291:

DELETE FROM wp_1291_posts WHERE post_date < "2009-08-15";

So I just copy that bit of SQL code into the PHPMyAdmin editor that lets you run SQL queries for a specific database like so…

And within a minute 66,000 posts were removed, and the table was now 142 MBs.

Now, let’s stop here for a second. How sick is that? Within minutes I got a solution to my issue and deleted 66,000 posts and potentially saved UMW Blogs a couple of more crashes this coming week, from a friend on twitter who just knew what to do. How much richer am I because of this relationship? How much richer is all of UMW? It’s kinda wild to think about that. And more than that, it doesn’t stop there….

When I removed those 66,000 posts the size of the table was still showing 425 MBs, but there was now a value in overhead column of the table that had a value of 140 MBs. I had o idea how to get rd of this, so asked again in Twitter, and D’Arcy Norman tweeted me back this:

He was right, optimizing the table brought the 425 Mbs down to a slender 140 MBs, and the overhead value was flushed clean. So this got me thinking, hmmmm, what if I could run a script and optimize every table in every database? I mean this site has been running non-stop for almost three years, and has been a work horse. How about giving UMW Blogs an “oil change”—to use Gowtham’s analogy which works beautifully. So, when I tweeted about that optimization question, Gowtham once again sent me a message, and after I gave him the naming conventions of my 18 databases on UWM Blogs, wham, I had a PHP script to optimize every table in UMW Blogs.

People, are you getting the point here? Gowtham is an Engineering Physics grad, a hell of a photographer too, but he knows his shit. And he was willing to share that will me in all of about a few minutes the first time. But for the optimization script, he actually wrote it up and sent it to me via email. I don;t know how long that took him, but it would have taken me hours and hours of research and learning to figure out I could do it. And hours more to beg someone who knew at UMW to write it for me (if that person existed). Well, this process was a matter of minutes.

And, Gowtham not only sent me the SQL Optimization script, but was more than cool with me sharing it, so here is the code to the script as a txt file.

And here it is copied below sans opening and closing PHP calls.

# PHP script to optimize each table in a given set
# of MySQL databases and improve the overall performance.
# First written: Gowtham, Mon Feb 27 09:33:01 EST 2006
# Last modified: Gowtham, Sun, 24 Jan 2010 13:01:58 -0500

# Connect to the database
# It is expected that you will be able to connect
# to all your databases [listed below] with this
# set of credentials
$host = 'localhost';
$dbuser = 'USERNAME';
$dbpasswd = 'PASSWORD';

# The act of connecting to the MySQL server
$connect = mysql_connect($host, $dbuser, $dbpasswd) or
die('MySQL Connection Error: ' .
mysql_errno() . ': ' .
mysql_error());

# List of databases
$databases = array(
"umwblogs_wpmu_0",
"umwblogs_wpmu_1",
"umwblogs_wpmu_2",
"umwblogs_wpmu_3",
"umwblogs_wpmu_4",
"umwblogs_wpmu_5",
"umwblogs_wpmu_6",
"umwblogs_wpmu_7",
"umwblogs_wpmu_8",
"umwblogs_wpmu_9",
"umwblogs_wpmu_a",
"umwblogs_wpmu_b",
"umwblogs_wpmu_c",
"umwblogs_wpmu_d",
"umwblogs_wpmu_e",
"umwblogs_wpmu_f",
"umwblogs_wpmu_global",
"umwblogs_wpmu_vip1"
);

# FOREACH_LOOP_DATABASES BEGINS
# Loop through the array, 'databases'
# Each array element will be stored in the variable 'database'
foreach ($databases as $database) {

# Connect to the database using details specified
# above - it expects that there is one username-password
# combination that can connect to all your databases
mysql_select_db($database, $connect) or
die('Database Connection Error: ' .
mysql_errno() . ': ' .
mysql_error());

# Select all tables from 'database'
$sql_q = "SHOW TABLES FROM $database";
$result = mysql_query($sql_q) or
die('Invalid Query: ' .
mysql_errno() . ': ' .
mysql_error());

# WHILE_LOOP_OPTIMIZE BEGINS
# Loop through the list of tables from 'database'
while ($table_details = mysql_fetch_row($result)) {
$table_name = $table_details[0];

# Print a message to the screen - helps in debugging
echo "$database :: $table_name \n";

# SQL query to optimize the table
$sql_o = "OPTIMIZE TABLE `$database`.`$table_name`";
$optimize = mysql_query($sql_o) or
die('Invalid Query: ' .
mysql_errno() . ': ' .
mysql_error());
}
# WHILE_LOOP_OPTIMIZE ENDS

}
# FOREACH_LOOP_DATABASES BEGINS

# Close the connection
mysql_close($connect);

I put in the drop database sign-in information, uploaded it to UMW Blogs via FTP, and went to the script at http://umwblogs.org/mysql_optimize.php, and a few minutes later all of the tables in all 18 of the databases were optimized.

Is this not awesome, UMW Blogs has gotten the oil change it has been in desparate need of—and I don’t recommend waiting every 4,000 users and blogs, every 2,000 may be wiser. So, thanks to Gowtham, UMW Blogs is purring like a cat, and I really hope it stays that way.

And just to show you I have no shame, something else I saw when the databases were optimizing is that random blogs still have the Spam Karma tables in them, I would think about 500 or 600 blog tables filled with old spam. The tables are labeled wp_blogid#_sk2_logs and wp_blogid#_sk2_spams. For example: wp_21_sk2_logs and wp_21_sk2_spams. So riddle be this Batman of Gowtham, how would you find and drop all tables with _sk2_ in them across 18 databases?

I love the internet, and I can’t thank you enough Gowtham for your selfless support, people like you make this space both fun and wonder-filled.

Posted in MySQL, UMW Blogs, WordPress, devwpmued, multiple databases, oil change, wordpress multi-user, wordpress mutli-user, wpmu, wpmudev, wpmued | Leave a comment