Blog Archive

Archived articles and blog posts.

← Back to latest posts

WordPress security - NGINX Hardening

Techniques for hardening WordPress Sites running on an Nginx server to enhance security. Limit Access to Admin Panel Limit XMLRPC Access This will lock down the XMLRPC endpoint which allows…

Continue reading

WordPress security - hardening introduction and plugins

This post is from 2019, it may be out-of-date. For up-to-date information try: How to secure WordPress This post is designed to give an overview of some of the techniques…

Continue reading

Simple jQuery Cookie Pop-up

This is a simple EU cookie notification pop-up for legacy websites. All that's required is jQuery. Add the following HTML, jQuery script and apply some CSS - example supplied.…

Continue reading

Automatically Deploy website from Github

This walk through will allow you to set-up a website to automatically deploy on a remote server whenever updates are pushed to the GitHub repository. You will need root access…

Continue reading

Magento 2.3.3

The latest version of Magento has been released - Magento version 2.3.3 is all about security and performance. Security Support has been added to Magento 2 for PHP 7.3.X and…

Continue reading

Setting up WordPress on Amazon Web Services (AWS) EC2

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.…

Continue reading

Choosing the right ecommerce platform

Choosing the right ecommerce platform is an important decision for any business looking to sell their products online. The three options below are tried-and-tested ecommerce platforms that are used by…

Continue reading

Jekyll: Post Loop in Liquid Templates

Jekyll uses the Liquid templating language to process templates. This post provides a basic example to show the five latest blog posts and highlight the first post. The code consists…

Continue reading

[Notes] WordPress + React Docker Starter Kit

I've been experimenting with a Headless WordPress + React Starter Kit from Postlight. It's an automated toolset to create a powerful web publishing tool. Headerless CMS - in this case…

Continue reading

Remove outdated content from Google Search Results

From time to time unwanted pages can appear in Google Search Results. Could be a temporary page, old content or even a test page that's made its way onto Google's…

Continue reading

Drupal

Drupal is a powerful, open‑source content management system Drupal excels when a website demands flexibility, robustness and scalability. Built around a modular architecture, it lets developers define custom content types,…

Continue reading

Kentico

Kentico is a commercial, all‑in‑one digital experience platform Kentico combines content management, e‑commerce and online marketing tools within a single, integrated solution. Designed for medium‑ to large‑scale organisations, it offers…

Continue reading

Magento 1: End of life

Magento 1's expected end of life is fast approaching. Many, many merchants are still up and running on the system need to think about what steps they are going to…

Continue reading

Magento 2 Configurable Product Import

Magento 2 allows configurable products to be imported through the CMS. Unlike Magento 1 where Magmi generally did all the hard work when it came to importing and updating Configurable…

Continue reading

Magento Code: Magento 2 Cache Refresh Script

This is a stand alone script which can be called to refresh the cache in Magento 2 The script hooks into Bootstrap to generate a unique instance without needing to…

Continue reading

Magento Code: Magento 2 Indexer Script

This is a stand alone script which can be called to reindex a Magento 2 Site The script will create a unique instance of the Magento Object Manager and use…

Continue reading

Magento 1 to Magento 2 Migration Process (Part 1)

While the Magento 1 platform is still active and supported there's less urgency to switch-up to Magento 2. There are benefits to upgrading to Magento 2. Magento 1 will come…

Continue reading

Magento 1 Ongoing Support and End of life

Some thoughts on the expected demise of Magento 1. Magento 1 - Official End Date The official end date of the Magento 1 project was due to be November 2018.…

Continue reading

Jekyll

I've been using WordPress for this site for a long time. It is familiar, well-supported and easy to get started with, but over time I began to feel weighed down…

Continue reading

Introduction to Ubuntu MATE

This article was written in 2019, it provides a general overview of Ubuntu MATE, highlighting its key features and benefits, and why I decided to make it my main operating…

Continue reading

Magento Development in Northern Ireland

Magento Developer I've been building Magento sites since 2009, from standard catalogue sites to bespoke custom-built product generators. I've worked on a range of Magento projects across Northern Ireland, the…

Continue reading

Magento Belfast

Magento eCommerce was released on March 31, 2008, by Varien and developed on Zend Framework, it's a feature-rich ecommerce platform that provides merchants with unprecedented flexibility and control over the…

Continue reading

Don't use images to display text

Don't use images to display text on your website. It may look nicer, oftentimes the same effect can be generated using style sheets while making the text more accessible to…

Continue reading

Laravel for PHP developers

As a PHP developer with several years of experience, my workflow has often been heavily reliant on procedural coding and custom-built solutions. For a long time, the idea of working…

Continue reading

Magento2 – Show/hide layered navigation on category pages

Magento Admin Panel > Catalog > Categories Click into the category you want to update and then expand the “Design”. To remove a layered navigation sidebar that appears by default:…

Continue reading

Magento2 CLI: Set Ubuntu PHP Version to match LAMPP/XAMPP

The Magento2 Command Line Interface (CLI) needs to use the same version of PHP as your local web environment. You can check this by setting up an info.php script with…

Continue reading

Enable Magento2 Command-Line Interface (CLI) on Linux

For both development, ongoing management and scheduled tasks Magento’s Command Line Interface is able to do it all. To enable CLI for Magento to you’ll need to make sure the…

Continue reading

Cookie pop-up notification for legacy websites.

This post is from 2019, it may be out-of-date. For a better solution try: Cookie Script for GDPR Simple no-nonsense JavaScript and CSS cookie pop-up notification for legacy websites. Required…

Continue reading

The latest update to PHP7 is here… 7.2.0

This month PHP released the latest update PHP7.2.0. While PHP 7.2 is an improvement, it is not groundbreaking as the jump from PHP5.6 to PHP7.0. However the biggest change, having…

Continue reading

Shopify: Setting up a multipurpose CMSed liquid homepage section

Setting up a multipurpose CMSed liquid homepage section for Shopify. The below schema includes two sets of data A YouTube Video display A list of testimonials (max 5) First we…

Continue reading

Shopify: List product variations on collection pages

The code below will allow you to display a set of product variations on a Shopify product collection pages. Set this code in the collections page product loop, or within…

Continue reading

CMS blocks disappear after version 1.9.2.2 upgrade or SUPEE-6788 patch

Magento version 1.9.2.2 and patch SUPEE-6788 both introduce a new security feature to Magento. Blocks on the front-end have to be enabled or whitelisted before it will work. Blocks can…

Continue reading

Magento Code: Seasonal sales link

A lot of sites have a seasonal sale which needs turned on and promoted at different times during the year . This code takes the ID of a sale category…

Continue reading

Running Ubuntu on Windows

**One of my favourite aspects of Windows 10 has been the Linux subsystem for Windows. ** I’ve been using it since launch partly because it sounded cool but also because…

Continue reading

Why is WordPress so popular?

WordPress is a free and open source software used by millions of people around the world to create websites and blogs. The most popular features of WordPress include its ease…

Continue reading

GDPR: What is the EU General Data Protection Regulation?

The General Data Protection Regulation (GDPR) will have an impact on how organisations handle the personal information that they look after. GDPR is a regulation by which the European Parliament,…

Continue reading

Checkout problems upgrading to Magento 1.9.3.4+

Magento version 1.9.3.4 include patch SUPEE-9767 V2 which includes security patching for the checkout process. For your current front-end templates to work with this patch you will need to include…

Continue reading

Upgrading Magento 1 through the Magento Connect Downloader

If you don’t fancy upgrading Magento 1 through command line, you can upgrade Magento core using Magento’s in-built Magento Connect Downloader. Load yoursite.com/downloader. Login with a user who has full…

Continue reading

Upgrading Magento 1 through command line

Alternative: Upgrade Magento using the Magento Connect Downloader Upgrading Magento is a must to keep your store in top-top condition, protect your customers and your business. Upgrading Magento through command…

Continue reading

Magento Server Transfer – Tried and Tested Method

Moving an entire Magento site from one server to another or between hosts can be a daunting task for non-server administrators. I’m going to try and expand this over time.…

Continue reading

Ordering assets in Magento 2

This one will come in useful until Magento 2 sorts itself out. For some reason, Magento 2 has no way to order assets out of the box. There is now…

Continue reading

Magento Code: Innoexts Currency Pricing Module Price and Special Price Import via SSH

Magento Code: Innoexts Currency Pricing Modual Price and Special Price Imports vis SSH Standard Price Import Use the following command: `php /home/var/public/html/magento/shell/Innoexts/CurrencyPricing/Catalog/Product/Price/Compound/Import.php --file-path /var/import/ --file-filename standard_price.csv` The CSV file should…

Continue reading

PHP: glob

glob($string); Return an array of pathnames matching a specific pattern. // Find all CSV files in the /home/var/imports/ directory glob("/home/var/imports/hello-*.csv"); /home/var/imports/hello-world.csv – Returned /home/var/imports/hell-world.csv – Not returned /home/var/imports/hello-.csv – Returned.…

Continue reading

Magento Code: Check an import directory for new product CSVs and process using a Magmi profile

This script will first scan the var/import directory for all CSV files starting “import-” using the glob() function in PHP. It will return an array of any files which match…

Continue reading

Magento: What are Sage Pay Orphan Transactions?

This is a regular issue when using Sage Pay with Magento that needs a bit of explaining. Sage Pay transactions started by the customer are stored in the Magento database.…

Continue reading

PHP: header

header($string); Used to send a raw HTTP header, often used for page redirects. Must be called before any other output is sent. // Redirect the request to https://keithgreer.dev header("Location: https://keithgreer.dev");…

Continue reading

PHP: str_replace

str_replace($search,$replace,$subject) All instances of $search are replaced with $replace in $subject. // Will print to screen: "Why is the sky blue?". echo str_replace("red","blue","Why is the sky red?")…

Continue reading

Create a custom URL rewrite/redirect in Magento

You can use a custom rewrite to redirect CMS pages, or any other type of page. For example, if you change the URL key of the privacy policy from privacy-policy-cookie-restriction-mode…

Continue reading

Magento Code: Include currency switcher in the header or footer with Foundation mark-up

It is easy to set-up multi-currencies in Magento. This code allows you to quickly include a currency drop down or link to the header or footer of your Magento store.…

Continue reading

Magento Code: Add a drop down attribute and display it on the product page in custom HTML

Magento makes it really easy to expand the usual product attributes through the Admin Panel. While these can be added to the product page in the standard attribute list table,…

Continue reading

Magento header.phtml basic user account and basket code

Some useful shippets for including customer account and a basic basket/cart product count in the header of Magento. This should be added to header.html in your template folder, athough the…

Continue reading

Magento Issue: Unable to sort configurable product attribute drop down options

Having encountered this issue a couple of times I though it was time to make a note. This is a fix for an issue in Magento 1.9 whereby the order…

Continue reading

Testing YouTube embedded video responsiveness in WordPress

It turns out YouTube video uploads have come a long way since I last tried them out. This is a test post with no discernibly interesting content. WordPress has, for…

Continue reading

Magento product types and what to use them for

Magento comes preconfigured with a number of different product types. These range from simple bog-standard products to digital downloads and configurable products with a myriad of options and configurations available…

Continue reading

Anonymous Browsing

A few links to help secure your online activities private and secure. Browsing the web The Tor Browser is one of the best known anonymous browsing tools out there. It…

Continue reading

WordPress Code: Completely disable comments using functions.php

The code below will completely disable any commenting and trackback features in WordPress. It is in response to the usual issue whereby you think comments have been completely turned-off only…

Continue reading

MySQL TRUNCATE command: Quickly and easily clear out the Magento database

This is a simple list of SQL commands which can be used to clear out various parts of the Magento database. It’ll be useful when creating a development environment from…

Continue reading

Session Management and Validation Settings in Magento Configuration

Cookie and session management is an important aspect of any ecommerce store. Everything from a customer’s cart, checkout process and recently viewed products is made possible by knowing who is…

Continue reading

All-in-one Google Analytics tracking in Magento

Simple single script to add Google’s conversion tracking to your Magento ecommerce website. The code should be added into the footer.phtml file within your current template. The code includes tracking…

Continue reading

All-in-one Facebook Pixel Code for Magento ecommerce

Simple single script to add Facebook’s Pixel Code tracking to your Magento ecommerce website. The code should be added into the head.phtml file within your template. This includes tracking of…

Continue reading

Why you should be using Magento for your ecommerce website

There are many ecommerce platforms around, many offer a similar experience but time and time again Magento comes to the top of the list. Magento is the fastest growing eCommerce…

Continue reading

How to use PHP to submit a cURL request with HTTP Post data

Straight forward script to POST an array of fields to a given URL. // First, set the URL you want to POST the data to $url = 'http://domain.com/script/'; // Specify…

Continue reading

Getting your product information ready for importing to your website

Product imports are an inevitable part of any ecommerce project. At some point the information you have on your products wherever it may be stored – EPOS systems, paper catalogues,…

Continue reading

You win Google: I’m Moving from keith.kg to keithgreer.dev

Google’s automatic identification of a website’s intended audience using the top level domains means my .kg domain name has been slowly sliding down the rankings in Google. I’ve finally bit…

Continue reading

Add Facebook Pixel Code to Magento Success Page

Update: Instead of this, try the All-in-one Facebook Pixel Code method. It’s easier to maintain. Facebook Pixel Code is a new and even more complicated way to annoy web developers,…

Continue reading

Quickfix: Quickly add a new Magento CMS page template

Sometimes it’s necessary to quickly add a template for a page into the Magento content management system. This can be done via a custom extension below is the quick fix…

Continue reading

Magento Code: Bulk add a new product attribute to all store attribute sets

This little script is an excellent time saver for adding a new attribute to all of the attribute sets configured in your Magento store. There are a few attributes to…

Continue reading

Magento Code: UK and Ireland counties for region drop-down in addresses

Full list of counties for the United Kingdom and Republic of Ireland. Run this SQL against your Magento database to replace the existing region text box in Magento with a…

Continue reading

Cloudflare: My next step for website optomisation

I’ve been working to dramatically reduce page load times on my site. Load times were reduced from 6 seconds to about 3 just by minifying content, using a CDN for…

Continue reading

Why use an SSL?.. Number 3: Search Engine Optimisation

Security · 2. Confidence · 3. SEO Google has, since 2014, been giving sites with a secure certificate installed a boost within their ranking algorithm. Google has been telling web…

Continue reading

Why use an SSL?.. Number 2: User Confidence

Security · 2. Confidence · 3. SEO As well as providing important security to your users the presence of an SSL certificate also enhances user confidence in your website and…

Continue reading

ADSL vs Fibre Broadband

This article was originally me complaining about he state of Broadband in North Belfast, compared to rural Mid Ulster. Since fibre has become available, I'm no longer angry at BT…

Continue reading

Why use an SSL?.. Number 1: Security

Security · 2. Confidence · 3. SEO The main reason to use an SSL certificate on your website is to secure sensitive information sent across the Internet. Keeping data encrypted…

Continue reading

Magento Issue: One Page Checkout appearing to jump to the bottom of the page after address is entered

This is a recurring issue with Magento’s standard One Page Checkout. It most often occurs when the template has been updated to include lots of big fonts and padding around…

Continue reading

Useful .htaccess Rules: Setting the expires header for browser caching

Expires headers let the browser know whether to serve a cached version of the page. This can simultaneously help to reduce server load and increase page load time by telling…

Continue reading

MySQL Database Backup and Restore via Command Line (Copy-and-pasteable)

Putting this together because I always end up checking online for the correct bash commands for Linux. These commands rely on your knowing for sure which database is which and…

Continue reading

PayPal IPN notification errors with Magento

This one has popped up a few times in the past. When PayPal has been set-up and configured to with Magento the store owner receives the email below seemingly randomly.…

Continue reading

PHP: Use WordPress blog tags to find related posts

A simple script that can be used to pull related-type posts for a WordPress blog post. The related aspect is based on the fist tag assigned to the post. The…

Continue reading

Google Chrome getting a new Security Panel for developers

Google is set to add a new Security Panel to the Chrome browser to help developers visualise and troubleshoot network connections. The security panel provides developers with connection information for…

Continue reading

Iceland 2015

More posts on Instagram #IcelandMMXV View this post on Instagram #Iceland #IcelandMMXV #icebergs #glacier A post shared by Keith (@keithtagram) on Dec 16, 2015 at 4:25am PST View this post…

Continue reading

Magento 2.0: An introduction to what has changed

At long last Magento 2.0 has finally be released into the wild. These are a few of the reasons merchants and developers should consider moving to Magento 2. Full Page…

Continue reading

M1 Get your Magento store ready for Black Friday

This is an old tutorial is for Magento 1. An updated version for Magento 2 can be found here: Optimising Magento 2 in Easy Steps. These are a few simple…

Continue reading

PHP Storm and making FTP connections with SSL (FTPS)

If you’re having issues connecting to a server via FTPS in phpStorm I found that the magic combination for PHP Storm and FTP-SSL connections is… Type: FTPS SSL: Explicit Passive…

Continue reading

Magento: How to clear all caches through command line

When making certain changes to Magento, such as modifying source files, installing extensions, reverting changes, it is necessary to clear the cache in order for the changes to become visible.…

Continue reading

Steven says Slack messenger is awesome

My colleague Steven Cotterill has outlined just how useful a messenger app can be in a development environment. At the beginning of the year we here at the Tomorrow Lab…

Continue reading

How to link to a PDF in WordPress

WordPress is designed to be simple and easy to use. Adding linking to a downloadable document is no different. Open a post or page and put your cursor where you…

Continue reading

M1 Import Values to Dropdown/Multiple Select Attributes

This code is for Magento 1, it won't work in Magento 2. Sometime when you need to deal with import of lots of values for a multiple select/drop down attribute.…

Continue reading

M1 Batch updater for Magento Product SKUs

This is a Magento 1 script, it won't work for Magento 2. The script will loop through a CSV file and update the SKU on each product. This can be…

Continue reading

Block access based on Client IP using PHP

Block access based on Client IP The opposite requires a simple exclamation mark before in_array() to change the script so that only those listed in the array will be allowed…

Continue reading

Useful .gitattributes defaults for Beanstalk Git

Some useful copy-and-paste lines for the .gitattributes file when using Beanstalk Git. Image and other binary files Upload and store images as binary files, rather than text – the default.…

Continue reading

Upgrading to Google’s Universal Analytics in Magento

The new Google Universal Analytics provides the opportunity for own measurement values and dimensions and allow you to track usage across platforms. Universal Analytics introduces a set of features that…

Continue reading

Add Google Analytics ecommerce:addTransaction to your Magento Store

A quick and way way to record transactions to Google Universal Analytics. First add this piece of PHP to your success page at the end of the checkout process. Update…

Continue reading

Add Static Blocks to CMS Pages in Admin

Static Blocks are an easy way to include snippets of code or text on many pages throughout your Magento store. They can be used to make a promotion or your…

Continue reading

Useful Excel Commands for Magento Image Import

Magento image import can be pretty flaky with case and spaces in the filename of images being uploaded. =CONCATENATE("/",SUBSTITUTE(LOWER(F2)," ","")) The above code will add a “/” at the beginning…

Continue reading

Domains, Subdomains and Subdirectories

Domains, subdomains, and subdirectories are all components of the hierarchical structure used to organise content on the internet. The terms can be confusing, here's what each means: domain.name A domain…

Continue reading

Magento Issue: Subtotal and Grand Total prices double at Cart/Checkout stages

Have recently encountered an issue with prices in Magento Checkout appearing doubled. There are a number of solutions online which seem to (in various combinations) do the trick. A particular…

Continue reading

Composer - Dependency Manager for PHP

Composer is an application-level dependency manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. Composer runs from the command…

Continue reading

LAMP Software Bundle

Linux, Apache, MySQL/MariaDB, PHP/Perl/Python LAMP is an acronym denoting one of the most common software stacks for many of the web's most popular applications. However, LAMP now refers to a…

Continue reading

€0.2: The EU Cookie Legislation

Are cookies dangerous? No, they are simply text files and are not (for example) viruses or Trojans. They cannot in themselves do anything to your computer; they can only be…

Continue reading

Understanding Markdown formatting

Markdown is a lightweight way of writing and formatting text that has become popular with developers, writers and content creators. Files that use Markdown usually end with the.md extension, and…

Continue reading