My thoughts on Slackware, life and everything

Tag: wordpress (Page 1 of 2)

I switched the blog’s theme

A blog  is something personal, and theming it just right is a challenge. You’ll surely have noticed that the theme of Alien Pastures has been changed overnight.

This blog started out with a theme by Andreas Viklund (wp-andreas01) but that did not scale well on mobile devices, also it did weird stuff with user comments. I liked its visual quality a lot but the usability challenges were not fixable even by rummaging around in its code.
Eventually I replaced that with a new theme by Rajeeb Banstola (techism) but during my recent WordPress blog-code update I realized that this techism theme had not been updated for years, the author’s website has disappeared and the Freemius SDK from which that theme is created has a XSS vulnerability. Real shame because I thought it was beautiful, light, responsive and it fixed the user comment issues I mentioned previously.

So I have used my December holiday to look for another theme, experimenting with several, but I wanted to end with one that at a minimum allows me to have two columns: one for the articles and one as a sidebar with widgets showing all kinds of permanent info. Three columns was what I had with wp-andreas01 and techism, but I could live without one of the two sidebars.

I finally found a theme collection created by Anders Norén. On his page teman he showcases several that I find appealing, but after some experimenting I chose his Lovecraft and Hemingway themes over Baskerville. I kept the visual style of the new theme as close as possible to the old one (header image, top menu, sidebar widgets etc).
A note about the header image – that one has changed a few times over the years. I always use a picture I have taken myself and I rotate them on occasion.

At the bottom I was able to add three widgets that otherwise would have gone into a left sidebar. I think it’s cleaner now. Plus, one of these bottom widgets shows posts that have been most popular during recent weeks. That’s always interesting information to you (visitors), previously I would be the only one with that overview – it shows in the blog’s admin dashboard.

I am still undecided whether Hemingway or Lovecraft will make it as my final choice. Hemingway theme shows the number of comments to each article and it’s visually somewhat more condensed. Lovecraft on the other hand is aesthetically more pleasing to my eye.

I hope you like and appreciate the change and the new interface does not pose any difficulty writing and posting your comments. Feel free to comment below of course!

Cheers, Eric

Alien Pastures switched to HTTPS

The “Alien Pastures” blog has been moved into a Virtual Machine (hence the short downtime yesterday) after its previous host hardware was replaced with a much beefier machine. This was a nice opportunity to configure the VM with a SSL certificate issued by LetsEncrypt (again, thanks Robby Workman).

So, from now on, the blog is served with a HTTPS URL by default. I hope you understand, this is a process seen on many other web sites too.

Cheers, Eric

New SQLite driver for the blog

Ever since this blog’s inception I have used a plugin called “PDO for WordPress” which allowed me to have a SQLite (file-based) database instead of the default MySQL database used by WordPress.

There are a couple of bugs in PDO for WordPress that I was getting tired of, and perhaps some of the people writing comments have been annoyed too, when their post failed to show up on the blog. Most notorious bug was that any text containing the two characters ) and ‘ immediately after eachother would silently be discarded by the driver… the only way to get your precious text back was to hit your browser’s “Back” button and try to find out what was wrong with the text.

The PDO for WordPress plugin has not been maintained for a while, mostly because the development pace of the WordPress code was faster than the PDO for WordPress author could manage. Some of the bugs were addressed with patches, but these were never incorporated into a new release.

I was finally so irritated with this that I was going to attempt to apply these patches to my own blog. Luckily, I did my research properly and I ran into a new plugin that can replace the old PDO for WordPress plugin: it is called “SQLite Integration“. This plugin uses PDO just like the old one.

Remember, PDO stands for PHP Data Objects. Quoting the PHP manual: “PDO provides a data-access abstraction layer, which means that, regardless of which database you’re using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn’t rewrite SQL or emulate missing features“. This is what allows the use of a different database than MySQL and at the same time is the cause of the bugs in my blog – there are incompatibilities in the way WordPress creates SQL queries (targeted at MySQL syntax which does not always work for SQLite).

Interesting enough, the discussion among the WordPress developers about the possible use of PDO has been revived now that the  mysql_* functions are officially deprecated in PHP 5.4.

This new SQLite Integration plugin will work with versions of WordPress starting with 3.3. My blog is at the latest 3.8 release so that is OK.  Thus I proceeded to do the installation of the plugin and re-configuration of the blog, following the instructions (I always RTFM before applying irreversible changes – and make a full backup too 😉

As you can see, the blog is still here. I have not checked whether the text entry bugs have gone now, but at least I am running on a well-maintained database driver again.

Eric

Blog updated to 3.4, sqlite database fixed

I just upgraded my blog to WordPress 3.4.

My blog’s database backend is not MySQL but instead (for portability reasons) I am using PDO for WordPress, a plugin which uses PDO (a PHP data access abstraction layer) to allow the use a sqlite database; i.e. a simple file.

Unfortunately this sqlite backend is not 100% compatible with WordPress installations starting with version 3.3. You can not even create a new blog using the PDO plugin with WordPress 3.3 and higher. The blog has to be created using wordpress-2.2.x, and then upgraded to 3.3 or later.

It looks like the maintainer of the PDO plugin will not be able to give adequate support for the sqlite backend. Not because he does not want to, but because it is difficult to create the proper glue between WordPress SQL code and generic SQL backends (WordPress developers have stated that they are not interested in supporting anything else than MySQL).

The problems with the PDO plugin show when creating a new post… the blog will be “dead” for at least five minutes and the apache log full of SQL errors. I am considering to  move “back” to a supported backend and wanted to check if I could export the full blog so that I could import it to a fresh installation with a MySQL backend.

I quickly discovered that this was not possible. Somewhere along the line, WordPress has added a new table to the database (wp_commentmeta) and the PDO plugin apparently has not been able to add that to my sqlite database. An attempt to export the blog to an XML file (one of the standard tools in WordPress) would lead to a lot of errors in the apache log about “Problem preparing the PDO SQL Statement.  Error was no such table: wp_commentmeta“.

I compared my blog’s sqlite database to a fresh MySQL-backed blog database and thus found the new table’s properties. I upgraded the database on the fly using the sqlite3 command-line program as follows:

$ sqlite MyBlog.sqlite > CREATE TABLE wp_commentmeta (
 meta_id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
 comment_id integer NOT NULL DEFAULT '0',
 meta_key text DEFAULT NULL,
 meta_value text); > .quit

After that modification, exporting the blog to XML took only seconds to create a 4.3 MB file instead of the previous 400 KB partial dump which took painstakingly long. I still have not tried to import that XML dump into an empty blog. Also, this new post will be a test to see how the blog recovers… will it still take many minutes before it is available again after I press “Publish”?

Eric

Blog software updated

Hi

I just upgraded the blog software and took the opportunity to also update to a new version of the wp-andreas01 theme that I have been using for my blog since day one. The new theme is more versatile, fixes some rendering bugs, draws a wider pane (1024 instead of 800 pixels) which I think is a more pleasant reading experience.

Please refresh your browser cache if you see graphical glitches. I had to rescale the banner images too, but they still look good:

Eric

« Older posts

© 2024 Alien Pastures

Theme by Anders NorenUp ↑