Offline WordPress

“You CAN have the cake and eat it too”

WordPress is an extensive blogging and CMS platform. With over 15k plugins and the most used CMS platform today. It’s ease of use and extensibility are important factors for choosing it as a CMS. The downside is that, because of its popularity, a lot of security holes have been discovered and there are probably more hiding. Therefore you cannot use WordPress as a CMS if you’re security savvy, or can you?

This post describes how to use WordPress to manage your content and publish it to static HTML. This has the security benefit that no code is executed and hence no vulnerabilities can exist. This also introduces a performance benefit.

Point of interest is dynamic elements in your site, they no longer work – the WP-way. The comments function, for example, needs to be substituted by something like Disqus. The contact-form needs to be substituted by, for example, a Wufoo form. The good thing about this is that these online services are focusing on one thing only and will do everything to keep this running. Therefore i think the security levels of Wufoo will be higher than if you have your own hosted contact form, when configured correctly.

There’s a plugin called really-static. What it does is create static HTML files of your pages, posts and other stuff and uploads this to an (s)FTP-server. More on this plugin at http://wordpress.org/extend/plugins/really-static/. The plugin will run every time you update/delete/create a page or post. What it doesn’t do automatically is transfer the themes/plugins/wp-include directories. But that’s easily fixed.

Here’s how it works:

  • Install wordpress on a private system. Configure your WP installation as you please. Please use online services for dynamic elements.
  • Install a webserver where the files should end up.
  • Install the really-static plugin and patch it to transfer addition directories. Perform the initial transfer.
  • Use it.

Install wordpress on a private system

Nothing special here. Just install wordpress as you normally would. The only thing to bear in mind is that dynamic elements will not work. Use their online equivalent.

Install the publish webserver

This is the secure webserver. Configure it accordingly. You don’t have to install PHP on it. Make sure there’s an account that can write files to the documentroot.

Install and configure really-static

In my example I have my WP installation on server.local in /var/www/wp which is accessible via http://server.local/wp/. I publish the page to http://www.company.com in /var/www/ which is available at http://www.company.com/.

Install the really-static plugin from the plugin menu and enable it. Add the following code to wp-content/plugins/really-static/php/configupdate.php just before the last function call ‘reallystatic_configok ( __(“Finish”, ‘reallystatic’ ), 3 );

 // Function to loop through dir's and getnpush the data
 // $basepath is the path to your WP installation on your servre
 // $subpath is the path relative to your $basepath that you want to getnpush
 // $sitepath is the path where the $basepath is accessible on the webserver
 function getnpush_misc( $basepath, $subpath, $sitepath ){
  $ignore = array( '.', '..' );
  $dh = @opendir( $basepath.$subpath );
  while( false !== ( $file = readdir( $dh ) ) ){
  if( !in_array( $file, $ignore ) && !preg_match('/\.php$/', $file)){
   if( is_dir( "$basepath$subpath/$file" ) ){
    getnpush_misc( $basepath, "$subpath/$file", $sitepath);
   } else {
    getnpush ( "$sitepath/$subpath/$file", "$subpath/$file", true );
   }
  }
 }
 closedir( $dh );
 }

 reallystatic_configok ( "->misc files", 2 );

 getnpush_misc("/var/www/wp/", "wp-content/themes", get_option ( 'siteurl' ) . "/");
 getnpush_misc("/var/www/wp/", "wp-content/plugins", get_option ( 'siteurl' ) . "/");
 getnpush_misc("/var/www/wp/", "wp-includes", get_option ( 'siteurl' ) . "/");

Now configure really-static under Settings -> Really-static:

  • Source: Where can you find your WP-site and it’s theme?
  • Destination: use sftp and add the user you created on the publish server. The domainprefix is where your published site will be accessible and should be set accordingly
  • Settings: Make sure to tick the rewrite option (high security) so all references to javascript, css et cetera point to the publish server
  • Reset: push the button to mark everything as ‘pending’
  • Manual Refresh: hit the ‘write all files’ button to transfer the whole site

Use it.

For the first time transfer, click manual refresh in the really-static settings. This should give a list of all files that are being generated and transferred.

Now for every page or post you add, edit or delete the really-static plugin gets started to publish it.

Please note that everything else you change on the site, like menus, themes, plugins, et cetera don’t get transferred automatically. They require a reset & manual refresh to transfer the whole site.

Things to address

  • Google API key changes
  • When deleting a post, delete it on the publish server
  • Google Site Search

Further reading

Posted in Wordpress | 6 Comments

The magical sleeping business

There are magical places called furniture malls. They are somehow able to alter thoughts of people who enter them. Imagine you’re shopping for a new bed and you think 1.500 Euro is a reasonable price. When you are engulfed in furniture stores you end up wondering where to get that 4.000 Euro for the fantastic-hard-to-refuse offer you just got.

Or at least, that’s what happened to me :). About a year ago we set our minds on getting a new bed. The old mattress developed a dent in the middle and just didn’t provide the comfort we like to have. The hardness of the mattress wasn’t right for me or my wife. This resulted in not sleeping well, waking up and not feeling rested and a mild back-pain now and then.

Sleeping is very important. You spend roughly 30 percent of your time doing it. Although science can’t yet fully grasp the sleeping process i can tell from personal experience it’s important :). Therefore people will be anxious to buy the right mattress or their health might be in danger.

What follows is my take on the (Dutch) mattress market from a consumer point of view.

There’s a trend that sleeping becomes more and more luxurious, a big example of this is Hastens who manufactures beds for more than 10.000 Euro. These beds are stuffed with horsehair and all different ‘exotic’ material you wouldn’t think of putting in your bed. I have slept on a Hastens in a resort once and the beds are actually very comfortable. Another example is the rumour that good sleeping is somehow a Swiss or Scandinavian thing and that products from those countries think they’re justified to charge a premium.

Sleeping is also becoming more high-tech. A few years ago a box spring was very good. Now some form of (pocket)springs are default and you need at least 5 different comfort zones. The foam is now the same as used by NASA! This foam ‘remembers’ the shape of your body and supposedly gives you more support. Of course box springs and high-tech foam mattresses could be better so the new thing is the hybrid mattress where you have a layer of NASA-foam on top of your 7 zone pocket springs.

The Dutch market for mattresses must be huge, if you assume every adult has a mattress which he or she changes  every 10 years and the average price is 500 Euro the annual turnover is 500 million Euro.

In my search for the perfect mattress, both in price and comfort, I came accross 5 different offerings:

  • Premium brands like Hastens, M-Line, Auping and Eastborn.
  • White label brands from the furniture stores like Beter Bed.
  • Budget brands like Leen Bakker, Kwantum and Sandic.
  • IKEA, the ubiquitous furniture store.
  • Webshops, notably Energy+, who sell exclusively online. Others are Medi-Active

When buying a mattress there are a number of factors you take into consideration. The 5 offerings provide different degrees of attention to those factors. This can be depicted in so called value curve (inspired by Blue Ocean Strategy):

The reasoning behind this curve is as follows:

Price: The premium brand is by far the most expensive. They easily charge 1.000 Euro for a 90×200 mattress. For a budget mattress of the same size you will need to bring 100-150 Euro. Energy+ charges 350 Euro for a 90×200 mattress.

Perceived Quality: No doubt the premium brands make sure you think they have the best quality. It’s for a good reason they’re so expensive so they must be good :). The Energy+ offering convinced me to have almost the same level of quality as, for example, M-Line. Please note that I deliberately mention the perceived quality, this is a subjective factor. The objective, measurable, quality can contribute to the perception. Energy+ for example has a stress test report from the Dutch TNO which states that their mattresses don’t form pits. The Dutch “Consumer Union” Consumentenbond regularly performs grouptests of mattresses in which once a budget mattress from Kwantum alledgedly came out as the winner.

Mass media marketing: The premium brands buy prime-time slots for showing their commercials on TV as wel as all other sorts of promotion. The white label brands are known for their persistent presence in the weekly snailmail. IKEA has the marketing efforts of the whole company also working for their mattress department. Energy+ in contrast doesn’t do mass media marketing except for some free publicity.

Showroom: The premium brands have nice showrooms with dedicated salesmen. You can try out all sorts of mattresses and get expert advice on what’s best for you. IKEA for example let’s you choos yourself and guides you with a simple system to find the right mattress. Online stores don’t have showrooms or only very limited.

Delivery time: When you buy a mattress at IKEA or a budget store you can usually take it with you right away. Strangely when you go to a premium bed store you notoriously have to wait up to 2 months before you receive your new mattress. Online stores usually have their  logistics well planned because that’s the only contact they directly have with a customer and that should be good. I received my mattress from an online store within 5 days for example.

Product transparency: With the growing complexity of mattresses, how stupid that may sound, it becomes harder to find out what you end up buying. The premium brands usually have nice displays with an intersection of the mattress and the salesmen can educate you on what’s inside. The online stores try hard to explain their product offerings through animations, video’s and detailed information and comparisons. Other offerings keep you more in the dark.

Written references: in the age of social media and the ‘like’ buttons everywhere the exclusivity of the store on telling you how good something is diminishes. People will seek references among their friends and on the Internet. The Online stores acknowledge this and facilitate customer testimonials, both positive and negative. It also enables them to respond to problems and provide customer care. IKEA has the benefit that they sell a lot of distinctively named mattresses. You can easily find other peoples experience with one of those. The premium brands of course do get attention but do not facilitate as such. Online communities can also be a problem when wrong information is distributed.

Referral fee marketing: When you bring a friend to a premium bed store you will probably get a thank you but not a referral fee. Energy+ relies heavily on referrals and stimulates that by paying 10% of the resulting invoice. (if you buy a mattress at them I don’t mind you sending me the invoice information…)

2-weeks free trial: When you buy a bed you want to know if it’s right for you. In a showroom you can test it out for a few minutes but no more. Some say it takes a couple of nights to determine if a bed is right for you. This poses a problem for the showroom-enabled companies. Online stores addressed this problem by providing a 2-weeks free trial. If you don’t like it you send it back and it costs you nothing. I read somewhere that Energy+ receives 10% of the delivered mattresses back. These mattresses are sent to countries in Eastern Europe, or so they say.

Eventually I ended up ordering 2 Energy+ mattresses, a slatted bed base with remote control and a bed frame from IKEA. Additionaly we also ordered pillows and a quilt. After 3 nights we decided to keep it and payed around 1.000-1.500 Euro, less than we wanted to spend in the first place!

Posted in Marketing | Tagged , , | 3 Comments

First pictures and video from my new camera

Some pictures i’ve taken:

And a compilation of some videos:

Posted in Pictures, Video | 2 Comments

New camera!

Last week it was my birthday, which we celebrated :). To make a long story short: i’m really thankful to my wife, friends and family for giving me a new ubergadget:

It’s the Lumix FT2 digital compactcamera! I want to use it for shooting pictures and movies of all the things i like to do. One of those things is travelling on my motorcycle. This camera should really be a good travel companion for the following reasons:

  • It is rugged, shockproof and waterproof. That’s handy when it’s mounted to your bike and the flies, dust, rain and whatmore have a go at it.
  • It has Leica optics which provide great image quality
  • It starts up VERY fast
  • It has a ‘just-click-and-the-picture-is-perfect’ setting
  • It records video in 720p HD quality which looks great!
  • It has ‘Power OIS’: don’t know how it works but it stabilizes the image very well, again handy when mounted to your handlebars.
  • It is freezeproof, so you can even mount it to your snowboard!
  • It records enough pictures/video on 1 battery charge (350pics/1hr)
  • It has a wide angle lens: you can get more scenery in your picture

Now i have to get me a nice mounting system for use on the road. The RAM-B-149Z-C1U unit from Ram Mounts is a good choice i think.

To the right you see a picture of normal compact camera which enjoyed 2000km of frontrow motorcycle entertainment and ended up with a stuck lens. Without the moving parts of the FT2  this probably won’t happen.

I have already made some shots with it which i will post later on.

Posted in gadgets | Tagged , , , | 1 Comment