Categories
Site Info

CSS Naked Day

I learned from Dries, founder of Drupal, that today is “CSS Naked Day” which encourages site owners to disable all CSS. You can read more about it on the day’s site.

Here’s a quick and dirty snippet to add to a WordPress site to enable it.

function bk_is_naked_day($d) {
  $start = date('U', mktime(-12, 0, 0, 04, $d, date('Y')));
  $end = date('U', mktime(36, 0, 0, 04, $d, date('Y')));
  $z = date('Z') * -1;
  $now = time() + $z; 
  if ( $now >= $start &amp;&amp; $now <= $end ) {
    return true;
  }
  return false;
}

function bk_remove_all_css(){
    global $wp_styles;
	if ( bk_is_naked_day( 9 ) ) {
        $wp_styles->queue = array();
	}
}

add_action( 'wp_print_styles', 'bk_remove_all_css', 99 );

function bk_announce_naked_day() {

	if ( bk_is_naked_day( 9 ) ) {
	echo "<p><i>🔥 Why does my website look so <strong>naked</strong>? April 9th is <a href='https://css-naked-day.github.io/'>CSS naked day</a>.  I'm participating to help promote web standards, including the proper use of HTML, semantic markup and more. I'm also using it as an opportunity to find out where I can improve the HTML on the site.</i></p>";
	}
}

add_action( 'wp_body_open', 'bk_announce_naked_day' );
Categories
Site Info

A facelift‽‽‽

Indeed. I switched the site over to the very alpha, raw, unfinished version of Twenty Twenty, the upcoming default theme that will be released with a future version of WordPress.

Over the years, I’ve found the best way to find and fix bugs with the default themes is to use it on a site you actively care about. Or your slightly neglected personal site. Either way. 😉

Categories
Microblog Site Info WordPress

Keeping It Clean

I went through my debug log tonight, which had been a bit long mainly due to older plugins throwing warnings in PHP 7.

Of four plugins generating PHP 7 warnings, two had merged-but-unreleased fixes, one has a pending PR that I could apply and confirm working, and wrote a PR for the last one.

Clean logs here I come!

Categories
Microblog Site Info

Facepile Lives

Rough, but any new ‘like’ webmention to my site will be given a ‘like’ custom comment type and displayed in a facepile. Still need to convert the existing ones.

See both previous (for now) and new likes on this post about Fr. Bill.

Categories
Microblog Site Info

Same site, only blog-ier: Introducing kraft.blog

I flipped my site over last night to live officially at kraft.blog. In addition to being a more accurate domain name than “kraft.im”, it’s also a bit easier to say and share with folks.

No offense to the Isle of Man—the country for whom .im belongs—I’ve spread your fame far and wide in sharing my URL before. I’m still planning on visiting someday.

This site has always been a blog since it started in 2002. It seems to be a format I’m sticking with, so let’s call a spade a spade, eh?

Categories
Site Info

PHP 7!

After running HHVM with a PHP 5.6 fallback for about six months, I switched over to PHP 7. Initially, left HHVM on as a fallback to PHP (ha), but after a week, Nginx never attempted to use HHVM.

Checking the average memory consumption, on an average day, never-used HHVM was using more memory than serving-everything PHP 7, so I removed HHVM.

A handful of plugins on the site threw some notices, mainly due PHP 7 deprecating the PHP 4 method of constructing a class. Otherwise, smooth sailing.