Posts Tagged ‘wordpress’

How to set up a web store with WooCommerce

Sunday, March 12th, 2017 | Tech

At the end of last year, I used Shopify to build an e-commerce store for Mountain Wallet. This worked well, but the costs quickly added up. The base Shopify subscription is only $30 but then there are themes and plugins that you will want to pay for on top of that. Last month, I ported it over to WordPress and WooCommerce, and I thought I would discuss my experience.

What is WooCommerce?

WooCommerce is a plugin for WordPress. Once installed, it provides you with a shop admin built into the WordPress admin, as well as front-end pages and a full checkout process. It installs like any other WordPress plugin making it very easy to get up-and-running.

Because of its popularity, many WordPress themes support WooCommerce out of the box. If not, you may need to play around until you find a suitable theme. I used a theme named Bento.

How easy is it to use?

As easy as Shopify. You add your products like you would add posts. It’s the same with adding product images: you use the media uploader. There was some messing around setting up shipping options and configuring payment integrations, but nothing too taxing.

Plugins I am using

As well as WooCommerce, I am using the following plugins:

  • Facebook Messenger Chat
  • Header and Footer
  • Instagram Feed
  • MailChimp
  • Social Media Flying Icons

There is nothing directly commerce related here. These allow me to add a chat link to the Facebook page, insert Google Tag Manager scripts, link the Instagram feed, add a mailing list sign-up form and some share icons.

I also have my standard array of security plugins installed.

SHOUTCLOUD WORDPRESS PLUGIN

Wednesday, July 1st, 2015 | Programming

HAVE YOU EVER WANTED TO CONVERT ALL YOUR BLOG CONTENT TO UPPERCASE? IF SO, I HAVE THE PLUGIN FOR YOU! I HAVE PUBLISHED A SHOUTCLOUD WORDPRESS PLUGIN THAT AUTOMATICALLY INTEGERGRATES YOUR BLOG WITH SHOUTCLOUD.

ADVANTAGES

  • AUTOMATICALLY CONVERTS ALL OF YOUR TITLES, CONTENT AND TAGS TO UPPERCASE
  • ZERO CONFIGURATION
  • ALL STRING MANIPULATION IS DONE IN THE CLOUD
  • INCREASES ANTIPCIPATION BY DRASTICALLY INCREASING LOAD TIME

DISADVANTAGES

  • NONE, EVERYTHING IS BETTER WHEN IT IS DONE IN THE CLOUD!

screenshot-1

Autop

Monday, June 22nd, 2015 | Programming

PHP has a function called nl2br that converts line breaks into <br> tags. This is really useful if you have content in a database and want to ensure the line breaks are in encoded in HTML without actually having to specify them in the content.

It is a bit of a clumsy tool though. It does not take into account that you might want to use paragraphs, or that you do not want br tags adding inside block elements such as pre or hidden elements such as script and style.

The programmers over at WordPress have done a great job of coming up with their own version that resolves all of these issues and many of us already benefit from it on our sites. Matt Mullenweg has written about it.

However, it is buried in the WordPress codebase, so if you want to use it in a non-Wordpress project, you have to mess about pulling it out of the codebase and inserting it into your own. To save myself from having to do this, I’ve created a project on Github that moves it to a standalone library. You can then drop this into your project using Composer and use away.

Using WordPress on real websites

Wednesday, May 21st, 2014 | Thoughts

WordPress is a super piece of software. It has made it easier and quicker to get a website up and running than any other content management system out there. It has a great range of plugins and themes, and is reasonably easy to add your own too.

That said, there are a couple of issues that I think make it a questionable choice for using on an important website.

It works fine if you deploy it to one location and just build everything there. However, often I will have a development version, a staging version and a production version. This allows me to pass a website through each stage while making sure it is working.

With WordPress, this is difficult.

You need to put the site URL into two different places in the config. This means that you have to update these values every time you deploy content to another server. So for example a typical use case would be to copy all your production data over to staging so you can perform major testing, and then potentially copy it back again. Or you want to develop the site locally and then push everything up to your server.

Unfortunately WordPress uses these URLs for the login process, so you cannot just log in and change them in the admin panel because you will not be able to get in. You have to do it via a script or by editing the database directly.

Secondly, it uses absolute URLs everywhere. Every time you upload a piece of media, or a post, it will store a URL for it in the database with the hostname included in it. When you insert the media into the post, it puts a absolute URL and SRC in there too.

This means that you have to do two things. Firstly, take our all the hostnames from the SRC and URL HTML content that WordPress generates every time it inserts a piece of media for you.

You also have to update the database to change all the URLs in there too. There does not seem to be any support to do this at all. I had to write a little plugin to change these. Arguably, you could use this plugin as well.

I am not sure why it does this. There does not seem to be any compelling argument to use absolute URLs. I had a look around for one, and the closest article was by Joost de Valk, none of which I think really stand up (certainly not in comparison to “is your site probably tested?”).

As pointed out here, if you really need to use absolute URLs, you could implement a short code to allow it to remain dynamic.

WordPress is a super piece of software, and indeed runs my blog. But I think it has it’s place in a certain set of use-cases and large production systems do not seem to be one of them.

Comment notifications

Sunday, January 11th, 2009 | News

I’ve finally got round to adding email notifications to further comments being posted on my blog entries. So if you comment on one of the entries you can now opt to be notified by email if someone posts a follow-up comment on that same entry.