St. Louis Good Friday 2011 Tornado

Filed in PersonalTags: Missouri, Saint Louis, Tornado, Weather

The St. Louis Good Friday tornado ended up being a rather close call for us. The storm track is in red; our location is in yellow:

Good Friday Tornado Track

St. Louis Good Friday Tornado, 22 April 2011

Unlike the 2010 Saint Ann tornado, this one did major damage in the area. Thankfully for us, though, the worst thing we suffered was a 12-hour power outage.

A Guide to Reviewing Themes for the WordPress Theme Repository

Filed in Web DevelopmentTags: Theme Review, Themes, tutorials, WordPress

Thanks in large part to Justin Tadlock's recent blog post, in which he solicited more people to get involved with the WordPress Theme Review Team (WPTRT), we have seen a fantastic, huge influx of new volunteers. Many of these new volunteers have had questions about how to perform a Theme review. Hopefully this guide will help answer those questions.

Getting Started

Test Environment Setup

First things first: review How to Join WPTRT.

WordPress Setup

Ensure that a few WordPress settings are modified in order to facilitate the Theme Unit Tests:

  • Settings -> General: set the Site Title to something fairly long, and set the Tagline to something even longer. These settings will facilitate testing how the Theme handles these values.
  • Settings -> Reading: set "Blog pages show at most" to 5. This setting will ensure that index/archive pagination is triggered.
  • Settings -> Discussion: enable Threaded Comments, at least 3 levels deep. This setting will facilitate testing of Theme comment list styling.
  • Settings -> Discussion: enable Break comments into pages, and set 5 comments per page. This setting will facilitate testing of Theme paginating link markup/styling.
  • Settings -> Media: ensure that no values are set for max width or height of Embedded media. This setting will facilitate testing of the Theme $content_width setting/implementation.
  • Settings -> Permalinks: ensure that a non-default permalink setting is selected, e.g. "Month and name". This setting will facilitate stepping through the Theme Unit Tests.

Next, create at least two Custom Menus:

  • Long Menu: all included Pages
  • Short Menu: a menu of 2-3 Pages

Now, you're ready to be assigned a ticket! Read on for the detailed review process.

Policy Requirements

The first area to review involves some policy requirements, rather than code quality. I verify these before I ever download or install the Theme, by reviewing the appropriate template files using the "SVN" link in the Trac ticket.

License

  • Review the header tags in style.css. Ensure that the License: and LicenseURI: header tags exist, that the indicated license is GPL-compatible, and that the indicated URI is a valid, full-text license.
  • Review the Theme files for bundled fonts or icon sets; if included, verify that the licenses for these bundled resources are GPL-compatible, and explicitly declared by the Theme, either in style.css, readme.txt, or somewhere similarly appropriate.
  • Review other template files, such as footer.php, to ensure that there are no inline comments regarding use restriction, such as prohibiting changing the footer, or requiring a credit link, etc.

Credit Links

  • Review the header tags in style.css. Ensure that Theme URI and Author URI, if used, are valid and appropriate.
  • Review the indicated URLs. Ensure that the sites are appropriate, that they do not sell or promote non-GPL WordPress Themes, and that any license or terms and conditions information does not include non-GPL-compatible content.
  • Review footer.php, sidebar.php, etc. and ensure that the Theme does not include any other inappropriate hard-coded links (sponsor links, SEO links, spam links, etc.). Ensure that all public-facing copyright notices indicate the site name, rather than the Theme name or developer.
  • Review functions.php and ensure that the Theme does not hook in any other inappropriate links or copyright notices.

Theme Name

  • Verify that the Theme name meets naming convention requirements.

Screenshot

  • Verify that screenshot.png is sized appropriately.

Theme Check

Next, install the Theme, and before activating, run Theme Check. Note any Warning or Required notices in the Trac ticket. (Note: for any Theme uploaded since late March 2011, Theme  Check should return no such notices, as they should all be caught by the Theme uploader script. If you notice any, please email the Theme-Reviewers mail list, and indicate what notices you observed.)

You are welcome to note Recommended or Info notices in the Trac ticket, but I generally don't. These notices are more for your reference, as you continue to review the Theme.

For Recommended notices regarding Theme functionality (Post Formats, Post Thumbnails, Navigation Menus, etc.), verify that the Theme does not use a custom implementation. If the Theme does use a custom implementation, note in the Trac ticket that the Theme is required to support the core implementation of the functionality.

Step through each Info notice, and review the Theme template files to determine if the notice is applicable. For example: verify appropriate use of include() vs. get_template_part(); verify appropriateness of hard-coded links; etc.

Code Quality

Now, the review enters the bulk of the requirements in the Theme Review guidelines.

header.php

Review header.php, and verify:

  • All appropriate document head guidelines (valid doctype declaration, properly formed tags (html, head, meta, etc.)
  • Feed links are not hard-coded into the document head
  • No CSS files other than style.css are hard-coded into the document head. (These files must either be enqueued and hooked in appropriately, or added using IE conditional tags.)
  • No scripts or script file links are hard-coded into the document head. (These must be enqueued and hooked in appropriately.)
  • No unnecessary meta tags (WordPress generator tag, SEO meta tags, copyright meta tags, etc.) are hard-coded into the document head.
  • The wp_head() template tag is placed immediately before the closing HTML head tag.

footer.php

Review footer.php, and verify:

  • No scripts or script file links are hard-coded into the footer. (These must be enqueued and hooked in appropriately.)
  • The wp_footer() template tag is placed immediately before the closing HTML body tag.

functions.php

Review functions.php, and verify:

  • All custom Theme functions, constants, classes, global variables, and options are prefixed with theme-slug (or an appropriate variant).
  • Theme Settings are implemented properly:
    • Theme options are added to the database via a single options array, rather than separately
    • Settings page added via add_theme_page() rather than add_menu_page()
    • Settings page capability is edit_theme_options, rather than admin, manage_options, edit_themes, etc.
    • All untrusted data are sanitized/validated upon input into the database, and escaped upon output
    • If the Theme is not using the Settings API:
      • Nonce-checking is performed explicitly
      • $_POST, $_GET, and $_REQUEST data are sanitized/validated upon input into the database, and escaped upon output
  • No core WordPress functions introduced prior to one previous, major WordPress release are wrapped in function_exists() conditionals.

style.css

Verify that all tags listed in the Tags: header tag are appropriate, and that all claimed functionality is included in the Theme.

Theme Template Files

Note which hierarchical template files are used (e.g. single.php, page.php, archive.php, date.php, author.php, category.php, tag.php, taxonomy.php, 404.php, home.php, front-page.php, and search.php), so that you will know which of these to verify when performing the Theme Unit Tests, later.

Review Theme template file names, and ensure that any hierarchical template file name variants (e.g. page-foo.php, category-foo.php, etc.) are included in the Theme documentation, with an explanation for their use.

File Includes

Review Theme template files, make note of any uses of include() or require() and ensure that such use is valid. Verify that:

  • All headers are included via get_header()
  • All footers are included via get_footer()
  • All comments templates are included via comments_template()
  • All sidebars are included using get_sidebar()
  • All template part files are included via get_template_part()
  • Any search form markup is included via get_search_form()
  • Any login form markup is included via wp_login_form()

Theme Unit Tests

Now the review moves on primarily to the requirements in the Theme Unit Tests.

Theme Activation Tests

  • Activate the Theme, and open the site in your browser. Verfiy that Debogger returns no PHP errors, warnings, or notices for index.php.
  • Via Dashboard -> Tools -> Deprecated Calls, verify that Log Deprecated Notices does not return any deprecated function calls or other notices.
    • Note: check the Deprecated Calls log one final time when you complete the review, after you switch back to your default Theme. Sometimes, some notices get thrown when the Theme is deactivated.
  • If the Theme includes a Custom Theme Settings:
    • Load the Settings page, and verify that Debogger returns no PHP errors, warnings, or notices.
    • Save current/default settings, and again verify that Debogger returns no PHP errors, warnings, or notices.
    • Test each Theme Option in turn, and verify that each option can be updated, that the setting is applied properly in the Theme, and that Debogger returns no PHP errors, warnings, or notices.
    • If the Theme Settings page includes a "Reset Defaults" button, reset defaults, and verify that default settings are applied, and that Debogger returns no PHP errors, warnings, or notices.
  • If the Theme supports Custom Image Headers, select a custom header, and verify that it is applied/displayed properly
  • If the Theme supports Custom Backgrounds, select a custom background image or color, and verify that it is applied/displayed properly
  • If the Theme supports Custom Nav Menus:
    • Verify that the default/fallback output renders properly
    • Apply the Short Menu to each theme_location, and verify that the menu renders properly
    • Apply the Long Menu to each theme_location, and verify that the menu renders properly, without breaking the site/menu layout
    • If the Theme has a limitation on number of list items in any theme_location, ensure that such limitation is documented in readme.txt
  • If the Theme adds Custom Widgets, verify that all custom Widgets function as intended, generate no PHP errors, are secure, etc.
  • If the Theme supports Custom Editor Style, verify that the Post editor content renders reasonably similar to the site output
  • If the Theme requires any custom settings or setup, ensure that setup instructions are documented in readme.txt

General Tests

Run the W3C HTML/CSS validator on the Readability Test post (to ensure minimal WordPress-caused validation errors), and note any egregious validation errors, such as:

  • Malformed or improperly closed tags, that cause the page layout to break
  • An exceptional number of HTML or CSS errors

View the site index page, and verify:

  • The screenshot, as seen in the Trac ticket, is a "reasonable facsimile" of the default view of the site
  • The Site Title and Tagline, if displayed, do not break the page layout

Template Page Tests

  • For all included template-hierarchy index pages (index.php, home.php, archive.php, date.php, author.php, category.php, tag.php), verify requirements, as specified.
  • If the Theme includes either a front-page.php or a home.php template file, go to Dashboard -> Settings -> Reading, and set the Front Page to display a Static Page (use any existing Page), and set the Blog Posts index to another Static Page (e.g. "Lorem Ipsum"). Verify requirements, as specified.
  • Trigger the Theme's 404.php page by navigating to a non-existent Page slug (e.g. www.domain.tld/sit-amet). Verify requirements, as specified.
  • Trigger the Theme's search.php page by performing a search (e.g. "lorem ipsum"). Verify requirements, as specified.

Blog Posts Index Page Tests

Return to the Blog Posts index page. Step through the Blog Posts Index Page tests.

Individual Unit Tests

Step through each Blog Post and Static Page, verifying all requirements, as specified. Each unit test should be fairly self-explanatory.

Finishing the Review

At this point, the review is thorough and complete. Summarize your comments in the Trac ticket and close the ticket with the appropriate resolution (or propose a suggested resolution, if you do not have appropriate rights to close the ticket).

Radiation Dose and Effect: Visual Perspective

Filed in ScienceTags: Media Bias, Radiation

If you're worried about radiation dose and health effects in the wake of the hurricane- and tsunami-induced damage to the Japanese nuclear power plants, then I would highly recommend that you take a look at this Radiation Infographic. 1

Radiation dose and health effects infographic

Radiation Dose Chart

More than likely, this infographic should help to allay some unwarranted fear about radiation and health effects.

(h/t: @BradleyPotter)

Notes:

  1. Source: xkcd.com. Licensed under CC-BY-NC-2.5

Incorporating the Settings API in WordPress Themes

Filed in Web DevelopmentTags: Settings API, Themes, tutorials, WordPress

The inter-tubes are awash in tutorials for how to add Theme Options to WordPress Themes - so why write another? Primarily, because most such tutorials are several years old, don't implement current best-practices, and were written without any awareness of the WordPress Settings API.

While others such as Otto and Ozh have done yeomen's work in explaining how to implement the Settings API, I have not yet come across anything that really put everything together, and explained the process and implementation from beginning to end, in a way that even the less-experienced Theme developers (like me) could easily understand.

This tutorial will attempt to fill that gap, by providing examples of current (as of the pending release of WordPress 3.1) best-practice implementation, not merely of the Settings API, but of Theme Options implementation as a whole, including:

  • Registering options in the database as a single options array
  • Initializing default options
  • Creating a single Theme Settings page (with tabs)
  • Defining settings page sections and fields
  • Validating and white-listing user-input form data
  • Adding Settings Page contextual help
  • Enqueueing custom CSS for the Settings page
  • Implementing settings in the Theme template files
  • Enqueueing front-end CSS

Throughout this tutorial, I will be using code from my Oenology Theme for implementation examples. For full code, see the latest development version.

Assumptions: Best Practices

The following will be the working list of best practices that will be incorporated:

  • Theme Settings defined as an options array in a single database entry
  • Theme settings added to a single Theme Settings Page
  • Theme Settings page is added to the "Appearance" menu
  • Theme Settings page added using the "edit_theme_options" user capability
  • Theme Settings registered, updated, and validated using the WordPress Settings API
  • Theme Settings modify the template using action/filter hooks wherever possible

Getting Started

The first thing we need to do, even before touching any code, is to determine:

  • What options to include in the Theme
  • How to organize those options on the Theme Settings Page

In my case, I am adding only a handful of simple options:

  • Header Navigation Menu Position: currently, Oenology displays the Header Navigation Menu above the site title and description. I am adding a setting optionally to display the Header Navigation Menu below the site title and description.
  • Header Navigation Menu Depth: currently, Oenology is designed so that only the top-level Pages display in the Header Navigation Menu, and Child Pages display in a left-column sub-menu. I am adding a setting optionally to display Pages to a depth of one (top-level Pages only), two, or three, with hover drop-down menus.
  • Footer Credit Link: currently, Oenology does not display any form of footer credit link. I am adding a setting optionally to display a footer credit link.
  • Varietals: the default style of Oenology is intentionally minimal. It is intended to be clean, simple, and cross-browser. I am adding a setting optionally to select from among Theme "skins" (which, in keeping with the oenology metaphor, will be called "varietals"), which will apply different color/style schemes to the Theme.

Given that I'm only adding four Theme options, I could very easily put all four together on one Settings page. However, I may want to add additional options in the future - and also, I want to provide a proof-of-concept for creating complex Theme Settings pages in a way that supports the Settings API. So, the Theme Settings page will have two tabs: "General", and "Varietals". Further, the "General" tab will have two sections: "Header Options" and "Footer Options".

So, that's our basis. Let's get started!

Rutabaga: Well-Kept Low-Carb Secret

Filed in PersonalTags: Health/Nutrition, Low Carb

Oh, rutabaga, where have you been my whole (low-carb) life?

I have been a dedicated low-carber for over a decade. While I could go the rest of my life without eating another dessert or drinking another soft drink, my meat-and-potatoes farm-community up-bringing often leaves me missing starch-laden foods of my youth, such as fried potatoes and biscuits and gravy. In fact, when I decide to splurge, it is almost alway with one of these two foods. In over ten years of living low-carb, I had never found a suitable, low-carb replacement for crispy potatoes fried in bacon grease.

Enter the rutabaga: humble root vegetable, that also happens to be incredibly low in carbohydrate (under half the net carbohydrate content of a potato). While not a strictly low-carb food, it makes for a great option for the occasional potato fix.

Apparently, the rutabaga has fallen out of popular use, due to its reputation as famine food during World War II. How unfortunate. As it turns out, the rutabaga is basically just as easy to work with as the potato, and makes an equally good accompaniment as the potato when fried.

Here are the results of tonight's experiment with making fried rutabaga.

The rutabaga is at first a somewhat unusual-looking vegetable, but is actually easier to peel than a potato:

Rutabaga Peeled and Unpeeled

Rutabaga Peeled and Unpeeled

Once peeled, rutabaga is considerably more difficult to cut through than a potato; however, once I quartered the rutabaga, the mandolin made quick work of slicing:

Rutabaga Quartered and Mandolin-Sliced

Rutabaga Quartered and Mandolin-Sliced

I initially fried a small batch (1/2 rutabaga) of potato chip-thin slices, to get a feel for the texture and taste of fried rutabaga.

Frying a trial batch of rutabaga

Frying a trial batch of rutabaga

Having discovered that rutabaga fries essentially the same as potato, we were pleasantly surprised further to discover the mild, natural sweetness of rutabaga that - especially when crispy-fried - pairs in a rather addictive manner with a little salt and pepper.

Finding the trial run successful, I set the mandolin to one setting thicker, sliced another whole rutabaga, and fried the whole batch in bacon grease, as before.

First full batch of fried rutabaga

First full batch of fried rutabaga

This batch definitely took longer to cook than the potato chip-thin slices, but still barely took longer than the time required to broil pork chops.

The pork chops and fried rutabaga (garnished with a few bits of crumbled bacon), combined with some Brussels sprouts "slaw" (steamed Brussels sprouts, core removed, mashed/quick chopped, with butter, Parmesan cheese, and a few drops of lemon juice) made for a tasty and - and unexpectedly filling - meal.

Fried rutabaga with broiled pork chop and Brussells sprout slaw

Fried rutabaga with broiled pork chop and Brussells sprout slaw

(I actually was unable to finish the entire plate.)

Next up: rutabaga chips in the deep fryer, rutabaga soup (using my secret family potato soup recipe), and roast with rutabaga.

Twitter Updates for 2011-01-28

Filed in Lifestream

Twitter Updates for 2011-01-27

Filed in Lifestream

Twitter Updates for 2011-01-26

Filed in Lifestream

Twitter Updates for 2011-01-25

Filed in Lifestream

Twitter Updates for 2011-01-24

Filed in Lifestream
  • @HurricaneJames5 rear-ended by a drunk driver? Hope everyone is alright! in reply to HurricaneJames5 #
  • @Jpeezy25 so what was the good Word this morning? in reply to Jpeezy25 #
  • @jmcc65 I've never liked the term "Man Upstairs", but Amen to the sentiment! We are #blessed aren't we? in reply to jmcc65 #
  • @18to88 did you see this? Baby James got rear-ended by a drunk driver last night: http://bit.ly/hfyefZ #
  • Beginning Git Cheat Sheet - http://bit.ly/ebYS6L #wordpress #
  • @prossorguk feedback? http://bit.ly/hpwkVc in reply to prossorguk #
  • @lewayotte @glennansley just started using Git last night. Appreciate any feedback! in reply to lewayotte #
  • the smartest choice would be "Owner" RT @DevonSweeney @LaVarArrington what position do u think the Redskins will draft with their #1 pick? in reply to DevonSweeney #
  • @prossorguk knew I forgot something! Going in to fix... in reply to prossorguk #
  • @prossorguk fixed! in reply to prossorguk #
  • I totally called (albeit one play early) that Rodgers naked bootleg! Nice opening drive by the Packers there. #
  • A PUNT from the 34-freaking yard line?!? Is Lovie Smith channeling his inner Jim Caldwell? #
  • 24-yard punt. 16-yard first-down run. Need I say more? #
  • And then the Packers bail out the Bears, with some utterly stupid play-calling from mid-field. Why go for 2 homerun balls there? #
  • Seriously? You let yourself get sacked out of FG range on 3rd & 6 from the 27? The Packers offense really is trying to keep the Bears in it #
  • So, does *either* team want to win this NFC Championship? Two near-safties, followed by a muffed punt? #ugly #
  • Jay Cutler is throwing with Mark-Sanchez-esque accuracy today. #
  • @LovinBlue I don't really care who wins it. Probably rooting for the Packers, but it won't bother me if the Bears win. in reply to LovinBlue #
  • This time: 11-yard punt, followed by a 10-yard run on first down. Good play-calling, Lovie... :/ #
  • @XL950 followed by a 10-yard run on first down, of course. in reply to XL950 #
  • @18to88 @BankOfWayne and it worked so well the first time, they just did it a second time! in reply to 18to88 #
  • The Packers should act like they want to win this game, and go for it on 4th & 1 from the 36. But what do they do? Punt, of course. #
  • Bad throw by Rodgers; WR tips it: interception. #
  • @coltsgurl4u apparently, Rodgers heard you. in reply to coltsgurl4u #
  • The Bears are in perfect position to play for a half-ending FG. What do they do? Homerun ball: INTERCEPTION #
  • My guess is the booth called for a review for down-by-contact, not for an incompletion. #
  • Uhhh.... he was CLEARLY tapped on the helmet on the way to the ground. How was he not down by contact at the 2? #
  • Please: someone explain to me why the Packers, up 14, with the Bears offense doing NOTHING, are still trying the homerun balls? #
  • WOW! That was a CHEAP pass interference call. Jacob Tamme would like a second opinion. #
  • @norcross but they've been successful with moving the ball at-will with shorter throws. Up 14. Kill the clock. in reply to norcross #
  • @XL950 or perhaps, only throw the flag when it's, you know, actually pass interference... in reply to XL950 #
  • Rodgers just threw his second interception in scoring position. Todd Collins now in at QB for the Bears. #
  • @Skitzzo I watch the contact that *doesn't* get called in Colts games; that didn't look anywhere *near* DPI to me... in reply to Skitzzo #
  • Sorry, make that a sack and a pick for Rodgers in scoring position. His first pick was from just outside FG range. #
  • @LisaSabinWilson not Rodgers' finest decision-making performance today. You guys should be up at *least* 20-0 by now. in reply to LisaSabinWilson #
  • @LovinBlue you can tell a difference between the two? in reply to LovinBlue #
  • Worst decision to field a punt of all time? Survey says: yes. #
  • I think Urlacher is just about the only Bears player who decided to show up to play today. #
  • @keder yes in reply to keder #
  • @dmataconis he can't now. The Bears put in their #3 QB. in reply to dmataconis #
  • @dmataconis dunno; I just know that once the #3 QB goes in, #1 #2 are done b/c #3 is emergency QB & doesn't count against active game roster in reply to dmataconis #
  • If Jacob Hanie leads da Bears back into the game & Chicago wins do the Bears have a QB controversy on their hands going into the Super Bowl? #
  • This time, Chicago punted 24 yards, and it wasn't even a touchback. #punting #fail #
  • Jay Cutler is in the game. He's wearing the #12 jersey for the Green Bay Packers. #
  • This game has had SIXTEEN punts. 8 of them have netted less than 35 yards. 6 have netted less than 30 yards. #punting #fail #
  • Jacob Hanie has now thrown 3 Touchdowns: 2 to the Bears, and one to the Packers. #
  • That was a sketchy call for intentional grounding. There WAS a receiver in the area; he got hooked/pulled to the ground, Reggie Wayne-style #
  • @18to88 @rtm237 clearly. That statement can only be borne out of complete ignorance. in reply to 18to88 #
  • @CrizzleColts @18to88 "fourth and ballgame" doesn't count as a gutsy playcall. in reply to CrizzleColts #
  • I almost wish that idiot DB had fumbled the ball for trying to run back that interception. #takeakneeforthewin #
  • @Skitzzo for what it's worth, their ball-control was worse than their clock management. in reply to Skitzzo #
  • @Shake1n1bake that, too - though there's no harm in picking it off it to prevent an errant catch. in reply to Shake1n1bake #
  • @coltsgurl4u sure... jinx the Steelers. Works for me! in reply to coltsgurl4u #
  • @technosailor I hear there's a football game on in reply to technosailor #
  • @technosailor @TurleyCEO that's okay, so did the Bears. in reply to technosailor #
  • @Frumph sleep? Ah, so that's why you disappeared! in reply to Frumph #
  • @nacin must be a filter called dont_format_<3_dangit()... in reply to nacin #
  • @WordPressKC a #wordcamp in Missouri? Awesome! #
  • @WordPressKC I might have to try to make it over there. in reply to WordPressKC #
  • @WordPressKC any interest in a discussion of Themes from the perspective of the Repository/Theme Review Team? in reply to WordPressKC #
  • @18to88 can you do a comparison of Big Ben's last pass to Manning's pass to Blair White? It looked almost *exactly* the same height. #
  • @18to88 you think? in reply to 18to88 #
  • @PeytonsHead except for me. Must try harder. in reply to PeytonsHead #
  • @18to88 but he was going to ground. Hmm... maybe I wasn't paying close enough attention. in reply to 18to88 #
  • I just threw up a little in my mouth hearing Ben the Rapist Roethlisberger saying "God is good" in the post-game interview. #
  • @18to88 we might be quibbling. Would you say they were within 1 foot of each other, in height off the ground (e.g. 1ft vs 2 ft? off ground)? in reply to 18to88 #
  • @18to88 I don't think it was that low. White was in the air; could see shadow beneath. At the time I put that pass at/just below knee height in reply to 18to88 #
  • @18to88 I'd call that just below knee height. Not worth being pedantic over, however... in reply to 18to88 #
  • @coltsgirl17 me too, in June in reply to coltsgirl17 #