Monthly Archives: August 2015

Updating WordPress

At some point after migrating this site to WordPress, the admin panel notified me of an available update. When I attempted to install the update, I was prompted for FTP credentials. I don’t have an FTP server configured, so I had to dig into the problem. A quick search turned up a lot of people with similar problems, though most report also having trouble installing and updating plugins. That’s working just fine for me.

One option I came across is to hard-code the FTP credentials in your wp-config.php file. That doesn’t seem like a great idea to me, and it would also involve setting up an FTP server.

It appears that the root of the issue is a file permissions (or ownership) problem. I need to learn more about the ownership model in Linux, and what it should look like for a WordPress install.

In the meantime, the simplest fix seems to be to add a single line to your wp-config.php file: define(‘FS_METHOD’,’direct’);

I wasn’t entirely sure what that did, which made me a little uneasy — so I removed that line again after I completed the update. There’s a pretty good explanation of how this works on Stack Overflow. It seems like the crux of the issue is that the test for the direct method is failing, but the direct method actual works just fine. By directly specifying that update method I’m just bypassing that test.

Since I haven’t resolved the underlying permissions issue, I’m sure I’ll be diving into this again at the next major version release. This document details the permissions scheme in WordPress; hopefully it will help me sort this out.


Update March 16, 2016: I looked into the permissions issue a little more, and found that the group assigned to all of the subfolders in /var/www/jeffvautin.com/ did not match the groups in /var/www/analogbias.com/, the other WordPress site I have installed on this server. I ended up making a call to chgrp to set all of the folder groups to www-data. This did the trick.

Clean My Archives 1.0.0

I just recently wrote about the modifications I made to the Clean My Archives plugin to remove the comment count from the archive list. As of last week, Clean My Archives has been updated from version 0.2.0 to version 1.0.0. With the change, I’ve had to update my modification as well.

From a clean installation of Clean My Archives, I changed line 167 of the plugin from:

sprintf( '</a> %s</li>', $comments ),

To:

sprintf( '</a> </li>'),

With that, I’ve once again removed the comment count from the page:

Screenshot of Archive Page without comment counts

WordPress Import Folder Permissions

In the course of migrating this site over to WordPress, I remembered an old, abandoned music-focus blog I had been hosting on WordPress.com. I figured that I might as well consolidate all of those posts onto this site as well.

The first step was to export the old posts from WordPress; that’s straightforward. There’s a built-in export function administration page, hiding under Tools. I chose to export all of the site content.

Once I had that archive stored locally, the next step was to import the content onto this site. The Import function is also under the Tools menu, and it will prompt you to install the WordPress Importer plugin. I completed the installation and activated the plugin.

Almost immediately, I hit an error message:

Is its parent directory writable by the server?

Some searching led me to the conclusion that the /wp-content/uploads/ folder had to be made world-writable, though I don’t fully understand why:

  1. First, I verified the current folder permissions:

    cd /var/www/jeffvautin.com/wp-content/
    ls -l
    

    The permissions were 755.

  2. Then I changed the permissions to world-writable:

    sudo chmod 777 /var/www/jeffvautin.com/wp-content/uploads/
    
  3. At this point I could import the old site.

  4. I changed the permissions back to where they had been:

    sudo chmod 755 /var/www/jeffvautin.com/wp-content/uploads/
    

After importing the content, I wanted to add it to my local Markdown file archive — in case I needed to modify it or move it anywhere else. To do this, I used Dr. Drang’s WP-MD scripts that I had previously set up. On my local machine, I first moved into the directory with the scripts:

cd /Users/jeffvautin/Dropbox/Application\ Support/BBEdit/Packages/WP-MD.bbpackage/Contents/Resources

Then I used this command to get a list of the post IDs, as a text file in BBEdit:

./recent-posts 40 | BBEdit

And finally, I imported the posts individually into BBEdit:

./get-post <post_ID> | BBEdit

Now they’re both on this site and a part of my local archive, which is a big improvement over the old arrangement, where they only lived on WordPress.com. The content isn’t as bad as I feared it was; you can see these old posts here.

First Patent

My first patent, number 8,913,777, was issued late last year. I know there’s a lot of controversy surrounding the utility of patents — and I agree with a lot of the criticism — but I was also proud of the external recognition of my work.

Providing speakers in a vehicle seat

A speaker system for use in a seat includes a speaker enclosure including a speaker having a sound-radiating element with a first side and a second side, and an at least partially enclosed volume of space larger than a volume of space occupied by the speaker and acoustically coupled to the second side of the sound-radiating element of the speaker, the enclosure sized to fit within a first vertically-oriented cavity in a seat back, open at the top of the seat back. A motor moves the first speaker enclosure between a first position in which the first speaker enclosure is fully contained within the first cavity and a second position in which the first speaker enclosure protrudes from the top of the seat back such that the first side of the sound-radiating element is coupled to free space at the top of the seat back.

Here’s a link to Google’s cached version, too.

Setting Up Markdown and SmartyPants in WordPress

One of the reasons I was previously hosting this site on Scriptogr.am was due to the native Markdown support. While WordPress.com offers native Markdown support, it’s not a feature of the WordPress.org project.

Once again, I followed Dr. Drang’s lead:

I figured I had to have the Markdown plugin installed before importing, so I went to Michel Fortin’s site and got both PHP-Markdown-Extra and PHP-SmartyPants. After unzipping the downloaded files, I copied them into the wp-content/plugins directory of my blog and activated them from the WordPress plugins administration page. Then I did the import, which seemed to go quickly and flawlessly; there were no error messages.

In the years since Dr. Drang’s original post, PHP-Markdown-Extra is no longer actively developed as a WordPress plugin. Version 1.2.8, from November 29, 2013, is the last ‘Classic’ release with WordPress plugin support. This is what I’m running for now, but I may try to figure out how to run the latest ‘Library’ version when I have some time.

To do the installation, I downloaded and unzipped the classic release. I used scp to copy the plugin over to the server, and then copied it from my home directory into /var/www/jeffvautin.com/wp-content/plugins. With that, the Markdown-formatted content I imported from Scriptogr.am is rendering properly.