Some Notes on Site Migration to WordPress

I have a tiny site, sign-in-sheet.com, that was an experiment to see if ads can pay; they can, but it’s a tiny site, with tiny revenues.

I ported it over to WordPress, and it took several hours. It took 9 and 1/3 hours, more or less.

The trade off is that it’s now easier to update.  I have a bunch of modified files that should be uploaded.

The site gets little traffic, but I basically spent less than a day making the initial site. It drives ad clicks, because you don’t have these dense, endless lists of options.  You search, land on a page, and see, along with the content, a big ad. Odds are, a vendor is remarketing something to you, so you are more likely to click.

Webmaster Tools Dinged Me

I found some unpublished printable forms, so added them to the site, growing the footprint. Since this site can now grow, with some effort, I decided to install the Yoast plugin to coach my writing.

Yoast produces an XML Sitemap, so I went over to Google Search Console, aka Webmaster Tools to see if the site was being indexed. As expected, it was out of date… but there were some improvements to the tools, one of them being some tools to analyze how the site will perform in a mobile phone.

There, I had some bad news. Google wants sites to be mobile-friendly. My theme was not.
At least not Google’s version. My CSS and HTML were responsive, and acceptable to my eyes… but Google couldn’t tell.

The lesson here is that you need to get into the search tools asap – meaning as you release the theme. It’ll add a few hours of work to the theme, though.

Converting HTML Layouts into a WordPress Theme

A few companies sell this service, and I looked into it. While conversion and existing layout to a WordPress theme isn’t too hard to create a rudimentary theme that replicates an existing website. Is this a valuable service? Is it going to help the site? Answers withing. Continue reading Converting HTML Layouts into a WordPress Theme

PHP Notice: Undefined index: HTTP_HOST in /home/…/ms-settings.php on line 48

You’re running the WP-CLI and get that message, plus the following error:

Error: One or more database tables are unavailable. The database may need to be repaired.

Continue reading PHP Notice: Undefined index: HTTP_HOST in /home/…/ms-settings.php on line 48

WP’s Backbone-like Templating Language

In yesterday’s post, I talked about fixing up old PHP code to be safer.

There’s another anti-pattern common in old PHP code, and that’s mixing the display logic with the output logic. While some of this is inevitable, nowadays, the rule is to use a templating system like Twig to separate out even small bits of HTML code from the logic.

WordPress does this on the front end via Underscore templates, but configured to use Handlebars-like syntax.

This is a PHP class that does the same thing with PHP. I wrote it so I could use the same, or similar, templates on both the client and server side.
Continue reading WP’s Backbone-like Templating Language

WordPress Customizer, Selective Refresh and Partials for Multiple Settings

There are several good references about how to set up the Customizer to avoid refreshing the entire page with each change. There’s one here, and there’s some deeper explanation here. What’s not described much is how to map several settings to a single area of the page (called a Partial).

This tutorial will go into updating Partials that use several settings. I assume you have already done the other tutorials.
Continue reading WordPress Customizer, Selective Refresh and Partials for Multiple Settings